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