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 "AliMUONConstants.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONGeometryEnvelopeStore.h"
35 ClassImp(AliMUONTriggerGeometryBuilder)
37 //______________________________________________________________________________
38 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
39 : AliMUONVGeometryBuilder(10, 11, 12, 13),
42 // Standard constructor
46 //______________________________________________________________________________
47 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
48 : AliMUONVGeometryBuilder(),
51 // Default constructor
55 //______________________________________________________________________________
56 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
57 : AliMUONVGeometryBuilder(rhs)
59 // Protected copy constructor
61 AliFatal("Copy constructor is not implemented.");
64 //______________________________________________________________________________
65 AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
69 //______________________________________________________________________________
70 AliMUONTriggerGeometryBuilder&
71 AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& rhs)
73 // Protected assignement operator
75 // check assignement to self
76 if (this == &rhs) return *this;
78 AliFatal("Assignment operator is not implemented.");
87 //______________________________________________________________________________
88 void AliMUONTriggerGeometryBuilder::CreateGeometry()
90 // From AliMUONv1::CreateGeometry()
93 zpos1 and zpos2 are the middle of the first and second
94 planes of station 1 (+1m for second station):
95 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
96 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
97 zposxm and zposxp= middles of gaz gaps within a detection plane
98 rem: the total thickness accounts for 1 mm of al on both
99 side of the RPCs (see zpos1 and zpos2)
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 detElemId=0; // Detection Element Number
109 // vertical gap between right and left chambers (kDXZERO*2=4cm)
110 const Float_t kDXZERO=2.;
111 // main distances for chamber definition in first plane/first station
112 const Float_t kXMIN=34.;
113 const Float_t kXMED=51.;
114 const Float_t kXMAX=255.;
115 // 090704 kXMAX changed from 272 to 255.
116 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
117 // segmentation updated accordingly
118 const Float_t kYMIN=34.;
119 const Float_t kYMAX=51.;
120 // inner/outer radius of flange between beam shield. and chambers (1/station)
121 // const Float_t kRMIN[2]={50.,50.};
122 // const Float_t kRMAX[2]={64.,68.};
123 // z position of the middle of the gas gap in mother vol
124 const Float_t kZm=-3.6;
125 const Float_t kZp=+3.6;
127 Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
128 Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) -
129 ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1;
133 // ratio of zpos1m/zpos1p and inverse for first plane
134 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
137 Int_t icount=0; // chamber counter (0 1 2 3)
139 for (Int_t istation=0; istation<2; istation++) { // loop on stations
140 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
142 Int_t iVolNum=1; // counter Volume Number
143 icount = Int_t(iplane<<0)+Int_t(istation<<1);
145 par[0] = AliMUONConstants::Rmin(5+istation);
146 par[1] = AliMUONConstants::Rmax(5+istation);
148 sprintf(volName,"%s%d", "SC",11+icount);
149 gMC->Gsvolu(volName,"TUBE", idAir, par, 3);
150 GetGeometry(10+icount)->SetVolume(volName);
151 Float_t zpos = AliMUONConstants::DefaultChamberZ(10+icount);
154 // Flange between beam shielding and RPC
155 tpar[0]= kRMIN[istation];
156 tpar[1]= kRMAX[istation];
159 sprintf(volFlange,"SF%dA",icount+1);
160 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
162 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
163 iChamber->GetGeometry()->GetEnvelopeStore()
164 ->AddEnvelope(volFlange, 0, false, "MANY");
168 Float_t zRatio = zpos / zpos1;
170 // envelopes (same size except line 5, all virtual)
172 tpar[1] = kYMIN * zRatio;
174 Int_t i=0; // counter
175 for (Int_t icolumn=0; icolumn<2; icolumn++) {
176 for (Int_t iline=1; iline<10; iline++){
177 tpar[0] = (kXMAX/2.) * zRatio;
178 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
180 sprintf(volEnv[i],"S%dR%d",icount,iline);
182 sprintf(volEnv[i],"S%dL%d",icount,iline);
183 gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
191 tpar[2]= 0.; char volAlu[5]; // Alu
192 char volBak[5]; // Bakelite
193 char volGaz[5]; // Gas streamer
194 sprintf(volAlu,"SC%dA",icount+1);
195 sprintf(volBak,"SB%dA",icount+1);
196 sprintf(volGaz,"S%dG",icount+11);
197 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
198 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
199 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
203 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
205 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
208 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
209 Float_t yEnvM = 0.; // y low position of envelope in chamber
210 Float_t yEnvP = 0.; // y up position of envelope in chamber
211 Float_t yEnvPsave = 0.; // tmp data
212 Float_t yEnvMsave = 0.; // tmp data
213 Float_t xpos = 0.; // x position of RPC in envelope
214 Float_t ypos = 0.; // y position of RPC in envelope
216 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
217 dpar[1] = kYMIN * zRatio;
219 detElemId = (10+icount+1)*100;
220 GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvP,kZp));
221 detElemId = (10+icount+1)*100+9;
222 GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
224 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
225 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
227 // chamber type B (plus envelope chambers B & C)
228 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
231 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
232 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
233 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
234 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
235 xpos = kXMIN/2. * zRatio;
236 ypos = (kYMIN - kYMIN/4.) * zRatio;
238 detElemId = (10+icount+1)*100+17;
239 GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvM,kZm));
240 detElemId = (10+icount+1)*100+1;
241 GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvM,kZm));
242 detElemId = (10+icount+1)*100+10;
243 GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
244 detElemId = (10+icount+1)*100+8;
245 GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
247 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
248 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
249 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
250 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
252 // chamber type C (note: same Z than type B)
253 dpar[0] = (kXMAX/2)*zRatio;
254 dpar[1] = (kYMAX/2)*zRatio;
256 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
258 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
259 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
260 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
261 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
263 // chamber type D, E and F (same size)
267 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
268 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
269 dpar[0] = (kXMAX/2.)*zRatio;
270 dpar[1] = kYMIN*zRatio;
272 detElemId = (10+icount+1)*100+16;
273 GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
274 detElemId = (10+icount+1)*100+2;
275 GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
276 detElemId = (10+icount+1)*100+11;
277 GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
278 detElemId = (10+icount+1)*100+7;
279 GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
281 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
282 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
283 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
284 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
289 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
290 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
292 detElemId = (10+icount+1)*100+15;
293 GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
294 detElemId = (10+icount+1)*100+3;
295 GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
296 detElemId = (10+icount+1)*100+12;
297 GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
298 detElemId = (10+icount+1)*100+6;
299 GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
301 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
302 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
303 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
304 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
310 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
311 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
313 detElemId = (10+icount+1)*100+14;
314 GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
315 detElemId = (10+icount+1)*100+4;
316 GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
317 detElemId = (10+icount+1)*100+13;
318 GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
319 detElemId = (10+icount+1)*100+5;
320 GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
322 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
323 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
324 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
325 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
327 } // end loop on detection planes
328 } // end loop on stations
331 //______________________________________________________________________________
332 void AliMUONTriggerGeometryBuilder::SetTransformations()
334 // Defines the transformations for the trigger chambers.
337 Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
338 SetTranslation(10, TGeoTranslation(0., 0., zpos1));
340 zpos1= AliMUONConstants::DefaultChamberZ(11);
341 SetTranslation(11, TGeoTranslation(0., 0., zpos1));
343 zpos1= AliMUONConstants::DefaultChamberZ(12);
344 SetTranslation(12, TGeoTranslation(0., 0., zpos1));
346 zpos1= AliMUONConstants::DefaultChamberZ(13);
347 SetTranslation(13, TGeoTranslation(0., 0., zpos1));
351 //______________________________________________________________________________
352 void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
354 // Defines the sensitive volumes for trigger station chambers.
357 GetGeometry(10)->SetSensitiveVolume("S11G");
358 GetGeometry(11)->SetSensitiveVolume("S12G");
359 GetGeometry(12)->SetSensitiveVolume("S13G");
360 GetGeometry(13)->SetSensitiveVolume("S14G");