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 AliMUONSt2GeometryBuilderV2
19 // -------------------------------
20 // MUON Station2 coarse geometry construction class.
21 // Extracted from AliMUONv1
22 // Dummy version of station 2 with the right DE id (Ch. Finck)
25 #include <TVirtualMC.h>
26 #include <TGeoMatrix.h>
30 #include "AliMUONSt2GeometryBuilderV2.h"
32 #include "AliMUONChamber.h"
33 #include "AliMUONGeometryModule.h"
34 #include "AliMUONGeometryEnvelopeStore.h"
36 ClassImp(AliMUONSt2GeometryBuilderV2)
38 //______________________________________________________________________________
39 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(AliMUON* muon)
40 : AliMUONVGeometryBuilder("st2V2.dat",
41 muon->Chamber(2).GetGeometry(),
42 muon->Chamber(3).GetGeometry()),
45 // Standard constructor
49 //______________________________________________________________________________
50 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2()
51 : AliMUONVGeometryBuilder(),
54 // Default constructor
58 //______________________________________________________________________________
59 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(const AliMUONSt2GeometryBuilderV2& rhs)
60 : AliMUONVGeometryBuilder(rhs)
62 // Protected copy constructor
64 AliFatal("Copy constructor is not implemented.");
67 //______________________________________________________________________________
68 AliMUONSt2GeometryBuilderV2::~AliMUONSt2GeometryBuilderV2() {
72 //______________________________________________________________________________
73 AliMUONSt2GeometryBuilderV2&
74 AliMUONSt2GeometryBuilderV2::operator = (const AliMUONSt2GeometryBuilderV2& rhs)
76 // Protected assignement operator
78 // check assignement to self
79 if (this == &rhs) return *this;
81 AliFatal("Assignment operator is not implemented.");
90 //______________________________________________________________________________
91 void AliMUONSt2GeometryBuilderV2::CreateGeometry()
93 // From AliMUONv1::CreateGeometry()
96 //********************************************************************
98 //********************************************************************
99 // indices 1 and 2 for first and second chambers in the station
100 // iChamber (first chamber) kept for other quanties than Z,
101 // assumed to be the same in both chambers
103 // Get tracking medias Ids
104 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
105 Int_t idAir= idtmed[1100]; // medium 1
106 // Int_t idAlu1=idtmed[1103]; // medium 4
107 // Int_t idAlu2=idtmed[1104]; // medium 5
108 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
110 const Float_t kDeltaQuad = 0.01;//2.6; dummy value til we find the good value
111 const Float_t kDeltaZ = 6.5/2.;
113 // Rotation matrices in the x-y plane
116 fMUON->AliMatrix(irot1, 90., 0., 90., 90., 0., 0.);
119 fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.);
121 AliMUONChamber* iChamber = &fMUON->Chamber(2);
122 // AliMUONChamber* iChamber1 = iChamber;
123 // AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
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 // DGas and DAlu not changed from standard values
131 // Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
132 // The same parameters are defined in builder for station 1
135 // Outer excess and inner recess for mother volume radius
136 // with respect to ROuter and RInner
137 // Float_t dframep=.001; // Value for station 3 should be 6 ...
138 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
139 // Float_t dframep1=.001;
140 // Float_t phi=2*TMath::Pi()/12/2;
141 // The same parameters are defined in builder for station 1 (30deg)
144 // Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
147 Float_t posx, posy, posz;
148 // Chamber Material represented by Alu sheet
149 tpar[0]= iChamber->RInner();
150 tpar[1]= iChamber->ROuter();
151 tpar[2] = (iChamber->DGas())/2;
157 gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
158 gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
167 gMC->Gsvolu("LE01", "TUBS", idAir, tpar, 5);
168 GetEnvelopes(2)->AddEnvelope("LE01", detElemId, true, TGeoTranslation(posx, posy, posz),
169 TGeoRotation("rot1",90,0,90,90,0,0) );
171 gMC->Gsvolu("LF01", "TUBS", idAir, tpar, 5);
172 GetEnvelopes(3)->AddEnvelope("LF01", detElemId, true, TGeoTranslation(posx, posy, posz),
173 TGeoRotation("rot1",90,0,90,90,0,0) );
175 gMC->Gsvolu("LE02", "TUBS", idAir, tpar, 5);
176 GetEnvelopes(2)->AddEnvelope("LE02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
177 TGeoRotation("rot2",90,180,90,90,180,0) );
179 gMC->Gsvolu("LF02", "TUBS", idAir, tpar, 5);
180 GetEnvelopes(3)->AddEnvelope("LF02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
181 TGeoRotation("rot2",90,180,90,90,180,0) );
183 gMC->Gsvolu("LE03", "TUBS", idAir, tpar, 5);
184 GetEnvelopes(2)->AddEnvelope("LE03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
185 TGeoRotation("rot3",90,0,90,270,180,0) );
187 gMC->Gsvolu("LF03", "TUBS", idAir, tpar, 5);
188 GetEnvelopes(3)->AddEnvelope("LF03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
189 TGeoRotation("rot3",90,0,90,270,180,0) );
191 gMC->Gsvolu("LE04", "TUBS", idAir, tpar, 5);
192 GetEnvelopes(2)->AddEnvelope("LE04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
193 TGeoRotation("rot4",90,180,90,270,0,0) );
195 gMC->Gsvolu("LF04", "TUBS", idAir, tpar, 5);
196 GetEnvelopes(3)->AddEnvelope("LF04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
197 TGeoRotation("rot4",90,180,90,270,0,0) );
199 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
200 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
202 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
203 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
205 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
206 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
208 GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
209 GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
213 //______________________________________________________________________________
214 void AliMUONSt2GeometryBuilderV2::SetTransformations()
216 // Defines the transformations for the station2 chambers.
219 AliMUONChamber* iChamber1 = &fMUON->Chamber(2);
220 Double_t zpos1 = - iChamber1->Z();
221 iChamber1->GetGeometry()
222 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
224 AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
225 Double_t zpos2 = - iChamber2->Z();
226 iChamber2->GetGeometry()
227 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
230 //______________________________________________________________________________
231 void AliMUONSt2GeometryBuilderV2::SetSensitiveVolumes()
233 // Defines the sensitive volumes for station2 chambers.
236 GetGeometry(2)->SetSensitiveVolume("S03G");
237 GetGeometry(3)->SetSensitiveVolume("S04G");