Line data Source code
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 :
32 : #include "AliMUONSt1GeometryBuilder.h"
33 : #include "AliMUON.h"
34 : #include "TArrayI.h"
35 : #include "AliMUONConstants.h"
36 : #include "AliMUONGeometryModule.h"
37 : #include "AliMUONGeometryEnvelopeStore.h"
38 : #include <iostream>
39 :
40 : using std::endl;
41 : using std::cout;
42 : /// \cond CLASSIMP
43 16 : ClassImp(AliMUONSt1GeometryBuilder)
44 : /// \endcond
45 :
46 : //______________________________________________________________________________
47 : AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon)
48 0 : : AliMUONVGeometryBuilder(0, 2),
49 0 : fMUON(muon)
50 0 : {
51 : /// Standard constructor
52 :
53 0 : }
54 :
55 : //______________________________________________________________________________
56 : AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder()
57 0 : : AliMUONVGeometryBuilder(),
58 0 : fMUON(0)
59 0 : {
60 : /// Default constructor
61 0 : }
62 :
63 : //______________________________________________________________________________
64 : AliMUONSt1GeometryBuilder::~AliMUONSt1GeometryBuilder()
65 0 : {
66 : /// Destructor
67 0 : }
68 :
69 : //
70 : // public methods
71 : //
72 :
73 : //______________________________________________________________________________
74 : void AliMUONSt1GeometryBuilder::CreateGeometry()
75 : {
76 : /// From AliMUONv1::CreateGeometry()
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 0 : Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
88 0 : Int_t idAir= idtmed[1100]; // medium 1
89 0 : Int_t idAlu1=idtmed[1103]; // medium 4
90 0 : Int_t idAlu2=idtmed[1104]; // medium 5
91 0 : 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 0 : Int_t irot1;
97 0 : fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
98 : // phi= 90 deg
99 0 : Int_t irot2;
100 0 : 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 0 : 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 0 : Float_t phi=2*TMath::Pi()/12/2;
125 : // The same parameters are defined in builder for station 2
126 :
127 0 : Float_t tpar[3];
128 0 : Float_t dstation = (-AliMUONConstants::DefaultChamberZ(1)) -
129 0 : (-AliMUONConstants::DefaultChamberZ(0));
130 0 : tpar[0] = AliMUONConstants::Rmin(0)-dframep;
131 0 : tpar[1] = (AliMUONConstants::Rmax(0)+dframep)/TMath::Cos(phi);
132 0 : tpar[2] = dstation/5;
133 :
134 0 : TVirtualMC::GetMC()->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
135 0 : 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 0 : GetEnvelopes(0)->AddEnvelope("S01M", 100, false);
142 0 : 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 0 : if (frameCrosses) {
178 : // outside gas
179 : // security for inside mother volume
180 0 : Float_t bpar[3];
181 0 : bpar[0] = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))
182 0 : * TMath::Cos(TMath::ASin(dframep1 /
183 0 : (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))))
184 0 : / 2.0;
185 0 : 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 0 : bpar[2] = (2.0 * dframez - kDAlu) / 4.0;
189 0 : TVirtualMC::GetMC()->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
190 0 : TVirtualMC::GetMC()->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
191 :
192 0 : TVirtualMC::GetMC()->Gspos("S01B",1,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
193 0 : irot1,"ONLY");
194 0 : TVirtualMC::GetMC()->Gspos("S01B",2,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
195 0 : irot1,"ONLY");
196 0 : TVirtualMC::GetMC()->Gspos("S01B",3,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
197 0 : irot2,"ONLY");
198 0 : TVirtualMC::GetMC()->Gspos("S01B",4,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
199 0 : irot2,"ONLY");
200 0 : TVirtualMC::GetMC()->Gspos("S01B",5,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
201 0 : irot1,"ONLY");
202 0 : TVirtualMC::GetMC()->Gspos("S01B",6,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
203 0 : irot1,"ONLY");
204 0 : TVirtualMC::GetMC()->Gspos("S01B",7,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
205 0 : irot2,"ONLY");
206 0 : TVirtualMC::GetMC()->Gspos("S01B",8,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
207 0 : irot2,"ONLY");
208 :
209 0 : TVirtualMC::GetMC()->Gspos("S02B",1,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
210 0 : irot1,"ONLY");
211 0 : TVirtualMC::GetMC()->Gspos("S02B",2,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
212 0 : irot1,"ONLY");
213 0 : TVirtualMC::GetMC()->Gspos("S02B",3,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
214 0 : irot2,"ONLY");
215 0 : TVirtualMC::GetMC()->Gspos("S02B",4,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
216 0 : irot2,"ONLY");
217 0 : TVirtualMC::GetMC()->Gspos("S02B",5,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
218 0 : irot1,"ONLY");
219 0 : TVirtualMC::GetMC()->Gspos("S02B",6,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
220 0 : irot1,"ONLY");
221 0 : TVirtualMC::GetMC()->Gspos("S02B",7,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
222 0 : irot2,"ONLY");
223 0 : TVirtualMC::GetMC()->Gspos("S02B",8,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
224 0 : irot2,"ONLY");
225 0 : }
226 : //
227 : // Chamber Material represented by Alu sheet
228 0 : tpar[0]= AliMUONConstants::Rmin(0);
229 0 : tpar[1]= AliMUONConstants::Rmax(0);
230 0 : tpar[2] = (kDGas+kDAlu)/2;
231 0 : TVirtualMC::GetMC()->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
232 0 : TVirtualMC::GetMC()->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
233 0 : TVirtualMC::GetMC()->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
234 0 : TVirtualMC::GetMC()->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
235 : //
236 : // Sensitive volumes
237 : // tpar[2] = kDGas;
238 0 : tpar[2] = kDGas/2;
239 0 : TVirtualMC::GetMC()->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
240 0 : TVirtualMC::GetMC()->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
241 0 : TVirtualMC::GetMC()->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
242 0 : 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 0 : }
274 :
275 : //______________________________________________________________________________
276 : void AliMUONSt1GeometryBuilder::SetVolumes()
277 : {
278 : /// Define the volumes for the station2 chambers.
279 0 : }
280 :
281 : //______________________________________________________________________________
282 : void AliMUONSt1GeometryBuilder::SetTransformations()
283 : {
284 : /// Define the transformations for the station2 chambers.
285 :
286 0 : Double_t zpos1= - AliMUONConstants::DefaultChamberZ(0);
287 0 : SetTranslation(0, TGeoTranslation(0., 0., zpos1));
288 :
289 0 : Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1);
290 0 : SetTranslation(0, TGeoTranslation(0., 0., zpos2));
291 0 : }
292 :
293 : //______________________________________________________________________________
294 : void AliMUONSt1GeometryBuilder::SetSensitiveVolumes()
295 : {
296 : /// Define the sensitive volumes for station1 chambers.
297 :
298 0 : GetGeometry(0)->SetSensitiveVolume("S01G");
299 0 : GetGeometry(1)->SetSensitiveVolume("S02G");
300 0 : }
|