AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONSt2GeometryBuilder.cxx
Go to the documentation of this file.
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 
33 #include "AliMUON.h"
34 #include "AliMUONConstants.h"
35 #include "AliMUONGeometryModule.h"
37 
41 
42 //______________________________________________________________________________
44  : AliMUONVGeometryBuilder(2, 2),
45  fMUON(muon)
46 {
48 
49 }
50 
51 //______________________________________________________________________________
54  fMUON(0)
55 {
57 }
58 
59 
60 //______________________________________________________________________________
62 {
64 }
65 
66 //
67 // public methods
68 //
69 
70 //______________________________________________________________________________
72 {
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  TVirtualMC::GetMC()->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
140  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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  TVirtualMC::GetMC()->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 //______________________________________________________________________________
196 {
198 
199  // Define chamber volumes as virtual
200  SetVolume(2, "SC03", true);
201  SetVolume(3, "SC04", true);
202 }
203 
204 //______________________________________________________________________________
206 {
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 //______________________________________________________________________________
218 {
220 
221  GetGeometry(2)->SetSensitiveVolume("S03G");
222  GetGeometry(3)->SetSensitiveVolume("S04G");
223 }
Abstract base class for geometry construction per module(s)
virtual void SetVolumes()
and eventually the mother volume name should be defined
AliDetector class for MUON subsystem providing simulation data management.
Definition: AliMUON.h:37
void SetSensitiveVolume(Int_t volId)
void AddEnvelope(const TString &name, Int_t id, Bool_t isVirtual, const char *only="ONLY")
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
static Float_t Rmax(Int_t i)
Return chamber i outer radius.
void SetTranslation(Int_t moduleId, const TGeoTranslation &translation)
AliMUONGeometryModule * GetGeometry(Int_t moduleId) const
void AddEnvelopeConstituent(const TString &name, const TString &envName, Int_t copyNo)
static Float_t Rmin(Int_t i)
Return chamber i inner radius.
AliMUONGeometryEnvelopeStore * GetEnvelopes(Int_t moduleId) const
AliMUON * muon()
void SetVolume(Int_t moduleId, const TString &volumeName, Bool_t isVirtual=false)
static Float_t * DefaultChamberZ()
Return pointer to array of positions.
MUON Station2 coarse geometry construction class.
AliMUON * fMUON
the MUON detector class