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