Mother volume changed from ALIC to YOUT1/YOUT2 (defined in SHIL)
[u/mrichter/AliRoot.git] / MUON / AliMUONSt2GeometryBuilderV2.cxx
CommitLineData
a2b41b89 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.
ffc01fb1 21//********************************************************************
22// Author: SANJOY PAL ,Prof. SUKALYAN CHATTOPADHAYAY [SINP, KOLKATA]
23// & Dr.SHAKEEL AHMAD (AMU), INDIA
24//********************************************************************
a2b41b89 25
26
27#include <TVirtualMC.h>
28#include <TGeoMatrix.h>
ffc01fb1 29#include <Riostream.h>
a2b41b89 30
ffc01fb1 31#include "AliRun.h"
a2b41b89 32#include "AliLog.h"
33
34#include "AliMUONSt2GeometryBuilderV2.h"
35#include "AliMUON.h"
b7ef3c96 36#include "AliMUONConstants.h"
a2b41b89 37#include "AliMUONGeometryModule.h"
38#include "AliMUONGeometryEnvelopeStore.h"
ffc01fb1 39#include "AliMUONConstants.h"
a2b41b89 40
ffc01fb1 41#define PI 3.14159
a2b41b89 42ClassImp(AliMUONSt2GeometryBuilderV2)
43
44//______________________________________________________________________________
45AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(AliMUON* muon)
b7ef3c96 46 : AliMUONVGeometryBuilder(2, 3),
a2b41b89 47 fMUON(muon)
48{
49// Standard constructor
50
51}
52
53//______________________________________________________________________________
54AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2()
55 : AliMUONVGeometryBuilder(),
56 fMUON(0)
57{
58// Default constructor
59}
60
61
62//______________________________________________________________________________
63AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(const AliMUONSt2GeometryBuilderV2& rhs)
64 : AliMUONVGeometryBuilder(rhs)
65{
66// Protected copy constructor
67
68 AliFatal("Copy constructor is not implemented.");
69}
70
71//______________________________________________________________________________
72AliMUONSt2GeometryBuilderV2::~AliMUONSt2GeometryBuilderV2() {
73//
74}
75
76//______________________________________________________________________________
ffc01fb1 77AliMUONSt2GeometryBuilderV2&
78AliMUONSt2GeometryBuilderV2::operator = (const AliMUONSt2GeometryBuilderV2& rhs)
a2b41b89 79{
80// Protected assignement operator
81
82 // check assignement to self
83 if (this == &rhs) return *this;
84
85 AliFatal("Assignment operator is not implemented.");
ffc01fb1 86
87 return *this;
a2b41b89 88}
89
90//
91// public methods
92//
93
94//______________________________________________________________________________
ffc01fb1 95void AliMUONSt2GeometryBuilderV2::CreateGeometry()
a2b41b89 96{
a2b41b89 97
98//
99//********************************************************************
100// Station 2 **
101//********************************************************************
102 // indices 1 and 2 for first and second chambers in the station
103 // iChamber (first chamber) kept for other quanties than Z,
104 // assumed to be the same in both chambers
105
ffc01fb1 106 // Get tracking medias Ids
a2b41b89 107 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
ffc01fb1 108 Int_t idAir = idtmed[1100]; // medium 1
109 Int_t idGas = idtmed[1108]; // medium Ar-CO2 gas (80%+20%)
110 Int_t idPCB = idtmed[1122]; // medium FR4
111 Int_t idCU = idtmed[1110]; // medium copper
112 Int_t idRoha = idtmed[1113]; // medium roha cell
113 Int_t idPGF30= idtmed[1123]; // medium for Frame Eq.to Bakelite
6dae0c71 114 //Int_t idScru = idtmed[1128]; // screw material - Stainless Steel(18%Cr,9%Ni,Fe)
ffc01fb1 115
ffc01fb1 116
ffc01fb1 117
118/*########################################################################################
6dae0c71 119 Create volume for one Quadrant
ffc01fb1 120##########################################################################################*/
121 Float_t tpar1[5];
6dae0c71 122 tpar1[0] = 20.55;
123 tpar1[1] = 123.5;
124 tpar1[2] = 6.8/2;
125 tpar1[3] = -12.0;
126 tpar1[4] = 102.0;
ffc01fb1 127
128
129 gMC->Gsvolu("SQM3","TUBS", idAir, tpar1, 5);
130 gMC->Gsvolu("SQM4","TUBS", idAir, tpar1, 5);
131
132
133
134//==================================================================================
6dae0c71 135// Plane
ffc01fb1 136//==================================================================================
137
138//Thickness of variour parts
6dae0c71 139 Float_t zCbb = 0.04; //cathode pcb
140 Float_t zCu = 0.004; // eff. cu in cathode pcb
ffc01fb1 141 Float_t zRoha = 2.5; // Rhocell
6dae0c71 142 Float_t zMeb = 0.08; //Mech. exit board
143 Float_t zEeb = 0.02; //Effective electronic exit board
ffc01fb1 144 //Z-positions of various parts--- in Plane-1
145
6dae0c71 146 Float_t zposCbb = 0.25; // 2.5 mm => gap between anode & chatode plane
147 Float_t zposCu =zposCbb + zCbb;
148 Float_t zposRoha =zposCu + zCu;
149 Float_t zposMeb =zposRoha + zRoha;
150 Float_t zposEeb =zposMeb + zMeb;
ffc01fb1 151
6dae0c71 152 Float_t zposCbbBar = zposCbb + zCbb/2.; //for segment 0 & 6
153 Float_t zposCuBar = zCbb/2. + zCu/2.;
154 Float_t zposRohaBar = zCu/2. + zRoha/2.;
155 Float_t zposMebBar = zRoha/2. + zMeb/2.;
156 Float_t zposEebBar = zMeb/2. + zEeb/2.;
ffc01fb1 157
158
159 //Cathode PCB + Copper sheet + Rohacell + mech exit board + eff. electronic exit board
160
6dae0c71 161 //Segment-0 ~~~Horizantal box ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162 Float_t bparH[3];
163 bparH[0] = 94.5/2.; // extension beyond 0 deg in x direction
164 bparH[1] = 1.2/2.; // extension beyond 0 deg in y direction (3.7[total extn] - 2.5[frame dim])
165 bparH[2] = zCbb/2.; // thickness of cathode sheet in z direction
166 gMC->Gsvolu("CB0L", "BOX", idPCB, bparH, 3);
167
168 bparH[2] = zCu/2.; //Thickness of Copper sheet
169 gMC->Gsvolu("CU0L", "BOX", idCU, bparH, 3);
ffc01fb1 170
6dae0c71 171 bparH[2] = zRoha/2.; //Thickness of Roha cell
172 gMC->Gsvolu("RH0L", "BOX", idRoha, bparH, 3);
ffc01fb1 173
6dae0c71 174 bparH[2] = zMeb/2; //Thickness of mechanical exit board
175 gMC->Gsvolu("MB0L", "BOX", idPCB, bparH, 3);
ffc01fb1 176
6dae0c71 177 bparH[2] = zEeb/2; //Thickness of effective electronic exit board
178 gMC->Gsvolu("EB0L", "BOX", idCU, bparH, 3);
ffc01fb1 179
180 //Segment-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6dae0c71 181 Float_t pgpar[10]; // polygon
182 pgpar[0] = 0.; // initial angle
183 pgpar[1] = 90.; // increment in angle starting from initial angle
184 pgpar[2] = 5; // number of side
185 pgpar[3] = 2.; // number of plane
186 pgpar[4] = 0.; // z-position of the first plane
187 pgpar[5] = 23.1; // innner radius first plane
188 pgpar[6] = 117.6; // outer radious first plane
189 pgpar[7] = pgpar[4] + zCbb; // z-position of the second plane
190 pgpar[8] = pgpar[5]; // innner radius of second plane
191 pgpar[9] = pgpar[6]; // outer radious of second plane
192 gMC->Gsvolu("CB1L", "PGON", idPCB, pgpar, 10);
193
194 pgpar[7] = pgpar[4] + zCu; // Thickness of copper-sheet
195 gMC->Gsvolu("CU1L", "PGON", idCU, pgpar, 10);
196
197 pgpar[7] = pgpar[4] + zRoha; // Thickness of Roha cell
198 gMC->Gsvolu("RH1L", "PGON", idRoha, pgpar, 10);
199
200 pgpar[7] = pgpar[4] + zMeb; // Thickness of mechanical exit board
201 gMC->Gsvolu("MB1L", "PGON", idPCB, pgpar, 10);
202
203 pgpar[7] = pgpar[4] + zEeb; // Thickness of electronic exit board
204 gMC->Gsvolu("EB1L", "PGON", idCU, pgpar, 10);
205
206
207//Segment-2 - vertical box (simalar to horizontal bar as in Segment 0)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208
209 Float_t bparV[3];
210
211 bparV[0] = 1.0/2.;
212 bparV[1] = 94.5/2.;
213 bparV[2] = zCbb/2.;
214 gMC->Gsvolu("CB2L", "BOX", idPCB, bparV, 3);
215
216 bparV[2] = zCu/2.;
217 gMC->Gsvolu("CU2L", "BOX", idCU, bparV, 3);
218
219 bparV[2] = zRoha/2.;
220 gMC->Gsvolu("RH2L", "BOX", idRoha, bparV, 3);
221
222 bparV[2] = zMeb/2;
223 gMC->Gsvolu("MB2L", "BOX", idPCB, bparV, 3);
224
225 bparV[2] = zEeb/2;
226 gMC->Gsvolu("EB2L", "BOX", idCU, bparV, 3);
227
228//....(Setting posion of Segment 0,1,2)..................................................................
229
230 Float_t xposHorBox = bparH[0] + 23.1; // 23.1 = 20.6(inner radius of qrd) + 2.5 (width of frame)
231 Float_t yposHorBox = -bparH[1];
232
233 Float_t xposVerBox = -bparV[0];
234 Float_t yposVerBox = bparV[1] + 23.1;
ffc01fb1 235
ffc01fb1 236
ffc01fb1 237
6dae0c71 238//Positioning the PCB
239//
ffc01fb1 240
6dae0c71 241 // chamber 3
242 gMC->Gspos("CB0L",1, "SQM3",xposHorBox,yposHorBox,zposCbbBar,0, "ONLY");// box horizontal
243 gMC->Gspos("CB1L",1, "SQM3", 0.0,0.0,zposCbb,0, "ONLY");
244 gMC->Gspos("CB2L",1, "SQM3",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");// box vertical
ffc01fb1 245
6dae0c71 246 gMC->Gspos("CB0L",2, "SQM3",xposHorBox,yposHorBox,-zposCbbBar,0, "ONLY");// box horizontal
247 gMC->Gspos("CB1L",2, "SQM3", 0.0,0.0,-(zposCbb+ zCbb),0, "ONLY");
248 gMC->Gspos("CB2L",2, "SQM3",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");// box vertical
ffc01fb1 249
6dae0c71 250 // chamber 4
251 gMC->Gspos("CB0L",3, "SQM4",xposHorBox,yposHorBox,zposCbbBar,0, "ONLY");
252 gMC->Gspos("CB1L",3, "SQM4", 0.0,0.0,zposCbb,0, "ONLY");
253 gMC->Gspos("CB2L",3, "SQM4",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");
ffc01fb1 254
6dae0c71 255 gMC->Gspos("CB0L",4, "SQM4",xposHorBox,yposHorBox,-zposCbbBar,0, "ONLY");
256 gMC->Gspos("CB1L",4, "SQM4", 0.0,0.0,-(zposCbb+ zCbb),0, "ONLY");
257 gMC->Gspos("CB2L",4, "SQM4",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");
ffc01fb1 258
ffc01fb1 259
6dae0c71 260//Positioning Copper sheet
ffc01fb1 261
6dae0c71 262 // chamber 3
ffc01fb1 263
6dae0c71 264 gMC->Gspos("CU0L",1, "SQM3",xposHorBox,yposHorBox,zposCuBar,0, "ONLY");
265 gMC->Gspos("CU1L",1, "SQM3", 0.0,0.0,zposCu,0, "ONLY");
266 gMC->Gspos("CU2L",1, "SQM3",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
ffc01fb1 267
6dae0c71 268 gMC->Gspos("CU0L",2, "SQM3",xposHorBox,yposHorBox,-zposCuBar,0, "ONLY");
269 gMC->Gspos("CU1L",2, "SQM3", 0.0,0.0,-(zposCu+ zCu),0, "ONLY");
270 gMC->Gspos("CU2L",2, "SQM3",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
271 // chamber 4
ffc01fb1 272
6dae0c71 273 gMC->Gspos("CU0L",3, "SQM4",xposHorBox,yposHorBox,zposCuBar,0, "ONLY");
274 gMC->Gspos("CU1L",3, "SQM4", 0.0,0.0,zposCu,0, "ONLY");
275 gMC->Gspos("CU2L",3, "SQM4",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
ffc01fb1 276
6dae0c71 277 gMC->Gspos("CU0L",4, "SQM4",xposHorBox,yposHorBox,-zposCuBar,0, "ONLY");
278 gMC->Gspos("CU1L",4, "SQM4", 0.0,0.0,-(zposCu+ zCu),0, "ONLY");
279 gMC->Gspos("CU2L",4, "SQM4",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
ffc01fb1 280
6dae0c71 281//Positioning Roha cell
ffc01fb1 282
6dae0c71 283 // chamber 3
ffc01fb1 284
6dae0c71 285 gMC->Gspos("RH0L",1, "SQM3",xposHorBox,yposHorBox,zposRohaBar,0, "ONLY");
286 gMC->Gspos("RH1L",1, "SQM3", 0.0,0.0,zposRoha,0, "ONLY");
287 gMC->Gspos("RH2L",1, "SQM3",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
ffc01fb1 288
6dae0c71 289 gMC->Gspos("RH0L",2, "SQM3",xposHorBox,yposHorBox,-zposRohaBar,0, "ONLY");
290 gMC->Gspos("RH1L",2, "SQM3", 0.0,0.0,-(zposRoha+ zRoha),0, "ONLY");
291 gMC->Gspos("RH2L",2, "SQM3",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
ffc01fb1 292
6dae0c71 293 // chamber 4
ffc01fb1 294
6dae0c71 295 gMC->Gspos("RH0L",3, "SQM4",xposHorBox,yposHorBox,zposRohaBar,0, "ONLY");
296 gMC->Gspos("RH1L",3, "SQM4", 0.0,0.0,zposRoha,0, "ONLY");
297 gMC->Gspos("RH2L",3, "SQM4",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
ffc01fb1 298
6dae0c71 299 gMC->Gspos("RH0L",4, "SQM4",xposHorBox,yposHorBox,-zposRohaBar,0, "ONLY");
300 gMC->Gspos("RH1L",4, "SQM4", 0.0,0.0,-(zposRoha+ zRoha),0, "ONLY");
301 gMC->Gspos("RH2L",4, "SQM4",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
ffc01fb1 302
6dae0c71 303//Positioning of Mech. exit board
ffc01fb1 304
6dae0c71 305 // chamber 3
ffc01fb1 306
6dae0c71 307 gMC->Gspos("MB0L",1, "SQM3",xposHorBox,yposHorBox,zposMebBar,0, "ONLY");
308 gMC->Gspos("MB1L",1, "SQM3", 0.0,0.0,zposMeb,0, "ONLY");
309 gMC->Gspos("MB2L",1, "SQM3",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
ffc01fb1 310
6dae0c71 311 gMC->Gspos("MB0L",2, "SQM3",xposHorBox,yposHorBox,-zposMebBar,0, "ONLY");
312 gMC->Gspos("MB1L",2, "SQM3", 0.0,0.0,-(zposMeb+ zMeb),0, "ONLY");
313 gMC->Gspos("MB2L",2, "SQM3",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
314 // chamber 4
ffc01fb1 315
6dae0c71 316 gMC->Gspos("MB0L",3, "SQM4",xposHorBox,yposHorBox,zposMebBar,0, "ONLY");
317 gMC->Gspos("MB1L",3, "SQM4", 0.0,0.0,zposMeb,0, "ONLY");
318 gMC->Gspos("MB2L",3, "SQM4",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
ffc01fb1 319
6dae0c71 320 gMC->Gspos("MB0L",4, "SQM4",xposHorBox,yposHorBox,-zposMebBar,0, "ONLY");
321 gMC->Gspos("MB1L",4, "SQM4", 0.0,0.0,-(zposMeb+ zMeb),0, "ONLY");
322 gMC->Gspos("MB2L",4, "SQM4",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
ffc01fb1 323
ffc01fb1 324//Positioning of Electronic exit board
ffc01fb1 325
ffc01fb1 326
6dae0c71 327 // chamber 3
ffc01fb1 328
6dae0c71 329 gMC->Gspos("EB0L",1, "SQM3",xposHorBox,yposHorBox,zposEebBar,0, "ONLY");
330 gMC->Gspos("EB1L",1, "SQM3", 0.0,0.0,zposEeb,0, "ONLY");
331 gMC->Gspos("EB2L",1, "SQM3",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
ffc01fb1 332
6dae0c71 333 gMC->Gspos("EB0L",2, "SQM3",xposHorBox,yposHorBox,-zposEebBar,0, "ONLY");
334 gMC->Gspos("EB1L",2, "SQM3", 0.0,0.0,-(zposEeb+ zEeb),0, "ONLY");
335 gMC->Gspos("EB2L",2, "SQM3",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
336 // chamber 4
ffc01fb1 337
6dae0c71 338 gMC->Gspos("EB0L",3, "SQM4",xposHorBox,yposHorBox,zposEebBar,0, "ONLY");
339 gMC->Gspos("EB1L",3, "SQM4", 0.0,0.0,zposEeb,0, "ONLY");
340 gMC->Gspos("EB2L",3, "SQM4",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
ffc01fb1 341
6dae0c71 342 gMC->Gspos("EB0L",4, "SQM4",xposHorBox,yposHorBox,-zposEebBar,0, "ONLY");
343 gMC->Gspos("EB1L",4, "SQM4", 0.0,0.0,-(zposEeb+ zEeb),0, "ONLY");
344 gMC->Gspos("EB2L",4, "SQM4",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
ffc01fb1 345
6dae0c71 346
ffc01fb1 347//----------------------------------------------------------------------
348// Frames
349//----------------------------------------------------------------------
350//Frame-1
6dae0c71 351 Float_t frame1[3] ;
352 frame1[0] = 101.0/2.; //100.6 = 94.5 + 2.5 + 3.6
353 frame1[1] = 2.5/2.;
354 frame1[2] = 5.0/2.;
355
356 gMC->Gsvolu("FRM1", "BOX", idPGF30, frame1, 3); //Frame - 1 // fill with pkk GF30
357
358 Float_t arib1[3];
359 arib1[0] = frame1[0];
360 arib1[1] = 0.9/2.;
361 arib1[2] =(frame1[2]-0.95)/2.0;
362
363 gMC->Gsvolu("FRA1", "BOX", idAir, arib1, 3); // fill with air
364
365 Float_t xposarib1 = 0;
366 Float_t yposarib1 = -frame1[1] + arib1[1];
367 Float_t zposarib1 = frame1[2] - arib1[2];
368
369 gMC->Gspos("FRA1",1, "FRM1", xposarib1, yposarib1, zposarib1,0, "ONLY"); //replace pkk GF30 with air(b)
370 gMC->Gspos("FRA1",2, "FRM1", xposarib1, yposarib1, -zposarib1,0, "ONLY"); //replace pkk GF30 with air(nb)
371
372 Float_t rrib1[3];
373 rrib1[0] = frame1[0];
374 rrib1[1] = 0.6/2.;
375 rrib1[2] =(frame1[2]-0.95)/2.0;
376
377 gMC->Gsvolu("FRR1", "BOX", idRoha, rrib1, 3); // fill with rohacell
378
379 Float_t xposrrib1 = 0.0;
380 Float_t yposrrib1 = frame1[1] - rrib1[1];
381 Float_t zposrrib1 = frame1[2] - rrib1[2];
382
383 gMC->Gspos("FRR1",1, "FRM1", xposrrib1, yposrrib1, zposrrib1,0, "ONLY");//replace pkk GF30 with rohacell
384 gMC->Gspos("FRR1",2, "FRM1", xposrrib1, yposrrib1, -zposrrib1,0, "ONLY");//replace pkk GF30 with rohacell
385
386
387 Float_t xposFr1 = frame1[0] + 20.6;
388 Float_t yposFr1 = -3.7 + frame1[1] ;
389 Float_t zposFr1 = 0.0;
390
391 gMC->Gspos("FRM1",1, "SQM3", xposFr1, yposFr1, zposFr1,0, "ONLY");// frame -1
392 gMC->Gspos("FRM1",2, "SQM4", xposFr1, yposFr1, zposFr1,0, "ONLY");// frame -1
393
ffc01fb1 394
395//......................................................................................
396//Frame-2
397
6dae0c71 398 Float_t frame2[3];
399 frame2[0] = 4.0/2.;
400 frame2[1] = 1.2/2.;
401 frame2[2] = 5.0/2;
ffc01fb1 402
6dae0c71 403 gMC->Gsvolu("FRM2", "BOX", idPGF30, frame2, 3); //Frame - 2
ffc01fb1 404
6dae0c71 405 Float_t rrib2[3];
406 rrib2[0] = frame2[0]-1.0/2.0;
407 rrib2[1] = frame2[1];
408 rrib2[2] =(frame2[2]-0.95)/2.0;
ffc01fb1 409
6dae0c71 410 gMC->Gsvolu("FRR2", "BOX", idRoha, rrib2, 3);
411
412 Float_t xposrrib2 = -1.0/2.0;
413 Float_t yposrrib2 = 0.0;
414 Float_t zposrrib2 = frame2[2] - rrib2[2];
ffc01fb1 415
6dae0c71 416 gMC->Gspos("FRR2",1, "FRM2", xposrrib2, yposrrib2, zposrrib2,0, "ONLY");//replace pkk GF30 with rohacell
417 gMC->Gspos("FRR2",2, "FRM2", xposrrib2, yposrrib2, -zposrrib2,0, "ONLY");//replace pkk GF30 with roha
ffc01fb1 418
ffc01fb1 419
ffc01fb1 420
6dae0c71 421 Float_t xposFr2 = frame2[0] + 117.6;
422 Float_t yposFr2 = -frame2[1];
423 Float_t zposFr2 = 0.0;
ffc01fb1 424
6dae0c71 425 gMC->Gspos("FRM2",1, "SQM3", xposFr2, yposFr2, zposFr2,0, "ONLY");//global positing of frame in SQM3
426 gMC->Gspos("FRM2",2, "SQM4", xposFr2, yposFr2, zposFr2,0, "ONLY");//global positing of frame in SQM4
427
428
ffc01fb1 429//......................................................................................
6dae0c71 430//Frame-3
ffc01fb1 431
6dae0c71 432 Float_t pgparFr3[10];
433 pgparFr3[0] = 0.;
434 pgparFr3[1] = 90.;
435 pgparFr3[2] = 5;
436 pgparFr3[3] = 2.;
437 pgparFr3[4] = 0.;
438 pgparFr3[5] = 117.6;
439 pgparFr3[6] = 121.6;
440 pgparFr3[7] = pgparFr3[4] + 5.0;
441 pgparFr3[8] = pgparFr3[5];
442 pgparFr3[9] = pgparFr3[6];
443
444 gMC->Gsvolu("FRM3", "PGON", idPGF30, pgparFr3, 10);
445
446 Float_t pgparRrib3[10];
447 pgparRrib3[0] = 0.;
448 pgparRrib3[1] = 90.;
449 pgparRrib3[2] = 5;
450 pgparRrib3[3] = 2.;
451 pgparRrib3[4] = 0.;
452 pgparRrib3[5] = 117.6;
453 pgparRrib3[6] = 120.6;
454 pgparRrib3[7] = pgparRrib3[4] +1.55 ;
455 pgparRrib3[8] = pgparRrib3[5];
456 pgparRrib3[9] = pgparRrib3[6];
457
458 gMC->Gsvolu("FRR3", "PGON", idRoha, pgparRrib3, 10);
459
460 Float_t xposrrib3 = 0.0;
461 Float_t yposrrib3 = 0.0;
462 Float_t zposrrib3 = 0.0;
463
464 gMC->Gspos("FRR3",1, "FRM3", xposrrib3, yposrrib3, zposrrib3,0, "ONLY");
465
466 zposrrib3 = 3.45;
467
468 gMC->Gspos("FRR3",2, "FRM3", xposrrib3, yposrrib3, zposrrib3,0, "ONLY");
469
470
471
472 Float_t xposFr3 = 0.0;
473 Float_t yposFr3 = 0.0;
474 Float_t zposFr3 = -frame1[2];
475
476 gMC->Gspos("FRM3",1, "SQM3", xposFr3, yposFr3, zposFr3,0, "ONLY");// frame -1
477 gMC->Gspos("FRM3",2, "SQM4", xposFr3, yposFr3, zposFr3,0, "ONLY");// frame -1
478
ffc01fb1 479
480//......................................................................................
6dae0c71 481//Frame-4
482
483 Float_t frame4[3];
484 frame4[0] = 1.0/2.;
485 frame4[1] = 4.0/2.;
486 frame4[2] = frame1[2];
ffc01fb1 487
6dae0c71 488 gMC->Gsvolu("FRM4", "BOX", idPGF30, frame4, 3);
ffc01fb1 489
6dae0c71 490 Float_t rrib4[3];
491 rrib4[0] = frame4[0];
492 rrib4[1] = frame4[1]-1.0/2;
493 rrib4[2] =(frame4[2]-0.95)/2.0;
ffc01fb1 494
6dae0c71 495 gMC->Gsvolu("FRR4", "BOX", idRoha, rrib4, 3);
496
497 Float_t xposrrib4 = 0.0;
498 Float_t yposrrib4 = -1.0/2;
499 Float_t zposrrib4 = frame4[2] - rrib4[2];
ffc01fb1 500
6dae0c71 501 gMC->Gspos("FRR4",1, "FRM4", xposrrib4, yposrrib4, zposrrib4,0, "ONLY");
502 gMC->Gspos("FRR4",2, "FRM4", xposrrib4, yposrrib4, -zposrrib4,0, "ONLY");
ffc01fb1 503
ffc01fb1 504
ffc01fb1 505
6dae0c71 506 Float_t xposFr4 = -frame4[0];
507 Float_t yposFr4 = -frame4[1] + 117.6;
508 Float_t zposFr4 = 0.0;
ffc01fb1 509
6dae0c71 510 gMC->Gspos("FRM4",1, "SQM3", xposFr4, yposFr4, zposFr4,0, "ONLY");
511 gMC->Gspos("FRM4",2, "SQM4", xposFr4, yposFr4, zposFr4,0, "ONLY");
512
ffc01fb1 513
514//......................................................................................
6dae0c71 515//Frame-5
516 Float_t frame5[3] ;
517 frame5[0] = 2.7/2.;
518 frame5[1] = 101.0/2.;
519 frame5[2] = 5.0/2.;
ffc01fb1 520
6dae0c71 521 gMC->Gsvolu("FRM5", "BOX", idPGF30, frame5, 3); //Frame - 1
522
523 Float_t arib5[3];
524 arib5[0] = 0.9/2.0;
525 arib5[1] = frame5[1];
526 arib5[2] = (frame5[2]-0.95)/2.0;
ffc01fb1 527
6dae0c71 528 gMC->Gsvolu("FRA5", "BOX", idAir, arib5, 3);
ffc01fb1 529
6dae0c71 530 Float_t xposarib5 = -frame5[0] + arib5[0];
531 Float_t yposarib5 = 0.0;
532 Float_t zposarib5 = frame5[2] - arib5[2];
ffc01fb1 533
6dae0c71 534 gMC->Gspos("FRA5",1, "FRM5", xposarib5, yposarib5, zposarib5,0, "ONLY");
535 gMC->Gspos("FRA5",2, "FRM5", xposarib5, yposarib5, -zposarib5,0, "ONLY");
ffc01fb1 536
6dae0c71 537 Float_t rrib5[3];
538 rrib5[0] = 0.8/2.0;
539 rrib5[1] = frame5[1];
540 rrib5[2] = (frame5[2]-0.95)/2.0;
ffc01fb1 541
6dae0c71 542 gMC->Gsvolu("FRR5", "BOX", idRoha, rrib5, 3);
ffc01fb1 543
6dae0c71 544 Float_t xposrrib5 = frame5[0] - rrib5[0];
545 Float_t yposrrib5 = 0.0;
546 Float_t zposrrib5 = frame5[2] - rrib5[2];
ffc01fb1 547
6dae0c71 548 gMC->Gspos("FRR5",1, "FRM5", xposrrib5, yposrrib5, zposrrib5,0, "ONLY");
549 gMC->Gspos("FRR5",2, "FRM5", xposrrib5, yposrrib5, -zposrrib5,0, "ONLY");
ffc01fb1 550
6dae0c71 551 Float_t xposFr5 = -3.7 + frame5[0];
552 Float_t yposFr5 = frame5[1] + 20.6;
553 Float_t zposFr5 = 0.0;
ffc01fb1 554
6dae0c71 555 gMC->Gspos("FRM5",1, "SQM3", xposFr5, yposFr5, zposFr5,0, "ONLY");
556 gMC->Gspos("FRM5",2, "SQM4", xposFr5, yposFr5, zposFr5,0, "ONLY");
ffc01fb1 557
ffc01fb1 558//......................................................................................
6dae0c71 559//Frame -6
560
561 Float_t frame6[3];
562 frame6[0] = 1.0/2.;
563 frame6[1] = 2.5/2.;
564 frame6[2] = frame1[2];
ffc01fb1 565
6dae0c71 566 gMC->Gsvolu("FRM6", "BOX", idPGF30, frame6, 3);
ffc01fb1 567
6dae0c71 568 Float_t rrib6[3];
569 rrib6[0] = frame6[0];
570 rrib6[1] = 1.5/2.;
571 rrib6[2] =(frame2[2]-0.95)/2.0;
ffc01fb1 572
6dae0c71 573 gMC->Gsvolu("FRR6", "BOX", idRoha, rrib6, 3);
574
575 Float_t xposrrib6 = 0.0;
576 Float_t yposrrib6 = 1.0/2.0;
577 Float_t zposrrib6 = frame6[2] - rrib6[2];
ffc01fb1 578
6dae0c71 579 gMC->Gspos("FRR6",1, "FRM6", xposrrib6, yposrrib6, zposrrib6,0, "ONLY");
580 gMC->Gspos("FRR6",2, "FRM6", xposrrib6, yposrrib6, -zposrrib6,0, "ONLY");
ffc01fb1 581
ffc01fb1 582
ffc01fb1 583
6dae0c71 584 Float_t xposFr6 = -frame6[0];
585 Float_t yposFr6 = frame6[1] + 20.6;
586 Float_t zposFr6 = 0.0;
ffc01fb1 587
6dae0c71 588 gMC->Gspos("FRM6",1, "SQM3", xposFr6, yposFr6, zposFr6,0, "ONLY");
589 gMC->Gspos("FRM6",2, "SQM4", xposFr6, yposFr6, zposFr6,0, "ONLY");
590
ffc01fb1 591
ffc01fb1 592//......................................................................................
6dae0c71 593//Frame - 7 inner pgon
594
595 Float_t pgparFr7[10];
596 pgparFr7[0] = 0.;
597 pgparFr7[1] = 90.;
598 pgparFr7[2] = 5;
599 pgparFr7[3] = 2.;
600 pgparFr7[4] = 0.;
601 pgparFr7[5] = 20.6;
602 pgparFr7[6] = 23.1;
603 pgparFr7[7] = pgparFr7[4] + 5.0;
604 pgparFr7[8] = pgparFr7[5];
605 pgparFr7[9] = pgparFr7[6];
606
607 gMC->Gsvolu("FRM7", "PGON", idPGF30, pgparFr7, 10);
608
609 Float_t pgparRrib7[10];
610 pgparRrib7[0] = 0.;
611 pgparRrib7[1] = 90.;
612 pgparRrib7[2] = 5;
613 pgparRrib7[3] = 2.;
614 pgparRrib7[4] = 0.;
615 pgparRrib7[5] = 21.6;
616 pgparRrib7[6] = 23.1;
617 pgparRrib7[7] = pgparRrib7[4] + 1.55;
618 pgparRrib7[8] = pgparRrib7[5];
619 pgparRrib7[9] = pgparRrib7[6];
620
621 gMC->Gsvolu("FRR7", "PGON", idRoha, pgparRrib7, 10);
622
623 Float_t xposrrib7 = 0.0;
624 Float_t yposrrib7 = 0.0;
625 Float_t zposrrib7 = 0.0;
626
627 gMC->Gspos("FRR7",1, "FRM7", xposrrib7, yposrrib7, zposrrib7,0, "ONLY");
628
629 zposrrib7 = 3.45;
630
631 gMC->Gspos("FRR7",2, "FRM7", xposrrib7, yposrrib7, zposrrib7,0, "ONLY");
632
633 Float_t xposFr7 = 0.0;
634 Float_t yposFr7 = 0.0;
635 Float_t zposFr7 = -frame1[2];
636
637 gMC->Gspos("FRM7",1, "SQM3", xposFr7, yposFr7, zposFr7,0, "ONLY");
638 gMC->Gspos("FRM7",2, "SQM4", xposFr7, yposFr7, zposFr7,0, "ONLY");
639
ffc01fb1 640
ffc01fb1 641//......................................................................................
6dae0c71 642//Frame - 8
ffc01fb1 643
ffc01fb1 644
6dae0c71 645 Float_t frame8[3] ;
646 frame8[0] = 2.5/2.0;
647 frame8[1] = 1.2/2.0;
648 frame8[2] = frame1[2];
ffc01fb1 649
6dae0c71 650 gMC->Gsvolu("FRM8", "BOX", idPGF30, frame8, 3); //Frame - 2
ffc01fb1 651
6dae0c71 652 Float_t rrib8[3];
653 rrib8[0] = frame8[0]-1.0/2;
654 rrib8[1] = frame8[1];
655 rrib8[2] =(frame8[2]-0.95)/2.0;
ffc01fb1 656
6dae0c71 657 gMC->Gsvolu("FRR8", "BOX", idRoha, rrib8, 3);
658
659 Float_t xposrrib8 = -1.0/2;
660 Float_t yposrrib8 = 0.0;
661 Float_t zposrrib8 = frame8[2] - rrib8[2];
ffc01fb1 662
6dae0c71 663 gMC->Gspos("FRR8",1, "FRM8", xposrrib8, yposrrib8, zposrrib8,0, "ONLY");
664 gMC->Gspos("FRR8",2, "FRM8", xposrrib8, yposrrib8, -zposrrib8,0, "ONLY");
ffc01fb1 665
ffc01fb1 666
ffc01fb1 667
6dae0c71 668 Float_t xposFr8 = frame8[0] + 20.6;
669 Float_t yposFr8 = -frame8[1];
670 Float_t zposFr8 = 0.0;
ffc01fb1 671
6dae0c71 672 gMC->Gspos("FRM8",1, "SQM3", xposFr8, yposFr8, zposFr8,0, "ONLY");
673 gMC->Gspos("FRM8",2, "SQM4", xposFr8, yposFr8, zposFr8,0, "ONLY");
674
675
ffc01fb1 676
ffc01fb1 677
678//^^^^^^^^^^^^^^^^^^^^^^^^^ Sensitive volumes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
679
680 Float_t zsenv = 0.5; // distance between two cathode plane
681
682 //Segment-0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6dae0c71 683 bparH[0] = 94.5/2.;
684 bparH[1] = 1.2/2.;
685 bparH[2] = zsenv/2.;
686 gMC->Gsvolu("C3G0", "BOX", idGas, bparH, 3);
687 gMC->Gsvolu("C4G0", "BOX", idGas, bparH, 3);
ffc01fb1 688
689 //Segment-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
690 pgpar[0] = 0.;
6dae0c71 691 pgpar[1] = 90.;
692 pgpar[2] = 5;
ffc01fb1 693 pgpar[3] = 2.;
694 pgpar[4] = -zsenv/2.;
6dae0c71 695 pgpar[5] = 23.1;
696 pgpar[6] = 117.6;
ffc01fb1 697 pgpar[7] = zsenv/2.;
698 pgpar[8] = pgpar[5];
699 pgpar[9] = pgpar[6];
700 gMC->Gsvolu("C3G1", "PGON", idGas, pgpar, 10);
701 gMC->Gsvolu("C4G1", "PGON", idGas, pgpar, 10);
702
ffc01fb1 703
6dae0c71 704//Segment-2 - vertical box ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ffc01fb1 705
6dae0c71 706 bparV[0] = 1.0/2.;
707 bparV[1] = 95.5/2.;
708 bparV[2] = zsenv/2.;
709 gMC->Gsvolu("C3G2", "BOX", idGas, bparV, 3);
710 gMC->Gsvolu("C4G2", "BOX", idGas, bparV, 3);
ffc01fb1 711
6dae0c71 712//...........................................................................................
ffc01fb1 713
6dae0c71 714 xposHorBox = bparH[0] + 23.1;
715 yposHorBox = -bparH[1];
ffc01fb1 716
6dae0c71 717 xposVerBox = -bparV[0];
718 yposVerBox = bparV[1] + 23.1;
ffc01fb1 719
6dae0c71 720 gMC->Gspos("C3G0",1, "SQM3", xposHorBox,yposHorBox,0.,0, "ONLY");
721 gMC->Gspos("C3G1",1, "SQM3", 0.,0.,0.,0, "ONLY");
722 gMC->Gspos("C3G2",1, "SQM3", xposVerBox,yposVerBox,0.,0, "ONLY");
723
724
725 gMC->Gspos("C4G0",1, "SQM4", xposHorBox,yposHorBox,0.,0, "ONLY");
726 gMC->Gspos("C4G1",1, "SQM4", 0.,0.,0.,0, "ONLY");
727 gMC->Gspos("C4G2",1, "SQM4", xposVerBox,yposVerBox,0.,0, "ONLY");
ffc01fb1 728
ffc01fb1 729
730//^^^^^^^^^^^^^^^^^^^^^^^^^ Sensitive volumes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
731
732
733//##################################################################################################
734// Positioning Quadrant in chamber#3 and chamber#4
735//##################################################################################################
736/******Transformations for Quadrant**********************************************
737 || I => Quadrant I: no rotation
738 ||
739 II. || I. II => Quadrant II: Reflaction of Quadrant I in XZ plane
740 || => TGeoRotation("Qrot2",90.,180.,90.,90.,180.,0.);
741=============
742 || III => Quadrant III: 180 degree rotation of Quadrant I in XY plane
743 III. || IV. => TGeoRotation("Qrot3",90.,180.,90.,90.,180.,0.);
744 || IV => Quadrant IV:-180 degree rotation of Quadrant II in XY plane
745 => TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.);
746**********************************************************************************************/
747
89b0b88d 748 Int_t detElemId1 = 1; // quadrant I
749 Int_t detElemId2 = 0; // quadrant II
750 Int_t detElemId3 = 3; // quadrant III
751 Int_t detElemId4 = 2; // quadrant IV
ffc01fb1 752
6dae0c71 753 //Float_t halfChamber = zCbb + zCu + zRoha + zMeb + zEeb + zsenv/2;
e768a44b 754// cout<< "\n half_chamber \t" << half_chamber << endl;
6dae0c71 755
756 Float_t halfChamber = tpar1[2];// tpar1[2] = 6.8/2;
ffc01fb1 757
758// ------------------------------St2 Chamber3------------------------------------------------
759
760 // GetEnvelopes(2)->AddEnvelope("S3M0", 300, true,TGeoTranslation(0.,0.,0.));
6dae0c71 761 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId1, 1, TGeoTranslation( 0., 0., - halfChamber));
762 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId2, 2, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 763 TGeoRotation("Qrot3",90.,180.,90.,90.,180.,0.));
6dae0c71 764 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId3, 3, TGeoTranslation( 0., 0., - halfChamber),
ffc01fb1 765 TGeoRotation("Qrot3",90.,180.,90.,270.,0.,0.));
6dae0c71 766 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId4, 4, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 767 TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.));
768
769//--------------------------------St2 Chamber4-------------------------------------------------
770
6dae0c71 771 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId1, 1, TGeoTranslation( 0., 0., - halfChamber));
772 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId2, 2, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 773 TGeoRotation("Qrot2",90.,180.,90.,90.,180.,0.));
6dae0c71 774 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId3, 3, TGeoTranslation( 0., 0., - halfChamber),
ffc01fb1 775 TGeoRotation("Qrot3",90.,180.,90.,270.,0.,0.));
6dae0c71 776 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId4, 4, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 777 TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.));
778
779//**********************************************************************************************
780
6dae0c71 781}
a2b41b89 782//______________________________________________________________________________
783void AliMUONSt2GeometryBuilderV2::SetTransformations()
784{
785// Defines the transformations for the station2 chambers.
786// ---
787
c0404a6c 788 if (gAlice->GetModule("SHIL")) {
789 SetMotherVolume(2, "YOUT1");
790 SetMotherVolume(3, "YOUT1");
791 }
792
17832c49 793 // Define chamber volumes as virtual
794 SetVolume(2, "SC03", true);
795 SetVolume(3, "SC04", true);
796
b7ef3c96 797 Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
798 SetTranslation(2, TGeoTranslation(0., 0., zpos1));
a2b41b89 799
b7ef3c96 800 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3);
801 SetTranslation(3, TGeoTranslation(0., 0., zpos2));
a2b41b89 802}
803
804//______________________________________________________________________________
805void AliMUONSt2GeometryBuilderV2::SetSensitiveVolumes()
806{
807// Defines the sensitive volumes for station2 chambers.
808// ---
809
ffc01fb1 810 GetGeometry(2)->SetSensitiveVolume("C3G0");
811 GetGeometry(2)->SetSensitiveVolume("C3G1");
812 GetGeometry(2)->SetSensitiveVolume("C3G2");
ffc01fb1 813
814 GetGeometry(3)->SetSensitiveVolume("C4G0");
815 GetGeometry(3)->SetSensitiveVolume("C4G1");
816 GetGeometry(3)->SetSensitiveVolume("C4G2");
a2b41b89 817}
6dae0c71 818