]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilder.cxx
Functionality restored and adapted to default and new trigger code
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilder.cxx
CommitLineData
e118b27e 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
d1cd2474 16// $Id$
17//
18// Class AliMUONSt1GeometryBuilder
19// -------------------------------
20// MUON Station1 coarse geometry construction class.
d1cd2474 21// Extracted from AliMUONv1
22// by Ivana Hrivnacova, IPN Orsay
5f1df83a 23// Included in AliRoot 2004/01/23
d1cd2474 24
25#include <TVirtualMC.h>
26#include <TGeoMatrix.h>
27
e118b27e 28#include "AliLog.h"
29
d1cd2474 30#include "AliMUONSt1GeometryBuilder.h"
31#include "AliMUON.h"
b7ef3c96 32#include "AliMUONConstants.h"
e118b27e 33#include "AliMUONGeometryModule.h"
a432117a 34#include "AliMUONGeometryEnvelopeStore.h"
d1cd2474 35
5398f946 36/// \cond CLASSIMP
d1cd2474 37ClassImp(AliMUONSt1GeometryBuilder)
5398f946 38/// \endcond
d1cd2474 39
40//______________________________________________________________________________
41AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon)
b7ef3c96 42 : AliMUONVGeometryBuilder(0, 1),
d1cd2474 43 fMUON(muon)
44{
5398f946 45/// Standard constructor
d1cd2474 46
47}
48
49//______________________________________________________________________________
50AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder()
51 : AliMUONVGeometryBuilder(),
52 fMUON(0)
53{
5398f946 54/// Default constructor
d1cd2474 55}
56
57
58//______________________________________________________________________________
59AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(const AliMUONSt1GeometryBuilder& rhs)
60 : AliMUONVGeometryBuilder(rhs)
61{
5398f946 62/// Protected copy constructor
30178c30 63
8c343c7c 64 AliFatal("Copy constructor is not implemented.");
d1cd2474 65}
66
67//______________________________________________________________________________
5398f946 68AliMUONSt1GeometryBuilder::~AliMUONSt1GeometryBuilder()
69{
70/// Destructor
d1cd2474 71}
72
73//______________________________________________________________________________
74AliMUONSt1GeometryBuilder&
75AliMUONSt1GeometryBuilder::operator = (const AliMUONSt1GeometryBuilder& rhs)
76{
5398f946 77/// Protected assignement operator
30178c30 78
d1cd2474 79 // check assignement to self
80 if (this == &rhs) return *this;
81
8c343c7c 82 AliFatal("Assignment operator is not implemented.");
d1cd2474 83
84 return *this;
85}
86
87//
88// public methods
89//
90
91//______________________________________________________________________________
92void AliMUONSt1GeometryBuilder::CreateGeometry()
93{
5398f946 94/// From AliMUONv1::CreateGeometry()
d1cd2474 95
96//********************************************************************
97// Station 1 **
98//********************************************************************
99// CONCENTRIC
100 // indices 1 and 2 for first and second chambers in the station
101 // iChamber (first chamber) kept for other quanties than Z,
102 // assumed to be the same in both chambers
103
104 // Get tracking medias Ids
105 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
106 Int_t idAir= idtmed[1100]; // medium 1
107 Int_t idAlu1=idtmed[1103]; // medium 4
108 Int_t idAlu2=idtmed[1104]; // medium 5
109 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
110 Bool_t frameCrosses=kTRUE;
111
112 // Rotation matrices in the x-y plane
113 // phi= 0 deg
114 Int_t irot1;
115 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
116 // phi= 90 deg
117 Int_t irot2;
118 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
119
d1cd2474 120 // DGas decreased from standard one (0.5)
b7ef3c96 121 const Float_t kDGas = 0.4;
d1cd2474 122
123 // DAlu increased from standard one (3% of X0),
124 // because more electronics with smaller pads
b7ef3c96 125 const Float_t kDAlu = 3.5 * 8.9 / 100.;
d1cd2474 126
127 // Half of the total thickness of frame crosses (including DAlu)
128 // for each chamber in stations 1 and 2:
129 // 3% of X0 of composite material,
130 // but taken as Aluminium here, with same thickness in number of X0
131 Float_t dframez = 3. * 8.9 / 100;
b7ef3c96 132 Float_t zfpos=-(kDGas+dframez+kDAlu)/2;
d1cd2474 133 // The same parameters are defined in builder for station 2
134
135 // Mother volume
136 // Outer excess and inner recess for mother volume radius
137 // with respect to ROuter and RInner
138 Float_t dframep=.001; // Value for station 3 should be 6 ...
139 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
140 // Float_t dframep1=.001;
141 Float_t dframep1 = 11.0;
142 Float_t phi=2*TMath::Pi()/12/2;
143 // The same parameters are defined in builder for station 2
144
145 Float_t tpar[3];
b7ef3c96 146 Float_t dstation = (-AliMUONConstants::DefaultChamberZ(1)) -
147 (-AliMUONConstants::DefaultChamberZ(0));
148 tpar[0] = AliMUONConstants::Rmin(0)-dframep;
149 tpar[1] = (AliMUONConstants::Rmax(0)+dframep)/TMath::Cos(phi);
d1cd2474 150 tpar[2] = dstation/5;
151
152 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
153 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
154
155 // CHANGED
156 //gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
a432117a 157 //gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
158
159 GetEnvelopes(0)->AddEnvelope("S01M", 100, false);
160 GetEnvelopes(1)->AddEnvelope("S02M", 200, false);
161
d1cd2474 162
163// // Aluminium frames
164// // Outer frames
165// pgpar[0] = 360/12/2;
166// pgpar[1] = 360.;
167// pgpar[2] = 12.;
168// pgpar[3] = 2;
169// pgpar[4] = -dframez/2;
b7ef3c96 170// pgpar[5] = AliMUONConstants::Rmax(0);
d1cd2474 171// pgpar[6] = pgpar[5]+dframep1;
172// pgpar[7] = +dframez/2;
173// pgpar[8] = pgpar[5];
174// pgpar[9] = pgpar[6];
175// gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
176// gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
177// gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
178// gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
179// gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
180// gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
181// //
182// // Inner frame
b7ef3c96 183// tpar[0]= AliMUONConstants::Rmin(0)-dframep1;
184// tpar[1]= AliMUONConstants::Rmin(0);
d1cd2474 185// tpar[2]= dframez/2;
186// gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
187// gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
188
189// gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
190// gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
191// gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
192// gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
193//
194// Frame Crosses
195 if (frameCrosses) {
196 // outside gas
197 // security for inside mother volume
198 Float_t bpar[3];
b7ef3c96 199 bpar[0] = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))
d1cd2474 200 * TMath::Cos(TMath::ASin(dframep1 /
b7ef3c96 201 (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0))))
d1cd2474 202 / 2.0;
203 bpar[1] = dframep1/2;
204 // total thickness will be (4 * bpar[2]) for each chamber,
205 // which has to be equal to (2 * dframez) - DAlu
b7ef3c96 206 bpar[2] = (2.0 * dframez - kDAlu) / 4.0;
d1cd2474 207 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
208 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
209
b7ef3c96 210 gMC->Gspos("S01B",1,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
d1cd2474 211 irot1,"ONLY");
b7ef3c96 212 gMC->Gspos("S01B",2,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
d1cd2474 213 irot1,"ONLY");
b7ef3c96 214 gMC->Gspos("S01B",3,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
d1cd2474 215 irot2,"ONLY");
b7ef3c96 216 gMC->Gspos("S01B",4,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
d1cd2474 217 irot2,"ONLY");
b7ef3c96 218 gMC->Gspos("S01B",5,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
d1cd2474 219 irot1,"ONLY");
b7ef3c96 220 gMC->Gspos("S01B",6,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
d1cd2474 221 irot1,"ONLY");
b7ef3c96 222 gMC->Gspos("S01B",7,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
d1cd2474 223 irot2,"ONLY");
b7ef3c96 224 gMC->Gspos("S01B",8,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
d1cd2474 225 irot2,"ONLY");
226
b7ef3c96 227 gMC->Gspos("S02B",1,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos,
d1cd2474 228 irot1,"ONLY");
b7ef3c96 229 gMC->Gspos("S02B",2,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos,
d1cd2474 230 irot1,"ONLY");
b7ef3c96 231 gMC->Gspos("S02B",3,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos,
d1cd2474 232 irot2,"ONLY");
b7ef3c96 233 gMC->Gspos("S02B",4,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos,
d1cd2474 234 irot2,"ONLY");
b7ef3c96 235 gMC->Gspos("S02B",5,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos,
d1cd2474 236 irot1,"ONLY");
b7ef3c96 237 gMC->Gspos("S02B",6,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos,
d1cd2474 238 irot1,"ONLY");
b7ef3c96 239 gMC->Gspos("S02B",7,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos,
d1cd2474 240 irot2,"ONLY");
b7ef3c96 241 gMC->Gspos("S02B",8,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos,
d1cd2474 242 irot2,"ONLY");
243 }
244//
245// Chamber Material represented by Alu sheet
b7ef3c96 246 tpar[0]= AliMUONConstants::Rmin(0);
247 tpar[1]= AliMUONConstants::Rmax(0);
248 tpar[2] = (kDGas+kDAlu)/2;
d1cd2474 249 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
250 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
251 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
252 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
253//
254// Sensitive volumes
b7ef3c96 255 // tpar[2] = kDGas;
256 tpar[2] = kDGas/2;
d1cd2474 257 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
258 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
259 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
260 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
261//
262// Frame Crosses to be placed inside gas
263 // NONE: chambers are sensitive everywhere
264// if (frameCrosses) {
265
b7ef3c96 266// dr = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0));
d1cd2474 267// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
268// bpar[1] = dframep1/2;
b7ef3c96 269// bpar[2] = kDGas/2;
d1cd2474 270// gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
271// gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
272
b7ef3c96 273// gMC->Gspos("S01F",1,"S01G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
d1cd2474 274// irot1,"ONLY");
b7ef3c96 275// gMC->Gspos("S01F",2,"S01G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
d1cd2474 276// irot1,"ONLY");
b7ef3c96 277// gMC->Gspos("S01F",3,"S01G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
d1cd2474 278// irot2,"ONLY");
b7ef3c96 279// gMC->Gspos("S01F",4,"S01G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
d1cd2474 280// irot2,"ONLY");
281
b7ef3c96 282// gMC->Gspos("S02F",1,"S02G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0,
d1cd2474 283// irot1,"ONLY");
b7ef3c96 284// gMC->Gspos("S02F",2,"S02G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0,
d1cd2474 285// irot1,"ONLY");
b7ef3c96 286// gMC->Gspos("S02F",3,"S02G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0,
d1cd2474 287// irot2,"ONLY");
b7ef3c96 288// gMC->Gspos("S02F",4,"S02G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0,
d1cd2474 289// irot2,"ONLY");
290// }
291}
292
293//______________________________________________________________________________
294void AliMUONSt1GeometryBuilder::SetTransformations()
295{
5398f946 296/// Define the transformations for the station2 chambers.
d1cd2474 297
b7ef3c96 298 Double_t zpos1= - AliMUONConstants::DefaultChamberZ(0);
299 SetTranslation(0, TGeoTranslation(0., 0., zpos1));
d1cd2474 300
b7ef3c96 301 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1);
302 SetTranslation(0, TGeoTranslation(0., 0., zpos2));
d1cd2474 303}
304
305//______________________________________________________________________________
306void AliMUONSt1GeometryBuilder::SetSensitiveVolumes()
307{
5398f946 308/// Define the sensitive volumes for station1 chambers.
d1cd2474 309
e118b27e 310 GetGeometry(0)->SetSensitiveVolume("S01G");
311 GetGeometry(1)->SetSensitiveVolume("S02G");
d1cd2474 312}