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 //-----------------------------------------------------------------------------
19 // Class AliMUONSt2GeometryBuilder
20 // -------------------------------
21 // MUON Station2 coarse geometry construction class.
22 // Extracted from AliMUONv1
23 // Dummy version of station 2 with the right DE id (Ch. Finck)
24 //-----------------------------------------------------------------------------
26 #include <TVirtualMC.h>
27 #include <TGeoMatrix.h>
32 #include "AliMUONSt2GeometryBuilder.h"
34 #include "AliMUONConstants.h"
35 #include "AliMUONGeometryModule.h"
36 #include "AliMUONGeometryEnvelopeStore.h"
39 ClassImp(AliMUONSt2GeometryBuilder)
42 //______________________________________________________________________________
43 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon)
44 : AliMUONVGeometryBuilder(2, 2),
47 /// Standard constructor
51 //______________________________________________________________________________
52 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder()
53 : AliMUONVGeometryBuilder(),
56 /// Default constructor
60 //______________________________________________________________________________
61 AliMUONSt2GeometryBuilder::~AliMUONSt2GeometryBuilder()
70 //______________________________________________________________________________
71 void AliMUONSt2GeometryBuilder::CreateGeometry()
73 /// From AliMUONv1::CreateGeometry()
76 //********************************************************************
78 //********************************************************************
79 // indices 1 and 2 for first and second chambers in the station
80 // iChamber (first chamber) kept for other quanties than Z,
81 // assumed to be the same in both chambers
83 // Get tracking medias Ids
84 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
85 Int_t idAir= idtmed[1100]; // medium 1
86 // Int_t idAlu1=idtmed[1103]; // medium 4
87 // Int_t idAlu2=idtmed[1104]; // medium 5
88 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
90 const Float_t kDeltaQuad = 0.01;//2.6; dummy value til we find the good value
91 const Float_t kDeltaZ = 6.5/2.;
93 // Rotation matrices in the x-y plane
96 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
99 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
101 // Half of the total thickness of frame crosses (including DAlu)
102 // for each chamber in stations 1 and 2:
103 // 3% of X0 of composite material,
104 // but taken as Aluminium here, with same thickness in number of X0
105 // Float_t dframez = 3. * 8.9 / 100;
106 // DGas and DAlu not changed from standard values
107 // Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
108 // The same parameters are defined in builder for station 1
111 const Float_t kDGas = 0.5;
113 // 3% radiation length of aluminum (X0=8.9 cm)
114 // const Float_t kDAlu = 3.5 * 8.9 / 100.;
117 // Outer excess and inner recess for mother volume radius
118 // with respect to ROuter and RInner
119 // Float_t dframep=.001; // Value for station 3 should be 6 ...
120 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
121 // Float_t dframep1=.001;
122 // Float_t phi=2*TMath::Pi()/12/2;
123 // The same parameters are defined in builder for station 1 (30deg)
126 // Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
129 Float_t posx, posy, posz;
130 // Chamber Material represented by Alu sheet
131 tpar[0]= AliMUONConstants::Rmin(1);
132 tpar[1]= AliMUONConstants::Rmax(1);
139 gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
140 gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
149 gMC->Gsvolu("LE01", "TUBS", idAir, tpar, 5);
150 GetEnvelopes(2)->AddEnvelope("LE01", detElemId, true, TGeoTranslation(posx, posy, posz),
151 TGeoRotation("rot1",90,0,90,90,0,0) );
153 gMC->Gsvolu("LF01", "TUBS", idAir, tpar, 5);
154 GetEnvelopes(3)->AddEnvelope("LF01", detElemId, true, TGeoTranslation(posx, posy, posz),
155 TGeoRotation("rot1",90,0,90,90,0,0) );
157 gMC->Gsvolu("LE02", "TUBS", idAir, tpar, 5);
158 GetEnvelopes(2)->AddEnvelope("LE02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
159 TGeoRotation("rot2",90,180,90,90,180,0) );
161 gMC->Gsvolu("LF02", "TUBS", idAir, tpar, 5);
162 GetEnvelopes(3)->AddEnvelope("LF02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
163 TGeoRotation("rot2",90,180,90,90,180,0) );
165 gMC->Gsvolu("LE03", "TUBS", idAir, tpar, 5);
166 GetEnvelopes(2)->AddEnvelope("LE03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
167 TGeoRotation("rot3",90,0,90,270,180,0) );
169 gMC->Gsvolu("LF03", "TUBS", idAir, tpar, 5);
170 GetEnvelopes(3)->AddEnvelope("LF03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
171 TGeoRotation("rot3",90,0,90,270,180,0) );
173 gMC->Gsvolu("LE04", "TUBS", idAir, tpar, 5);
174 GetEnvelopes(2)->AddEnvelope("LE04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
175 TGeoRotation("rot4",90,180,90,270,0,0) );
177 gMC->Gsvolu("LF04", "TUBS", idAir, tpar, 5);
178 GetEnvelopes(3)->AddEnvelope("LF04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
179 TGeoRotation("rot4",90,180,90,270,0,0) );
181 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
182 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
184 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
185 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
187 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
188 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
190 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
191 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
194 //______________________________________________________________________________
195 void AliMUONSt2GeometryBuilder::SetVolumes()
197 /// Defines the volumes for the station2 chambers.
199 // Define chamber volumes as virtual
200 SetVolume(2, "SC03", true);
201 SetVolume(3, "SC04", true);
204 //______________________________________________________________________________
205 void AliMUONSt2GeometryBuilder::SetTransformations()
207 /// Defines the transformations for the station2 chambers.
209 Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
210 SetTranslation(2, TGeoTranslation(0., 0., zpos1));
212 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3);
213 SetTranslation(3, TGeoTranslation(0., 0., zpos2));
216 //______________________________________________________________________________
217 void AliMUONSt2GeometryBuilder::SetSensitiveVolumes()
219 /// Defines the sensitive volumes for station2 chambers.
221 GetGeometry(2)->SetSensitiveVolume("S03G");
222 GetGeometry(3)->SetSensitiveVolume("S04G");