]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt2GeometryBuilder.cxx
Important bugfix. Missing reset of the equipment header data. It was causing a wrong...
[u/mrichter/AliRoot.git] / MUON / AliMUONSt2GeometryBuilder.cxx
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
16 // $Id$
17 //
18 // Class AliMUONSt2GeometryBuilder
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)
23
24 #include <TVirtualMC.h>
25 #include <TGeoMatrix.h>
26
27 #include "AliLog.h"
28
29 #include "AliMUONSt2GeometryBuilder.h"
30 #include "AliMUON.h"
31 #include "AliMUONConstants.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONGeometryEnvelopeStore.h"
34
35 /// \cond CLASSIMP
36 ClassImp(AliMUONSt2GeometryBuilder)
37 /// \endcond
38
39 //______________________________________________________________________________
40 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon)
41  : AliMUONVGeometryBuilder(2, 3), 
42    fMUON(muon)
43 {
44 // Standard constructor
45
46 }
47
48 //______________________________________________________________________________
49 AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder()
50  : AliMUONVGeometryBuilder(),
51    fMUON(0)
52 {
53 // Default constructor
54 }
55
56
57 //______________________________________________________________________________
58 AliMUONSt2GeometryBuilder::~AliMUONSt2GeometryBuilder() {
59 //
60 }
61
62 //
63 // public methods
64 //
65
66 //______________________________________________________________________________
67 void AliMUONSt2GeometryBuilder::CreateGeometry() 
68 {
69 // From AliMUONv1::CreateGeometry()
70
71 //
72 //********************************************************************
73 //                            Station 2                             **
74 //********************************************************************
75      // indices 1 and 2 for first and second chambers in the station
76      // iChamber (first chamber) kept for other quanties than Z,
77      // assumed to be the same in both chambers
78
79      // Get tracking medias Ids     
80      Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
81      Int_t idAir= idtmed[1100]; // medium 1
82   //     Int_t idAlu1=idtmed[1103]; // medium 4
83      //     Int_t idAlu2=idtmed[1104]; // medium 5
84      Int_t idGas=idtmed[1108];  // medium 9 = Ar-CO2 gas (80%+20%)
85
86      const Float_t kDeltaQuad = 0.01;//2.6; dummy value til we find the good value
87      const Float_t kDeltaZ = 6.5/2.;
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
97      // Half of the total thickness of frame crosses (including DAlu)
98      // for each chamber in stations 1 and 2:
99      // 3% of X0 of composite material,
100      // but taken as Aluminium here, with same thickness in number of X0
101      //     Float_t dframez = 3. * 8.9 / 100;
102      // DGas and DAlu not changed from standard values
103      //     Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
104              // The same parameters are defined in builder for station 1 
105
106      //    sensitive gas gap
107      const Float_t kDGas = 0.5;
108
109      //    3% radiation length of aluminum (X0=8.9 cm)      
110      // const Float_t kDAlu = 3.5 * 8.9 / 100.;
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 phi=2*TMath::Pi()/12/2;
119              // The same parameters are defined in builder for station 1 (30deg)
120
121      Float_t tpar[5];
122      //     Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
123
124
125      Float_t posx, posy, posz;
126 //   Chamber Material represented by Alu sheet
127      tpar[0]= AliMUONConstants::Rmin(1);
128      tpar[1]= AliMUONConstants::Rmax(1);
129      tpar[2] = kDGas/2;
130      tpar[3] = 0.;
131      tpar[4] = 90.;
132   
133 //     
134 //   Sensitive volumes
135      gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
136      gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
137
138      Int_t detElemId;
139
140      posx = kDeltaQuad;
141      posy = kDeltaQuad;
142      posz = -kDeltaZ;
143
144      detElemId = 301;
145      gMC->Gsvolu("LE01", "TUBS", idAir, tpar, 5);
146      GetEnvelopes(2)->AddEnvelope("LE01", detElemId, true, TGeoTranslation(posx, posy, posz),
147                                    TGeoRotation("rot1",90,0,90,90,0,0) );
148      detElemId = 401;
149      gMC->Gsvolu("LF01", "TUBS", idAir, tpar, 5);
150      GetEnvelopes(3)->AddEnvelope("LF01", detElemId, true, TGeoTranslation(posx, posy, posz),
151                                    TGeoRotation("rot1",90,0,90,90,0,0) );
152      detElemId = 300;
153      gMC->Gsvolu("LE02", "TUBS", idAir, tpar, 5);
154      GetEnvelopes(2)->AddEnvelope("LE02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
155                                   TGeoRotation("rot2",90,180,90,90,180,0) );
156      detElemId = 400;
157      gMC->Gsvolu("LF02", "TUBS", idAir, tpar, 5);
158      GetEnvelopes(3)->AddEnvelope("LF02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
159                                   TGeoRotation("rot2",90,180,90,90,180,0) );
160      detElemId = 302;
161      gMC->Gsvolu("LE03", "TUBS", idAir, tpar, 5);
162      GetEnvelopes(2)->AddEnvelope("LE03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
163                                   TGeoRotation("rot3",90,0,90,270,180,0) );
164      detElemId = 402;
165      gMC->Gsvolu("LF03", "TUBS", idAir, tpar, 5);
166      GetEnvelopes(3)->AddEnvelope("LF03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
167                                   TGeoRotation("rot3",90,0,90,270,180,0) );
168      detElemId = 303;
169      gMC->Gsvolu("LE04", "TUBS", idAir, tpar, 5);
170      GetEnvelopes(2)->AddEnvelope("LE04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
171                                   TGeoRotation("rot4",90,180,90,270,0,0) );
172      detElemId = 403;
173      gMC->Gsvolu("LF04", "TUBS", idAir, tpar, 5);
174      GetEnvelopes(3)->AddEnvelope("LF04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
175                                   TGeoRotation("rot4",90,180,90,270,0,0) );
176
177      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
178      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
179
180      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
181      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
182
183      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
184      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
185
186      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
187      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
188 }
189
190 //______________________________________________________________________________
191 void AliMUONSt2GeometryBuilder::SetTransformations()
192 {
193 // Defines the transformations for the station2 chambers.
194 // ---
195
196   // Define chamber volumes as virtual
197   SetVolume(2, "SC03", true);
198   SetVolume(3, "SC04", true);
199
200   Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2); 
201   SetTranslation(2, TGeoTranslation(0., 0., zpos1));
202
203   Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3); 
204   SetTranslation(3, TGeoTranslation(0., 0., zpos2));
205 }
206
207 //______________________________________________________________________________
208 void AliMUONSt2GeometryBuilder::SetSensitiveVolumes()
209 {
210 // Defines the sensitive volumes for station2 chambers.
211 // ---
212
213   GetGeometry(2)->SetSensitiveVolume("S03G");
214   GetGeometry(3)->SetSensitiveVolume("S04G");
215 }