]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTriggerGeometryBuilder.cxx
remove obsolete flange (Pascal)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerGeometryBuilder.cxx
CommitLineData
30178c30 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
d1cd2474 16// $Id$
17//
18// Class AliMUONTriggerGeometryBuilder
19// -----------------------------------
20// MUON Trigger stations geometry construction class.
21//
22// Author: Philippe Crochette, LPC Clermont-Ferrand
23
24#include <TVirtualMC.h>
25#include <TGeoMatrix.h>
26
e118b27e 27#include "AliLog.h"
28
d1cd2474 29#include "AliMUONTriggerGeometryBuilder.h"
30#include "AliMUON.h"
31#include "AliMUONChamber.h"
e118b27e 32#include "AliMUONGeometryModule.h"
a432117a 33#include "AliMUONGeometryEnvelopeStore.h"
d1cd2474 34
35ClassImp(AliMUONTriggerGeometryBuilder)
36
37//______________________________________________________________________________
38AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
a432117a 39 : AliMUONVGeometryBuilder("trigger.dat",
e118b27e 40 muon->Chamber(10).GetGeometry(),
41 muon->Chamber(11).GetGeometry(),
42 muon->Chamber(12).GetGeometry(),
43 muon->Chamber(13).GetGeometry()),
d1cd2474 44 fMUON(muon)
45{
46// Standard constructor
47
48}
49
50//______________________________________________________________________________
51AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
52 : AliMUONVGeometryBuilder(),
53 fMUON(0)
54{
55// Default constructor
56}
57
58
59//______________________________________________________________________________
60AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
61 : AliMUONVGeometryBuilder(rhs)
62{
30178c30 63// Protected copy constructor
64
8c343c7c 65 AliFatal("Copy constructor is not implemented.");
d1cd2474 66}
67
68//______________________________________________________________________________
69AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
70//
71}
72
73//______________________________________________________________________________
74AliMUONTriggerGeometryBuilder&
75AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& rhs)
76{
30178c30 77// Protected assignement operator
78
d1cd2474 79 // check assignement to self
80 if (this == &rhs) return *this;
81
8c343c7c 82 AliFatal("Assignment operator is not implemented.");
d1cd2474 83
84 return *this;
85}
86
87//
88// public methods
89//
90
91//______________________________________________________________________________
92void AliMUONTriggerGeometryBuilder::CreateGeometry()
93{
94// From AliMUONv1::CreateGeometry()
95
96 /*
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)
104 */
105
106 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
107 Int_t idAir= idtmed[1100]; // medium 1
108 Int_t idAlu1=idtmed[1103]; // medium 4
a432117a 109 Int_t detElemId=0; // Detection Element Number
d1cd2474 110 Float_t tpar[3];
111 Double_t dpar[3];
112
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.;
b6a52ffa 118 const Float_t kXMAX=255.;
119// 090704 kXMAX changed from 272 to 255.
d1cd2474 120// (see fig.2-4 & 2-5 of Local Trigger Board PRR)
b6a52ffa 121// segmentation updated accordingly
d1cd2474 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;
130
131 AliMUONChamber *iChamber, *iChamber1;
e118b27e 132 iChamber1 = &fMUON->Chamber(10);
d1cd2474 133 Float_t zpos1=-iChamber1->Z();
134
135// ratio of zpos1m/zpos1p and inverse for first plane
136 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
137 Float_t zpm=1./zmp;
138
139 Int_t icount=0; // chamber counter (0 1 2 3)
140
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
143
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));
147
e118b27e 148 iChamber = &fMUON->Chamber(10+icount);
d1cd2474 149 Float_t zpos = - iChamber->Z();
150
880610c7 151/* removed 03/18/05
d1cd2474 152// Flange between beam shielding and RPC
153 tpar[0]= kRMIN[istation];
154 tpar[1]= kRMAX[istation];
155 tpar[2]= 4.0;
156 char volFlange[5];
157 sprintf(volFlange,"SF%dA",icount+1);
158 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
159 // changed by ivana
160 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
a432117a 161 iChamber->GetGeometry()->GetEnvelopeStore()
162 ->AddEnvelope(volFlange, 0, false, "MANY");
880610c7 163*/
d1cd2474 164
165// scaling factor
166 Float_t zRatio = zpos / zpos1;
167
168// envelopes (same size except line 5, all virtual)
169 char volEnv[18][5];
170 tpar[1] = kYMIN * zRatio;
171 tpar[2] = 0.4;
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;
177 if (icolumn==0)
d1cd2474 178 sprintf(volEnv[i],"S%dR%d",icount,iline);
528abf6f 179 else
180 sprintf(volEnv[i],"S%dL%d",icount,iline);
d1cd2474 181 gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
182 i++;
183 }
184 }
185
186// chamber prototype
187 tpar[0]= 0.;
188 tpar[1]= 0.;
189 tpar[2]= 0.;
190 char volAlu[5]; // Alu
191 char volBak[5]; // Bakelite
192 char volGaz[5]; // Gas streamer
193 sprintf(volAlu,"SC%dA",icount+1);
194 sprintf(volBak,"SB%dA",icount+1);
195 sprintf(volGaz,"SG%dA",icount+1);
196 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
197 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
198 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
199 tpar[0] = -1.;
200 tpar[1] = -1.;
201 tpar[2] = 0.1;
202 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
203 tpar[2] = 0.3;
204 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
205
206// chamber type A
207 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
208 Float_t yEnvM = 0.; // y low position of envelope in chamber
209 Float_t yEnvP = 0.; // y up position of envelope in chamber
210 Float_t yEnvPsave = 0.; // tmp data
211 Float_t yEnvMsave = 0.; // tmp data
212 Float_t xpos = 0.; // x position of RPC in envelope
213 Float_t ypos = 0.; // y position of RPC in envelope
214 dpar[2] = 0.4;
215 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
216 dpar[1] = kYMIN * zRatio;
217
a432117a 218 detElemId = (10+icount+1)*100+4;
219 GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvM,kZm));
220 detElemId = (10+icount+1)*100+50+4;
298c0899 221 GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 222
a432117a 223 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
224 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
d1cd2474 225
226// chamber type B (plus envelope chambers B & C)
227 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
228 yEnvPsave = yEnvP;
229 yEnvMsave = yEnvM;
230 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
231 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
232 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
233 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
234 xpos = kXMIN/2. * zRatio;
235 ypos = (kYMIN - kYMIN/4.) * zRatio;
236
a432117a 237 detElemId = (10+icount+1)*100+3;
238 GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvP,kZp));
239 detElemId = (10+icount+1)*100+5;
240 GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvP,kZp));
241 detElemId = (10+icount+1)*100+50+3;
298c0899 242 GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
a432117a 243 detElemId = (10+icount+1)*100+50+5;
298c0899 244 GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 245
a432117a 246 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
247 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
298c0899 248 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
249 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
d1cd2474 250
251// chamber type C (note: same Z than type B)
252 dpar[0] = (kXMAX/2)*zRatio;
253 dpar[1] = (kYMAX/2)*zRatio;
254 xpos = 0.;
255 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
256
a432117a 257 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
258 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
298c0899 259 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
260 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
880610c7 261
d1cd2474 262// chamber type D, E and F (same size)
263// D
264 yEnvPsave = yEnvP;
265 yEnvMsave = yEnvM;
266 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
267 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
268 dpar[0] = (kXMAX/2.)*zRatio;
269 dpar[1] = kYMIN*zRatio;
270
a432117a 271 detElemId = (10+icount+1)*100+2;
272 GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
273 detElemId = (10+icount+1)*100+6;
274 GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
275 detElemId = (10+icount+1)*100+50+2;
298c0899 276 GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
a432117a 277 detElemId = (10+icount+1)*100+50+6;
298c0899 278 GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 279
a432117a 280 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
281 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
282 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
283 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
d1cd2474 284
285// E
286 yEnvPsave = yEnvP;
287 yEnvMsave = yEnvM;
288 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
289 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
290
a432117a 291 detElemId = (10+icount+1)*100+1;
292 GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
293 detElemId = (10+icount+1)*100+7;
294 GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
295 detElemId = (10+icount+1)*100+50+1;
298c0899 296 GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
a432117a 297 detElemId = (10+icount+1)*100+50+7;
298c0899 298 GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 299
a432117a 300 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
301 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
302 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
303 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
d1cd2474 304
305
306// F
307 yEnvPsave = yEnvP;
308 yEnvMsave = yEnvM;
309 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
310 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
311
a432117a 312 detElemId = (10+icount+1)*100;
313 GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
314 detElemId = (10+icount+1)*100+8;
315 GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
316 detElemId = (10+icount+1)*100+50;
298c0899 317 GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
a432117a 318 detElemId = (10+icount+1)*100+50+8;
298c0899 319 GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
528abf6f 320
a432117a 321 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
322 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
323 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
324 GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
d1cd2474 325
326 } // end loop on detection planes
327 } // end loop on stations
328}
329
330//______________________________________________________________________________
331void AliMUONTriggerGeometryBuilder::SetTransformations()
332{
333// Defines the transformations for the trigger chambers.
334// ---
335 Double_t zpos1, zpos2;
336 AliMUONChamber *iChamber1, *iChamber2;
337
e118b27e 338 iChamber1 = &fMUON->Chamber(10);
d1cd2474 339 zpos1= - iChamber1->Z();
340 iChamber1->GetGeometry()
341 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
342
e118b27e 343 iChamber2 = &fMUON->Chamber(11);
d1cd2474 344 zpos2 = - iChamber2->Z();
345 iChamber2->GetGeometry()
346 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
347
e118b27e 348 iChamber1 = &fMUON->Chamber(12);
d1cd2474 349 zpos1 = - iChamber1->Z();
350 iChamber1->GetGeometry()
351 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
352
e118b27e 353 iChamber2 = &fMUON->Chamber(13);
d1cd2474 354 zpos2 = - iChamber2->Z();
355 iChamber2->GetGeometry()
356 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
357}
358
359//______________________________________________________________________________
360void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
361{
362// Defines the sensitive volumes for trigger station chambers.
363// ---
364
e118b27e 365 GetGeometry(10)->SetSensitiveVolume("SG1A");
366 GetGeometry(11)->SetSensitiveVolume("SG2A");
367 GetGeometry(12)->SetSensitiveVolume("SG3A");
368 GetGeometry(13)->SetSensitiveVolume("SG4A");
d1cd2474 369}
370