1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // Class AliMUONSt1GeometryBuilder
19 // -------------------------------
20 // MUON Station1 coarse geometry construction class.
21 // Extracted from AliMUONv1
22 // by Ivana Hrivnacova, IPN Orsay
23 // Included in AliRoot 2004/01/23
25 #include <TVirtualMC.h>
26 #include <TGeoMatrix.h>
30 #include "AliMUONSt1GeometryBuilder.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONGeometryModule.h"
34 #include "AliMUONGeometryEnvelopeStore.h"
36 ClassImp(AliMUONSt1GeometryBuilder)
38 //______________________________________________________________________________
39 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon)
40 : AliMUONVGeometryBuilder(0, 1),
43 // Standard constructor
47 //______________________________________________________________________________
48 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder()
49 : AliMUONVGeometryBuilder(),
52 // Default constructor
56 //______________________________________________________________________________
57 AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(const AliMUONSt1GeometryBuilder& rhs)
58 : AliMUONVGeometryBuilder(rhs)
60 // Protected copy constructor
62 AliFatal("Copy constructor is not implemented.");
65 //______________________________________________________________________________
66 AliMUONSt1GeometryBuilder::~AliMUONSt1GeometryBuilder() {
70 //______________________________________________________________________________
71 AliMUONSt1GeometryBuilder&
72 AliMUONSt1GeometryBuilder::operator = (const AliMUONSt1GeometryBuilder& rhs)
74 // Protected assignement operator
76 // check assignement to self
77 if (this == &rhs) return *this;
79 AliFatal("Assignment operator is not implemented.");
88 //______________________________________________________________________________
89 void AliMUONSt1GeometryBuilder::CreateGeometry()
91 // From AliMUONv1::CreateGeometry()
94 //********************************************************************
96 //********************************************************************
98 // indices 1 and 2 for first and second chambers in the station
99 // iChamber (first chamber) kept for other quanties than Z,
100 // assumed to be the same in both chambers
102 // Get tracking medias Ids
103 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
104 Int_t idAir= idtmed[1100]; // medium 1
105 Int_t idAlu1=idtmed[1103]; // medium 4
106 Int_t idAlu2=idtmed[1104]; // medium 5
107 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
108 Bool_t frameCrosses=kTRUE;
110 // Rotation matrices in the x-y plane
113 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
116 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
118 // DGas decreased from standard one (0.5)
119 const Float_t kDGas = 0.4;
121 // DAlu increased from standard one (3% of X0),
122 // because more electronics with smaller pads
123 const Float_t kDAlu = 3.5 * 8.9 / 100.;
125 // Half of the total thickness of frame crosses (including DAlu)
126 // for each chamber in stations 1 and 2:
127 // 3% of X0 of composite material,
128 // but taken as Aluminium here, with same thickness in number of X0
129 Float_t dframez = 3. * 8.9 / 100;
130 Float_t zfpos=-(kDGas+dframez+kDAlu)/2;
131 // The same parameters are defined in builder for station 2
134 // Outer excess and inner recess for mother volume radius
135 // with respect to ROuter and RInner
136 Float_t dframep=.001; // Value for station 3 should be 6 ...
137 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
138 // Float_t dframep1=.001;
139 Float_t dframep1 = 11.0;
140 Float_t phi=2*TMath::Pi()/12/2;
141 // The same parameters are defined in builder for station 2
144 Float_t dstation = (-AliMUONConstants::DefaultChamberZ(1)) -
145 (-AliMUONConstants::DefaultChamberZ(0));
146 tpar[0] = AliMUONConstants::Rmin(0)-dframep;
147 tpar[1] = (AliMUONConstants::Rmax(0)+dframep)/TMath::Cos(phi);
148 tpar[2] = dstation/5;
150 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
151 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
154 //gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
155 //gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
157 GetEnvelopes(0)->AddEnvelope("S01M", 100, false);
158 GetEnvelopes(1)->AddEnvelope("S02M", 200, false);
161 // // Aluminium frames
163 // pgpar[0] = 360/12/2;
167 // pgpar[4] = -dframez/2;
168 // pgpar[5] = AliMUONConstants::Rmax(0);
169 // pgpar[6] = pgpar[5]+dframep1;
170 // pgpar[7] = +dframez/2;
171 // pgpar[8] = pgpar[5];
172 // pgpar[9] = pgpar[6];
173 // gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
174 // gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
175 // gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
176 // gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
177 // gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
178 // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
181 // tpar[0]= AliMUONConstants::Rmin(0)-dframep1;
182 // tpar[1]= AliMUONConstants::Rmin(0);
183 // tpar[2]= dframez/2;
184 // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
185 // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
187 // gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
188 // gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
189 // gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
190 // gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
195 // security for inside mother volume
197 bpar[0] = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))
198 * TMath::Cos(TMath::ASin(dframep1 /
199 (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))))
201 bpar[1] = dframep1/2;
202 // total thickness will be (4 * bpar[2]) for each chamber,
203 // which has to be equal to (2 * dframez) - DAlu
204 bpar[2] = (2.0 * dframez - kDAlu) / 4.0;
205 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
206 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
208 gMC->Gspos("S01B",1,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
210 gMC->Gspos("S01B",2,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
212 gMC->Gspos("S01B",3,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
214 gMC->Gspos("S01B",4,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
216 gMC->Gspos("S01B",5,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
218 gMC->Gspos("S01B",6,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
220 gMC->Gspos("S01B",7,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
222 gMC->Gspos("S01B",8,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
225 gMC->Gspos("S02B",1,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
227 gMC->Gspos("S02B",2,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
229 gMC->Gspos("S02B",3,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
231 gMC->Gspos("S02B",4,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
233 gMC->Gspos("S02B",5,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
235 gMC->Gspos("S02B",6,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
237 gMC->Gspos("S02B",7,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
239 gMC->Gspos("S02B",8,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
243 // Chamber Material represented by Alu sheet
244 tpar[0]= AliMUONConstants::Rmin(0);
245 tpar[1]= AliMUONConstants::Rmax(0);
246 tpar[2] = (kDGas+kDAlu)/2;
247 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
248 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
249 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
250 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
255 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
256 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
257 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
258 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
260 // Frame Crosses to be placed inside gas
261 // NONE: chambers are sensitive everywhere
262 // if (frameCrosses) {
264 // dr = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0));
265 // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
266 // bpar[1] = dframep1/2;
267 // bpar[2] = kDGas/2;
268 // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
269 // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
271 // gMC->Gspos("S01F",1,"S01G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
273 // gMC->Gspos("S01F",2,"S01G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
275 // gMC->Gspos("S01F",3,"S01G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
277 // gMC->Gspos("S01F",4,"S01G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
280 // gMC->Gspos("S02F",1,"S02G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
282 // gMC->Gspos("S02F",2,"S02G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
284 // gMC->Gspos("S02F",3,"S02G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
286 // gMC->Gspos("S02F",4,"S02G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
291 //______________________________________________________________________________
292 void AliMUONSt1GeometryBuilder::SetTransformations()
294 // Defines the transformations for the station2 chambers.
297 Double_t zpos1= - AliMUONConstants::DefaultChamberZ(0);
298 SetTranslation(0, TGeoTranslation(0., 0., zpos1));
300 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1);
301 SetTranslation(0, TGeoTranslation(0., 0., zpos2));
304 //______________________________________________________________________________
305 void AliMUONSt1GeometryBuilder::SetSensitiveVolumes()
307 // Defines the sensitive volumes for station1 chambers.
310 GetGeometry(0)->SetSensitiveVolume("S01G");
311 GetGeometry(1)->SetSensitiveVolume("S02G");