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 AliMUONTriggerGeometryBuilder
19 // -----------------------------------
20 // MUON Trigger stations geometry construction class.
22 // Author: Philippe Crochette, LPC Clermont-Ferrand
24 #include <TVirtualMC.h>
25 #include <TGeoMatrix.h>
29 #include "AliMUONTriggerGeometryBuilder.h"
31 #include "AliMUONChamber.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONGeometryEnvelopeStore.h"
35 ClassImp(AliMUONTriggerGeometryBuilder)
37 //______________________________________________________________________________
38 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
39 : AliMUONVGeometryBuilder("trigger.dat",
40 muon->Chamber(10).GetGeometry(),
41 muon->Chamber(11).GetGeometry(),
42 muon->Chamber(12).GetGeometry(),
43 muon->Chamber(13).GetGeometry()),
46 // Standard constructor
50 //______________________________________________________________________________
51 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
52 : AliMUONVGeometryBuilder(),
55 // Default constructor
59 //______________________________________________________________________________
60 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
61 : AliMUONVGeometryBuilder(rhs)
63 // Protected copy constructor
65 AliFatal("Copy constructor is not implemented.");
68 //______________________________________________________________________________
69 AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
73 //______________________________________________________________________________
74 AliMUONTriggerGeometryBuilder&
75 AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& rhs)
77 // Protected assignement operator
79 // check assignement to self
80 if (this == &rhs) return *this;
82 AliFatal("Assignment operator is not implemented.");
91 //______________________________________________________________________________
92 void AliMUONTriggerGeometryBuilder::CreateGeometry()
94 // From AliMUONv1::CreateGeometry()
97 zpos1 and zpos2 are the middle of the first and second
98 planes of station 1 (+1m for second station):
99 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
100 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
101 zposxm and zposxp= middles of gaz gaps within a detection plane
102 rem: the total thickness accounts for 1 mm of al on both
103 side of the RPCs (see zpos1 and zpos2)
106 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
107 Int_t idAir= idtmed[1100]; // medium 1
108 Int_t idAlu1=idtmed[1103]; // medium 4
109 Int_t detElemId=0; // Detection Element Number
113 // vertical gap between right and left chambers (kDXZERO*2=4cm)
114 const Float_t kDXZERO=2.;
115 // main distances for chamber definition in first plane/first station
116 const Float_t kXMIN=34.;
117 const Float_t kXMED=51.;
118 const Float_t kXMAX=255.;
119 // 090704 kXMAX changed from 272 to 255.
120 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
121 // segmentation updated accordingly
122 const Float_t kYMIN=34.;
123 const Float_t kYMAX=51.;
124 // inner/outer radius of flange between beam shield. and chambers (1/station)
125 // const Float_t kRMIN[2]={50.,50.};
126 // const Float_t kRMAX[2]={64.,68.};
127 // z position of the middle of the gas gap in mother vol
128 const Float_t kZm=-3.6;
129 const Float_t kZp=+3.6;
131 AliMUONChamber *iChamber, *iChamber1;
132 iChamber1 = &fMUON->Chamber(10);
133 Float_t zpos1=-iChamber1->Z();
135 // ratio of zpos1m/zpos1p and inverse for first plane
136 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
139 Int_t icount=0; // chamber counter (0 1 2 3)
141 for (Int_t istation=0; istation<2; istation++) { // loop on stations
142 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
144 Int_t iVolNum=1; // counter Volume Number
145 icount = Int_t(iplane*TMath::Power(2,0))+
146 Int_t(istation*TMath::Power(2,1));
148 iChamber = &fMUON->Chamber(10+icount);
149 Float_t zpos = - iChamber->Z();
152 // Flange between beam shielding and RPC
153 tpar[0]= kRMIN[istation];
154 tpar[1]= kRMAX[istation];
157 sprintf(volFlange,"SF%dA",icount+1);
158 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
160 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
161 iChamber->GetGeometry()->GetEnvelopeStore()
162 ->AddEnvelope(volFlange, 0, false, "MANY");
166 Float_t zRatio = zpos / zpos1;
168 // envelopes (same size except line 5, all virtual)
170 tpar[1] = kYMIN * zRatio;
172 Int_t i=0; // counter
173 for (Int_t icolumn=0; icolumn<2; icolumn++) {
174 for (Int_t iline=1; iline<10; iline++){
175 tpar[0] = (kXMAX/2.) * zRatio;
176 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
178 sprintf(volEnv[i],"S%dR%d",icount,iline);
180 sprintf(volEnv[i],"S%dL%d",icount,iline);
181 gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
189 tpar[2]= 0.; char volAlu[5]; // Alu
190 char volBak[5]; // Bakelite
191 char volGaz[5]; // Gas streamer
192 sprintf(volAlu,"SC%dA",icount+1);
193 sprintf(volBak,"SB%dA",icount+1);
194 sprintf(volGaz,"SG%dA",icount+1);
195 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
196 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
197 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
201 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
203 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
206 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
207 Float_t yEnvM = 0.; // y low position of envelope in chamber
208 Float_t yEnvP = 0.; // y up position of envelope in chamber
209 Float_t yEnvPsave = 0.; // tmp data
210 Float_t yEnvMsave = 0.; // tmp data
211 Float_t xpos = 0.; // x position of RPC in envelope
212 Float_t ypos = 0.; // y position of RPC in envelope
214 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
215 dpar[1] = kYMIN * zRatio;
217 detElemId = (10+icount+1)*100+4;
218 GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvP,kZp));
219 detElemId = (10+icount+1)*100+50+4;
220 GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
222 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
223 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
225 // chamber type B (plus envelope chambers B & C)
226 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
229 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
230 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
231 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
232 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
233 xpos = kXMIN/2. * zRatio;
234 ypos = (kYMIN - kYMIN/4.) * zRatio;
236 detElemId = (10+icount+1)*100+3;
237 GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvM,kZm));
238 detElemId = (10+icount+1)*100+5;
239 GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvM,kZm));
240 detElemId = (10+icount+1)*100+50+3;
241 GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
242 detElemId = (10+icount+1)*100+50+5;
243 GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
245 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
246 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
247 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
248 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
250 // chamber type C (note: same Z than type B)
251 dpar[0] = (kXMAX/2)*zRatio;
252 dpar[1] = (kYMAX/2)*zRatio;
254 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
256 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
257 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
258 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
259 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
261 // chamber type D, E and F (same size)
265 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
266 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
267 dpar[0] = (kXMAX/2.)*zRatio;
268 dpar[1] = kYMIN*zRatio;
270 detElemId = (10+icount+1)*100+2;
271 GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
272 detElemId = (10+icount+1)*100+6;
273 GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
274 detElemId = (10+icount+1)*100+50+2;
275 GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
276 detElemId = (10+icount+1)*100+50+6;
277 GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
279 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
280 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
281 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
282 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
287 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
288 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
290 detElemId = (10+icount+1)*100+1;
291 GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
292 detElemId = (10+icount+1)*100+7;
293 GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
294 detElemId = (10+icount+1)*100+50+1;
295 GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
296 detElemId = (10+icount+1)*100+50+7;
297 GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
299 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
300 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
301 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
302 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
308 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
309 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
311 detElemId = (10+icount+1)*100;
312 GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
313 detElemId = (10+icount+1)*100+8;
314 GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
315 detElemId = (10+icount+1)*100+50;
316 GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
317 detElemId = (10+icount+1)*100+50+8;
318 GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
320 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
321 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
322 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
323 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
325 } // end loop on detection planes
326 } // end loop on stations
329 //______________________________________________________________________________
330 void AliMUONTriggerGeometryBuilder::SetTransformations()
332 // Defines the transformations for the trigger chambers.
334 Double_t zpos1, zpos2;
335 AliMUONChamber *iChamber1, *iChamber2;
337 iChamber1 = &fMUON->Chamber(10);
338 zpos1= - iChamber1->Z();
339 iChamber1->GetGeometry()
340 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
342 iChamber2 = &fMUON->Chamber(11);
343 zpos2 = - iChamber2->Z();
344 iChamber2->GetGeometry()
345 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
347 iChamber1 = &fMUON->Chamber(12);
348 zpos1 = - iChamber1->Z();
349 iChamber1->GetGeometry()
350 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
352 iChamber2 = &fMUON->Chamber(13);
353 zpos2 = - iChamber2->Z();
354 iChamber2->GetGeometry()
355 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
358 //______________________________________________________________________________
359 void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
361 // Defines the sensitive volumes for trigger station chambers.
364 GetGeometry(10)->SetSensitiveVolume("SG1A");
365 GetGeometry(11)->SetSensitiveVolume("SG2A");
366 GetGeometry(12)->SetSensitiveVolume("SG3A");
367 GetGeometry(13)->SetSensitiveVolume("SG4A");