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 // -----------------------------------
19 // Class AliMUONTriggerGeometryBuilder
20 // -----------------------------------
21 // MUON Trigger stations geometry
22 // construction class.
23 // Author: Philippe Crochet (LPCCFd)
25 #include <TVirtualMC.h>
26 #include <TGeoMatrix.h>
30 #include "AliMUONTriggerGeometryBuilder.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONGeometryModule.h"
34 #include "AliMUONGeometryEnvelopeStore.h"
36 ClassImp(AliMUONTriggerGeometryBuilder)
38 //______________________________________________________________________________
39 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
40 : AliMUONVGeometryBuilder(10, 11, 12, 13),
43 // Standard constructor
47 //______________________________________________________________________________
48 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
49 : AliMUONVGeometryBuilder(),
52 // Default constructor
56 //______________________________________________________________________________
57 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
58 : AliMUONVGeometryBuilder(rhs)
60 // Protected copy constructor
62 AliFatal("Copy constructor is not implemented.");
65 //______________________________________________________________________________
66 AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
70 //______________________________________________________________________________
71 AliMUONTriggerGeometryBuilder&
72 AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& 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 AliMUONTriggerGeometryBuilder::CreateGeometry()
91 // From AliMUONv1::CreateGeometry()
94 zpos1 and zpos2 are the middle of the first and second
95 planes of station 1 (+1m for second station):
96 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
97 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
98 zposxm and zposxp= middles of gaz gaps within a detection plane
99 rem: the total thickness accounts for 1 mm of al on both
100 side of the RPCs (see zpos1 and zpos2)
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 detElemId=0; // Detection Element Number
110 // vertical gap between right and left chambers (kDXZERO*2=4cm)
111 const Float_t kDXZERO=2.;
112 // main distances for chamber definition in first plane/first station
113 const Float_t kXMIN=34.;
114 const Float_t kXMED=51.;
115 const Float_t kXMAX=255.;
116 // 090704 kXMAX changed from 272 to 255.
117 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
118 // segmentation updated accordingly
119 const Float_t kYMIN=34.;
120 const Float_t kYMAX=51.;
121 // inner/outer radius of flange between beam shield. and chambers (1/station)
122 // const Float_t kRMIN[2]={50.,50.};
123 // const Float_t kRMAX[2]={64.,68.};
124 // z position of the middle of the gas gap in mother vol
125 const Float_t kZm=-3.6;
126 const Float_t kZp=+3.6;
128 Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
129 Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) -
130 ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1;
134 // ratio of zpos1m/zpos1p and inverse for first plane
135 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
138 Int_t icount=0; // chamber counter (0 1 2 3)
140 for (Int_t istation=0; istation<2; istation++) { // loop on stations
141 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
143 Int_t iVolNum=1; // counter Volume Number
144 icount = Int_t(iplane<<0)+Int_t(istation<<1);
146 par[0] = AliMUONConstants::Rmin(5+istation);
147 par[1] = AliMUONConstants::Rmax(5+istation);
149 sprintf(volName,"%s%d", "SC",11+icount);
150 gMC->Gsvolu(volName,"TUBE", idAir, par, 3);
151 //SetVolume(10+icount, volName);
152 // Float_t zpos = AliMUONConstants::DefaultChamberZ(10+icount);
155 // Flange between beam shielding and RPC
156 tpar[0]= kRMIN[istation];
157 tpar[1]= kRMAX[istation];
160 sprintf(volFlange,"SF%dA",icount+1);
161 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
163 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
164 iChamber->GetGeometry()->GetEnvelopeStore()
165 ->AddEnvelope(volFlange, 0, false, "MANY");
169 // Float_t zRatio = zpos / zpos1;
170 Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
175 // envelopes (same size except line 5, all virtual)
177 tpar[1] = kYMIN * zRatio;
179 Int_t i=0; // counter
180 for (Int_t icolumn=0; icolumn<2; icolumn++) {
181 for (Int_t iline=1; iline<10; iline++){
182 tpar[0] = (kXMAX/2.) * zRatio;
183 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
185 sprintf(volEnv[i],"S%dR%d",icount,iline);
187 sprintf(volEnv[i],"S%dL%d",icount,iline);
188 // gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
196 tpar[2]= 0.; char volAlu[5]; // Alu
197 char volBak[5]; // Bakelite
198 char volGaz[5]; // Gas streamer
199 sprintf(volAlu,"SC%dA",icount+1);
200 sprintf(volBak,"SB%dA",icount+1);
201 sprintf(volGaz,"S%dG",icount+11);
202 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
203 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
204 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
208 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
210 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
213 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
214 Float_t yEnvM = 0.; // y low position of envelope in chamber
215 Float_t yEnvP = 0.; // y up position of envelope in chamber
216 Float_t yEnvPsave = 0.; // tmp data
217 Float_t yEnvMsave = 0.; // tmp data
218 Float_t xpos = 0.; // x position of RPC in envelope
219 Float_t ypos = 0.; // y position of RPC in envelope
221 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
222 dpar[1] = kYMIN * zRatio;
224 detElemId = (10+icount+1)*100;
225 GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvP,kZp));
226 detElemId = (10+icount+1)*100+9;
227 GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
229 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
230 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
232 // chamber type B (plus envelope chambers B & C)
233 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
236 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
237 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
238 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
239 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
240 xpos = kXMIN/2. * zRatio;
241 ypos = (kYMIN - kYMIN/4.) * zRatio;
243 detElemId = (10+icount+1)*100+17;
244 GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvM,kZm));
245 detElemId = (10+icount+1)*100+1;
246 GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvM,kZm));
247 detElemId = (10+icount+1)*100+10;
248 GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
249 detElemId = (10+icount+1)*100+8;
250 GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
252 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
253 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
254 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
255 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
257 // chamber type C (note: same Z than type B)
258 dpar[0] = (kXMAX/2)*zRatio;
259 dpar[1] = (kYMAX/2)*zRatio;
261 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
263 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
264 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
265 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
266 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
268 // chamber type D, E and F (same size)
272 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
273 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
274 dpar[0] = (kXMAX/2.)*zRatio;
275 dpar[1] = kYMIN*zRatio;
277 detElemId = (10+icount+1)*100+16;
278 GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
279 detElemId = (10+icount+1)*100+2;
280 GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
281 detElemId = (10+icount+1)*100+11;
282 GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
283 detElemId = (10+icount+1)*100+7;
284 GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
286 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
287 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
288 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
289 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
294 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
295 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
297 detElemId = (10+icount+1)*100+15;
298 GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
299 detElemId = (10+icount+1)*100+3;
300 GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
301 detElemId = (10+icount+1)*100+12;
302 GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
303 detElemId = (10+icount+1)*100+6;
304 GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
306 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
307 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
308 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
309 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
315 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
316 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
318 detElemId = (10+icount+1)*100+14;
319 GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
320 detElemId = (10+icount+1)*100+4;
321 GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
322 detElemId = (10+icount+1)*100+13;
323 GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
324 detElemId = (10+icount+1)*100+5;
325 GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
327 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
328 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
329 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
330 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
332 } // end loop on detection planes
333 } // end loop on stations
336 //______________________________________________________________________________
337 void AliMUONTriggerGeometryBuilder::SetTransformations()
339 // Defines the transformations for the trigger chambers.
342 SetVolume(10, "SC11");
343 SetVolume(11, "SC12");
344 SetVolume(12, "SC13");
345 SetVolume(13, "SC14");
347 Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
348 SetTranslation(10, TGeoTranslation(0., 0., zpos1));
350 zpos1= AliMUONConstants::DefaultChamberZ(11);
351 SetTranslation(11, TGeoTranslation(0., 0., zpos1));
353 zpos1= AliMUONConstants::DefaultChamberZ(12);
354 SetTranslation(12, TGeoTranslation(0., 0., zpos1));
356 zpos1= AliMUONConstants::DefaultChamberZ(13);
357 SetTranslation(13, TGeoTranslation(0., 0., zpos1));
360 //______________________________________________________________________________
361 void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
363 // Defines the sensitive volumes for trigger station chambers.
366 GetGeometry(10)->SetSensitiveVolume("S11G");
367 GetGeometry(11)->SetSensitiveVolume("S12G");
368 GetGeometry(12)->SetSensitiveVolume("S13G");
369 GetGeometry(13)->SetSensitiveVolume("S14G");