]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTriggerGeometryBuilder.cxx
Comments for Doxygen (mostly added comments for inline functions)
[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$
d1525c79 17
18// -----------------------------------
d1cd2474 19// Class AliMUONTriggerGeometryBuilder
20// -----------------------------------
d1525c79 21// MUON Trigger stations geometry
22// construction class.
23// Author: Philippe Crochet (LPCCFd)
d1cd2474 24
25#include <TVirtualMC.h>
26#include <TGeoMatrix.h>
27
e118b27e 28#include "AliLog.h"
c0404a6c 29#include "AliRun.h"
e118b27e 30
d1cd2474 31#include "AliMUONTriggerGeometryBuilder.h"
32#include "AliMUON.h"
b7ef3c96 33#include "AliMUONConstants.h"
e118b27e 34#include "AliMUONGeometryModule.h"
a432117a 35#include "AliMUONGeometryEnvelopeStore.h"
d1cd2474 36
5398f946 37/// \cond CLASSIMP
d1cd2474 38ClassImp(AliMUONTriggerGeometryBuilder)
5398f946 39/// \endcond
d1cd2474 40
41//______________________________________________________________________________
42AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
cf19fcc5 43 : AliMUONVGeometryBuilder(16, 4),
d1cd2474 44 fMUON(muon)
45{
71a2d3aa 46/// Standard constructor
d1cd2474 47
48}
49
50//______________________________________________________________________________
51AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
52 : AliMUONVGeometryBuilder(),
53 fMUON(0)
54{
71a2d3aa 55/// Default constructor
d1cd2474 56}
57
d1cd2474 58//______________________________________________________________________________
71a2d3aa 59AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder()
60{
61/// Destructor
d1cd2474 62}
63
d1cd2474 64//
65// public methods
66//
67
68//______________________________________________________________________________
69void AliMUONTriggerGeometryBuilder::CreateGeometry()
70{
71a2d3aa 71/// From AliMUONv1::CreateGeometry()
d1cd2474 72
73 /*
74 zpos1 and zpos2 are the middle of the first and second
75 planes of station 1 (+1m for second station):
76 zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
77 zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
78 zposxm and zposxp= middles of gaz gaps within a detection plane
79 rem: the total thickness accounts for 1 mm of al on both
80 side of the RPCs (see zpos1 and zpos2)
81 */
82
83 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
84 Int_t idAir= idtmed[1100]; // medium 1
85 Int_t idAlu1=idtmed[1103]; // medium 4
a432117a 86 Int_t detElemId=0; // Detection Element Number
d1cd2474 87 Float_t tpar[3];
88 Double_t dpar[3];
89
90// vertical gap between right and left chambers (kDXZERO*2=4cm)
91 const Float_t kDXZERO=2.;
92// main distances for chamber definition in first plane/first station
93 const Float_t kXMIN=34.;
94 const Float_t kXMED=51.;
b6a52ffa 95 const Float_t kXMAX=255.;
96// 090704 kXMAX changed from 272 to 255.
d1cd2474 97// (see fig.2-4 & 2-5 of Local Trigger Board PRR)
b6a52ffa 98// segmentation updated accordingly
d1cd2474 99 const Float_t kYMIN=34.;
100 const Float_t kYMAX=51.;
101// inner/outer radius of flange between beam shield. and chambers (1/station)
936e7ca3 102// const Float_t kRMIN[2]={50.,50.};
103// const Float_t kRMAX[2]={64.,68.};
d1cd2474 104// z position of the middle of the gas gap in mother vol
105 const Float_t kZm=-3.6;
65bcb249 106 const Float_t kZp=+3.6;
107
b7ef3c96 108 Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
109 Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) -
110 ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1;
eb571c25 111 Float_t par[3];
112 par[2] = dstation;
113
d1cd2474 114// ratio of zpos1m/zpos1p and inverse for first plane
115 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
116 Float_t zpm=1./zmp;
117
118 Int_t icount=0; // chamber counter (0 1 2 3)
119
120 for (Int_t istation=0; istation<2; istation++) { // loop on stations
121 for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
122
123 Int_t iVolNum=1; // counter Volume Number
a04ce845 124 icount = Int_t(iplane<<0)+Int_t(istation<<1);
d1cd2474 125
b7ef3c96 126 par[0] = AliMUONConstants::Rmin(5+istation);
127 par[1] = AliMUONConstants::Rmax(5+istation);
eb571c25 128 Char_t volName[6];
e1d22736 129 sprintf(volName,"%s%d", "SC",11+icount);
eb571c25 130 gMC->Gsvolu(volName,"TUBE", idAir, par, 3);
eb1c3e3a 131 //SetVolume(10+icount, volName);
43adb63d 132// Float_t zpos = AliMUONConstants::DefaultChamberZ(10+icount);
133
880610c7 134/* removed 03/18/05
d1cd2474 135// Flange between beam shielding and RPC
136 tpar[0]= kRMIN[istation];
137 tpar[1]= kRMAX[istation];
138 tpar[2]= 4.0;
139 char volFlange[5];
140 sprintf(volFlange,"SF%dA",icount+1);
141 gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
142 // changed by ivana
143 //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
a432117a 144 iChamber->GetGeometry()->GetEnvelopeStore()
145 ->AddEnvelope(volFlange, 0, false, "MANY");
880610c7 146*/
d1cd2474 147
148// scaling factor
43adb63d 149// Float_t zRatio = zpos / zpos1;
150 Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
151
152
153
154
d1cd2474 155// envelopes (same size except line 5, all virtual)
156 char volEnv[18][5];
157 tpar[1] = kYMIN * zRatio;
158 tpar[2] = 0.4;
159 Int_t i=0; // counter
160 for (Int_t icolumn=0; icolumn<2; icolumn++) {
161 for (Int_t iline=1; iline<10; iline++){
162 tpar[0] = (kXMAX/2.) * zRatio;
163 if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
164 if (icolumn==0)
d1cd2474 165 sprintf(volEnv[i],"S%dR%d",icount,iline);
528abf6f 166 else
167 sprintf(volEnv[i],"S%dL%d",icount,iline);
eb1c3e3a 168 // gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
d1cd2474 169 i++;
170 }
171 }
172
173// chamber prototype
174 tpar[0]= 0.;
175 tpar[1]= 0.;
936e7ca3 176 tpar[2]= 0.; char volAlu[5]; // Alu
d1cd2474 177 char volBak[5]; // Bakelite
178 char volGaz[5]; // Gas streamer
179 sprintf(volAlu,"SC%dA",icount+1);
180 sprintf(volBak,"SB%dA",icount+1);
eb571c25 181 sprintf(volGaz,"S%dG",icount+11);
d1cd2474 182 gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
183 gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
184 gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
185 tpar[0] = -1.;
186 tpar[1] = -1.;
187 tpar[2] = 0.1;
188 gMC->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
189 tpar[2] = 0.3;
190 gMC->Gsposp(volBak,1,volAlu,0.,0.,0.,0,"ONLY",tpar,3);
191
192// chamber type A
193 Float_t xEnv = (kDXZERO+kXMED+(kXMAX-kXMED)/2.)*zRatio;
194 Float_t yEnvM = 0.; // y low position of envelope in chamber
195 Float_t yEnvP = 0.; // y up position of envelope in chamber
196 Float_t yEnvPsave = 0.; // tmp data
197 Float_t yEnvMsave = 0.; // tmp data
198 Float_t xpos = 0.; // x position of RPC in envelope
199 Float_t ypos = 0.; // y position of RPC in envelope
200 dpar[2] = 0.4;
201 dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
202 dpar[1] = kYMIN * zRatio;
203
65bcb249 204 detElemId = (10+icount+1)*100;
cf19fcc5 205 GetEnvelopes(16+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvP,kZp));
65bcb249 206 detElemId = (10+icount+1)*100+9;
cf19fcc5 207 GetEnvelopes(16+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 208
cf19fcc5 209 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
210 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
d1cd2474 211
212// chamber type B (plus envelope chambers B & C)
213 xEnv = (kDXZERO+kXMAX/2.)*zRatio;
214 yEnvPsave = yEnvP;
215 yEnvMsave = yEnvM;
216 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
217 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
218 dpar[0] = ((kXMAX-kXMIN)/2.) * zRatio;
219 dpar[1] = ((kYMAX-kYMIN)/2.) * zRatio;
220 xpos = kXMIN/2. * zRatio;
221 ypos = (kYMIN - kYMIN/4.) * zRatio;
222
65bcb249 223 detElemId = (10+icount+1)*100+17;
cf19fcc5 224 GetEnvelopes(16+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvM,kZm));
65bcb249 225 detElemId = (10+icount+1)*100+1;
cf19fcc5 226 GetEnvelopes(16+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvM,kZm));
65bcb249 227 detElemId = (10+icount+1)*100+10;
cf19fcc5 228 GetEnvelopes(16+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
65bcb249 229 detElemId = (10+icount+1)*100+8;
cf19fcc5 230 GetEnvelopes(16+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 231
cf19fcc5 232 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
233 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
234 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
235 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
d1cd2474 236
237// chamber type C (note: same Z than type B)
238 dpar[0] = (kXMAX/2)*zRatio;
239 dpar[1] = (kYMAX/2)*zRatio;
240 xpos = 0.;
241 ypos = ((kYMAX - kYMIN)/2.) * zRatio;
242
cf19fcc5 243 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
244 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
245 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
246 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
880610c7 247
d1cd2474 248// chamber type D, E and F (same size)
249// D
250 yEnvPsave = yEnvP;
251 yEnvMsave = yEnvM;
252 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
253 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
254 dpar[0] = (kXMAX/2.)*zRatio;
255 dpar[1] = kYMIN*zRatio;
256
65bcb249 257 detElemId = (10+icount+1)*100+16;
cf19fcc5 258 GetEnvelopes(16+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
65bcb249 259 detElemId = (10+icount+1)*100+2;
cf19fcc5 260 GetEnvelopes(16+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
65bcb249 261 detElemId = (10+icount+1)*100+11;
cf19fcc5 262 GetEnvelopes(16+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
65bcb249 263 detElemId = (10+icount+1)*100+7;
cf19fcc5 264 GetEnvelopes(16+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 265
cf19fcc5 266 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
267 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
268 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
269 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
d1cd2474 270
271// E
272 yEnvPsave = yEnvP;
273 yEnvMsave = yEnvM;
274 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
275 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
276
65bcb249 277 detElemId = (10+icount+1)*100+15;
cf19fcc5 278 GetEnvelopes(16+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
65bcb249 279 detElemId = (10+icount+1)*100+3;
cf19fcc5 280 GetEnvelopes(16+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
65bcb249 281 detElemId = (10+icount+1)*100+12;
cf19fcc5 282 GetEnvelopes(16+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
65bcb249 283 detElemId = (10+icount+1)*100+6;
cf19fcc5 284 GetEnvelopes(16+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
d1cd2474 285
cf19fcc5 286 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
287 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
288 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
289 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
d1cd2474 290
291
292// F
293 yEnvPsave = yEnvP;
294 yEnvMsave = yEnvM;
295 yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
296 yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
297
65bcb249 298 detElemId = (10+icount+1)*100+14;
cf19fcc5 299 GetEnvelopes(16+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
65bcb249 300 detElemId = (10+icount+1)*100+4;
cf19fcc5 301 GetEnvelopes(16+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
65bcb249 302 detElemId = (10+icount+1)*100+13;
cf19fcc5 303 GetEnvelopes(16+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
65bcb249 304 detElemId = (10+icount+1)*100+5;
cf19fcc5 305 GetEnvelopes(16+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
528abf6f 306
cf19fcc5 307 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
308 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
309 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
310 GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
d1cd2474 311
312 } // end loop on detection planes
313 } // end loop on stations
314}
315
316//______________________________________________________________________________
317void AliMUONTriggerGeometryBuilder::SetTransformations()
318{
71a2d3aa 319/// Defines the transformations for the trigger chambers.
d1cd2474 320
c0404a6c 321 if (gAlice->GetModule("SHIL")) {
cf19fcc5 322 SetMotherVolume(16, "YOUT2");
323 SetMotherVolume(17, "YOUT2");
324 SetMotherVolume(18, "YOUT2");
325 SetMotherVolume(19, "YOUT2");
c0404a6c 326 }
327
cf19fcc5 328 SetVolume(16, "SC11");
329 SetVolume(17, "SC12");
330 SetVolume(18, "SC13");
331 SetVolume(19, "SC14");
eb1c3e3a 332
b7ef3c96 333 Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
cf19fcc5 334 SetTranslation(16, TGeoTranslation(0., 0., zpos1));
d1cd2474 335
b7ef3c96 336 zpos1= AliMUONConstants::DefaultChamberZ(11);
cf19fcc5 337 SetTranslation(17, TGeoTranslation(0., 0., zpos1));
b7ef3c96 338
339 zpos1= AliMUONConstants::DefaultChamberZ(12);
cf19fcc5 340 SetTranslation(18, TGeoTranslation(0., 0., zpos1));
b7ef3c96 341
342 zpos1= AliMUONConstants::DefaultChamberZ(13);
cf19fcc5 343 SetTranslation(19, TGeoTranslation(0., 0., zpos1));
d1cd2474 344}
345
346//______________________________________________________________________________
347void AliMUONTriggerGeometryBuilder::SetSensitiveVolumes()
348{
71a2d3aa 349/// Defines the sensitive volumes for trigger station chambers.
d1cd2474 350
cf19fcc5 351 GetGeometry(16)->SetSensitiveVolume("S11G");
352 GetGeometry(17)->SetSensitiveVolume("S12G");
353 GetGeometry(18)->SetSensitiveVolume("S13G");
354 GetGeometry(19)->SetSensitiveVolume("S14G");
d1cd2474 355}
356