1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Class AliMUONSt2GeometryBuilder
19 // -------------------------------
20 // MUON Station2 coarse geometry construction class.
21 // Extracted from AliMUONv1
22 // by Ivana Hrivnacova, IPN Orsay
23 // Included in AliRoot 2004/01/23
25 #include <TVirtualMC.h>
26 #include <TGeoMatrix.h>
28 #include "AliMUONSt2GeometryBuilder.h"
30 #include "AliMUONChamber.h"
31 #include "AliMUONChamberGeometry.h"
32 #include "AliMUONGeometryEnvelopeStore.h"
35 ClassImp(AliMUONSt2GeometryBuilder)
37 //______________________________________________________________________________
38 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon)
39 : AliMUONVGeometryBuilder("st2.dat",
40 &muon->Chamber(2), &muon->Chamber(3)),
43 // Standard constructor
47 //______________________________________________________________________________
48 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder()
49 : AliMUONVGeometryBuilder(),
52 // Default constructor
56 //______________________________________________________________________________
57 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(const AliMUONSt2GeometryBuilder& rhs)
58 : AliMUONVGeometryBuilder(rhs)
60 // Protected copy constructor
62 AliFatal("Copy constructor is not implemented.");
65 //______________________________________________________________________________
66 AliMUONSt2GeometryBuilder::~AliMUONSt2GeometryBuilder() {
70 //______________________________________________________________________________
71 AliMUONSt2GeometryBuilder&
72 AliMUONSt2GeometryBuilder::operator = (const AliMUONSt2GeometryBuilder& rhs)
74 // Protected assignement operator
76 // check assignement to self
77 if (this == &rhs) return *this;
79 AliFatal("Assignment operator is not implemented.");
88 //______________________________________________________________________________
89 void AliMUONSt2GeometryBuilder::CreateGeometry()
91 // From AliMUONv1::CreateGeometry()
94 //********************************************************************
96 //********************************************************************
97 // indices 1 and 2 for first and second chambers in the station
98 // iChamber (first chamber) kept for other quanties than Z,
99 // assumed to be the same in both chambers
101 // Get tracking medias Ids
102 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
103 Int_t idAir= idtmed[1100]; // medium 1
104 Int_t idAlu1=idtmed[1103]; // medium 4
105 Int_t idAlu2=idtmed[1104]; // medium 5
106 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
107 Bool_t frameCrosses=kTRUE;
109 // Rotation matrices in the x-y plane
112 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
115 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
117 AliMUONChamber* iChamber = GetChamber(2);
118 AliMUONChamber* iChamber1 = iChamber;
119 AliMUONChamber* iChamber2 = GetChamber(3);
121 // Half of the total thickness of frame crosses (including DAlu)
122 // for each chamber in stations 1 and 2:
123 // 3% of X0 of composite material,
124 // but taken as Aluminium here, with same thickness in number of X0
125 Float_t dframez = 3. * 8.9 / 100;
126 // DGas and DAlu not changed from standard values
127 Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
128 // The same parameters are defined in builder for station 1
131 // Outer excess and inner recess for mother volume radius
132 // with respect to ROuter and RInner
133 Float_t dframep=.001; // Value for station 3 should be 6 ...
134 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
135 // Float_t dframep1=.001;
136 Float_t phi=2*TMath::Pi()/12/2;
137 // The same parameters are defined in builder for station 1
140 Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
141 tpar[0] = iChamber->RInner()-dframep;
142 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
143 tpar[2] = dstation/5;
145 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
146 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
149 //gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
150 //gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
152 GetEnvelopes(2)->AddEnvelope("S03M", 300, false);
153 GetEnvelopes(3)->AddEnvelope("S04M", 400, false);
155 gMC->Gsbool("S03M", "L3DO");
156 gMC->Gsbool("S03M", "L3O1");
157 gMC->Gsbool("S03M", "L3O2");
158 gMC->Gsbool("S04M", "L3DO");
159 gMC->Gsbool("S04M", "L3O1");
160 gMC->Gsbool("S04M", "L3O2");
162 // // Aluminium frames
164 // pgpar[0] = 360/12/2;
168 // pgpar[4] = -dframez/2;
169 // pgpar[5] = iChamber->ROuter();
170 // pgpar[6] = pgpar[5]+dframep;
171 // pgpar[7] = +dframez/2;
172 // pgpar[8] = pgpar[5];
173 // pgpar[9] = pgpar[6];
174 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
175 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
176 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
177 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
178 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
179 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
182 // tpar[0]= iChamber->RInner()-dframep;
183 // tpar[1]= iChamber->RInner();
184 // tpar[2]= dframez/2;
185 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
186 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
188 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
189 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
190 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
191 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
196 // security for inside mother volume
199 Float_t dframep1 = 11.0;
200 Float_t dframez = 3. * 8.9 / 100;
203 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
204 * TMath::Cos(TMath::ASin(dframep1 /
205 (iChamber->ROuter() - iChamber->RInner())))
207 bpar[1] = dframep1/2;
208 // total thickness will be (4 * bpar[2]) for each chamber,
209 // which has to be equal to (2 * dframez) - DAlu
210 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
211 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
212 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
214 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
216 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
218 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
220 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
222 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
224 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
226 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
228 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
231 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
233 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
235 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
237 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
239 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
241 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
243 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
245 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
249 // Chamber Material represented by Alu sheet
250 tpar[0]= iChamber->RInner();
251 tpar[1]= iChamber->ROuter();
252 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
253 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
254 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
255 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
256 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
259 // tpar[2] = iChamber->DGas();
260 tpar[2] = iChamber->DGas()/2;
261 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
262 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
263 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
264 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
266 // Frame Crosses to be placed inside gas
267 // NONE: chambers are sensitive everywhere
268 // if (frameCrosses) {
270 // dr = (iChamber->ROuter() - iChamber->RInner());
271 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
272 // bpar[1] = dframep1/2;
273 // bpar[2] = iChamber->DGas()/2;
274 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
275 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
277 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
279 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
281 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
283 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
286 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
288 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
290 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
292 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
296 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
297 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
298 zpos1=iChamber1->Z();
299 zpos2=iChamber2->Z();
300 dstation = zpos2 - zpos1;
301 // DGas and DAlu not changed from standard values
302 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
306 tpar[0] = iChamber->RInner()-dframep;
307 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
308 tpar[2] = dstation/5;
310 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
311 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
312 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
313 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
314 gMC->Gsbool("S03M", "L3DO");
315 gMC->Gsbool("S03M", "L3O1");
316 gMC->Gsbool("S03M", "L3O2");
317 gMC->Gsbool("S04M", "L3DO");
318 gMC->Gsbool("S04M", "L3O1");
319 gMC->Gsbool("S04M", "L3O2");
321 // // Aluminium frames
323 // pgpar[0] = 360/12/2;
327 // pgpar[4] = -dframez/2;
328 // pgpar[5] = iChamber->ROuter();
329 // pgpar[6] = pgpar[5]+dframep;
330 // pgpar[7] = +dframez/2;
331 // pgpar[8] = pgpar[5];
332 // pgpar[9] = pgpar[6];
333 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
334 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
335 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
336 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
337 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
338 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
341 // tpar[0]= iChamber->RInner()-dframep;
342 // tpar[1]= iChamber->RInner();
343 // tpar[2]= dframez/2;
344 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
345 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
347 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
348 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
349 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
350 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
355 // security for inside mother volume
356 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
357 * TMath::Cos(TMath::ASin(dframep1 /
358 (iChamber->ROuter() - iChamber->RInner())))
360 bpar[1] = dframep1/2;
361 // total thickness will be (4 * bpar[2]) for each chamber,
362 // which has to be equal to (2 * dframez) - DAlu
363 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
364 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
365 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
367 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
369 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
371 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
373 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
375 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
377 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
379 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
381 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
384 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
386 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
388 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
390 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
392 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
394 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
396 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
398 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
402 // Chamber Material represented by Alu sheet
403 tpar[0]= iChamber->RInner();
404 tpar[1]= iChamber->ROuter();
405 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
406 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
407 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
408 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
409 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
412 // tpar[2] = iChamber->DGas();
413 tpar[2] = iChamber->DGas()/2;
414 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
415 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
416 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
417 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
419 // Frame Crosses to be placed inside gas
420 // NONE: chambers are sensitive everywhere
421 // if (frameCrosses) {
423 // dr = (iChamber->ROuter() - iChamber->RInner());
424 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
425 // bpar[1] = dframep1/2;
426 // bpar[2] = iChamber->DGas()/2;
427 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
428 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
430 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
432 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
434 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
436 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
439 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
441 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
443 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
445 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
452 //______________________________________________________________________________
453 void AliMUONSt2GeometryBuilder::SetTransformations()
455 // Defines the transformations for the station2 chambers.
458 AliMUONChamber* iChamber1 = GetChamber(2);
459 Double_t zpos1 = - iChamber1->Z();
460 iChamber1->GetGeometry()
461 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
463 AliMUONChamber* iChamber2 = GetChamber(3);
464 Double_t zpos2 = - iChamber2->Z();
465 iChamber2->GetGeometry()
466 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
469 //______________________________________________________________________________
470 void AliMUONSt2GeometryBuilder::SetSensitiveVolumes()
472 // Defines the sensitive volumes for station2 chambers.
475 GetChamber(2)->GetGeometry()->SetSensitiveVolume("S03G");
476 GetChamber(3)->GetGeometry()->SetSensitiveVolume("S04G");