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"
34 ClassImp(AliMUONSt2GeometryBuilder)
36 //______________________________________________________________________________
37 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon)
38 : AliMUONVGeometryBuilder("st2.dat",
39 &muon->Chamber(2), &muon->Chamber(3)),
42 // Standard constructor
46 //______________________________________________________________________________
47 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder()
48 : AliMUONVGeometryBuilder(),
51 // Default constructor
55 //______________________________________________________________________________
56 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(const AliMUONSt2GeometryBuilder& rhs)
57 : AliMUONVGeometryBuilder(rhs)
59 // Protected copy constructor
61 Fatal("Copy constructor",
62 "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;
80 "Assignment operator is not implemented.");
89 //______________________________________________________________________________
90 void AliMUONSt2GeometryBuilder::CreateGeometry()
92 // From AliMUONv1::CreateGeometry()
95 //********************************************************************
97 //********************************************************************
98 // indices 1 and 2 for first and second chambers in the station
99 // iChamber (first chamber) kept for other quanties than Z,
100 // assumed to be the same in both chambers
102 // Get tracking medias Ids
103 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
104 Int_t idAir= idtmed[1100]; // medium 1
105 Int_t idAlu1=idtmed[1103]; // medium 4
106 Int_t idAlu2=idtmed[1104]; // medium 5
107 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
108 Bool_t frameCrosses=kTRUE;
110 // Rotation matrices in the x-y plane
113 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
116 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
118 AliMUONChamber* iChamber = GetChamber(2);
119 AliMUONChamber* iChamber1 = iChamber;
120 AliMUONChamber* iChamber2 = GetChamber(3);
122 // Half of the total thickness of frame crosses (including DAlu)
123 // for each chamber in stations 1 and 2:
124 // 3% of X0 of composite material,
125 // but taken as Aluminium here, with same thickness in number of X0
126 Float_t dframez = 3. * 8.9 / 100;
127 // DGas and DAlu not changed from standard values
128 Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
129 // The same parameters are defined in builder for station 1
132 // Outer excess and inner recess for mother volume radius
133 // with respect to ROuter and RInner
134 Float_t dframep=.001; // Value for station 3 should be 6 ...
135 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
136 // Float_t dframep1=.001;
137 Float_t phi=2*TMath::Pi()/12/2;
138 // The same parameters are defined in builder for station 1
141 Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
142 tpar[0] = iChamber->RInner()-dframep;
143 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
144 tpar[2] = dstation/5;
146 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
147 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
150 //gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
151 //gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
153 GetEnvelopes(2)->AddEnvelope("S03M", 300, false);
154 GetEnvelopes(3)->AddEnvelope("S04M", 400, false);
156 gMC->Gsbool("S03M", "L3DO");
157 gMC->Gsbool("S03M", "L3O1");
158 gMC->Gsbool("S03M", "L3O2");
159 gMC->Gsbool("S04M", "L3DO");
160 gMC->Gsbool("S04M", "L3O1");
161 gMC->Gsbool("S04M", "L3O2");
163 // // Aluminium frames
165 // pgpar[0] = 360/12/2;
169 // pgpar[4] = -dframez/2;
170 // pgpar[5] = iChamber->ROuter();
171 // pgpar[6] = pgpar[5]+dframep;
172 // pgpar[7] = +dframez/2;
173 // pgpar[8] = pgpar[5];
174 // pgpar[9] = pgpar[6];
175 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
176 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
177 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
178 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
179 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
180 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
183 // tpar[0]= iChamber->RInner()-dframep;
184 // tpar[1]= iChamber->RInner();
185 // tpar[2]= dframez/2;
186 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
187 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
189 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
190 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
191 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
192 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
197 // security for inside mother volume
200 Float_t dframep1 = 11.0;
201 Float_t dframez = 3. * 8.9 / 100;
204 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
205 * TMath::Cos(TMath::ASin(dframep1 /
206 (iChamber->ROuter() - iChamber->RInner())))
208 bpar[1] = dframep1/2;
209 // total thickness will be (4 * bpar[2]) for each chamber,
210 // which has to be equal to (2 * dframez) - DAlu
211 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
212 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
213 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
215 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
217 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
219 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
221 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
223 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
225 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
227 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
229 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
232 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
234 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
236 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
238 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
240 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
242 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
244 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
246 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
250 // Chamber Material represented by Alu sheet
251 tpar[0]= iChamber->RInner();
252 tpar[1]= iChamber->ROuter();
253 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
254 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
255 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
256 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
257 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
260 // tpar[2] = iChamber->DGas();
261 tpar[2] = iChamber->DGas()/2;
262 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
263 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
264 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
265 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
267 // Frame Crosses to be placed inside gas
268 // NONE: chambers are sensitive everywhere
269 // if (frameCrosses) {
271 // dr = (iChamber->ROuter() - iChamber->RInner());
272 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
273 // bpar[1] = dframep1/2;
274 // bpar[2] = iChamber->DGas()/2;
275 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
276 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
278 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
280 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
282 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
284 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
287 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
289 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
291 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
293 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
297 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
298 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
299 zpos1=iChamber1->Z();
300 zpos2=iChamber2->Z();
301 dstation = zpos2 - zpos1;
302 // DGas and DAlu not changed from standard values
303 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
307 tpar[0] = iChamber->RInner()-dframep;
308 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
309 tpar[2] = dstation/5;
311 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
312 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
313 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
314 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
315 gMC->Gsbool("S03M", "L3DO");
316 gMC->Gsbool("S03M", "L3O1");
317 gMC->Gsbool("S03M", "L3O2");
318 gMC->Gsbool("S04M", "L3DO");
319 gMC->Gsbool("S04M", "L3O1");
320 gMC->Gsbool("S04M", "L3O2");
322 // // Aluminium frames
324 // pgpar[0] = 360/12/2;
328 // pgpar[4] = -dframez/2;
329 // pgpar[5] = iChamber->ROuter();
330 // pgpar[6] = pgpar[5]+dframep;
331 // pgpar[7] = +dframez/2;
332 // pgpar[8] = pgpar[5];
333 // pgpar[9] = pgpar[6];
334 // gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
335 // gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
336 // gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
337 // gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
338 // gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
339 // gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
342 // tpar[0]= iChamber->RInner()-dframep;
343 // tpar[1]= iChamber->RInner();
344 // tpar[2]= dframez/2;
345 // gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
346 // gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
348 // gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
349 // gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
350 // gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
351 // gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
356 // security for inside mother volume
357 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
358 * TMath::Cos(TMath::ASin(dframep1 /
359 (iChamber->ROuter() - iChamber->RInner())))
361 bpar[1] = dframep1/2;
362 // total thickness will be (4 * bpar[2]) for each chamber,
363 // which has to be equal to (2 * dframez) - DAlu
364 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
365 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
366 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
368 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
370 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
372 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
374 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
376 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
378 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
380 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
382 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
385 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
387 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
389 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
391 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
393 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
395 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
397 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
399 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
403 // Chamber Material represented by Alu sheet
404 tpar[0]= iChamber->RInner();
405 tpar[1]= iChamber->ROuter();
406 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
407 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
408 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
409 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
410 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
413 // tpar[2] = iChamber->DGas();
414 tpar[2] = iChamber->DGas()/2;
415 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
416 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
417 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
418 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
420 // Frame Crosses to be placed inside gas
421 // NONE: chambers are sensitive everywhere
422 // if (frameCrosses) {
424 // dr = (iChamber->ROuter() - iChamber->RInner());
425 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
426 // bpar[1] = dframep1/2;
427 // bpar[2] = iChamber->DGas()/2;
428 // gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
429 // gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
431 // gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
433 // gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
435 // gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
437 // gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
440 // gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
442 // gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
444 // gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
446 // gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
453 //______________________________________________________________________________
454 void AliMUONSt2GeometryBuilder::SetTransformations()
456 // Defines the transformations for the station2 chambers.
459 AliMUONChamber* iChamber1 = GetChamber(2);
460 Double_t zpos1 = - iChamber1->Z();
461 iChamber1->GetGeometry()
462 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
464 AliMUONChamber* iChamber2 = GetChamber(3);
465 Double_t zpos2 = - iChamber2->Z();
466 iChamber2->GetGeometry()
467 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
470 //______________________________________________________________________________
471 void AliMUONSt2GeometryBuilder::SetSensitiveVolumes()
473 // Defines the sensitive volumes for station2 chambers.
476 GetChamber(2)->GetGeometry()->SetSensitiveVolume("S03G");
477 GetChamber(3)->GetGeometry()->SetSensitiveVolume("S04G");