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