]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt2GeometryBuilderV2.cxx
4fc6cc9b61faa80ed6d359db8e9ba02f67ec9663
[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 // Dummy version of station 2 with the right DE id (Ch. Finck)
23
24
25 #include <TVirtualMC.h>
26 #include <TGeoMatrix.h>
27
28 #include "AliLog.h"
29
30 #include "AliMUONSt2GeometryBuilderV2.h"
31 #include "AliMUON.h"
32 #include "AliMUONChamber.h"
33 #include "AliMUONGeometryModule.h"
34 #include "AliMUONGeometryEnvelopeStore.h"
35
36 ClassImp(AliMUONSt2GeometryBuilderV2)
37
38 //______________________________________________________________________________
39 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(AliMUON* muon)
40  : AliMUONVGeometryBuilder("st2V2.dat",
41                            muon->Chamber(2).GetGeometry(), 
42                            muon->Chamber(3).GetGeometry()),
43    fMUON(muon)
44 {
45 // Standard constructor
46
47 }
48
49 //______________________________________________________________________________
50 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2()
51  : AliMUONVGeometryBuilder(),
52    fMUON(0)
53 {
54 // Default constructor
55 }
56
57
58 //______________________________________________________________________________
59 AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(const AliMUONSt2GeometryBuilderV2& rhs)
60   : AliMUONVGeometryBuilder(rhs)
61 {
62 // Protected copy constructor
63
64   AliFatal("Copy constructor is not implemented.");
65 }
66
67 //______________________________________________________________________________
68 AliMUONSt2GeometryBuilderV2::~AliMUONSt2GeometryBuilderV2() {
69 //
70 }
71
72 //______________________________________________________________________________
73 AliMUONSt2GeometryBuilderV2& 
74 AliMUONSt2GeometryBuilderV2::operator = (const AliMUONSt2GeometryBuilderV2& rhs) 
75 {
76 // Protected assignement operator
77
78   // check assignement to self
79   if (this == &rhs) return *this;
80
81   AliFatal("Assignment operator is not implemented.");
82     
83   return *this;  
84 }
85
86 //
87 // public methods
88 //
89
90 //______________________________________________________________________________
91 void AliMUONSt2GeometryBuilderV2::CreateGeometry() 
92 {
93 // From AliMUONv1::CreateGeometry()
94
95 //
96 //********************************************************************
97 //                            Station 2                             **
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
102
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%)
109
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.;
112
113      // Rotation matrices in the x-y plane  
114      // phi= 0 deg
115      Int_t irot1;
116      fMUON->AliMatrix(irot1,  90.,   0., 90.,  90., 0., 0.);
117      // phi= 90 deg
118      Int_t irot2;
119      fMUON->AliMatrix(irot2,  90.,  90., 90., 180., 0., 0.);
120
121      AliMUONChamber* iChamber = &fMUON->Chamber(2);
122      //     AliMUONChamber* iChamber1 = iChamber;
123      //     AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
124      
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 
133      
134      // Mother volume
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)
142
143      Float_t tpar[5];
144      //     Double_t dstation = (-iChamber2->Z()) - (-iChamber1->Z());
145
146
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;
152      tpar[3] = 0.;
153      tpar[4] = 90.;
154   
155 //     
156 //   Sensitive volumes
157      gMC->Gsvolu("S03G", "TUBS", idGas, tpar, 5);
158      gMC->Gsvolu("S04G", "TUBS", idGas, tpar, 5);
159
160      Int_t detElemId;
161
162      posx = kDeltaQuad;
163      posy = kDeltaQuad;
164      posz = -kDeltaZ;
165
166      detElemId = 351;
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) );
170      detElemId = 451;
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) );
174      detElemId = 300;
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) );
178      detElemId = 400;
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) );
182      detElemId = 350;
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) );
186      detElemId = 450;
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) );
190      detElemId = 301;
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) );
194      detElemId = 401;
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) );
198
199      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE01", 1);
200      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF01", 1);
201
202      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE02", 2);
203      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF02", 2);
204
205      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE03", 3);
206      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF03", 3);
207
208      GetEnvelopes(2)->AddEnvelopeConstituent("S03G", "LE04", 4);
209      GetEnvelopes(3)->AddEnvelopeConstituent("S04G", "LF04", 4);
210
211 }
212
213 //______________________________________________________________________________
214 void AliMUONSt2GeometryBuilderV2::SetTransformations()
215 {
216 // Defines the transformations for the station2 chambers.
217 // ---
218
219   AliMUONChamber* iChamber1 = &fMUON->Chamber(2);
220   Double_t zpos1 = - iChamber1->Z(); 
221   iChamber1->GetGeometry()
222     ->SetTranslation(TGeoTranslation(0., 0., zpos1));
223
224   AliMUONChamber* iChamber2 = &fMUON->Chamber(3);
225   Double_t zpos2 = - iChamber2->Z(); 
226   iChamber2->GetGeometry()
227     ->SetTranslation(TGeoTranslation(0., 0., zpos2));
228 }
229
230 //______________________________________________________________________________
231 void AliMUONSt2GeometryBuilderV2::SetSensitiveVolumes()
232 {
233 // Defines the sensitive volumes for station2 chambers.
234 // ---
235
236   GetGeometry(2)->SetSensitiveVolume("S03G");
237   GetGeometry(3)->SetSensitiveVolume("S04G");
238 }