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"
32 ClassImp(AliMUONTriggerGeometryBuilder)
34 //______________________________________________________________________________
35 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
36 : AliMUONVGeometryBuilder(&muon->Chamber(10), &muon->Chamber(11),&muon->Chamber(12),&muon->Chamber(13)),
39 // Standard constructor
43 //______________________________________________________________________________
44 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
45 : AliMUONVGeometryBuilder(),
48 // Default constructor
52 //______________________________________________________________________________
53 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
54 : AliMUONVGeometryBuilder(rhs)
56 // Protected copy constructor
58 Fatal("Copy constructor",
59 "Copy constructor is not implemented.");
62 //______________________________________________________________________________
63 AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
67 //______________________________________________________________________________
68 AliMUONTriggerGeometryBuilder&
69 AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& rhs)
71 // Protected assignement operator
73 // check assignement to self
74 if (this == &rhs) return *this;
77 "Assignment operator is not implemented.");
86 //______________________________________________________________________________
87 void AliMUONTriggerGeometryBuilder::CreateGeometry()
89 // From AliMUONv1::CreateGeometry()
92 zpos1 and zpos2 are the middle of the first and second
93 planes of station 1 (+1m for second station):
94 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
95 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
96 zposxm and zposxp= middles of gaz gaps within a detection plane
97 rem: the total thickness accounts for 1 mm of al on both
98 side of the RPCs (see zpos1 and zpos2)
101 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
102 Int_t idAir= idtmed[1100]; // medium 1
103 Int_t idAlu1=idtmed[1103]; // medium 4
107 // vertical gap between right and left chambers (kDXZERO*2=4cm)
108 const Float_t kDXZERO=2.;
109 // main distances for chamber definition in first plane/first station
110 const Float_t kXMIN=34.;
111 const Float_t kXMED=51.;
112 const Float_t kXMAX=255.;
113 // 090704 kXMAX changed from 272 to 255.
114 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
115 // segmentation updated accordingly
116 const Float_t kYMIN=34.;
117 const Float_t kYMAX=51.;
118 // inner/outer radius of flange between beam shield. and chambers (1/station)
119 const Float_t kRMIN[2]={50.,50.};
120 const Float_t kRMAX[2]={64.,68.};
121 // z position of the middle of the gas gap in mother vol
122 const Float_t kZm=-3.6;
123 const Float_t kZp=+3.6;
125 AliMUONChamber *iChamber, *iChamber1;
126 iChamber1 = GetChamber(10);
127 Float_t zpos1=-iChamber1->Z();
129 // ratio of zpos1m/zpos1p and inverse for first plane
130 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
133 Int_t icount=0; // chamber counter (0 1 2 3)
135 for (Int_t istation=0; istation<2; istation++) { // loop on stations
136 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
138 Int_t iVolNum=1; // counter Volume Number
139 icount = Int_t(iplane*TMath::Power(2,0))+
140 Int_t(istation*TMath::Power(2,1));
142 iChamber = GetChamber(10+icount);
143 Float_t zpos = - iChamber->Z();
145 // Flange between beam shielding and RPC
146 tpar[0]= kRMIN[istation];
147 tpar[1]= kRMAX[istation];
150 sprintf(volFlange,"SF%dA",icount+1);
151 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
153 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
154 iChamber->GetGeometry()->AddEnvelope(volFlange, false, "MANY");
157 Float_t zRatio = zpos / zpos1;
159 // envelopes (same size except line 5, all virtual)
161 tpar[1] = kYMIN * zRatio;
163 Int_t i=0; // counter
164 for (Int_t icolumn=0; icolumn<2; icolumn++) {
165 for (Int_t iline=1; iline<10; iline++){
166 tpar[0] = (kXMAX/2.) * zRatio;
167 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
169 sprintf(volEnv[i],"S%dR%d",icount,iline);
171 sprintf(volEnv[i],"S%dL%d",icount,iline);
172 gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
181 char volAlu[5]; // Alu
182 char volBak[5]; // Bakelite
183 char volGaz[5]; // Gas streamer
184 sprintf(volAlu,"SC%dA",icount+1);
185 sprintf(volBak,"SB%dA",icount+1);
186 sprintf(volGaz,"SG%dA",icount+1);
187 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
188 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
189 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
193 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
195 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
198 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
199 Float_t yEnvM = 0.; // y low position of envelope in chamber
200 Float_t yEnvP = 0.; // y up position of envelope in chamber
201 Float_t yEnvPsave = 0.; // tmp data
202 Float_t yEnvMsave = 0.; // tmp data
203 Float_t xpos = 0.; // x position of RPC in envelope
204 Float_t ypos = 0.; // y position of RPC in envelope
206 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
207 dpar[1] = kYMIN * zRatio;
209 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[4], true, TGeoTranslation(xEnv,yEnvM,kZm));
210 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[13], true, TGeoTranslation(-xEnv,yEnvP,kZp));
212 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
213 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
215 // chamber type B (plus envelope chambers B & C)
216 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
219 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
220 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
221 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
222 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
223 xpos = kXMIN/2. * zRatio;
224 ypos = (kYMIN - kYMIN/4.) * zRatio;
226 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[3], true, TGeoTranslation( xEnv,-yEnvP,kZp));
227 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[5], true, TGeoTranslation( xEnv, yEnvP,kZp));
228 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[12], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
229 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[14], true, TGeoTranslation(-xEnv, yEnvM,kZm));
231 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
232 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
233 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
234 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
236 // chamber type C (note: same Z than type B)
237 dpar[0] = (kXMAX/2)*zRatio;
238 dpar[1] = (kYMAX/2)*zRatio;
240 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
242 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
243 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
244 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
245 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
247 // chamber type D, E and F (same size)
251 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
252 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
253 dpar[0] = (kXMAX/2.)*zRatio;
254 dpar[1] = kYMIN*zRatio;
256 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[2], true, TGeoTranslation(xEnv,-yEnvM,kZm));
257 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[6], true, TGeoTranslation(xEnv, yEnvM,kZm));
258 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[11], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
259 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[15], true, TGeoTranslation(-xEnv, yEnvP,kZp));
261 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
262 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
263 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
264 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
269 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
270 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
272 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[1], true, TGeoTranslation(xEnv,-yEnvP,kZp));
273 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[7], true, TGeoTranslation(xEnv, yEnvP,kZp));
274 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[10], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
275 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[16], true, TGeoTranslation(-xEnv, yEnvM,kZm));
277 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
278 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
279 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
280 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
286 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
287 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
289 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[0], true, TGeoTranslation(xEnv,-yEnvM,kZm));
290 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[8], true, TGeoTranslation(xEnv, yEnvM,kZm));
291 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[9], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
292 GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[17], true, TGeoTranslation(-xEnv, yEnvP,kZp));
294 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
295 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
296 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
297 GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
299 } // end loop on detection planes
300 } // end loop on stations
303 //______________________________________________________________________________
304 void AliMUONTriggerGeometryBuilder::SetTransformations()
306 // Defines the transformations for the trigger chambers.
308 Double_t zpos1, zpos2;
309 AliMUONChamber *iChamber1, *iChamber2;
311 iChamber1 = GetChamber(10);
312 zpos1= - iChamber1->Z();
313 iChamber1->GetGeometry()
314 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
316 iChamber2 = GetChamber(11);
317 zpos2 = - iChamber2->Z();
318 iChamber2->GetGeometry()
319 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
321 iChamber1 = GetChamber(12);
322 zpos1 = - iChamber1->Z();
323 iChamber1->GetGeometry()
324 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
326 iChamber2 = GetChamber(13);
327 zpos2 = - iChamber2->Z();
328 iChamber2->GetGeometry()
329 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
332 //______________________________________________________________________________
333 void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
335 // Defines the sensitive volumes for trigger station chambers.
338 GetChamber(10)->GetGeometry()->SetSensitiveVolume("SG1A");
339 GetChamber(11)->GetGeometry()->SetSensitiveVolume("SG2A");
340 GetChamber(12)->GetGeometry()->SetSensitiveVolume("SG3A");
341 GetChamber(13)->GetGeometry()->SetSensitiveVolume("SG4A");