]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONSt2GeometryBuilder.cxx
No need to liknk with lhapdf, pythia6 and microcern libraries
[u/mrichter/AliRoot.git] / MUON / AliMUONSt2GeometryBuilder.cxx
... / ...
CommitLineData
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
16// $Id$
17
18//-----------------------------------------------------------------------------
19// Class AliMUONSt2GeometryBuilder
20// -------------------------------
21// MUON Station2 coarse geometry construction class.
22// Extracted from AliMUONv1
23// Dummy version of station 2 with the right DE id (Ch. Finck)
24//-----------------------------------------------------------------------------
25
26#include <TVirtualMC.h>
27#include <TGeoMatrix.h>
28#include <TArrayI.h>
29
30#include "AliLog.h"
31
32#include "AliMUONSt2GeometryBuilder.h"
33#include "AliMUON.h"
34#include "AliMUONConstants.h"
35#include "AliMUONGeometryModule.h"
36#include "AliMUONGeometryEnvelopeStore.h"
37
38/// \cond CLASSIMP
39ClassImp(AliMUONSt2GeometryBuilder)
40/// \endcond
41
42//______________________________________________________________________________
43AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon)
44 : AliMUONVGeometryBuilder(2, 2),
45 fMUON(muon)
46{
47/// Standard constructor
48
49}
50
51//______________________________________________________________________________
52AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder()
53 : AliMUONVGeometryBuilder(),
54 fMUON(0)
55{
56/// Default constructor
57}
58
59
60//______________________________________________________________________________
61AliMUONSt2GeometryBuilder::~AliMUONSt2GeometryBuilder()
62{
63/// Destructor
64}
65
66//
67// public methods
68//
69
70//______________________________________________________________________________
71void AliMUONSt2GeometryBuilder::CreateGeometry()
72{
73/// From AliMUONv1::CreateGeometry()
74
75//
76//********************************************************************
77// Station 2 **
78//********************************************************************
79 // indices 1 and 2 for first and second chambers in the station
80 // iChamber (first chamber) kept for other quanties than Z,
81 // assumed to be the same in both chambers
82
83 // Get tracking medias Ids
84 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
85 Int_t idAir= idtmed[1100]; // medium 1
86 // Int_t idAlu1=idtmed[1103]; // medium 4
87 // Int_t idAlu2=idtmed[1104]; // medium 5
88 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
89
90 const Float_t kDeltaQuad = 0.01;//2.6; dummy value til we find the good value
91 const Float_t kDeltaZ = 6.5/2.;
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
101 // Half of the total thickness of frame crosses (including DAlu)
102 // for each chamber in stations 1 and 2:
103 // 3% of X0 of composite material,
104 // but taken as Aluminium here, with same thickness in number of X0
105 // Float_t dframez = 3. * 8.9 / 100;
106 // DGas and DAlu not changed from standard values
107 // Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
108 // The same parameters are defined in builder for station 1
109
110 // sensitive gas gap
111 const Float_t kDGas = 0.5;
112
113 // 3% radiation length of aluminum (X0=8.9 cm)
114 // const Float_t kDAlu = 3.5 * 8.9 / 100.;
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 phi=2*TMath::Pi()/12/2;
123 // The same parameters are defined in builder for station 1 (30deg)
124
125 Float_t tpar[5];
126 // Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
127
128
129 Float_t posx, posy, posz;
130// Chamber Material represented by Alu sheet
131 tpar[0]= AliMUONConstants::Rmin(1);
132 tpar[1]= AliMUONConstants::Rmax(1);
133 tpar[2] = kDGas/2;
134 tpar[3] = 0.;
135 tpar[4] = 90.;
136
137//
138// Sensitive volumes
139 gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
140 gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
141
142 Int_t detElemId;
143
144 posx = kDeltaQuad;
145 posy = kDeltaQuad;
146 posz = -kDeltaZ;
147
148 detElemId = 301;
149 gMC->Gsvolu("LE01", "TUBS", idAir, tpar, 5);
150 GetEnvelopes(2)->AddEnvelope("LE01", detElemId, true, TGeoTranslation(posx, posy, posz),
151 TGeoRotation("rot1",90,0,90,90,0,0) );
152 detElemId = 401;
153 gMC->Gsvolu("LF01", "TUBS", idAir, tpar, 5);
154 GetEnvelopes(3)->AddEnvelope("LF01", detElemId, true, TGeoTranslation(posx, posy, posz),
155 TGeoRotation("rot1",90,0,90,90,0,0) );
156 detElemId = 300;
157 gMC->Gsvolu("LE02", "TUBS", idAir, tpar, 5);
158 GetEnvelopes(2)->AddEnvelope("LE02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
159 TGeoRotation("rot2",90,180,90,90,180,0) );
160 detElemId = 400;
161 gMC->Gsvolu("LF02", "TUBS", idAir, tpar, 5);
162 GetEnvelopes(3)->AddEnvelope("LF02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
163 TGeoRotation("rot2",90,180,90,90,180,0) );
164 detElemId = 302;
165 gMC->Gsvolu("LE03", "TUBS", idAir, tpar, 5);
166 GetEnvelopes(2)->AddEnvelope("LE03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
167 TGeoRotation("rot3",90,0,90,270,180,0) );
168 detElemId = 402;
169 gMC->Gsvolu("LF03", "TUBS", idAir, tpar, 5);
170 GetEnvelopes(3)->AddEnvelope("LF03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
171 TGeoRotation("rot3",90,0,90,270,180,0) );
172 detElemId = 303;
173 gMC->Gsvolu("LE04", "TUBS", idAir, tpar, 5);
174 GetEnvelopes(2)->AddEnvelope("LE04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
175 TGeoRotation("rot4",90,180,90,270,0,0) );
176 detElemId = 403;
177 gMC->Gsvolu("LF04", "TUBS", idAir, tpar, 5);
178 GetEnvelopes(3)->AddEnvelope("LF04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
179 TGeoRotation("rot4",90,180,90,270,0,0) );
180
181 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
182 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
183
184 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
185 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
186
187 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
188 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
189
190 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
191 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
192}
193
194//______________________________________________________________________________
195void AliMUONSt2GeometryBuilder::SetVolumes()
196{
197/// Defines the volumes for the station2 chambers.
198
199 // Define chamber volumes as virtual
200 SetVolume(2, "SC03", true);
201 SetVolume(3, "SC04", true);
202}
203
204//______________________________________________________________________________
205void AliMUONSt2GeometryBuilder::SetTransformations()
206{
207/// Defines the transformations for the station2 chambers.
208
209 Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
210 SetTranslation(2, TGeoTranslation(0., 0., zpos1));
211
212 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3);
213 SetTranslation(3, TGeoTranslation(0., 0., zpos2));
214}
215
216//______________________________________________________________________________
217void AliMUONSt2GeometryBuilder::SetSensitiveVolumes()
218{
219/// Defines the sensitive volumes for station2 chambers.
220
221 GetGeometry(2)->SetSensitiveVolume("S03G");
222 GetGeometry(3)->SetSensitiveVolume("S04G");
223}