3 // Class AliMUONSt1GeometryBuilder
4 // -------------------------------
5 // MUON Station1 coarse geometry construction class.
7 // Extracted from AliMUONv1
8 // by Ivana Hrivnacova, IPN Orsay
10 #include <TVirtualMC.h>
11 #include <TGeoMatrix.h>
13 #include "AliMUONSt1GeometryBuilder.h"
15 #include "AliMUONChamber.h"
16 #include "AliMUONChamberGeometry.h"
18 ClassImp(AliMUONSt1GeometryBuilder)
20 //______________________________________________________________________________
21 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon)
22 : AliMUONVGeometryBuilder(&muon->Chamber(0), &muon->Chamber(1)),
25 // Standard constructor
29 //______________________________________________________________________________
30 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder()
31 : AliMUONVGeometryBuilder(),
34 // Default constructor
38 //______________________________________________________________________________
39 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(const AliMUONSt1GeometryBuilder& rhs)
40 : AliMUONVGeometryBuilder(rhs)
42 Fatal("Copy constructor",
43 "Copy constructor is not implemented.");
46 //______________________________________________________________________________
47 AliMUONSt1GeometryBuilder::~AliMUONSt1GeometryBuilder() {
51 //______________________________________________________________________________
52 AliMUONSt1GeometryBuilder&
53 AliMUONSt1GeometryBuilder::operator = (const AliMUONSt1GeometryBuilder& rhs)
55 // check assignement to self
56 if (this == &rhs) return *this;
59 "Assignment operator is not implemented.");
68 //______________________________________________________________________________
69 void AliMUONSt1GeometryBuilder::CreateGeometry()
71 // From AliMUONv1::CreateGeometry()
74 //********************************************************************
76 //********************************************************************
78 // indices 1 and 2 for first and second chambers in the station
79 // iChamber (first chamber) kept for other quanties than Z,
80 // assumed to be the same in both chambers
82 // Get tracking medias Ids
83 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
84 Int_t idAir= idtmed[1100]; // medium 1
85 Int_t idAlu1=idtmed[1103]; // medium 4
86 Int_t idAlu2=idtmed[1104]; // medium 5
87 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
88 Bool_t frameCrosses=kTRUE;
90 // Rotation matrices in the x-y plane
93 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
96 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
98 AliMUONChamber* iChamber1 = GetChamber(0);
99 AliMUONChamber* iChamber2 = GetChamber(1);
100 AliMUONChamber* iChamber = iChamber1;
102 // DGas decreased from standard one (0.5)
103 iChamber->SetDGas(0.4);
104 iChamber2->SetDGas(0.4);
106 // DAlu increased from standard one (3% of X0),
107 // because more electronics with smaller pads
108 iChamber->SetDAlu(3.5 * 8.9 / 100.);
109 iChamber2->SetDAlu(3.5 * 8.9 / 100.);
111 // Half of the total thickness of frame crosses (including DAlu)
112 // for each chamber in stations 1 and 2:
113 // 3% of X0 of composite material,
114 // but taken as Aluminium here, with same thickness in number of X0
115 Float_t dframez = 3. * 8.9 / 100;
116 Float_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
117 // The same parameters are defined in builder for station 2
120 // Outer excess and inner recess for mother volume radius
121 // with respect to ROuter and RInner
122 Float_t dframep=.001; // Value for station 3 should be 6 ...
123 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
124 // Float_t dframep1=.001;
125 Float_t dframep1 = 11.0;
126 Float_t phi=2*TMath::Pi()/12/2;
127 // The same parameters are defined in builder for station 2
130 Float_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
131 tpar[0] = iChamber->RInner()-dframep;
132 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
133 tpar[2] = dstation/5;
135 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
136 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
139 //gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
140 //gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
141 GetChamber(0)->GetGeometry()->AddEnvelope("S01M", false);
142 GetChamber(1)->GetGeometry()->AddEnvelope("S02M", false);
144 // // Aluminium frames
146 // pgpar[0] = 360/12/2;
150 // pgpar[4] = -dframez/2;
151 // pgpar[5] = iChamber->ROuter();
152 // pgpar[6] = pgpar[5]+dframep1;
153 // pgpar[7] = +dframez/2;
154 // pgpar[8] = pgpar[5];
155 // pgpar[9] = pgpar[6];
156 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
157 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
158 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
159 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
160 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
161 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
164 // tpar[0]= iChamber->RInner()-dframep1;
165 // tpar[1]= iChamber->RInner();
166 // tpar[2]= dframez/2;
167 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
168 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
170 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
171 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
172 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
173 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
178 // security for inside mother volume
180 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
181 * TMath::Cos(TMath::ASin(dframep1 /
182 (iChamber->ROuter() - iChamber->RInner())))
184 bpar[1] = dframep1/2;
185 // total thickness will be (4 * bpar[2]) for each chamber,
186 // which has to be equal to (2 * dframez) - DAlu
187 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
188 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
189 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
191 gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
193 gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
195 gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
197 gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
199 gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
201 gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
203 gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
205 gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
208 gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
210 gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
212 gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
214 gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
216 gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
218 gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
220 gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
222 gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
226 // Chamber Material represented by Alu sheet
227 tpar[0]= iChamber->RInner();
228 tpar[1]= iChamber->ROuter();
229 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
230 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
231 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
232 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
233 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
236 // tpar[2] = iChamber->DGas();
237 tpar[2] = iChamber->DGas()/2;
238 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
239 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
240 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
241 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
243 // Frame Crosses to be placed inside gas
244 // NONE: chambers are sensitive everywhere
245 // if (frameCrosses) {
247 // dr = (iChamber->ROuter() - iChamber->RInner());
248 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
249 // bpar[1] = dframep1/2;
250 // bpar[2] = iChamber->DGas()/2;
251 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
252 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
254 // gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
256 // gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
258 // gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
260 // gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
263 // gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
265 // gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
267 // gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
269 // gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
274 //______________________________________________________________________________
275 void AliMUONSt1GeometryBuilder::SetTransformations()
277 // Defines the transformations for the station2 chambers.
280 AliMUONChamber* iChamber1 = GetChamber(0);
281 Double_t zpos1= - iChamber1->Z();
282 iChamber1->GetGeometry()
283 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
285 AliMUONChamber* iChamber2 = GetChamber(1);
286 Double_t zpos2 = - iChamber2->Z();
287 iChamber2->GetGeometry()
288 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
291 //______________________________________________________________________________
292 void AliMUONSt1GeometryBuilder::SetSensitiveVolumes()
294 // Defines the sensitive volumes for station1 chambers.
297 GetChamber(0)->GetGeometry()->SetSensitiveVolume("S01G");
298 GetChamber(1)->GetGeometry()->SetSensitiveVolume("S02G");