bug fixed
[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
ffc01fb1 114//==================================================================================
e0470e0a 115// Plane
ffc01fb1 116//==================================================================================
117
118//Thickness of variour parts
e0470e0a 119 Float_t zCu = 0.005; // eff. cu in cathode pcb
120 Float_t zCbb = 0.04; //cathode pcb
121 Float_t zRoha = 2.5; // Rhocell
122 Float_t zMeb = 0.04; //Mech. exit board //0.08
123 Float_t zEeb = 0.04; //Effective electronic readout board //0.02
124
125 //starting Z-positions of various parts--- in Plane-1
126 Float_t zposCu = 0.25; // 2.5 mm => gap between anode & chatode plane
127 Float_t zposCbb = zposCu + zCu;
128 Float_t zposRoha = zposCbb + zCbb;
129 Float_t zposMeb = zposRoha + zRoha;
130 Float_t zposEeb = zposMeb + zMeb;
131
132 Float_t zposCuBar = zposCu + zCu/2.; //for segment 0 & 6
133 Float_t zposCbbBar = zposCbb + zCbb/2.;
134 Float_t zposRohaBar = zposRoha + zRoha/2.;
135 Float_t zposMebBar = zposMeb + zMeb/2.;
136 Float_t zposEebBar = zposEeb + zEeb/2.;
ffc01fb1 137
138
139 //Cathode PCB + Copper sheet + Rohacell + mech exit board + eff. electronic exit board
140
6dae0c71 141 //Segment-0 ~~~Horizantal box ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e0470e0a 142 Float_t bparH[3];
143 bparH[0] = 95.5/2.; // extension beyond 0 deg in x direction // 94.5
144 bparH[1] = 1.2/2.; // extension beyond 0 deg in y direction (3.7[total extn] - 2.5[frame dim])
145 bparH[2] = zCu/2.; //Thickness of Copper sheet
9eb6e4ee 146 gMC->Gsvolu("SCU0L", "BOX", idCU, bparH, 3);
e0470e0a 147
148 bparH[2] = zCbb/2.; // thickness of cathode sheet in z direction
9eb6e4ee 149 gMC->Gsvolu("SCB0L", "BOX", idPCB, bparH, 3);
e0470e0a 150
151 bparH[2] = zRoha/2.; //Thickness of Roha cell
9eb6e4ee 152 gMC->Gsvolu("SRH0L", "BOX", idRoha, bparH, 3);
ffc01fb1 153
e0470e0a 154 bparH[2] = zMeb/2; //Thickness of mechanical exit board
9eb6e4ee 155 gMC->Gsvolu("SMB0L", "BOX", idPCB, bparH, 3);
e0470e0a 156
157 bparH[2] = zEeb/2; //Thickness of effective electronic exit board
9eb6e4ee 158 gMC->Gsvolu("SEB0L", "BOX", idCU, bparH, 3);
e0470e0a 159
160 //Segment-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161 Float_t pgpar[10]; // polygon
162 pgpar[0] = 0.; // initial angle
163 pgpar[1] = 90.; // increment in angle starting from initial angle
164 pgpar[2] = 5; // number of side
165 pgpar[3] = 2.; // number of plane
166 pgpar[4] = -zCu/2.; // z-position of the first plane
167 pgpar[5] = 23.1; // innner radius first plane
168 pgpar[6] = 117.6; // outer radious first plane
169 pgpar[7] = zCu/2.; // z-position of the second plane
170 pgpar[8] = pgpar[5]; // innner radius of second plane
171 pgpar[9] = pgpar[6]; // outer radious of second plane
9eb6e4ee 172 gMC->Gsvolu("SCU1L", "PGON", idCU, pgpar, 10);
e0470e0a 173
174 pgpar[4] = -zCbb/2.; // z-position of the first plane
175 pgpar[7] = zCbb/2.; // Thickness of copper-sheet
9eb6e4ee 176 gMC->Gsvolu("SCB1L", "PGON", idPCB, pgpar, 10);
e0470e0a 177
178 pgpar[4] = -zRoha/2.; // Thickness of Roha cell
179 pgpar[7] = zRoha/2.; // Thickness of Roha cell
9eb6e4ee 180 gMC->Gsvolu("SRH1L", "PGON", idRoha, pgpar, 10);
6dae0c71 181
e0470e0a 182 pgpar[4] = -zMeb/2.; // Thickness of mechanical exit board
183 pgpar[7] = zMeb/2.; // Thickness of mechanical exit board
9eb6e4ee 184 gMC->Gsvolu("SMB1L", "PGON", idPCB, pgpar, 10);
e0470e0a 185
186 pgpar[4] = -zEeb/2.; // Thickness of electronic readout board
187 pgpar[7] = zEeb/2.; // Thickness of electronic readout board
9eb6e4ee 188 gMC->Gsvolu("SEB1L", "PGON", idCU, pgpar, 10);
6dae0c71 189
190
191//Segment-2 - vertical box (simalar to horizontal bar as in Segment 0)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
e0470e0a 193 Float_t bparV[3];
194
195 bparV[0] = 1.0/2.;
196 bparV[1] = 95.5/2.; // 94.5
197 bparV[2] = zCu/2.;
9eb6e4ee 198 gMC->Gsvolu("SCU2L", "BOX", idCU, bparV, 3);
e0470e0a 199
200 bparV[2] = zCbb/2.;
9eb6e4ee 201 gMC->Gsvolu("SCB2L", "BOX", idPCB, bparV, 3);
e0470e0a 202
203
204 bparV[2] = zRoha/2.;
9eb6e4ee 205 gMC->Gsvolu("SRH2L", "BOX", idRoha, bparV, 3);
e0470e0a 206
207 bparV[2] = zMeb/2;
9eb6e4ee 208 gMC->Gsvolu("SMB2L", "BOX", idPCB, bparV, 3);
e0470e0a 209
210 bparV[2] = zEeb/2;
9eb6e4ee 211 gMC->Gsvolu("SEB2L", "BOX", idCU, bparV, 3);
6dae0c71 212
e0470e0a 213 //....(Setting posion of Segment 0,1,2)..................................................................
214
215 Float_t xposHorBox = bparH[0] + 23.1; // 23.1 = 20.6(inner radius of qrd) + 2.5 (width of frame)
216 Float_t yposHorBox = -bparH[1];
217
218 Float_t xposVerBox = -bparV[0];
219 Float_t yposVerBox = bparV[1] + 23.1;
220
221
222 //Positioning the PCB
223
224
225 // chamber 3
9eb6e4ee 226 gMC->Gspos("SCB0L",1, "SQM3",xposHorBox,yposHorBox,zposCbbBar,0, "ONLY");
227 gMC->Gspos("SCB1L",1, "SQM3", 0.0,0.0,zposCbbBar,0, "ONLY");
228 gMC->Gspos("SCB2L",1, "SQM3",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");
e0470e0a 229
9eb6e4ee 230 gMC->Gspos("SCB0L",2, "SQM3",xposHorBox,yposHorBox,-zposCbbBar,0, "ONLY");
231 gMC->Gspos("SCB1L",2, "SQM3", 0.0,0.0,-zposCbbBar,0, "ONLY");
232 gMC->Gspos("SCB2L",2, "SQM3",xposVerBox,yposVerBox,-zposCbbBar,0, "ONLY");
e0470e0a 233
234 // chamber 4
9eb6e4ee 235 gMC->Gspos("SCB0L",3, "SQM4",xposHorBox,yposHorBox,zposCbbBar,0, "ONLY");
236 gMC->Gspos("SCB1L",3, "SQM4", 0.0,0.0,zposCbbBar,0, "ONLY");
237 gMC->Gspos("SCB2L",3, "SQM4",xposVerBox,yposVerBox,zposCbbBar,0, "ONLY");
e0470e0a 238
9eb6e4ee 239 gMC->Gspos("SCB0L",4, "SQM4",xposHorBox,yposHorBox,-zposCbbBar,0, "ONLY");
240 gMC->Gspos("SCB1L",4, "SQM4", 0.0,0.0,-zposCbbBar,0, "ONLY");
241 gMC->Gspos("SCB2L",4, "SQM4",xposVerBox,yposVerBox,-zposCbbBar,0, "ONLY");
e0470e0a 242
6dae0c71 243
e0470e0a 244 //Positioning Copper sheet
245
246 // chamber 3
6dae0c71 247
9eb6e4ee 248 gMC->Gspos("SCU0L",1, "SQM3",xposHorBox,yposHorBox,zposCuBar,0, "ONLY");
249 gMC->Gspos("SCU1L",1, "SQM3", 0.0,0.0,zposCuBar,0, "ONLY");
250 gMC->Gspos("SCU2L",1, "SQM3",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
e0470e0a 251
9eb6e4ee 252 gMC->Gspos("SCU0L",2, "SQM3",xposHorBox,yposHorBox,-zposCuBar,0, "ONLY");
253 gMC->Gspos("SCU1L",2, "SQM3", 0.0,0.0,-zposCuBar,0, "ONLY");
254 gMC->Gspos("SCU2L",2, "SQM3",xposVerBox,yposVerBox,-zposCuBar,0, "ONLY");
e0470e0a 255
256 // chamber 4
9eb6e4ee 257 gMC->Gspos("SCU0L",3, "SQM4",xposHorBox,yposHorBox,zposCuBar,0, "ONLY");
258 gMC->Gspos("SCU1L",3, "SQM4", 0.0,0.0,zposCuBar,0, "ONLY");
259 gMC->Gspos("SCU2L",3, "SQM4",xposVerBox,yposVerBox,zposCuBar,0, "ONLY");
e0470e0a 260
9eb6e4ee 261 gMC->Gspos("SCU0L",4, "SQM4",xposHorBox,yposHorBox,-zposCuBar,0, "ONLY");
262 gMC->Gspos("SCU1L",4, "SQM4", 0.0,0.0,-zposCuBar,0, "ONLY");
263 gMC->Gspos("SCU2L",4, "SQM4",xposVerBox,yposVerBox,-zposCuBar,0, "ONLY");
6dae0c71 264
e0470e0a 265 //Positioning Roha cell
266
267 // chamber 3
268
9eb6e4ee 269 gMC->Gspos("SRH0L",1, "SQM3",xposHorBox,yposHorBox,zposRohaBar,0, "ONLY");
270 gMC->Gspos("SRH1L",1, "SQM3", 0.0,0.0,zposRohaBar,0, "ONLY");
271 gMC->Gspos("SRH2L",1, "SQM3",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
e0470e0a 272
9eb6e4ee 273 gMC->Gspos("SRH0L",2, "SQM3",xposHorBox,yposHorBox,-zposRohaBar,0, "ONLY");
274 gMC->Gspos("SRH1L",2, "SQM3", 0.0,0.0,-zposRohaBar,0, "ONLY");
275 gMC->Gspos("SRH2L",2, "SQM3",xposVerBox,yposVerBox,-zposRohaBar,0, "ONLY");
e0470e0a 276
277 // chamber 4
278
9eb6e4ee 279 gMC->Gspos("SRH0L",3, "SQM4",xposHorBox,yposHorBox,zposRohaBar,0, "ONLY");
280 gMC->Gspos("SRH1L",3, "SQM4", 0.0,0.0,zposRohaBar,0, "ONLY");
281 gMC->Gspos("SRH2L",3, "SQM4",xposVerBox,yposVerBox,zposRohaBar,0, "ONLY");
e0470e0a 282
9eb6e4ee 283 gMC->Gspos("SRH0L",4, "SQM4",xposHorBox,yposHorBox,-zposRohaBar,0, "ONLY");
284 gMC->Gspos("SRH1L",4, "SQM4", 0.0,0.0,-zposRohaBar,0, "ONLY");
285 gMC->Gspos("SRH2L",4, "SQM4",xposVerBox,yposVerBox,-zposRohaBar,0, "ONLY");
ffc01fb1 286
e0470e0a 287 //Positioning of Mech. exit board
288
289 // chamber 3
290
9eb6e4ee 291 gMC->Gspos("SMB0L",1, "SQM3",xposHorBox,yposHorBox,zposMebBar,0, "ONLY");
292 gMC->Gspos("SMB1L",1, "SQM3", 0.0,0.0,zposMebBar,0, "ONLY");
293 gMC->Gspos("SMB2L",1, "SQM3",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
e0470e0a 294
9eb6e4ee 295 gMC->Gspos("SMB0L",2, "SQM3",xposHorBox,yposHorBox,-zposMebBar,0, "ONLY");
296 gMC->Gspos("SMB1L",2, "SQM3", 0.0,0.0,-zposMebBar,0, "ONLY");
297 gMC->Gspos("SMB2L",2, "SQM3",xposVerBox,yposVerBox,-zposMebBar,0, "ONLY");
e0470e0a 298 // chamber 4
299
9eb6e4ee 300 gMC->Gspos("SMB0L",3, "SQM4",xposHorBox,yposHorBox,zposMebBar,0, "ONLY");
301 gMC->Gspos("SMB1L",3, "SQM4", 0.0,0.0,zposMebBar,0, "ONLY");
302 gMC->Gspos("SMB2L",3, "SQM4",xposVerBox,yposVerBox,zposMebBar,0, "ONLY");
e0470e0a 303
9eb6e4ee 304 gMC->Gspos("SMB0L",4, "SQM4",xposHorBox,yposHorBox,-zposMebBar,0, "ONLY");
305 gMC->Gspos("SMB1L",4, "SQM4", 0.0,0.0,-zposMebBar,0, "ONLY");
306 gMC->Gspos("SMB2L",4, "SQM4",xposVerBox,yposVerBox,-zposMebBar,0, "ONLY");
e0470e0a 307
308 //Positioning of Electronic exit board
309
310
311 // chamber 3
ffc01fb1 312
9eb6e4ee 313 gMC->Gspos("SEB0L",1, "SQM3",xposHorBox,yposHorBox,zposEebBar,0, "ONLY");
314 gMC->Gspos("SEB1L",1, "SQM3", 0.0,0.0,zposEebBar,0, "ONLY");
315 gMC->Gspos("SEB2L",1, "SQM3",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
6dae0c71 316
9eb6e4ee 317 gMC->Gspos("SEB0L",2, "SQM3",xposHorBox,yposHorBox,-zposEebBar,0, "ONLY");
318 gMC->Gspos("SEB1L",2, "SQM3", 0.0,0.0,-zposEebBar,0, "ONLY");
319 gMC->Gspos("SEB2L",2, "SQM3",xposVerBox,yposVerBox,-zposEebBar,0, "ONLY");
e0470e0a 320 // chamber 4
321
9eb6e4ee 322 gMC->Gspos("SEB0L",3, "SQM4",xposHorBox,yposHorBox,zposEebBar,0, "ONLY");
323 gMC->Gspos("SEB1L",3, "SQM4", 0.0,0.0,zposEebBar,0, "ONLY");
324 gMC->Gspos("SEB2L",3, "SQM4",xposVerBox,yposVerBox,zposEebBar,0, "ONLY");
e0470e0a 325
9eb6e4ee 326 gMC->Gspos("SEB0L",4, "SQM4",xposHorBox,yposHorBox,-zposEebBar,0, "ONLY");
327 gMC->Gspos("SEB1L",4, "SQM4", 0.0,0.0,-zposEebBar,0, "ONLY");
328 gMC->Gspos("SEB2L",4, "SQM4",xposVerBox,yposVerBox,-zposEebBar,0, "ONLY");
e0470e0a 329
330
331 //----------------------------------------------------------------------
332 // Frames
333 //----------------------------------------------------------------------
334 //Frame-1
335
336 Float_t frame1[3] ;
337 frame1[0] = 101.0/2.; //100.6 = 94.5 + 2.5 + 3.6
338 frame1[1] = 2.5/2.;
339 frame1[2] = 5.0/2.;
340
9eb6e4ee 341 gMC->Gsvolu("SFRM1", "BOX", idPGF30, frame1, 3); //Frame - 1 // fill with pkk GF30
e0470e0a 342
343 Float_t arib1[3];
344 arib1[0] = frame1[0];
345 arib1[1] = 0.9/2.;
346 arib1[2] =(frame1[2]-0.95)/2.0;
347
9eb6e4ee 348 gMC->Gsvolu("SFRA1", "BOX", idAir, arib1, 3); // fill with air
e0470e0a 349
350 Float_t xposarib1 = 0;
351 Float_t yposarib1 = -frame1[1] + arib1[1];
352 Float_t zposarib1 = frame1[2] - arib1[2];
353
9eb6e4ee 354 gMC->Gspos("SFRA1",1, "SFRM1", xposarib1, yposarib1, zposarib1,0, "ONLY"); //replace pkk GF30 with air(b)
355 gMC->Gspos("SFRA1",2, "SFRM1", xposarib1, yposarib1, -zposarib1,0, "ONLY"); //replace pkk GF30 with air(nb)
e0470e0a 356
357 Float_t rrib1[3];
358 rrib1[0] = frame1[0];
359 rrib1[1] = 0.6/2.;
360 rrib1[2] =(frame1[2]-0.95)/2.0;
361
9eb6e4ee 362 gMC->Gsvolu("SFRR1", "BOX", idRoha, rrib1, 3); // fill with rohacell
e0470e0a 363
364 Float_t xposrrib1 = 0.0;
365 Float_t yposrrib1 = frame1[1] - rrib1[1];
366 Float_t zposrrib1 = frame1[2] - rrib1[2];
367
9eb6e4ee 368 gMC->Gspos("SFRR1",1, "SFRM1", xposrrib1, yposrrib1, zposrrib1,0, "ONLY");//replace pkk GF30 with rohacell
369 gMC->Gspos("SFRR1",2, "SFRM1", xposrrib1, yposrrib1, -zposrrib1,0, "ONLY");//replace pkk GF30 with rohacell
e0470e0a 370
371
372 Float_t xposFr1 = frame1[0] + 20.6;
373 Float_t yposFr1 = -3.7 + frame1[1] ;
374 Float_t zposFr1 = 0.0;
375
9eb6e4ee 376 gMC->Gspos("SFRM1",1, "SQM3", xposFr1, yposFr1, zposFr1,0, "ONLY");// frame -1
377 gMC->Gspos("SFRM1",2, "SQM4", xposFr1, yposFr1, zposFr1,0, "ONLY");// frame -1
e0470e0a 378
379
380 //......................................................................................
381 //Frame-2
6dae0c71 382
e0470e0a 383 Float_t frame2[3];
384 frame2[0] = 4.0/2.;
385 frame2[1] = 1.2/2.;
386 frame2[2] = 5.0/2;
387
9eb6e4ee 388 gMC->Gsvolu("SFRM2", "BOX", idPGF30, frame2, 3); //Frame - 2
e0470e0a 389
390 Float_t rrib2[3];
391 rrib2[0] = frame2[0]-1.0/2.0;
392 rrib2[1] = frame2[1];
393 rrib2[2] =(frame2[2]-0.95)/2.0;
6dae0c71 394
9eb6e4ee 395 gMC->Gsvolu("SFRR2", "BOX", idRoha, rrib2, 3);
6dae0c71 396
e0470e0a 397 Float_t xposrrib2 = -1.0/2.0;
398 Float_t yposrrib2 = 0.0;
399 Float_t zposrrib2 = frame2[2] - rrib2[2];
400
9eb6e4ee 401 gMC->Gspos("SFRR2",1, "SFRM2", xposrrib2, yposrrib2, zposrrib2,0, "ONLY");//replace pkk GF30 with rohacell
402 gMC->Gspos("SFRR2",2, "SFRM2", xposrrib2, yposrrib2, -zposrrib2,0, "ONLY");//replace pkk GF30 with roha
e0470e0a 403
ffc01fb1 404
e0470e0a 405
406 Float_t xposFr2 = frame2[0] + 117.6;
407 Float_t yposFr2 = -frame2[1];
408 Float_t zposFr2 = 0.0;
409
9eb6e4ee 410 gMC->Gspos("SFRM2",1, "SQM3", xposFr2, yposFr2, zposFr2,0, "MANY");//global positing of frame in SQM3
411 gMC->Gspos("SFRM2",2, "SQM4", xposFr2, yposFr2, zposFr2,0, "MANY");//global positing of frame in SQM4
e0470e0a 412
413
414 //......................................................................................
415
416 //Frame-3
417
418 Float_t pgparFr3[10];
419 pgparFr3[0] = 0.;
420 pgparFr3[1] = 90.;
421 pgparFr3[2] = 5;
422 pgparFr3[3] = 2.;
423 pgparFr3[4] = 0.;
424 pgparFr3[5] = 117.6;
425 pgparFr3[6] = 121.6;
426 pgparFr3[7] = pgparFr3[4] + 5.0;
427 pgparFr3[8] = pgparFr3[5];
428 pgparFr3[9] = pgparFr3[6];
429
9eb6e4ee 430 gMC->Gsvolu("SFRM3", "PGON", idPGF30, pgparFr3, 10);
e0470e0a 431
432 Float_t pgparRrib3[10];
433 pgparRrib3[0] = 0.;
434 pgparRrib3[1] = 90.;
435 pgparRrib3[2] = 5;
436 pgparRrib3[3] = 2.;
437 pgparRrib3[4] = 0.;
438 pgparRrib3[5] = 117.6;
439 pgparRrib3[6] = 120.6;
440 pgparRrib3[7] = pgparRrib3[4] +1.55 ;
441 pgparRrib3[8] = pgparRrib3[5];
442 pgparRrib3[9] = pgparRrib3[6];
443
9eb6e4ee 444 gMC->Gsvolu("SFRR3", "PGON", idRoha, pgparRrib3, 10);
e0470e0a 445
446 Float_t xposrrib3 = 0.0;
447 Float_t yposrrib3 = 0.0;
448 Float_t zposrrib3 = 0.0;
ffc01fb1 449
9eb6e4ee 450 gMC->Gspos("SFRR3",1, "SFRM3", xposrrib3, yposrrib3, zposrrib3,0, "ONLY");
e0470e0a 451
452 zposrrib3 = 3.45;
453
9eb6e4ee 454 gMC->Gspos("SFRR3",2, "SFRM3", xposrrib3, yposrrib3, zposrrib3,0, "ONLY");
e0470e0a 455
6dae0c71 456
e0470e0a 457
458 Float_t xposFr3 = 0.0;
459 Float_t yposFr3 = 0.0;
460 Float_t zposFr3 = -frame1[2];
6dae0c71 461
9eb6e4ee 462 gMC->Gspos("SFRM3",1, "SQM3", xposFr3, yposFr3, zposFr3,0, "ONLY");// frame -1
463 gMC->Gspos("SFRM3",2, "SQM4", xposFr3, yposFr3, zposFr3,0, "ONLY");// frame -1
e0470e0a 464
465
466 //......................................................................................
467 //Frame-4
468
469 Float_t frame4[3];
470 frame4[0] = 1.0/2.;
471 frame4[1] = 4.0/2.;
472 frame4[2] = frame1[2];
473
9eb6e4ee 474 gMC->Gsvolu("SFRM4", "BOX", idPGF30, frame4, 3);
e0470e0a 475
476 Float_t rrib4[3];
477 rrib4[0] = frame4[0];
478 rrib4[1] = frame4[1]-1.0/2;
479 rrib4[2] =(frame4[2]-0.95)/2.0;
ffc01fb1 480
9eb6e4ee 481 gMC->Gsvolu("SFRR4", "BOX", idRoha, rrib4, 3);
e0470e0a 482
483 Float_t xposrrib4 = 0.0;
484 Float_t yposrrib4 = -1.0/2;
485 Float_t zposrrib4 = frame4[2] - rrib4[2];
486
9eb6e4ee 487 gMC->Gspos("SFRR4",1, "SFRM4", xposrrib4, yposrrib4, zposrrib4,0, "ONLY");
488 gMC->Gspos("SFRR4",2, "SFRM4", xposrrib4, yposrrib4, -zposrrib4,0, "ONLY");
e0470e0a 489
ffc01fb1 490
e0470e0a 491
492 Float_t xposFr4 = -frame4[0];
493 Float_t yposFr4 = -frame4[1] + 117.6;
494 Float_t zposFr4 = 0.0;
495
9eb6e4ee 496 gMC->Gspos("SFRM4",1, "SQM3", xposFr4, yposFr4, zposFr4,0, "MANY");
497 gMC->Gspos("SFRM4",2, "SQM4", xposFr4, yposFr4, zposFr4,0, "MANY");
e0470e0a 498
499
500 //......................................................................................
501 //Frame-5
502 Float_t frame5[3] ;
503 frame5[0] = 2.7/2.;
504 frame5[1] = 101.0/2.;
505 frame5[2] = 5.0/2.;
506
9eb6e4ee 507 gMC->Gsvolu("SFRM5", "BOX", idPGF30, frame5, 3); //Frame - 1
6dae0c71 508
e0470e0a 509 Float_t arib5[3];
510 arib5[0] = 0.9/2.0;
511 arib5[1] = frame5[1];
512 arib5[2] = (frame5[2]-0.95)/2.0;
513
9eb6e4ee 514 gMC->Gsvolu("SFRA5", "BOX", idAir, arib5, 3);
e0470e0a 515
516 Float_t xposarib5 = -frame5[0] + arib5[0];
517 Float_t yposarib5 = 0.0;
518 Float_t zposarib5 = frame5[2] - arib5[2];
6dae0c71 519
9eb6e4ee 520 gMC->Gspos("SFRA5",1, "SFRM5", xposarib5, yposarib5, zposarib5,0, "ONLY");
521 gMC->Gspos("SFRA5",2, "SFRM5", xposarib5, yposarib5, -zposarib5,0, "ONLY");
e0470e0a 522
523 Float_t rrib5[3];
524 rrib5[0] = 0.8/2.0;
525 rrib5[1] = frame5[1];
526 rrib5[2] = (frame5[2]-0.95)/2.0;
527
9eb6e4ee 528 gMC->Gsvolu("SFRR5", "BOX", idRoha, rrib5, 3);
e0470e0a 529
530 Float_t xposrrib5 = frame5[0] - rrib5[0];
531 Float_t yposrrib5 = 0.0;
532 Float_t zposrrib5 = frame5[2] - rrib5[2];
533
9eb6e4ee 534 gMC->Gspos("SFRR5",1, "SFRM5", xposrrib5, yposrrib5, zposrrib5,0, "ONLY");
535 gMC->Gspos("SFRR5",2, "SFRM5", xposrrib5, yposrrib5, -zposrrib5,0, "ONLY");
e0470e0a 536
537 Float_t xposFr5 = -3.7 + frame5[0];
538 Float_t yposFr5 = frame5[1] + 20.6;
539 Float_t zposFr5 = 0.0;
540
9eb6e4ee 541 gMC->Gspos("SFRM5",1, "SQM3", xposFr5, yposFr5, zposFr5,0, "ONLY");
542 gMC->Gspos("SFRM5",2, "SQM4", xposFr5, yposFr5, zposFr5,0, "ONLY");
e0470e0a 543
544 //......................................................................................
545 //Frame -6
546
547 Float_t frame6[3];
548 frame6[0] = 1.0/2.;
549 frame6[1] = 2.5/2.;
550 frame6[2] = frame1[2];
551
9eb6e4ee 552 gMC->Gsvolu("SFRM6", "BOX", idPGF30, frame6, 3);
e0470e0a 553
554 Float_t rrib6[3];
555 rrib6[0] = frame6[0];
556 rrib6[1] = 1.5/2.;
557 rrib6[2] =(frame2[2]-0.95)/2.0;
ffc01fb1 558
9eb6e4ee 559 gMC->Gsvolu("SFRR6", "BOX", idRoha, rrib6, 3);
e0470e0a 560
561 Float_t xposrrib6 = 0.0;
562 Float_t yposrrib6 = 1.0/2.0;
563 Float_t zposrrib6 = frame6[2] - rrib6[2];
ffc01fb1 564
9eb6e4ee 565 gMC->Gspos("SFRR6",1, "SFRM6", xposrrib6, yposrrib6, zposrrib6,0, "ONLY");
566 gMC->Gspos("SFRR6",2, "SFRM6", xposrrib6, yposrrib6, -zposrrib6,0, "ONLY");
e0470e0a 567
568
569
570 Float_t xposFr6 = -frame6[0];
571 Float_t yposFr6 = frame6[1] + 20.6;
572 Float_t zposFr6 = 0.0;
ffc01fb1 573
9eb6e4ee 574 gMC->Gspos("SFRM6",1, "SQM3", xposFr6, yposFr6, zposFr6,0, "ONLY");
575 gMC->Gspos("SFRM6",2, "SQM4", xposFr6, yposFr6, zposFr6,0, "ONLY");
e0470e0a 576
577
ffc01fb1 578//......................................................................................
6dae0c71 579//Frame - 7 inner pgon
e0470e0a 580
581 Float_t pgparFr7[10];
582 pgparFr7[0] = 0.;
583 pgparFr7[1] = 90.;
584 pgparFr7[2] = 5;
585 pgparFr7[3] = 2.;
586 pgparFr7[4] = 0.;
587 pgparFr7[5] = 20.6;
588 pgparFr7[6] = 23.1;
589 pgparFr7[7] = pgparFr7[4] + 5.0;
590 pgparFr7[8] = pgparFr7[5];
591 pgparFr7[9] = pgparFr7[6];
592
9eb6e4ee 593 gMC->Gsvolu("SFRM7", "PGON", idPGF30, pgparFr7, 10);
e0470e0a 594
595 Float_t pgparRrib7[10];
596 pgparRrib7[0] = 0.;
597 pgparRrib7[1] = 90.;
598 pgparRrib7[2] = 5;
599 pgparRrib7[3] = 2.;
600 pgparRrib7[4] = 0.;
601 pgparRrib7[5] = 21.6;
602 pgparRrib7[6] = 23.1;
603 pgparRrib7[7] = pgparRrib7[4] + 1.55;
604 pgparRrib7[8] = pgparRrib7[5];
605 pgparRrib7[9] = pgparRrib7[6];
606
9eb6e4ee 607 gMC->Gsvolu("SFRR7", "PGON", idRoha, pgparRrib7, 10);
e0470e0a 608
609 Float_t xposrrib7 = 0.0;
610 Float_t yposrrib7 = 0.0;
611 Float_t zposrrib7 = 0.0;
612
9eb6e4ee 613 gMC->Gspos("SFRR7",1, "SFRM7", xposrrib7, yposrrib7, zposrrib7,0, "ONLY");
e0470e0a 614
615 zposrrib7 = 3.45;
616
9eb6e4ee 617 gMC->Gspos("SFRR7",2, "SFRM7", xposrrib7, yposrrib7, zposrrib7,0, "ONLY");
e0470e0a 618
619 Float_t xposFr7 = 0.0;
620 Float_t yposFr7 = 0.0;
621 Float_t zposFr7 = -frame1[2];
622
9eb6e4ee 623 gMC->Gspos("SFRM7",1, "SQM3", xposFr7, yposFr7, zposFr7,0, "ONLY");
624 gMC->Gspos("SFRM7",2, "SQM4", xposFr7, yposFr7, zposFr7,0, "ONLY");
e0470e0a 625
626
627 //......................................................................................
628 //Frame - 8
6dae0c71 629
e0470e0a 630
631 Float_t frame8[3] ;
632 frame8[0] = 2.5/2.0;
633 frame8[1] = 1.2/2.0;
634 frame8[2] = frame1[2];
635
9eb6e4ee 636 gMC->Gsvolu("SFRM8", "BOX", idPGF30, frame8, 3); //Frame - 2
6dae0c71 637
e0470e0a 638 Float_t rrib8[3];
639 rrib8[0] = frame8[0]-1.0/2;
640 rrib8[1] = frame8[1];
641 rrib8[2] =(frame8[2]-0.95)/2.0;
642
9eb6e4ee 643 gMC->Gsvolu("SFRR8", "BOX", idRoha, rrib8, 3);
e0470e0a 644
645 Float_t xposrrib8 = -1.0/2;
646 Float_t yposrrib8 = 0.0;
647 Float_t zposrrib8 = frame8[2] - rrib8[2];
648
9eb6e4ee 649 gMC->Gspos("SFRR8",1, "SFRM8", xposrrib8, yposrrib8, zposrrib8,0, "ONLY");
650 gMC->Gspos("SFRR8",2, "SFRM8", xposrrib8, yposrrib8, -zposrrib8,0, "ONLY");
e0470e0a 651
652
653
654 Float_t xposFr8 = frame8[0] + 20.6;
655 Float_t yposFr8 = -frame8[1];
656 Float_t zposFr8 = 0.0;
657
9eb6e4ee 658 gMC->Gspos("SFRM8",1, "SQM3", xposFr8, yposFr8, zposFr8,0, "ONLY");
659 gMC->Gspos("SFRM8",2, "SQM4", xposFr8, yposFr8, zposFr8,0, "ONLY");
e0470e0a 660
661
662
ffc01fb1 663
e0470e0a 664 //^^^^^^^^^^^^^^^^^^^^^^^^^ Sensitive volumes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
665
666 Float_t zsenv = 0.5; // distance between two cathode plane
667
668 //Segment-0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
669 bparH[0] = 94.5/2.;
670 bparH[1] = 1.2/2.;
671 bparH[2] = zsenv/2.;
9eb6e4ee 672 gMC->Gsvolu("SC3G0", "BOX", idGas, bparH, 3);
673 gMC->Gsvolu("SC4G0", "BOX", idGas, bparH, 3);
e0470e0a 674
ffc01fb1 675 //Segment-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e0470e0a 676 pgpar[0] = 0.;
677 pgpar[1] = 90.;
678 pgpar[2] = 5;
679 pgpar[3] = 2.;
680 pgpar[4] = -zsenv/2.;
681 pgpar[5] = 23.1;
682 pgpar[6] = 117.6;
683 pgpar[7] = zsenv/2.;
684 pgpar[8] = pgpar[5];
685 pgpar[9] = pgpar[6];
9eb6e4ee 686 gMC->Gsvolu("SC3G1", "PGON", idGas, pgpar, 10);
687 gMC->Gsvolu("SC4G1", "PGON", idGas, pgpar, 10);
e0470e0a 688
ffc01fb1 689
e0470e0a 690 //Segment-2 - vertical box ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
691
692 bparV[0] = 1.0/2.;
693 bparV[1] = 95.5/2.;
694 bparV[2] = zsenv/2.;
9eb6e4ee 695 gMC->Gsvolu("SC3G2", "BOX", idGas, bparV, 3);
696 gMC->Gsvolu("SC4G2", "BOX", idGas, bparV, 3);
e0470e0a 697
698 //...........................................................................................
699
700 xposHorBox = bparH[0] + 23.1;
701 yposHorBox = -bparH[1];
702
703 xposVerBox = -bparV[0];
704 yposVerBox = bparV[1] + 23.1;
705
9eb6e4ee 706 gMC->Gspos("SC3G0",1, "SQM3", xposHorBox,yposHorBox,0.,0, "ONLY");
707 gMC->Gspos("SC3G1",1, "SQM3", 0.,0.,0.,0, "ONLY");
708 gMC->Gspos("SC3G2",1, "SQM3", xposVerBox,yposVerBox,0.,0, "ONLY");
e0470e0a 709
710
9eb6e4ee 711 gMC->Gspos("SC4G0",1, "SQM4", xposHorBox,yposHorBox,0.,0, "ONLY");
712 gMC->Gspos("SC4G1",1, "SQM4", 0.,0.,0.,0, "ONLY");
713 gMC->Gspos("SC4G2",1, "SQM4", xposVerBox,yposVerBox,0.,0, "ONLY");
e0470e0a 714
715
716 //^^^^^^^^^^^^^^^^^^^^^^^^^ Sensitive volumes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ffc01fb1 717
ffc01fb1 718
719
720//##################################################################################################
721// Positioning Quadrant in chamber#3 and chamber#4
722//##################################################################################################
723/******Transformations for Quadrant**********************************************
724 || I => Quadrant I: no rotation
725 ||
726 II. || I. II => Quadrant II: Reflaction of Quadrant I in XZ plane
727 || => TGeoRotation("Qrot2",90.,180.,90.,90.,180.,0.);
728=============
729 || III => Quadrant III: 180 degree rotation of Quadrant I in XY plane
730 III. || IV. => TGeoRotation("Qrot3",90.,180.,90.,90.,180.,0.);
731 || IV => Quadrant IV:-180 degree rotation of Quadrant II in XY plane
732 => TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.);
733**********************************************************************************************/
734
89b0b88d 735 Int_t detElemId1 = 1; // quadrant I
736 Int_t detElemId2 = 0; // quadrant II
737 Int_t detElemId3 = 3; // quadrant III
738 Int_t detElemId4 = 2; // quadrant IV
ffc01fb1 739
6dae0c71 740 //Float_t halfChamber = zCbb + zCu + zRoha + zMeb + zEeb + zsenv/2;
e768a44b 741// cout<< "\n half_chamber \t" << half_chamber << endl;
6dae0c71 742
743 Float_t halfChamber = tpar1[2];// tpar1[2] = 6.8/2;
ffc01fb1 744
745// ------------------------------St2 Chamber3------------------------------------------------
746
747 // GetEnvelopes(2)->AddEnvelope("S3M0", 300, true,TGeoTranslation(0.,0.,0.));
6dae0c71 748 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId1, 1, TGeoTranslation( 0., 0., - halfChamber));
749 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId2, 2, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 750 TGeoRotation("Qrot3",90.,180.,90.,90.,180.,0.));
6dae0c71 751 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId3, 3, TGeoTranslation( 0., 0., - halfChamber),
ffc01fb1 752 TGeoRotation("Qrot3",90.,180.,90.,270.,0.,0.));
6dae0c71 753 GetEnvelopes(2)->AddEnvelope("SQM3", 300+detElemId4, 4, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 754 TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.));
755
756//--------------------------------St2 Chamber4-------------------------------------------------
757
6dae0c71 758 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId1, 1, TGeoTranslation( 0., 0., - halfChamber));
759 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId2, 2, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 760 TGeoRotation("Qrot2",90.,180.,90.,90.,180.,0.));
6dae0c71 761 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId3, 3, TGeoTranslation( 0., 0., - halfChamber),
ffc01fb1 762 TGeoRotation("Qrot3",90.,180.,90.,270.,0.,0.));
6dae0c71 763 GetEnvelopes(3)->AddEnvelope("SQM4", 400+detElemId4, 4, TGeoTranslation( 0., 0., + halfChamber),
ffc01fb1 764 TGeoRotation("Qrot4",90.,0.,90.,-90.,180.,0.));
765
766//**********************************************************************************************
767
6dae0c71 768}
a2b41b89 769//______________________________________________________________________________
b96f7067 770void AliMUONSt2GeometryBuilderV2::SetVolumes()
a2b41b89 771{
b96f7067 772/// Defines the volumes for the station2 chambers.
a2b41b89 773
c0404a6c 774 if (gAlice->GetModule("SHIL")) {
775 SetMotherVolume(2, "YOUT1");
776 SetMotherVolume(3, "YOUT1");
777 }
778
17832c49 779 // Define chamber volumes as virtual
780 SetVolume(2, "SC03", true);
781 SetVolume(3, "SC04", true);
b96f7067 782}
783
784//______________________________________________________________________________
785void AliMUONSt2GeometryBuilderV2::SetTransformations()
786{
787/// Defines the transformations for the station2 chambers.
17832c49 788
b7ef3c96 789 Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2);
790 SetTranslation(2, TGeoTranslation(0., 0., zpos1));
a2b41b89 791
b7ef3c96 792 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3);
793 SetTranslation(3, TGeoTranslation(0., 0., zpos2));
a2b41b89 794}
795
796//______________________________________________________________________________
797void AliMUONSt2GeometryBuilderV2::SetSensitiveVolumes()
798{
71a2d3aa 799/// Defines the sensitive volumes for station2 chambers.
a2b41b89 800
9eb6e4ee 801 GetGeometry(2)->SetSensitiveVolume("SC3G0");
802 GetGeometry(2)->SetSensitiveVolume("SC3G1");
803 GetGeometry(2)->SetSensitiveVolume("SC3G2");
ffc01fb1 804
9eb6e4ee 805 GetGeometry(3)->SetSensitiveVolume("SC4G0");
806 GetGeometry(3)->SetSensitiveVolume("SC4G1");
807 GetGeometry(3)->SetSensitiveVolume("SC4G2");
a2b41b89 808}
6dae0c71 809