next50 trigger mask in AliHLTGlobalEsdConverterComponent
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilder.cxx
CommitLineData
e118b27e 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$
3d1463c8 17
18//-----------------------------------------------------------------------------
d1cd2474 19// Class AliMUONSt1GeometryBuilder
20// -------------------------------
21// MUON Station1 coarse geometry construction class.
d1cd2474 22// Extracted from AliMUONv1
23// by Ivana Hrivnacova, IPN Orsay
5f1df83a 24// Included in AliRoot 2004/01/23
3d1463c8 25//-----------------------------------------------------------------------------
d1cd2474 26
27#include <TVirtualMC.h>
28#include <TGeoMatrix.h>
29
e118b27e 30#include "AliLog.h"
31
d1cd2474 32#include "AliMUONSt1GeometryBuilder.h"
33#include "AliMUON.h"
17c7d4c9 34#include "TArrayI.h"
b7ef3c96 35#include "AliMUONConstants.h"
e118b27e 36#include "AliMUONGeometryModule.h"
a432117a 37#include "AliMUONGeometryEnvelopeStore.h"
d1cd2474 38
cdd730d0 39using std::endl;
40using std::cout;
5398f946 41/// \cond CLASSIMP
d1cd2474 42ClassImp(AliMUONSt1GeometryBuilder)
5398f946 43/// \endcond
d1cd2474 44
45//______________________________________________________________________________
46AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon)
8cf07955 47 : AliMUONVGeometryBuilder(0, 2),
d1cd2474 48 fMUON(muon)
49{
5398f946 50/// Standard constructor
d1cd2474 51
52}
53
54//______________________________________________________________________________
55AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder()
56 : AliMUONVGeometryBuilder(),
57 fMUON(0)
58{
5398f946 59/// Default constructor
d1cd2474 60}
61
d1cd2474 62//______________________________________________________________________________
5398f946 63AliMUONSt1GeometryBuilder::~AliMUONSt1GeometryBuilder()
64{
65/// Destructor
d1cd2474 66}
67
d1cd2474 68//
69// public methods
70//
71
72//______________________________________________________________________________
73void AliMUONSt1GeometryBuilder::CreateGeometry()
74{
5398f946 75/// From AliMUONv1::CreateGeometry()
d1cd2474 76
77//********************************************************************
78// Station 1 **
79//********************************************************************
80// CONCENTRIC
81 // indices 1 and 2 for first and second chambers in the station
82 // iChamber (first chamber) kept for other quanties than Z,
83 // assumed to be the same in both chambers
84
85 // Get tracking medias Ids
86 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
87 Int_t idAir= idtmed[1100]; // medium 1
88 Int_t idAlu1=idtmed[1103]; // medium 4
89 Int_t idAlu2=idtmed[1104]; // medium 5
90 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
91 Bool_t frameCrosses=kTRUE;
92
93 // Rotation matrices in the x-y plane
94 // phi= 0 deg
95 Int_t irot1;
96 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
97 // phi= 90 deg
98 Int_t irot2;
99 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
100
d1cd2474 101 // DGas decreased from standard one (0.5)
b7ef3c96 102 const Float_t kDGas = 0.4;
d1cd2474 103
104 // DAlu increased from standard one (3% of X0),
105 // because more electronics with smaller pads
b7ef3c96 106 const Float_t kDAlu = 3.5 * 8.9 / 100.;
d1cd2474 107
108 // Half of the total thickness of frame crosses (including DAlu)
109 // for each chamber in stations 1 and 2:
110 // 3% of X0 of composite material,
111 // but taken as Aluminium here, with same thickness in number of X0
112 Float_t dframez = 3. * 8.9 / 100;
b7ef3c96 113 Float_t zfpos=-(kDGas+dframez+kDAlu)/2;
d1cd2474 114 // The same parameters are defined in builder for station 2
115
116 // Mother volume
117 // Outer excess and inner recess for mother volume radius
118 // with respect to ROuter and RInner
119 Float_t dframep=.001; // Value for station 3 should be 6 ...
120 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
121 // Float_t dframep1=.001;
122 Float_t dframep1 = 11.0;
123 Float_t phi=2*TMath::Pi()/12/2;
124 // The same parameters are defined in builder for station 2
125
126 Float_t tpar[3];
b7ef3c96 127 Float_t dstation = (-AliMUONConstants::DefaultChamberZ(1)) -
128 (-AliMUONConstants::DefaultChamberZ(0));
129 tpar[0] = AliMUONConstants::Rmin(0)-dframep;
130 tpar[1] = (AliMUONConstants::Rmax(0)+dframep)/TMath::Cos(phi);
d1cd2474 131 tpar[2] = dstation/5;
132
2942f542 133 TVirtualMC::GetMC()->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
134 TVirtualMC::GetMC()->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
d1cd2474 135
136 // CHANGED
2942f542 137 //TVirtualMC::GetMC()->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
138 //TVirtualMC::GetMC()->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
a432117a 139
140 GetEnvelopes(0)->AddEnvelope("S01M", 100, false);
141 GetEnvelopes(1)->AddEnvelope("S02M", 200, false);
142
d1cd2474 143
144// // Aluminium frames
145// // Outer frames
146// pgpar[0] = 360/12/2;
147// pgpar[1] = 360.;
148// pgpar[2] = 12.;
149// pgpar[3] = 2;
150// pgpar[4] = -dframez/2;
b7ef3c96 151// pgpar[5] = AliMUONConstants::Rmax(0);
d1cd2474 152// pgpar[6] = pgpar[5]+dframep1;
153// pgpar[7] = +dframez/2;
154// pgpar[8] = pgpar[5];
155// pgpar[9] = pgpar[6];
2942f542 156// TVirtualMC::GetMC()->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
157// TVirtualMC::GetMC()->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
158// TVirtualMC::GetMC()->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
159// TVirtualMC::GetMC()->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
160// TVirtualMC::GetMC()->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
161// TVirtualMC::GetMC()->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
d1cd2474 162// //
163// // Inner frame
b7ef3c96 164// tpar[0]= AliMUONConstants::Rmin(0)-dframep1;
165// tpar[1]= AliMUONConstants::Rmin(0);
d1cd2474 166// tpar[2]= dframez/2;
2942f542 167// TVirtualMC::GetMC()->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
168// TVirtualMC::GetMC()->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
d1cd2474 169
2942f542 170// TVirtualMC::GetMC()->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
171// TVirtualMC::GetMC()->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
172// TVirtualMC::GetMC()->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
173// TVirtualMC::GetMC()->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
d1cd2474 174//
175// Frame Crosses
176 if (frameCrosses) {
177 // outside gas
178 // security for inside mother volume
179 Float_t bpar[3];
b7ef3c96 180 bpar[0] = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))
d1cd2474 181 * TMath::Cos(TMath::ASin(dframep1 /
b7ef3c96 182 (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))))
d1cd2474 183 / 2.0;
184 bpar[1] = dframep1/2;
185 // total thickness will be (4 * bpar[2]) for each chamber,
186 // which has to be equal to (2 * dframez) - DAlu
b7ef3c96 187 bpar[2] = (2.0 * dframez - kDAlu) / 4.0;
2942f542 188 TVirtualMC::GetMC()->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
189 TVirtualMC::GetMC()->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
d1cd2474 190
2942f542 191 TVirtualMC::GetMC()->Gspos("S01B",1,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
d1cd2474 192 irot1,"ONLY");
2942f542 193 TVirtualMC::GetMC()->Gspos("S01B",2,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
d1cd2474 194 irot1,"ONLY");
2942f542 195 TVirtualMC::GetMC()->Gspos("S01B",3,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
d1cd2474 196 irot2,"ONLY");
2942f542 197 TVirtualMC::GetMC()->Gspos("S01B",4,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
d1cd2474 198 irot2,"ONLY");
2942f542 199 TVirtualMC::GetMC()->Gspos("S01B",5,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
d1cd2474 200 irot1,"ONLY");
2942f542 201 TVirtualMC::GetMC()->Gspos("S01B",6,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
d1cd2474 202 irot1,"ONLY");
2942f542 203 TVirtualMC::GetMC()->Gspos("S01B",7,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
d1cd2474 204 irot2,"ONLY");
2942f542 205 TVirtualMC::GetMC()->Gspos("S01B",8,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
d1cd2474 206 irot2,"ONLY");
207
2942f542 208 TVirtualMC::GetMC()->Gspos("S02B",1,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
d1cd2474 209 irot1,"ONLY");
2942f542 210 TVirtualMC::GetMC()->Gspos("S02B",2,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
d1cd2474 211 irot1,"ONLY");
2942f542 212 TVirtualMC::GetMC()->Gspos("S02B",3,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
d1cd2474 213 irot2,"ONLY");
2942f542 214 TVirtualMC::GetMC()->Gspos("S02B",4,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
d1cd2474 215 irot2,"ONLY");
2942f542 216 TVirtualMC::GetMC()->Gspos("S02B",5,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
d1cd2474 217 irot1,"ONLY");
2942f542 218 TVirtualMC::GetMC()->Gspos("S02B",6,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
d1cd2474 219 irot1,"ONLY");
2942f542 220 TVirtualMC::GetMC()->Gspos("S02B",7,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
d1cd2474 221 irot2,"ONLY");
2942f542 222 TVirtualMC::GetMC()->Gspos("S02B",8,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
d1cd2474 223 irot2,"ONLY");
224 }
225//
226// Chamber Material represented by Alu sheet
b7ef3c96 227 tpar[0]= AliMUONConstants::Rmin(0);
228 tpar[1]= AliMUONConstants::Rmax(0);
229 tpar[2] = (kDGas+kDAlu)/2;
2942f542 230 TVirtualMC::GetMC()->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
231 TVirtualMC::GetMC()->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
232 TVirtualMC::GetMC()->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
233 TVirtualMC::GetMC()->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
d1cd2474 234//
235// Sensitive volumes
b7ef3c96 236 // tpar[2] = kDGas;
237 tpar[2] = kDGas/2;
2942f542 238 TVirtualMC::GetMC()->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
239 TVirtualMC::GetMC()->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
240 TVirtualMC::GetMC()->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
241 TVirtualMC::GetMC()->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
d1cd2474 242//
243// Frame Crosses to be placed inside gas
244 // NONE: chambers are sensitive everywhere
245// if (frameCrosses) {
246
b7ef3c96 247// dr = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0));
d1cd2474 248// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
249// bpar[1] = dframep1/2;
b7ef3c96 250// bpar[2] = kDGas/2;
2942f542 251// TVirtualMC::GetMC()->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
252// TVirtualMC::GetMC()->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
d1cd2474 253
2942f542 254// TVirtualMC::GetMC()->Gspos("S01F",1,"S01G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
d1cd2474 255// irot1,"ONLY");
2942f542 256// TVirtualMC::GetMC()->Gspos("S01F",2,"S01G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
d1cd2474 257// irot1,"ONLY");
2942f542 258// TVirtualMC::GetMC()->Gspos("S01F",3,"S01G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
d1cd2474 259// irot2,"ONLY");
2942f542 260// TVirtualMC::GetMC()->Gspos("S01F",4,"S01G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
d1cd2474 261// irot2,"ONLY");
262
2942f542 263// TVirtualMC::GetMC()->Gspos("S02F",1,"S02G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
d1cd2474 264// irot1,"ONLY");
2942f542 265// TVirtualMC::GetMC()->Gspos("S02F",2,"S02G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
d1cd2474 266// irot1,"ONLY");
2942f542 267// TVirtualMC::GetMC()->Gspos("S02F",3,"S02G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
d1cd2474 268// irot2,"ONLY");
2942f542 269// TVirtualMC::GetMC()->Gspos("S02F",4,"S02G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
d1cd2474 270// irot2,"ONLY");
271// }
272}
273
274//______________________________________________________________________________
b96f7067 275void AliMUONSt1GeometryBuilder::SetVolumes()
276{
277/// Define the volumes for the station2 chambers.
278}
279
280//______________________________________________________________________________
d1cd2474 281void AliMUONSt1GeometryBuilder::SetTransformations()
282{
5398f946 283/// Define the transformations for the station2 chambers.
d1cd2474 284
b7ef3c96 285 Double_t zpos1= - AliMUONConstants::DefaultChamberZ(0);
286 SetTranslation(0, TGeoTranslation(0., 0., zpos1));
d1cd2474 287
b7ef3c96 288 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1);
289 SetTranslation(0, TGeoTranslation(0., 0., zpos2));
d1cd2474 290}
291
292//______________________________________________________________________________
293void AliMUONSt1GeometryBuilder::SetSensitiveVolumes()
294{
5398f946 295/// Define the sensitive volumes for station1 chambers.
d1cd2474 296
e118b27e 297 GetGeometry(0)->SetSensitiveVolume("S01G");
298 GetGeometry(1)->SetSensitiveVolume("S02G");
d1cd2474 299}