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>
27 #include "AliMUONTriggerGeometryBuilder.h"
29 #include "AliMUONChamber.h"
30 #include "AliMUONChamberGeometry.h"
31 #include "AliMUONGeometryEnvelopeStore.h"
34 ClassImp(AliMUONTriggerGeometryBuilder)
36 //______________________________________________________________________________
37 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
38 : AliMUONVGeometryBuilder("trigger.dat",
39 &muon->Chamber(10), &muon->Chamber(11),
40 &muon->Chamber(12),&muon->Chamber(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 AliMUONChamber *iChamber, *iChamber1;
129 iChamber1 = GetChamber(10);
130 Float_t zpos1=-iChamber1->Z();
132 // ratio of zpos1m/zpos1p and inverse for first plane
133 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
136 Int_t icount=0; // chamber counter (0 1 2 3)
138 for (Int_t istation=0; istation<2; istation++) { // loop on stations
139 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
141 Int_t iVolNum=1; // counter Volume Number
142 icount = Int_t(iplane*TMath::Power(2,0))+
143 Int_t(istation*TMath::Power(2,1));
145 iChamber = GetChamber(10+icount);
146 Float_t zpos = - iChamber->Z();
148 // Flange between beam shielding and RPC
149 tpar[0]= kRMIN[istation];
150 tpar[1]= kRMAX[istation];
153 sprintf(volFlange,"SF%dA",icount+1);
154 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
156 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
157 iChamber->GetGeometry()->GetEnvelopeStore()
158 ->AddEnvelope(volFlange, 0, false, "MANY");
161 Float_t zRatio = zpos / zpos1;
163 // envelopes (same size except line 5, all virtual)
165 tpar[1] = kYMIN * zRatio;
167 Int_t i=0; // counter
168 for (Int_t icolumn=0; icolumn<2; icolumn++) {
169 for (Int_t iline=1; iline<10; iline++){
170 tpar[0] = (kXMAX/2.) * zRatio;
171 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
173 sprintf(volEnv[i],"S%dR%d",icount,iline);
175 sprintf(volEnv[i],"S%dL%d",icount,iline);
176 gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
185 char volAlu[5]; // Alu
186 char volBak[5]; // Bakelite
187 char volGaz[5]; // Gas streamer
188 sprintf(volAlu,"SC%dA",icount+1);
189 sprintf(volBak,"SB%dA",icount+1);
190 sprintf(volGaz,"SG%dA",icount+1);
191 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
192 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
193 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
197 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
199 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
202 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
203 Float_t yEnvM = 0.; // y low position of envelope in chamber
204 Float_t yEnvP = 0.; // y up position of envelope in chamber
205 Float_t yEnvPsave = 0.; // tmp data
206 Float_t yEnvMsave = 0.; // tmp data
207 Float_t xpos = 0.; // x position of RPC in envelope
208 Float_t ypos = 0.; // y position of RPC in envelope
210 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
211 dpar[1] = kYMIN * zRatio;
213 detElemId = (10+icount+1)*100+4;
214 GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvM,kZm));
215 detElemId = (10+icount+1)*100+50+4;
216 GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvP,kZp));
218 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
219 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
221 // chamber type B (plus envelope chambers B & C)
222 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
225 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
226 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
227 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
228 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
229 xpos = kXMIN/2. * zRatio;
230 ypos = (kYMIN - kYMIN/4.) * zRatio;
232 detElemId = (10+icount+1)*100+3;
233 GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvP,kZp));
234 detElemId = (10+icount+1)*100+5;
235 GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvP,kZp));
236 detElemId = (10+icount+1)*100+50+3;
237 GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm));
238 detElemId = (10+icount+1)*100+50+5;
239 GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm));
241 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
242 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
243 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
244 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
246 // chamber type C (note: same Z than type B)
247 dpar[0] = (kXMAX/2)*zRatio;
248 dpar[1] = (kYMAX/2)*zRatio;
250 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
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 D, E and F (same size)
261 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
262 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
263 dpar[0] = (kXMAX/2.)*zRatio;
264 dpar[1] = kYMIN*zRatio;
266 detElemId = (10+icount+1)*100+2;
267 GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
268 detElemId = (10+icount+1)*100+6;
269 GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
270 detElemId = (10+icount+1)*100+50+2;
271 GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp));
272 detElemId = (10+icount+1)*100+50+6;
273 GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp));
275 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
276 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
277 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
278 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
283 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
284 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
286 detElemId = (10+icount+1)*100+1;
287 GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
288 detElemId = (10+icount+1)*100+7;
289 GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
290 detElemId = (10+icount+1)*100+50+1;
291 GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm));
292 detElemId = (10+icount+1)*100+50+7;
293 GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm));
295 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
296 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
297 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
298 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
304 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
305 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
307 detElemId = (10+icount+1)*100;
308 GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
309 detElemId = (10+icount+1)*100+8;
310 GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
311 detElemId = (10+icount+1)*100+50;
312 GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp));
313 detElemId = (10+icount+1)*100+50+8;
314 GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp));
316 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
317 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
318 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
319 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
321 } // end loop on detection planes
322 } // end loop on stations
325 //______________________________________________________________________________
326 void AliMUONTriggerGeometryBuilder::SetTransformations()
328 // Defines the transformations for the trigger chambers.
330 Double_t zpos1, zpos2;
331 AliMUONChamber *iChamber1, *iChamber2;
333 iChamber1 = GetChamber(10);
334 zpos1= - iChamber1->Z();
335 iChamber1->GetGeometry()
336 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
338 iChamber2 = GetChamber(11);
339 zpos2 = - iChamber2->Z();
340 iChamber2->GetGeometry()
341 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
343 iChamber1 = GetChamber(12);
344 zpos1 = - iChamber1->Z();
345 iChamber1->GetGeometry()
346 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
348 iChamber2 = GetChamber(13);
349 zpos2 = - iChamber2->Z();
350 iChamber2->GetGeometry()
351 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
354 //______________________________________________________________________________
355 void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
357 // Defines the sensitive volumes for trigger station chambers.
360 GetChamber(10)->GetGeometry()->SetSensitiveVolume("SG1A");
361 GetChamber(11)->GetGeometry()->SetSensitiveVolume("SG2A");
362 GetChamber(12)->GetGeometry()->SetSensitiveVolume("SG3A");
363 GetChamber(13)->GetGeometry()->SetSensitiveVolume("SG4A");