]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt2GeometryBuilderV2.cxx
Removing extrap.F (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONSt2GeometryBuilderV2.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 AliMUONSt2GeometryBuilderV2
19 // -------------------------------
20 // MUON Station2 coarse geometry construction class.
21 // Extracted from AliMUONv1
22
23
24 #include <TVirtualMC.h>
25 #include <TGeoMatrix.h>
26
27 #include "AliLog.h"
28
29 #include "AliMUONSt2GeometryBuilderV2.h"
30 #include "AliMUON.h"
31 #include "AliMUONChamber.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONGeometryEnvelopeStore.h"
34
35 ClassImp(AliMUONSt2GeometryBuilderV2)
36
37 //______________________________________________________________________________
38 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(AliMUON* muon)
39  : AliMUONVGeometryBuilder("st2.dat",
40                            muon->Chamber(2).GetGeometry(), 
41                            muon->Chamber(3).GetGeometry()),
42    fMUON(muon)
43 {
44 // Standard constructor
45
46 }
47
48 //______________________________________________________________________________
49 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2()
50  : AliMUONVGeometryBuilder(),
51    fMUON(0)
52 {
53 // Default constructor
54 }
55
56
57 //______________________________________________________________________________
58 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(const AliMUONSt2GeometryBuilderV2& rhs)
59   : AliMUONVGeometryBuilder(rhs)
60 {
61 // Protected copy constructor
62
63   AliFatal("Copy constructor is not implemented.");
64 }
65
66 //______________________________________________________________________________
67 AliMUONSt2GeometryBuilderV2::~AliMUONSt2GeometryBuilderV2() {
68 //
69 }
70
71 //______________________________________________________________________________
72 AliMUONSt2GeometryBuilderV2& 
73 AliMUONSt2GeometryBuilderV2::operator = (const AliMUONSt2GeometryBuilderV2& rhs) 
74 {
75 // Protected assignement operator
76
77   // check assignement to self
78   if (this == &rhs) return *this;
79
80   AliFatal("Assignment operator is not implemented.");
81     
82   return *this;  
83 }
84
85 //
86 // public methods
87 //
88
89 //______________________________________________________________________________
90 void AliMUONSt2GeometryBuilderV2::CreateGeometry() 
91 {
92 // From AliMUONv1::CreateGeometry()
93
94 //
95 //********************************************************************
96 //                            Station 2                             **
97 //********************************************************************
98      // indices 1 and 2 for first and second chambers in the station
99      // iChamber (first chamber) kept for other quanties than Z,
100      // assumed to be the same in both chambers
101
102      // Get tracking medias Ids     
103      Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
104      Int_t idAir= idtmed[1100]; // medium 1
105   //     Int_t idAlu1=idtmed[1103]; // medium 4
106      //     Int_t idAlu2=idtmed[1104]; // medium 5
107      Int_t idGas=idtmed[1108];  // medium 9 = Ar-CO2 gas (80%+20%)
108
109      const Float_t kDeltaQuad = 2.6;
110      const Float_t kDeltaZ = 6.5/2.;
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
120      AliMUONChamber* iChamber = &fMUON->Chamber(2);
121      //     AliMUONChamber* iChamber1 = iChamber;
122      //     AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
123      
124      // Half of the total thickness of frame crosses (including DAlu)
125      // for each chamber in stations 1 and 2:
126      // 3% of X0 of composite material,
127      // but taken as Aluminium here, with same thickness in number of X0
128      //     Float_t dframez = 3. * 8.9 / 100;
129      // DGas and DAlu not changed from standard values
130      //     Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
131              // The same parameters are defined in builder for station 1 
132      
133      // Mother volume
134      // Outer excess and inner recess for mother volume radius
135      // with respect to ROuter and RInner
136      //     Float_t dframep=.001; // Value for station 3 should be 6 ...
137      // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
138      // Float_t dframep1=.001;
139      //     Float_t phi=2*TMath::Pi()/12/2;
140              // The same parameters are defined in builder for station 1 (30deg)
141
142      Float_t tpar[5];
143      //     Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
144
145
146      Float_t posx, posy, posz;
147 //   Chamber Material represented by Alu sheet
148      tpar[0]= iChamber->RInner();
149      tpar[1]= iChamber->ROuter();
150      tpar[2] = (iChamber->DGas())/2;
151      tpar[3] = 0.;
152      tpar[4] = 90.;
153   
154 //     
155 //   Sensitive volumes
156      gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
157      gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
158
159      Int_t detElemId;
160
161      posx = kDeltaQuad;
162      posy = kDeltaQuad;
163      posz = kDeltaZ;
164
165      detElemId = 300;
166      gMC->Gsvolu("LE01", "TUBS", idAir, tpar, 5);
167      GetEnvelopes(2)->AddEnvelope("LE01", detElemId, true, TGeoTranslation(posx, posy, posz),
168                                    TGeoRotation("rot1",90,0,90,90,0,0) );
169      detElemId = 400;
170      gMC->Gsvolu("LF01", "TUBS", idAir, tpar, 5);
171      GetEnvelopes(3)->AddEnvelope("LF01", detElemId, true, TGeoTranslation(posx, posy, posz),
172                                    TGeoRotation("rot1",90,0,90,90,0,0) );
173      detElemId = 351;
174      gMC->Gsvolu("LE02", "TUBS", idAir, tpar, 5);
175      GetEnvelopes(2)->AddEnvelope("LE02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
176                                   TGeoRotation("rot2",90,180,90,90,180,0) );
177      detElemId = 451;
178      gMC->Gsvolu("LF02", "TUBS", idAir, tpar, 5);
179      GetEnvelopes(3)->AddEnvelope("LF02", detElemId, true, TGeoTranslation(-posx, posy,-posz),
180                                   TGeoRotation("rot2",90,180,90,90,180,0) );
181      detElemId = 301;
182      gMC->Gsvolu("LE03", "TUBS", idAir, tpar, 5);
183      GetEnvelopes(2)->AddEnvelope("LE03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
184                                   TGeoRotation("rot3",90,0,90,270,180,0) );
185      detElemId = 401;
186      gMC->Gsvolu("LF03", "TUBS", idAir, tpar, 5);
187      GetEnvelopes(3)->AddEnvelope("LF03", detElemId, true, TGeoTranslation(posx, -posy, -posz),
188                                   TGeoRotation("rot3",90,0,90,270,180,0) );
189      detElemId = 350;
190      gMC->Gsvolu("LE04", "TUBS", idAir, tpar, 5);
191      GetEnvelopes(2)->AddEnvelope("LE04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
192                                   TGeoRotation("rot4",90,180,90,270,0,0) );
193      detElemId = 450;
194      gMC->Gsvolu("LF04", "TUBS", idAir, tpar, 5);
195      GetEnvelopes(3)->AddEnvelope("LF04", detElemId, true, TGeoTranslation(-posx, -posy, posz),
196                                   TGeoRotation("rot4",90,180,90,270,0,0) );
197
198      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
199      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
200
201      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
202      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
203
204      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
205      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
206
207      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
208      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
209
210 }
211
212 //______________________________________________________________________________
213 void AliMUONSt2GeometryBuilderV2::SetTransformations()
214 {
215 // Defines the transformations for the station2 chambers.
216 // ---
217
218   AliMUONChamber* iChamber1 = &fMUON->Chamber(2);
219   Double_t zpos1 = - iChamber1->Z(); 
220   iChamber1->GetGeometry()
221     ->SetTranslation(TGeoTranslation(0., 0., zpos1));
222
223   AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
224   Double_t zpos2 = - iChamber2->Z(); 
225   iChamber2->GetGeometry()
226     ->SetTranslation(TGeoTranslation(0., 0., zpos2));
227 }
228
229 //______________________________________________________________________________
230 void AliMUONSt2GeometryBuilderV2::SetSensitiveVolumes()
231 {
232 // Defines the sensitive volumes for station2 chambers.
233 // ---
234
235   GetGeometry(2)->SetSensitiveVolume("S03G");
236   GetGeometry(3)->SetSensitiveVolume("S04G");
237 }