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