]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONv1.cxx
Gsbool calls added to resolve MANY. (I. Hrivnacova)
[u/mrichter/AliRoot.git] / MUON / AliMUONv1.cxx
CommitLineData
a9e2aefa 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 *
2c799aa2 12 * about the suitability of this software for any purpeateose. It is *
a9e2aefa 13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
03da3c56 18Revision 1.31.4.2 2002/07/24 10:07:21 alibrary
19Updating VirtualMC
20
3f08857e 21Revision 1.33 2002/07/23 10:02:46 morsch
22All volume names start with "S".
23
b74f1c6a 24Revision 1.32 2002/05/02 12:51:10 morsch
25For G4: gMC->VolId(...) replaced by gAlice->GetModule(...).
26
fe713e43 27Revision 1.31 2002/03/13 07:55:04 jchudoba
28Correction of the errourness last commit.
29
4b1670dc 30Revision 1.29 2001/06/21 14:54:37 morsch
31Put volumes of station 3 into DIPO if present. (A. de Falco)
32
2724ae40 33Revision 1.28 2001/05/16 14:57:17 alibrary
34New files for folders and Stack
35
9e1a0ddb 36Revision 1.27 2001/04/06 11:24:43 morsch
37Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class.
38Static method Build() builds the MUON system out of chambers, segmentation and response.
39
be3bb6c1 40Revision 1.26 2001/03/17 10:07:20 morsch
41Correct inconsistent variable name / method name / comments.
42
2eb55fab 43Revision 1.25 2001/03/16 15:32:06 morsch
44Corrections of overlap with beam shield and dipole (A. de Falco)
45
21a18f36 46Revision 1.24 2001/03/14 17:22:15 pcrochet
47Geometry of the trigger chambers : a vertical gap of has been introduced around x=0 according fig.3.27 of the TDR (P.Dupieux)
48
236fe2c5 49Revision 1.23 2001/01/18 15:23:49 egangler
50Bug correction in StepManager :
51Now the systematic offset with angle is cured
52
e0f71fb7 53Revision 1.22 2001/01/17 21:01:21 hristov
54Unused variable removed
55
a7e8b51a 56Revision 1.21 2000/12/20 13:00:22 egangler
57
58Added charge correlation between cathods.
59In Config_slat.C, use
60 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
61 q1/q2 to 11 % (number from Alberto)
62 This is stored in AliMUONChamber fChargeCorrel member.
63 At generation time, when a tracks enters the volume,
64 AliMUONv1::StepManager calls
65 AliMUONChamber::ChargeCorrelationInit() to set the current value of
66 fCurrentCorrel which is then used at Disintegration level to scale
67 appropriately the PadHit charges.
68
681d067b 69Revision 1.20 2000/12/04 17:48:23 gosset
70Modifications for stations 1 et 2 mainly:
71* station 1 with 4 mm gas gap and smaller cathode segmentation...
72* stations 1 and 2 with "grey" frame crosses
73* mean noise at 1.5 ADC channel
74* Ar-CO2 gas (80%+20%)
75
b64652f5 76Revision 1.19 2000/12/02 17:15:46 morsch
77Correction of dead zones in inner regions of stations 3-5
78Correction of length of slats 3 and 9 of station 4.
79
a083207d 80Revision 1.17 2000/11/24 12:57:10 morsch
81New version of geometry for stations 3-5 "Slats" (A. de Falco)
82 - sensitive region at station 3 inner radius
83 - improved volume tree structure
84
3c084d9f 85Revision 1.16 2000/11/08 13:01:40 morsch
86Chamber half-planes of stations 3-5 at different z-positions.
87
e1ad7d45 88Revision 1.15 2000/11/06 11:39:02 morsch
89Bug in StepManager() corrected.
90
e3cf5faa 91Revision 1.14 2000/11/06 09:16:50 morsch
92Avoid overlap of slat volumes.
93
2c799aa2 94Revision 1.13 2000/10/26 07:33:44 morsch
95Correct x-position of slats in station 5.
96
8013c580 97Revision 1.12 2000/10/25 19:55:35 morsch
98Switches for each station individually for debug and lego.
99
b17c0c87 100Revision 1.11 2000/10/22 16:44:01 morsch
101Update of slat geometry for stations 3,4,5 (A. deFalco)
102
f9f7c205 103Revision 1.10 2000/10/12 16:07:04 gosset
104StepManager:
105* SigGenCond only called for tracking chambers,
106 hence no more division by 0,
107 and may use last ALIROOT/dummies.C with exception handling;
108* "10" replaced by "AliMUONConstants::NTrackingCh()".
109
a75f073c 110Revision 1.9 2000/10/06 15:37:22 morsch
111Problems with variable redefinition in for-loop solved.
112Variable names starting with u-case letters changed to l-case.
113
6c5ddcfa 114Revision 1.8 2000/10/06 09:06:31 morsch
115Include Slat chambers (stations 3-5) into geometry (A. de Falco)
116
1e8fff9c 117Revision 1.7 2000/10/02 21:28:09 fca
118Removal of useless dependecies via forward declarations
119
94de3818 120Revision 1.6 2000/10/02 17:20:45 egangler
121Cleaning of the code (continued ) :
122-> coding conventions
123-> void Streamers
124-> some useless includes removed or replaced by "class" statement
125
8c449e83 126Revision 1.5 2000/06/28 15:16:35 morsch
127(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
128to allow development of slat-muon chamber simulation and reconstruction code in the MUON
129framework. The changes should have no side effects (mostly dummy arguments).
130(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
131of chambers with overlapping modules (MakePadHits, Disintegration).
132
802a864d 133Revision 1.4 2000/06/26 14:02:38 morsch
134Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
135
f665c1ea 136Revision 1.3 2000/06/22 14:10:05 morsch
137HP scope problems corrected (PH)
138
e17592e9 139Revision 1.2 2000/06/15 07:58:49 morsch
140Code from MUON-dev joined
141
a9e2aefa 142Revision 1.1.2.14 2000/06/14 14:37:25 morsch
143Initialization of TriggerCircuit added (PC)
144
145Revision 1.1.2.13 2000/06/09 21:55:47 morsch
146Most coding rule violations corrected.
147
148Revision 1.1.2.12 2000/05/05 11:34:29 morsch
149Log inside comments.
150
151Revision 1.1.2.11 2000/05/05 10:06:48 morsch
152Coding Rule violations regarding trigger section corrected (CP)
153Log messages included.
154*/
155
156/////////////////////////////////////////////////////////
157// Manager and hits classes for set:MUON version 0 //
158/////////////////////////////////////////////////////////
159
160#include <TTUBE.h>
161#include <TNode.h>
162#include <TRandom.h>
163#include <TLorentzVector.h>
164#include <iostream.h>
165
166#include "AliMUONv1.h"
167#include "AliRun.h"
168#include "AliMC.h"
94de3818 169#include "AliMagF.h"
a9e2aefa 170#include "AliCallf77.h"
171#include "AliConst.h"
172#include "AliMUONChamber.h"
173#include "AliMUONHit.h"
174#include "AliMUONPadHit.h"
f665c1ea 175#include "AliMUONConstants.h"
8c449e83 176#include "AliMUONTriggerCircuit.h"
be3bb6c1 177#include "AliMUONFactory.h"
a9e2aefa 178
179ClassImp(AliMUONv1)
180
181//___________________________________________
37c0cd40 182AliMUONv1::AliMUONv1() : AliMUON()
a9e2aefa 183{
184// Constructor
37c0cd40 185 fChambers = 0;
a9e2aefa 186}
187
188//___________________________________________
189AliMUONv1::AliMUONv1(const char *name, const char *title)
190 : AliMUON(name,title)
191{
192// Constructor
be3bb6c1 193 AliMUONFactory::Build(this, title);
a9e2aefa 194}
195
196//___________________________________________
197void AliMUONv1::CreateGeometry()
198{
199//
200// Note: all chambers have the same structure, which could be
201// easily parameterised. This was intentionally not done in order
202// to give a starting point for the implementation of the actual
203// design of each station.
204 Int_t *idtmed = fIdtmed->GetArray()-1099;
205
206// Distance between Stations
207//
208 Float_t bpar[3];
209 Float_t tpar[3];
b64652f5 210// Float_t pgpar[10];
a9e2aefa 211 Float_t zpos1, zpos2, zfpos;
b64652f5 212 // Outer excess and inner recess for mother volume radius
213 // with respect to ROuter and RInner
a9e2aefa 214 Float_t dframep=.001; // Value for station 3 should be 6 ...
b64652f5 215 // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
216// Float_t dframep1=.001;
217 Float_t dframep1 = 11.0;
218// Bool_t frameCrosses=kFALSE;
219 Bool_t frameCrosses=kTRUE;
3f08857e 220 Float_t *dum=0;
a9e2aefa 221
b64652f5 222// Float_t dframez=0.9;
223 // Half of the total thickness of frame crosses (including DAlu)
224 // for each chamber in stations 1 and 2:
225 // 3% of X0 of composite material,
226 // but taken as Aluminium here, with same thickness in number of X0
227 Float_t dframez = 3. * 8.9 / 100;
228// Float_t dr;
a9e2aefa 229 Float_t dstation;
230
231//
232// Rotation matrices in the x-y plane
233 Int_t idrotm[1199];
234// phi= 0 deg
235 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
236// phi= 90 deg
237 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
238// phi= 180 deg
239 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
240// phi= 270 deg
241 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
242//
243 Float_t phi=2*TMath::Pi()/12/2;
244
245//
246// pointer to the current chamber
247// pointer to the current chamber
b64652f5 248 Int_t idAlu1=idtmed[1103]; // medium 4
249 Int_t idAlu2=idtmed[1104]; // medium 5
a9e2aefa 250// Int_t idAlu1=idtmed[1100];
251// Int_t idAlu2=idtmed[1100];
b64652f5 252 Int_t idAir=idtmed[1100]; // medium 1
253// Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
254 Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
a9e2aefa 255
256
257 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
b17c0c87 258 Int_t stations[5] = {1, 1, 1, 1, 1};
259
260 if (stations[0]) {
261
a9e2aefa 262//********************************************************************
263// Station 1 **
264//********************************************************************
265// CONCENTRIC
266 // indices 1 and 2 for first and second chambers in the station
267 // iChamber (first chamber) kept for other quanties than Z,
268 // assumed to be the same in both chambers
269 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
270 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
271 zpos1=iChamber1->Z();
272 zpos2=iChamber2->Z();
273 dstation = zpos2 - zpos1;
b64652f5 274 // DGas decreased from standard one (0.5)
275 iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
276 // DAlu increased from standard one (3% of X0),
277 // because more electronics with smaller pads
278 iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
a9e2aefa 279 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
280
281//
282// Mother volume
b64652f5 283 tpar[0] = iChamber->RInner()-dframep;
284 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
2c799aa2 285 tpar[2] = dstation/5;
a9e2aefa 286
b74f1c6a 287 gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
288 gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
289 gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
290 gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
b64652f5 291// // Aluminium frames
292// // Outer frames
293// pgpar[0] = 360/12/2;
294// pgpar[1] = 360.;
295// pgpar[2] = 12.;
296// pgpar[3] = 2;
297// pgpar[4] = -dframez/2;
298// pgpar[5] = iChamber->ROuter();
299// pgpar[6] = pgpar[5]+dframep1;
300// pgpar[7] = +dframez/2;
301// pgpar[8] = pgpar[5];
302// pgpar[9] = pgpar[6];
b74f1c6a 303// gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
304// gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
305// gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
306// gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
307// gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
308// gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
b64652f5 309// //
310// // Inner frame
311// tpar[0]= iChamber->RInner()-dframep1;
312// tpar[1]= iChamber->RInner();
313// tpar[2]= dframez/2;
b74f1c6a 314// gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
315// gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
b64652f5 316
b74f1c6a 317// gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
318// gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
319// gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
320// gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
a9e2aefa 321//
322// Frame Crosses
b64652f5 323 if (frameCrosses) {
324 // outside gas
325 // security for inside mother volume
326 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
327 * TMath::Cos(TMath::ASin(dframep1 /
328 (iChamber->ROuter() - iChamber->RInner())))
329 / 2.0;
a9e2aefa 330 bpar[1] = dframep1/2;
b64652f5 331 // total thickness will be (4 * bpar[2]) for each chamber,
332 // which has to be equal to (2 * dframez) - DAlu
333 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
b74f1c6a 334 gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
335 gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
a9e2aefa 336
b74f1c6a 337 gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
a9e2aefa 338 idrotm[1100],"ONLY");
b74f1c6a 339 gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
a9e2aefa 340 idrotm[1100],"ONLY");
b74f1c6a 341 gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
a9e2aefa 342 idrotm[1101],"ONLY");
b74f1c6a 343 gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
a9e2aefa 344 idrotm[1101],"ONLY");
b74f1c6a 345 gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
a9e2aefa 346 idrotm[1100],"ONLY");
b74f1c6a 347 gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
a9e2aefa 348 idrotm[1100],"ONLY");
b74f1c6a 349 gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
a9e2aefa 350 idrotm[1101],"ONLY");
b74f1c6a 351 gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
a9e2aefa 352 idrotm[1101],"ONLY");
353
b74f1c6a 354 gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
a9e2aefa 355 idrotm[1100],"ONLY");
b74f1c6a 356 gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
a9e2aefa 357 idrotm[1100],"ONLY");
b74f1c6a 358 gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
a9e2aefa 359 idrotm[1101],"ONLY");
b74f1c6a 360 gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
a9e2aefa 361 idrotm[1101],"ONLY");
b74f1c6a 362 gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
a9e2aefa 363 idrotm[1100],"ONLY");
b74f1c6a 364 gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
a9e2aefa 365 idrotm[1100],"ONLY");
b74f1c6a 366 gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
a9e2aefa 367 idrotm[1101],"ONLY");
b74f1c6a 368 gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
a9e2aefa 369 idrotm[1101],"ONLY");
370 }
371//
372// Chamber Material represented by Alu sheet
373 tpar[0]= iChamber->RInner();
374 tpar[1]= iChamber->ROuter();
375 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
b74f1c6a 376 gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
377 gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
378 gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
379 gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
a9e2aefa 380//
381// Sensitive volumes
382 // tpar[2] = iChamber->DGas();
383 tpar[2] = iChamber->DGas()/2;
b74f1c6a 384 gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
385 gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
386 gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
387 gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
a9e2aefa 388//
b64652f5 389// Frame Crosses to be placed inside gas
390 // NONE: chambers are sensitive everywhere
391// if (frameCrosses) {
392
393// dr = (iChamber->ROuter() - iChamber->RInner());
394// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
395// bpar[1] = dframep1/2;
396// bpar[2] = iChamber->DGas()/2;
b74f1c6a 397// gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
398// gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
a9e2aefa 399
b74f1c6a 400// gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
b64652f5 401// idrotm[1100],"ONLY");
b74f1c6a 402// gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
b64652f5 403// idrotm[1100],"ONLY");
b74f1c6a 404// gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
b64652f5 405// idrotm[1101],"ONLY");
b74f1c6a 406// gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
b64652f5 407// idrotm[1101],"ONLY");
a9e2aefa 408
b74f1c6a 409// gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
b64652f5 410// idrotm[1100],"ONLY");
b74f1c6a 411// gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
b64652f5 412// idrotm[1100],"ONLY");
b74f1c6a 413// gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
b64652f5 414// idrotm[1101],"ONLY");
b74f1c6a 415// gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
b64652f5 416// idrotm[1101],"ONLY");
417// }
b17c0c87 418 }
419 if (stations[1]) {
420
a9e2aefa 421//********************************************************************
422// Station 2 **
423//********************************************************************
424 // indices 1 and 2 for first and second chambers in the station
425 // iChamber (first chamber) kept for other quanties than Z,
426 // assumed to be the same in both chambers
427 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
428 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
429 zpos1=iChamber1->Z();
430 zpos2=iChamber2->Z();
431 dstation = zpos2 - zpos1;
b64652f5 432 // DGas and DAlu not changed from standard values
a9e2aefa 433 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
434
435//
436// Mother volume
437 tpar[0] = iChamber->RInner()-dframep;
438 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
2c799aa2 439 tpar[2] = dstation/5;
a9e2aefa 440
b74f1c6a 441 gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
442 gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
443 gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
444 gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
03da3c56 445 gMC->Gsbool("S03M", "L3DO");
446 gMC->Gsbool("S03M", "L3O1");
447 gMC->Gsbool("S03M", "L3O2");
448 gMC->Gsbool("S04M", "L3DO");
449 gMC->Gsbool("S04M", "L3O1");
450 gMC->Gsbool("S04M", "L3O2");
1e8fff9c 451
b64652f5 452// // Aluminium frames
453// // Outer frames
454// pgpar[0] = 360/12/2;
455// pgpar[1] = 360.;
456// pgpar[2] = 12.;
457// pgpar[3] = 2;
458// pgpar[4] = -dframez/2;
459// pgpar[5] = iChamber->ROuter();
460// pgpar[6] = pgpar[5]+dframep;
461// pgpar[7] = +dframez/2;
462// pgpar[8] = pgpar[5];
463// pgpar[9] = pgpar[6];
b74f1c6a 464// gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
465// gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
466// gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
467// gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
468// gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
469// gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
b64652f5 470// //
471// // Inner frame
472// tpar[0]= iChamber->RInner()-dframep;
473// tpar[1]= iChamber->RInner();
474// tpar[2]= dframez/2;
b74f1c6a 475// gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
476// gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
b64652f5 477
b74f1c6a 478// gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
479// gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
480// gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
481// gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
a9e2aefa 482//
483// Frame Crosses
b64652f5 484 if (frameCrosses) {
485 // outside gas
486 // security for inside mother volume
487 bpar[0] = (iChamber->ROuter() - iChamber->RInner())
488 * TMath::Cos(TMath::ASin(dframep1 /
489 (iChamber->ROuter() - iChamber->RInner())))
490 / 2.0;
491 bpar[1] = dframep1/2;
492 // total thickness will be (4 * bpar[2]) for each chamber,
493 // which has to be equal to (2 * dframez) - DAlu
494 bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
b74f1c6a 495 gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
496 gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
a9e2aefa 497
b74f1c6a 498 gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
a9e2aefa 499 idrotm[1100],"ONLY");
b74f1c6a 500 gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
a9e2aefa 501 idrotm[1100],"ONLY");
b74f1c6a 502 gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
a9e2aefa 503 idrotm[1101],"ONLY");
b74f1c6a 504 gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
a9e2aefa 505 idrotm[1101],"ONLY");
b74f1c6a 506 gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
a9e2aefa 507 idrotm[1100],"ONLY");
b74f1c6a 508 gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
a9e2aefa 509 idrotm[1100],"ONLY");
b74f1c6a 510 gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
a9e2aefa 511 idrotm[1101],"ONLY");
b74f1c6a 512 gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
a9e2aefa 513 idrotm[1101],"ONLY");
514
b74f1c6a 515 gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
a9e2aefa 516 idrotm[1100],"ONLY");
b74f1c6a 517 gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
a9e2aefa 518 idrotm[1100],"ONLY");
b74f1c6a 519 gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
a9e2aefa 520 idrotm[1101],"ONLY");
b74f1c6a 521 gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
a9e2aefa 522 idrotm[1101],"ONLY");
b74f1c6a 523 gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
a9e2aefa 524 idrotm[1100],"ONLY");
b74f1c6a 525 gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
a9e2aefa 526 idrotm[1100],"ONLY");
b74f1c6a 527 gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
a9e2aefa 528 idrotm[1101],"ONLY");
b74f1c6a 529 gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
a9e2aefa 530 idrotm[1101],"ONLY");
531 }
532//
533// Chamber Material represented by Alu sheet
534 tpar[0]= iChamber->RInner();
535 tpar[1]= iChamber->ROuter();
536 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
b74f1c6a 537 gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
538 gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
539 gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
540 gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
a9e2aefa 541//
542// Sensitive volumes
543 // tpar[2] = iChamber->DGas();
544 tpar[2] = iChamber->DGas()/2;
b74f1c6a 545 gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
546 gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
547 gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
548 gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
a9e2aefa 549//
550// Frame Crosses to be placed inside gas
b64652f5 551 // NONE: chambers are sensitive everywhere
552// if (frameCrosses) {
553
554// dr = (iChamber->ROuter() - iChamber->RInner());
555// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
556// bpar[1] = dframep1/2;
557// bpar[2] = iChamber->DGas()/2;
b74f1c6a 558// gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
559// gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
a9e2aefa 560
b74f1c6a 561// gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
b64652f5 562// idrotm[1100],"ONLY");
b74f1c6a 563// gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
b64652f5 564// idrotm[1100],"ONLY");
b74f1c6a 565// gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
b64652f5 566// idrotm[1101],"ONLY");
b74f1c6a 567// gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
b64652f5 568// idrotm[1101],"ONLY");
a9e2aefa 569
b74f1c6a 570// gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
b64652f5 571// idrotm[1100],"ONLY");
b74f1c6a 572// gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
b64652f5 573// idrotm[1100],"ONLY");
b74f1c6a 574// gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
b64652f5 575// idrotm[1101],"ONLY");
b74f1c6a 576// gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
b64652f5 577// idrotm[1101],"ONLY");
578// }
b17c0c87 579 }
1e8fff9c 580 // define the id of tracking media:
581 Int_t idCopper = idtmed[1110];
582 Int_t idGlass = idtmed[1111];
583 Int_t idCarbon = idtmed[1112];
584 Int_t idRoha = idtmed[1113];
585
1e8fff9c 586 // sensitive area: 40*40 cm**2
6c5ddcfa 587 const Float_t sensLength = 40.;
588 const Float_t sensHeight = 40.;
589 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
590 const Int_t sensMaterial = idGas;
1e8fff9c 591 const Float_t yOverlap = 1.5;
592
593 // PCB dimensions in cm; width: 30 mum copper
6c5ddcfa 594 const Float_t pcbLength = sensLength;
595 const Float_t pcbHeight = 60.;
596 const Float_t pcbWidth = 0.003;
597 const Int_t pcbMaterial = idCopper;
1e8fff9c 598
599 // Insulating material: 200 mum glass fiber glued to pcb
6c5ddcfa 600 const Float_t insuLength = pcbLength;
601 const Float_t insuHeight = pcbHeight;
602 const Float_t insuWidth = 0.020;
603 const Int_t insuMaterial = idGlass;
1e8fff9c 604
605 // Carbon fiber panels: 200mum carbon/epoxy skin
6c5ddcfa 606 const Float_t panelLength = sensLength;
607 const Float_t panelHeight = sensHeight;
608 const Float_t panelWidth = 0.020;
609 const Int_t panelMaterial = idCarbon;
1e8fff9c 610
611 // rohacell between the two carbon panels
6c5ddcfa 612 const Float_t rohaLength = sensLength;
613 const Float_t rohaHeight = sensHeight;
614 const Float_t rohaWidth = 0.5;
615 const Int_t rohaMaterial = idRoha;
1e8fff9c 616
617 // Frame around the slat: 2 sticks along length,2 along height
618 // H: the horizontal ones
6c5ddcfa 619 const Float_t hFrameLength = pcbLength;
620 const Float_t hFrameHeight = 1.5;
621 const Float_t hFrameWidth = sensWidth;
622 const Int_t hFrameMaterial = idGlass;
1e8fff9c 623
624 // V: the vertical ones
6c5ddcfa 625 const Float_t vFrameLength = 4.0;
626 const Float_t vFrameHeight = sensHeight + hFrameHeight;
627 const Float_t vFrameWidth = sensWidth;
628 const Int_t vFrameMaterial = idGlass;
1e8fff9c 629
630 // B: the horizontal border filled with rohacell
6c5ddcfa 631 const Float_t bFrameLength = hFrameLength;
632 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
633 const Float_t bFrameWidth = hFrameWidth;
634 const Int_t bFrameMaterial = idRoha;
1e8fff9c 635
636 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
6c5ddcfa 637 const Float_t nulocLength = 2.5;
638 const Float_t nulocHeight = 7.5;
639 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
640 const Int_t nulocMaterial = idCopper;
1e8fff9c 641
6c5ddcfa 642 const Float_t slatHeight = pcbHeight;
643 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
644 2.* panelWidth + rohaWidth);
645 const Int_t slatMaterial = idAir;
646 const Float_t dSlatLength = vFrameLength; // border on left and right
1e8fff9c 647
1e8fff9c 648 Float_t spar[3];
b17c0c87 649 Int_t i, j;
650
3c084d9f 651 // the panel volume contains the rohacell
652
653 Float_t twidth = 2 * panelWidth + rohaWidth;
654 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
b17c0c87 655 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
3c084d9f 656
657 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
658
659 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
660 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
661 twidth -= 2 * insuWidth;
662 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
663 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
664 Float_t theight = 2*hFrameHeight + sensHeight;
665 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
b17c0c87 666 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
3c084d9f 667 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
b17c0c87 668 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
b17c0c87 669 Float_t xx;
670 Float_t xxmax = (bFrameLength - nulocLength)/2.;
671 Int_t index=0;
672
673 if (stations[2]) {
674
675//********************************************************************
676// Station 3 **
677//********************************************************************
678 // indices 1 and 2 for first and second chambers in the station
679 // iChamber (first chamber) kept for other quanties than Z,
680 // assumed to be the same in both chambers
681 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
682 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
683 zpos1=iChamber1->Z();
684 zpos2=iChamber2->Z();
685 dstation = zpos2 - zpos1;
686
b64652f5 687// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
b17c0c87 688//
689// Mother volume
690 tpar[0] = iChamber->RInner()-dframep;
691 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
21a18f36 692 tpar[2] = dstation/5;
2724ae40 693
b74f1c6a 694 char *slats5Mother = "S05M";
695 char *slats6Mother = "S06M";
2724ae40 696 Float_t zoffs5 = 0;
697 Float_t zoffs6 = 0;
698
fe713e43 699 if (gAlice->GetModule("DIPO")) {
2724ae40 700 slats5Mother="DDIP";
701 slats6Mother="DDIP";
702
703 zoffs5 = zpos1;
704 zoffs6 = zpos2;
705 }
706 else {
b74f1c6a 707 gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
708 gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
709 gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
710 gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
2724ae40 711 }
712
b17c0c87 713 // volumes for slat geometry (xx=5,..,10 chamber id):
714 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
715 // SxxG --> Sensitive volume (gas)
716 // SxxP --> PCB (copper)
717 // SxxI --> Insulator (vetronite)
718 // SxxC --> Carbon panel
719 // SxxR --> Rohacell
720 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
21a18f36 721 // SB5x --> Volumes for the 35 cm long PCB
b17c0c87 722 // slat dimensions: slat is a MOTHER volume!!! made of air
723
21a18f36 724 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
725
726 Float_t tlength = 35.;
727 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
728 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
729 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
730 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
731 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
732 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
733 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
734
a083207d 735 const Int_t nSlats3 = 5; // number of slats per quadrant
736 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
21a18f36 737 const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
b17c0c87 738 Float_t slatLength3[nSlats3];
739
740 // create and position the slat (mother) volumes
741
6c5ddcfa 742 char volNam5[5];
743 char volNam6[5];
f9f7c205 744 Float_t xSlat3;
b17c0c87 745
21a18f36 746 Float_t spar2[3];
6c5ddcfa 747 for (i = 0; i<nSlats3; i++){
3c084d9f 748 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
a083207d 749 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
21a18f36 750 if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
a083207d 751 Float_t ySlat31 = sensHeight * i - yOverlap * i;
752 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
3c084d9f 753 spar[0] = slatLength3[i]/2.;
754 spar[1] = slatHeight/2.;
755 spar[2] = slatWidth/2. * 1.01;
21a18f36 756 // take away 5 cm from the first slat in chamber 5
757 Float_t xSlat32 = 0;
758 if (i==1 || i==2) { // 1 pcb is shortened by 5cm
759 spar2[0] = spar[0]-5./2.;
760 xSlat32 = xSlat3 - 5/2.;
761 }
762 else {
763 spar2[0] = spar[0];
764 xSlat32 = xSlat3;
765 }
766 spar2[1] = spar[1];
767 spar2[2] = spar[2];
3c084d9f 768 Float_t dzCh3=spar[2] * 1.01;
769 // zSlat to be checked (odd downstream or upstream?)
770 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
771 sprintf(volNam5,"S05%d",i);
21a18f36 772 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
2724ae40 773 gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
774 gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
21a18f36 775
a083207d 776 if (i>0) {
2724ae40 777 gMC->Gspos(volNam5, i*4+3,slats5Mother, xSlat32, ySlat32, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
778 gMC->Gspos(volNam5, i*4+4,slats5Mother,-xSlat32, ySlat32, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
a083207d 779 }
3c084d9f 780 sprintf(volNam6,"S06%d",i);
781 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
2724ae40 782 gMC->Gspos(volNam6, i*4+1,slats6Mother, xSlat3, ySlat31, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
783 gMC->Gspos(volNam6, i*4+2,slats6Mother,-xSlat3, ySlat31, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
a083207d 784 if (i>0) {
2724ae40 785 gMC->Gspos(volNam6, i*4+3,slats6Mother, xSlat3, ySlat32, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
786 gMC->Gspos(volNam6, i*4+4,slats6Mother,-xSlat3, ySlat32, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
a083207d 787 }
3c084d9f 788 }
1e8fff9c 789
790 // create the panel volume
b17c0c87 791
6c5ddcfa 792 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
21a18f36 793 gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
6c5ddcfa 794 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
1e8fff9c 795
796 // create the rohacell volume
b17c0c87 797
6c5ddcfa 798 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
21a18f36 799 gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
6c5ddcfa 800 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
1e8fff9c 801
3c084d9f 802 // create the insulating material volume
803
804 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
21a18f36 805 gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
3c084d9f 806 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
807
808 // create the PCB volume
809
810 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
21a18f36 811 gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
3c084d9f 812 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
813
814 // create the sensitive volumes,
3f08857e 815 gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
816 gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
3c084d9f 817
818
1e8fff9c 819 // create the vertical frame volume
b17c0c87 820
6c5ddcfa 821 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
822 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 823
824 // create the horizontal frame volume
b17c0c87 825
6c5ddcfa 826 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
21a18f36 827 gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
6c5ddcfa 828 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 829
830 // create the horizontal border volume
b17c0c87 831
6c5ddcfa 832 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
21a18f36 833 gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
6c5ddcfa 834 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
1e8fff9c 835
b17c0c87 836 index=0;
6c5ddcfa 837 for (i = 0; i<nSlats3; i++){
838 sprintf(volNam5,"S05%d",i);
839 sprintf(volNam6,"S06%d",i);
f9f7c205 840 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
21a18f36 841 Float_t xvFrame2 = xvFrame;
842 if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
3c084d9f 843 // position the vertical frames
21a18f36 844 if (i!=1 && i!=0) {
845 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
846 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
3c084d9f 847 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
848 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
849 }
850 // position the panels and the insulating material
6c5ddcfa 851 for (j=0; j<nPCB3[i]; j++){
1e8fff9c 852 index++;
6c5ddcfa 853 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
21a18f36 854 Float_t xx2 = xx + 5/2.;
3c084d9f 855
856 Float_t zPanel = spar[2] - panelpar[2];
21a18f36 857 if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
858 gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
859 gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
860 gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
861 }
862 else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
863 gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
864 gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
865 gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
866 }
867 else {
868 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
869 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
870 gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
871 }
3c084d9f 872 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
873 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
3c084d9f 874 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
1e8fff9c 875 }
a9e2aefa 876 }
21a18f36 877
3c084d9f 878 // position the rohacell volume inside the panel volume
879 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
21a18f36 880 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
3c084d9f 881 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
882
883 // position the PCB volume inside the insulating material volume
884 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
21a18f36 885 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
3c084d9f 886 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
887 // position the horizontal frame volume inside the PCB volume
888 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
21a18f36 889 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
3c084d9f 890 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
891 // position the sensitive volume inside the horizontal frame volume
892 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
21a18f36 893 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
3c084d9f 894 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
895 // position the border volumes inside the PCB volume
896 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
897 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
898 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
21a18f36 899 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
900 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
3c084d9f 901 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
902 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
903
1e8fff9c 904 // create the NULOC volume and position it in the horizontal frame
b17c0c87 905
6c5ddcfa 906 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
907 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
6c5ddcfa 908 index = 0;
21a18f36 909 Float_t xxmax2 = xxmax - 5./2.;
910 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1e8fff9c 911 index++;
6c5ddcfa 912 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
913 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
21a18f36 914 if (xx > -xxmax2 && xx< xxmax2) {
915 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
916 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
917 }
6c5ddcfa 918 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
919 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
1e8fff9c 920 }
3c084d9f 921
922 // position the volumes approximating the circular section of the pipe
a083207d 923 Float_t yoffs = sensHeight/2. - yOverlap;
3c084d9f 924 Float_t epsilon = 0.001;
925 Int_t ndiv=6;
926 Float_t divpar[3];
927 Double_t dydiv= sensHeight/ndiv;
21a18f36 928 Double_t ydiv = yoffs -dydiv;
3c084d9f 929 Int_t imax=0;
3c084d9f 930 imax = 1;
21a18f36 931 Float_t rmin = 33.;
a083207d 932 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
3c084d9f 933 for (Int_t idiv=0;idiv<ndiv; idiv++){
934 ydiv+= dydiv;
425ebd0a 935 Float_t xdiv = 0.;
3c084d9f 936 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
937 divpar[0] = (pcbLength-xdiv)/2.;
938 divpar[1] = dydiv/2. - epsilon;
939 divpar[2] = sensWidth/2.;
425ebd0a 940 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
a083207d 941 Float_t yvol=ydiv + dydiv/2.;
21a18f36 942 //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
2724ae40 943 gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother, xvol, yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
944 gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother, xvol, yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
945 gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother, xvol,-yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
946 gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother, xvol,-yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
947 gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,-xvol, yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
948 gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,-xvol, yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
949 gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,-xvol,-yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
950 gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,-xvol,-yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
3c084d9f 951 }
b17c0c87 952 }
b17c0c87 953
3c084d9f 954 if (stations[3]) {
955
a9e2aefa 956//********************************************************************
957// Station 4 **
958//********************************************************************
959 // indices 1 and 2 for first and second chambers in the station
960 // iChamber (first chamber) kept for other quanties than Z,
961 // assumed to be the same in both chambers
962 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
963 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
964 zpos1=iChamber1->Z();
965 zpos2=iChamber2->Z();
966 dstation = zpos2 - zpos1;
b64652f5 967// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
a9e2aefa 968
969//
970// Mother volume
971 tpar[0] = iChamber->RInner()-dframep;
972 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
2724ae40 973 tpar[2] = dstation/4;
a9e2aefa 974
b74f1c6a 975 gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
976 gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
977 gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
978 gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1e8fff9c 979
a9e2aefa 980
f9f7c205 981 const Int_t nSlats4 = 6; // number of slats per quadrant
425ebd0a 982 const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
21a18f36 983 const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
6c5ddcfa 984 Float_t slatLength4[nSlats4];
1e8fff9c 985
986 // create and position the slat (mother) volumes
987
6c5ddcfa 988 char volNam7[5];
989 char volNam8[5];
1e8fff9c 990 Float_t xSlat4;
f9f7c205 991 Float_t ySlat4;
1e8fff9c 992
6c5ddcfa 993 for (i = 0; i<nSlats4; i++){
a083207d 994 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
995 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
2724ae40 996 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
a083207d 997 ySlat4 = sensHeight * i - yOverlap *i;
998
999 spar[0] = slatLength4[i]/2.;
1000 spar[1] = slatHeight/2.;
1001 spar[2] = slatWidth/2.*1.01;
1002 Float_t dzCh4=spar[2]*1.01;
1003 // zSlat to be checked (odd downstream or upstream?)
1004 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
1005 sprintf(volNam7,"S07%d",i);
1006 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
b74f1c6a 1007 gMC->Gspos(volNam7, i*4+1,"S07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1008 gMC->Gspos(volNam7, i*4+2,"S07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
a083207d 1009 if (i>0) {
b74f1c6a 1010 gMC->Gspos(volNam7, i*4+3,"S07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1011 gMC->Gspos(volNam7, i*4+4,"S07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
a083207d 1012 }
1013 sprintf(volNam8,"S08%d",i);
1014 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
b74f1c6a 1015 gMC->Gspos(volNam8, i*4+1,"S08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1016 gMC->Gspos(volNam8, i*4+2,"S08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
a083207d 1017 if (i>0) {
b74f1c6a 1018 gMC->Gspos(volNam8, i*4+3,"S08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
1019 gMC->Gspos(volNam8, i*4+4,"S08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
a083207d 1020 }
a9e2aefa 1021 }
a083207d 1022
3c084d9f 1023
1024 // create the panel volume
1e8fff9c 1025
3c084d9f 1026 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
1027 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
a9e2aefa 1028
3c084d9f 1029 // create the rohacell volume
1030
1031 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
1032 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
1e8fff9c 1033
1e8fff9c 1034 // create the insulating material volume
1035
6c5ddcfa 1036 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
1037 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
1e8fff9c 1038
3c084d9f 1039 // create the PCB volume
1e8fff9c 1040
3c084d9f 1041 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
1042 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
1e8fff9c 1043
3c084d9f 1044 // create the sensitive volumes,
1045
3f08857e 1046 gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
1047 gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
1e8fff9c 1048
1049 // create the vertical frame volume
1050
6c5ddcfa 1051 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
1052 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 1053
1054 // create the horizontal frame volume
1055
6c5ddcfa 1056 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
1057 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 1058
1059 // create the horizontal border volume
1060
6c5ddcfa 1061 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
1062 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
3c084d9f 1063
1064 index=0;
6c5ddcfa 1065 for (i = 0; i<nSlats4; i++){
1066 sprintf(volNam7,"S07%d",i);
1067 sprintf(volNam8,"S08%d",i);
1068 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
3c084d9f 1069 // position the vertical frames
21a18f36 1070 if (i!=1 && i!=0) {
a083207d 1071 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
1072 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
1073 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
1074 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
1075 }
3c084d9f 1076 // position the panels and the insulating material
6c5ddcfa 1077 for (j=0; j<nPCB4[i]; j++){
1e8fff9c 1078 index++;
6c5ddcfa 1079 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
3c084d9f 1080
1081 Float_t zPanel = spar[2] - panelpar[2];
1082 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
1083 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
1084 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
1085 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
1086
1087 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
1088 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1e8fff9c 1089 }
a9e2aefa 1090 }
1e8fff9c 1091
3c084d9f 1092 // position the rohacell volume inside the panel volume
1093 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
1094 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
1095
1096 // position the PCB volume inside the insulating material volume
1097 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
1098 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
1099 // position the horizontal frame volume inside the PCB volume
1100 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
1101 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
1102 // position the sensitive volume inside the horizontal frame volume
1103 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
1104 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
3c084d9f 1105 // position the border volumes inside the PCB volume
1106 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1107 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
1108 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
1109 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
1110 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
1111
1e8fff9c 1112 // create the NULOC volume and position it in the horizontal frame
3c084d9f 1113
6c5ddcfa 1114 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
1115 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
3c084d9f 1116 index = 0;
21a18f36 1117 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1e8fff9c 1118 index++;
6c5ddcfa 1119 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1120 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
1121 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1122 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
1e8fff9c 1123 }
a083207d 1124
1125 // position the volumes approximating the circular section of the pipe
21a18f36 1126 Float_t yoffs = sensHeight/2. - yOverlap;
a083207d 1127 Float_t epsilon = 0.001;
1128 Int_t ndiv=6;
1129 Float_t divpar[3];
1130 Double_t dydiv= sensHeight/ndiv;
21a18f36 1131 Double_t ydiv = yoffs -dydiv;
a083207d 1132 Int_t imax=0;
a083207d 1133 imax = 1;
1134 Float_t rmin = 40.;
1135 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
1136 for (Int_t idiv=0;idiv<ndiv; idiv++){
1137 ydiv+= dydiv;
425ebd0a 1138 Float_t xdiv = 0.;
a083207d 1139 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1140 divpar[0] = (pcbLength-xdiv)/2.;
1141 divpar[1] = dydiv/2. - epsilon;
1142 divpar[2] = sensWidth/2.;
425ebd0a 1143 Float_t xvol=(pcbLength+xdiv)/2.+1.999;
a083207d 1144 Float_t yvol=ydiv + dydiv/2.;
b74f1c6a 1145 gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1146 gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1147 gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1148 gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1149 gMC->Gsposp("S07G",imax+4*idiv+3,"S07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1150 gMC->Gsposp("S08G",imax+4*idiv+3,"S08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1151 gMC->Gsposp("S07G",imax+4*idiv+4,"S07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1152 gMC->Gsposp("S08G",imax+4*idiv+4,"S08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
a083207d 1153 }
1154
1155
1156
1157
1158
b17c0c87 1159 }
3c084d9f 1160
b17c0c87 1161 if (stations[4]) {
1162
1e8fff9c 1163
a9e2aefa 1164//********************************************************************
1165// Station 5 **
1166//********************************************************************
1167 // indices 1 and 2 for first and second chambers in the station
1168 // iChamber (first chamber) kept for other quanties than Z,
1169 // assumed to be the same in both chambers
1170 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1171 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1172 zpos1=iChamber1->Z();
1173 zpos2=iChamber2->Z();
1174 dstation = zpos2 - zpos1;
b64652f5 1175// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
3c084d9f 1176
a9e2aefa 1177//
1178// Mother volume
1179 tpar[0] = iChamber->RInner()-dframep;
1180 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
3c084d9f 1181 tpar[2] = dstation/5.;
a9e2aefa 1182
b74f1c6a 1183 gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
1184 gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
1185 gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1186 gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
a9e2aefa 1187
a9e2aefa 1188
1e8fff9c 1189 const Int_t nSlats5 = 7; // number of slats per quadrant
a083207d 1190 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
21a18f36 1191 const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
6c5ddcfa 1192 Float_t slatLength5[nSlats5];
6c5ddcfa 1193 char volNam9[5];
1194 char volNam10[5];
f9f7c205 1195 Float_t xSlat5;
1196 Float_t ySlat5;
1e8fff9c 1197
6c5ddcfa 1198 for (i = 0; i<nSlats5; i++){
1199 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
a083207d 1200 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
21a18f36 1201 if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
f9f7c205 1202 ySlat5 = sensHeight * i - yOverlap * i;
6c5ddcfa 1203 spar[0] = slatLength5[i]/2.;
1204 spar[1] = slatHeight/2.;
3c084d9f 1205 spar[2] = slatWidth/2. * 1.01;
1206 Float_t dzCh5=spar[2]*1.01;
1e8fff9c 1207 // zSlat to be checked (odd downstream or upstream?)
3c084d9f 1208 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
6c5ddcfa 1209 sprintf(volNam9,"S09%d",i);
1210 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
b74f1c6a 1211 gMC->Gspos(volNam9, i*4+1,"S09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1212 gMC->Gspos(volNam9, i*4+2,"S09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1213 if (i>0) {
b74f1c6a 1214 gMC->Gspos(volNam9, i*4+3,"S09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1215 gMC->Gspos(volNam9, i*4+4,"S09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1216 }
6c5ddcfa 1217 sprintf(volNam10,"S10%d",i);
1218 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
b74f1c6a 1219 gMC->Gspos(volNam10, i*4+1,"S10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1220 gMC->Gspos(volNam10, i*4+2,"S10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1221 if (i>0) {
b74f1c6a 1222 gMC->Gspos(volNam10, i*4+3,"S10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1223 gMC->Gspos(volNam10, i*4+4,"S10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1224 }
a9e2aefa 1225 }
1226
1e8fff9c 1227 // create the panel volume
3c084d9f 1228
6c5ddcfa 1229 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1230 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
3c084d9f 1231
1e8fff9c 1232 // create the rohacell volume
3c084d9f 1233
6c5ddcfa 1234 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1235 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
3c084d9f 1236
1237 // create the insulating material volume
1238
1239 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1240 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1241
1242 // create the PCB volume
1243
1244 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1245 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1246
1247 // create the sensitive volumes,
1248
3f08857e 1249 gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
1250 gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
3c084d9f 1251
1e8fff9c 1252 // create the vertical frame volume
3c084d9f 1253
6c5ddcfa 1254 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1255 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 1256
1257 // create the horizontal frame volume
3c084d9f 1258
6c5ddcfa 1259 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1260 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 1261
1262 // create the horizontal border volume
1263
6c5ddcfa 1264 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1265 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1e8fff9c 1266
3c084d9f 1267 index=0;
6c5ddcfa 1268 for (i = 0; i<nSlats5; i++){
1269 sprintf(volNam9,"S09%d",i);
1270 sprintf(volNam10,"S10%d",i);
1271 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
3c084d9f 1272 // position the vertical frames
21a18f36 1273 if (i!=1 && i!=0) {
a083207d 1274 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1275 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1276 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1277 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1278 }
3c084d9f 1279
1280 // position the panels and the insulating material
6c5ddcfa 1281 for (j=0; j<nPCB5[i]; j++){
1e8fff9c 1282 index++;
3c084d9f 1283 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1284
1285 Float_t zPanel = spar[2] - panelpar[2];
1286 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1287 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1288 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1289 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1290
1291 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1292 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1e8fff9c 1293 }
1294 }
1295
3c084d9f 1296 // position the rohacell volume inside the panel volume
1297 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1298 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1299
1300 // position the PCB volume inside the insulating material volume
1301 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1302 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1303 // position the horizontal frame volume inside the PCB volume
1304 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1305 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1306 // position the sensitive volume inside the horizontal frame volume
1307 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1308 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
3c084d9f 1309 // position the border volumes inside the PCB volume
1310 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1311 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1312 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1313 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1314 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1315
1e8fff9c 1316 // create the NULOC volume and position it in the horizontal frame
3c084d9f 1317
6c5ddcfa 1318 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1319 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
3c084d9f 1320 index = 0;
21a18f36 1321 for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
1e8fff9c 1322 index++;
6c5ddcfa 1323 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1324 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1325 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1326 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
a9e2aefa 1327 }
a083207d 1328 // position the volumes approximating the circular section of the pipe
21a18f36 1329 Float_t yoffs = sensHeight/2. - yOverlap;
a083207d 1330 Float_t epsilon = 0.001;
1331 Int_t ndiv=6;
1332 Float_t divpar[3];
1333 Double_t dydiv= sensHeight/ndiv;
21a18f36 1334 Double_t ydiv = yoffs -dydiv;
a083207d 1335 Int_t imax=0;
1336 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1337 imax = 1;
1338 Float_t rmin = 40.;
1339 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1340 for (Int_t idiv=0;idiv<ndiv; idiv++){
1341 ydiv+= dydiv;
425ebd0a 1342 Float_t xdiv = 0.;
a083207d 1343 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1344 divpar[0] = (pcbLength-xdiv)/2.;
1345 divpar[1] = dydiv/2. - epsilon;
1346 divpar[2] = sensWidth/2.;
425ebd0a 1347 Float_t xvol=(pcbLength+xdiv)/2. + 1.999;
a083207d 1348 Float_t yvol=ydiv + dydiv/2.;
b74f1c6a 1349 gMC->Gsposp("S09G",imax+4*idiv+1,"S09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1350 gMC->Gsposp("S10G",imax+4*idiv+1,"S10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1351 gMC->Gsposp("S09G",imax+4*idiv+2,"S09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1352 gMC->Gsposp("S10G",imax+4*idiv+2,"S10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1353 gMC->Gsposp("S09G",imax+4*idiv+3,"S09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1354 gMC->Gsposp("S10G",imax+4*idiv+3,"S10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1355 gMC->Gsposp("S09G",imax+4*idiv+4,"S09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1356 gMC->Gsposp("S10G",imax+4*idiv+4,"S10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
a083207d 1357 }
1358
b17c0c87 1359 }
1360
1e8fff9c 1361
a9e2aefa 1362///////////////////////////////////////
1363// GEOMETRY FOR THE TRIGGER CHAMBERS //
1364///////////////////////////////////////
1365
1366// 03/00 P. Dupieux : introduce a slighly more realistic
1367// geom. of the trigger readout planes with
1368// 2 Zpos per trigger plane (alternate
1369// between left and right of the trigger)
1370
1371// Parameters of the Trigger Chambers
1372
236fe2c5 1373// DP03-01 introduce dead zone of +/- 2 cm arround x=0 (as in TDR, fig3.27)
1374 const Float_t kDXZERO=2.;
a9e2aefa 1375 const Float_t kXMC1MIN=34.;
1376 const Float_t kXMC1MED=51.;
1377 const Float_t kXMC1MAX=272.;
1378 const Float_t kYMC1MIN=34.;
1379 const Float_t kYMC1MAX=51.;
1380 const Float_t kRMIN1=50.;
236fe2c5 1381// DP03-01 const Float_t kRMAX1=62.;
1382 const Float_t kRMAX1=64.;
a9e2aefa 1383 const Float_t kRMIN2=50.;
236fe2c5 1384// DP03-01 const Float_t kRMAX2=66.;
1385 const Float_t kRMAX2=68.;
a9e2aefa 1386
1387// zposition of the middle of the gas gap in mother vol
1388 const Float_t kZMCm=-3.6;
1389 const Float_t kZMCp=+3.6;
1390
1391
1392// TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1393
1394 // iChamber 1 and 2 for first and second chambers in the station
1395 // iChamber (first chamber) kept for other quanties than Z,
1396 // assumed to be the same in both chambers
1397 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1398 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1399
1400 // 03/00
1401 // zpos1 and zpos2 are now the middle of the first and second
1402 // plane of station 1 :
1403 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1404 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1405 //
1406 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1407 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1408 // rem : the total thickness accounts for 1 mm of al on both
1409 // side of the RPCs (see zpos1 and zpos2), as previously
1410
1411 zpos1=iChamber1->Z();
1412 zpos2=iChamber2->Z();
1413
1414
1415// Mother volume definition
1416 tpar[0] = iChamber->RInner();
1417 tpar[1] = iChamber->ROuter();
1418 tpar[2] = 4.0;
b74f1c6a 1419 gMC->Gsvolu("SM11", "TUBE", idAir, tpar, 3);
1420 gMC->Gsvolu("SM12", "TUBE", idAir, tpar, 3);
a9e2aefa 1421
1422// Definition of the flange between the beam shielding and the RPC
1423 tpar[0]= kRMIN1;
1424 tpar[1]= kRMAX1;
1425 tpar[2]= 4.0;
1426
b74f1c6a 1427 gMC->Gsvolu("SF1A", "TUBE", idAlu1, tpar, 3); //Al
1428 gMC->Gspos("SF1A", 1, "SM11", 0., 0., 0., 0, "MANY");
03da3c56 1429
1430 gMC->Gsvolu("SF3A", "TUBE", idAlu1, tpar, 3); //Al
1431 gMC->Gspos("SF3A", 1, "SM12", 0., 0., 0., 0, "MANY");
a9e2aefa 1432
1433
1434// FIRST PLANE OF STATION 1
1435
1436// ratios of zpos1m/zpos1p and inverse for first plane
1437 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1438 Float_t zpm=1./zmp;
1439
1440
1441// Definition of prototype for chambers in the first plane
1442
1443 tpar[0]= 0.;
1444 tpar[1]= 0.;
1445 tpar[2]= 0.;
1446
b74f1c6a 1447 gMC->Gsvolu("SC1A", "BOX ", idAlu1, tpar, 0); //Al
1448 gMC->Gsvolu("SB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1449 gMC->Gsvolu("SG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
a9e2aefa 1450
1451// chamber type A
1452 tpar[0] = -1.;
1453 tpar[1] = -1.;
1454
236fe2c5 1455// DP03-01 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1456 const Float_t kXMC1A=kDXZERO+kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
a9e2aefa 1457 const Float_t kYMC1Am=0.;
1458 const Float_t kYMC1Ap=0.;
1459
1460 tpar[2] = 0.1;
b74f1c6a 1461 gMC->Gsposp("SG1A", 1, "SB1A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1462 tpar[2] = 0.3;
b74f1c6a 1463 gMC->Gsposp("SB1A", 1, "SC1A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1464
1465 tpar[2] = 0.4;
1466 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1467 tpar[1] = kYMC1MIN;
1468
b74f1c6a 1469 gMC->Gsposp("SC1A", 1, "SM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1470 gMC->Gsposp("SC1A", 2, "SM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
03da3c56 1471 gMC->Gsbool("SC1A", "SF1A");
a9e2aefa 1472
1473// chamber type B
1474 Float_t tpar1save=tpar[1];
1475 Float_t y1msave=kYMC1Am;
1476 Float_t y1psave=kYMC1Ap;
1477
1478 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1479 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1480
236fe2c5 1481// DP03-01 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1482 const Float_t kXMC1B=kDXZERO+kXMC1MIN+tpar[0];
a9e2aefa 1483 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1484 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1485
b74f1c6a 1486 gMC->Gsposp("SC1A", 3, "SM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1487 gMC->Gsposp("SC1A", 4, "SM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1488 gMC->Gsposp("SC1A", 5, "SM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1489 gMC->Gsposp("SC1A", 6, "SM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1490
1491// chamber type C (end of type B !!)
1492 tpar1save=tpar[1];
1493 y1msave=kYMC1Bm;
1494 y1psave=kYMC1Bp;
1495
1496 tpar[0] = kXMC1MAX/2;
1497 tpar[1] = kYMC1MAX/2;
1498
236fe2c5 1499
1500// DP03-01 const Float_t kXMC1C=tpar[0];
1501 const Float_t kXMC1C=kDXZERO+tpar[0];
a9e2aefa 1502// warning : same Z than type B
1503 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1504 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1505
b74f1c6a 1506 gMC->Gsposp("SC1A", 7, "SM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1507 gMC->Gsposp("SC1A", 8, "SM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1508 gMC->Gsposp("SC1A", 9, "SM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1509 gMC->Gsposp("SC1A", 10, "SM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1510
1511// chamber type D, E and F (same size)
1512 tpar1save=tpar[1];
1513 y1msave=kYMC1Cm;
1514 y1psave=kYMC1Cp;
1515
1516 tpar[0] = kXMC1MAX/2.;
1517 tpar[1] = kYMC1MIN;
1518
236fe2c5 1519// DP03-01 const Float_t kXMC1D=tpar[0];
1520 const Float_t kXMC1D=kDXZERO+tpar[0];
a9e2aefa 1521 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1522 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1523
b74f1c6a 1524 gMC->Gsposp("SC1A", 11, "SM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1525 gMC->Gsposp("SC1A", 12, "SM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1526 gMC->Gsposp("SC1A", 13, "SM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1527 gMC->Gsposp("SC1A", 14, "SM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1528
1529
1530 tpar1save=tpar[1];
1531 y1msave=kYMC1Dm;
1532 y1psave=kYMC1Dp;
1533 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1534 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1535
b74f1c6a 1536 gMC->Gsposp("SC1A", 15, "SM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1537 gMC->Gsposp("SC1A", 16, "SM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1538 gMC->Gsposp("SC1A", 17, "SM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1539 gMC->Gsposp("SC1A", 18, "SM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1540
1541 tpar1save=tpar[1];
1542 y1msave=kYMC1Em;
1543 y1psave=kYMC1Ep;
1544 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1545 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1546
b74f1c6a 1547 gMC->Gsposp("SC1A", 19, "SM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1548 gMC->Gsposp("SC1A", 20, "SM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1549 gMC->Gsposp("SC1A", 21, "SM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1550 gMC->Gsposp("SC1A", 22, "SM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1551
1552// Positioning first plane in ALICE
b74f1c6a 1553 gMC->Gspos("SM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
a9e2aefa 1554
1555// End of geometry definition for the first plane of station 1
1556
1557
1558
1559// SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1560
1561 const Float_t kZ12=zpos2/zpos1;
1562
1563// Definition of prototype for chambers in the second plane of station 1
1564
1565 tpar[0]= 0.;
1566 tpar[1]= 0.;
1567 tpar[2]= 0.;
1568
b74f1c6a 1569 gMC->Gsvolu("SC2A", "BOX ", idAlu1, tpar, 0); //Al
1570 gMC->Gsvolu("SB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1571 gMC->Gsvolu("SG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
a9e2aefa 1572
1573// chamber type A
1574 tpar[0] = -1.;
1575 tpar[1] = -1.;
1576
1577 const Float_t kXMC2A=kXMC1A*kZ12;
1578 const Float_t kYMC2Am=0.;
1579 const Float_t kYMC2Ap=0.;
1580
1581 tpar[2] = 0.1;
b74f1c6a 1582 gMC->Gsposp("SG2A", 1, "SB2A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1583 tpar[2] = 0.3;
b74f1c6a 1584 gMC->Gsposp("SB2A", 1, "SC2A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1585
1586 tpar[2] = 0.4;
1587 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1588 tpar[1] = kYMC1MIN*kZ12;
1589
b74f1c6a 1590 gMC->Gsposp("SC2A", 1, "SM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1591 gMC->Gsposp("SC2A", 2, "SM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
03da3c56 1592 gMC->Gsbool("SC2A", "SF3A");
a9e2aefa 1593
1594
1595// chamber type B
1596
1597 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1598 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1599
1600 const Float_t kXMC2B=kXMC1B*kZ12;
1601 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1602 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
b74f1c6a 1603 gMC->Gsposp("SC2A", 3, "SM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1604 gMC->Gsposp("SC2A", 4, "SM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1605 gMC->Gsposp("SC2A", 5, "SM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1606 gMC->Gsposp("SC2A", 6, "SM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1607
1608
1609// chamber type C (end of type B !!)
1610
1611 tpar[0] = (kXMC1MAX/2)*kZ12;
1612 tpar[1] = (kYMC1MAX/2)*kZ12;
1613
1614 const Float_t kXMC2C=kXMC1C*kZ12;
1615 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1616 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
b74f1c6a 1617 gMC->Gsposp("SC2A", 7, "SM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1618 gMC->Gsposp("SC2A", 8, "SM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1619 gMC->Gsposp("SC2A", 9, "SM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1620 gMC->Gsposp("SC2A", 10, "SM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1621
1622// chamber type D, E and F (same size)
1623
1624 tpar[0] = (kXMC1MAX/2.)*kZ12;
1625 tpar[1] = kYMC1MIN*kZ12;
1626
1627 const Float_t kXMC2D=kXMC1D*kZ12;
1628 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1629 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
b74f1c6a 1630 gMC->Gsposp("SC2A", 11, "SM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1631 gMC->Gsposp("SC2A", 12, "SM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1632 gMC->Gsposp("SC2A", 13, "SM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1633 gMC->Gsposp("SC2A", 14, "SM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1634
1635 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1636 const Float_t kYMC2Em=kYMC1Em*kZ12;
b74f1c6a 1637 gMC->Gsposp("SC2A", 15, "SM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1638 gMC->Gsposp("SC2A", 16, "SM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1639 gMC->Gsposp("SC2A", 17, "SM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1640 gMC->Gsposp("SC2A", 18, "SM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1641
1642
1643 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1644 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
b74f1c6a 1645 gMC->Gsposp("SC2A", 19, "SM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1646 gMC->Gsposp("SC2A", 20, "SM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1647 gMC->Gsposp("SC2A", 21, "SM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1648 gMC->Gsposp("SC2A", 22, "SM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1649
1650// Positioning second plane of station 1 in ALICE
1651
b74f1c6a 1652 gMC->Gspos("SM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
a9e2aefa 1653
1654// End of geometry definition for the second plane of station 1
1655
1656
1657
1658// TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1659
1660 // 03/00
1661 // zpos3 and zpos4 are now the middle of the first and second
1662 // plane of station 2 :
1663 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1664 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1665 //
1666 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1667 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1668 // rem : the total thickness accounts for 1 mm of al on both
1669 // side of the RPCs (see zpos3 and zpos4), as previously
1670 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1671 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1672 Float_t zpos3=iChamber1->Z();
1673 Float_t zpos4=iChamber2->Z();
1674
1675
1676// Mother volume definition
1677 tpar[0] = iChamber->RInner();
1678 tpar[1] = iChamber->ROuter();
1679 tpar[2] = 4.0;
1680
b74f1c6a 1681 gMC->Gsvolu("SM21", "TUBE", idAir, tpar, 3);
1682 gMC->Gsvolu("SM22", "TUBE", idAir, tpar, 3);
a9e2aefa 1683
1684// Definition of the flange between the beam shielding and the RPC
1685// ???? interface shielding
1686
1687 tpar[0]= kRMIN2;
1688 tpar[1]= kRMAX2;
1689 tpar[2]= 4.0;
1690
b74f1c6a 1691 gMC->Gsvolu("SF2A", "TUBE", idAlu1, tpar, 3); //Al
1692 gMC->Gspos("SF2A", 1, "SM21", 0., 0., 0., 0, "MANY");
03da3c56 1693
1694 gMC->Gsvolu("SF4A", "TUBE", idAlu1, tpar, 3); //Al
1695 gMC->Gspos("SF4A", 1, "SM22", 0., 0., 0., 0, "MANY");
a9e2aefa 1696
1697
1698
1699// FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1700
1701 const Float_t kZ13=zpos3/zpos1;
1702
1703// Definition of prototype for chambers in the first plane of station 2
1704 tpar[0]= 0.;
1705 tpar[1]= 0.;
1706 tpar[2]= 0.;
1707
b74f1c6a 1708 gMC->Gsvolu("SC3A", "BOX ", idAlu1, tpar, 0); //Al
1709 gMC->Gsvolu("SB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1710 gMC->Gsvolu("SG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
a9e2aefa 1711
1712
1713// chamber type A
1714 tpar[0] = -1.;
1715 tpar[1] = -1.;
1716
1717 const Float_t kXMC3A=kXMC1A*kZ13;
1718 const Float_t kYMC3Am=0.;
1719 const Float_t kYMC3Ap=0.;
1720
1721 tpar[2] = 0.1;
b74f1c6a 1722 gMC->Gsposp("SG3A", 1, "SB3A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1723 tpar[2] = 0.3;
b74f1c6a 1724 gMC->Gsposp("SB3A", 1, "SC3A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1725
1726 tpar[2] = 0.4;
1727 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1728 tpar[1] = kYMC1MIN*kZ13;
b74f1c6a 1729 gMC->Gsposp("SC3A", 1, "SM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1730 gMC->Gsposp("SC3A", 2, "SM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
03da3c56 1731 gMC->Gsbool("SC3A", "SF2A");
a9e2aefa 1732
1733
1734// chamber type B
1735 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1736 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1737
1738 const Float_t kXMC3B=kXMC1B*kZ13;
1739 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1740 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
b74f1c6a 1741 gMC->Gsposp("SC3A", 3, "SM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1742 gMC->Gsposp("SC3A", 4, "SM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1743 gMC->Gsposp("SC3A", 5, "SM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1744 gMC->Gsposp("SC3A", 6, "SM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1745
1746
1747// chamber type C (end of type B !!)
1748 tpar[0] = (kXMC1MAX/2)*kZ13;
1749 tpar[1] = (kYMC1MAX/2)*kZ13;
1750
1751 const Float_t kXMC3C=kXMC1C*kZ13;
1752 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1753 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
b74f1c6a 1754 gMC->Gsposp("SC3A", 7, "SM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1755 gMC->Gsposp("SC3A", 8, "SM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1756 gMC->Gsposp("SC3A", 9, "SM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1757 gMC->Gsposp("SC3A", 10, "SM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1758
1759
1760// chamber type D, E and F (same size)
1761
1762 tpar[0] = (kXMC1MAX/2.)*kZ13;
1763 tpar[1] = kYMC1MIN*kZ13;
1764
1765 const Float_t kXMC3D=kXMC1D*kZ13;
1766 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1767 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
b74f1c6a 1768 gMC->Gsposp("SC3A", 11, "SM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1769 gMC->Gsposp("SC3A", 12, "SM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1770 gMC->Gsposp("SC3A", 13, "SM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1771 gMC->Gsposp("SC3A", 14, "SM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1772
1773 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1774 const Float_t kYMC3Em=kYMC1Em*kZ13;
b74f1c6a 1775 gMC->Gsposp("SC3A", 15, "SM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1776 gMC->Gsposp("SC3A", 16, "SM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1777 gMC->Gsposp("SC3A", 17, "SM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1778 gMC->Gsposp("SC3A", 18, "SM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1779
1780 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1781 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
b74f1c6a 1782 gMC->Gsposp("SC3A", 19, "SM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1783 gMC->Gsposp("SC3A", 20, "SM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1784 gMC->Gsposp("SC3A", 21, "SM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1785 gMC->Gsposp("SC3A", 22, "SM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1786
1787
1788// Positioning first plane of station 2 in ALICE
1789
b74f1c6a 1790 gMC->Gspos("SM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
a9e2aefa 1791
1792// End of geometry definition for the first plane of station 2
1793
1794
1795
1796
1797// SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1798
1799 const Float_t kZ14=zpos4/zpos1;
1800
1801// Definition of prototype for chambers in the second plane of station 2
1802
1803 tpar[0]= 0.;
1804 tpar[1]= 0.;
1805 tpar[2]= 0.;
1806
b74f1c6a 1807 gMC->Gsvolu("SC4A", "BOX ", idAlu1, tpar, 0); //Al
1808 gMC->Gsvolu("SB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1809 gMC->Gsvolu("SG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
a9e2aefa 1810
1811// chamber type A
1812 tpar[0] = -1.;
1813 tpar[1] = -1.;
1814
1815 const Float_t kXMC4A=kXMC1A*kZ14;
1816 const Float_t kYMC4Am=0.;
1817 const Float_t kYMC4Ap=0.;
1818
1819 tpar[2] = 0.1;
b74f1c6a 1820 gMC->Gsposp("SG4A", 1, "SB4A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1821 tpar[2] = 0.3;
b74f1c6a 1822 gMC->Gsposp("SB4A", 1, "SC4A", 0., 0., 0., 0, "ONLY",tpar,3);
a9e2aefa 1823
1824 tpar[2] = 0.4;
1825 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1826 tpar[1] = kYMC1MIN*kZ14;
b74f1c6a 1827 gMC->Gsposp("SC4A", 1, "SM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1828 gMC->Gsposp("SC4A", 2, "SM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
03da3c56 1829 gMC->Gsbool("SC4A", "SF4A");
a9e2aefa 1830
1831
1832// chamber type B
1833 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1834 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1835
1836 const Float_t kXMC4B=kXMC1B*kZ14;
1837 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1838 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
b74f1c6a 1839 gMC->Gsposp("SC4A", 3, "SM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1840 gMC->Gsposp("SC4A", 4, "SM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1841 gMC->Gsposp("SC4A", 5, "SM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1842 gMC->Gsposp("SC4A", 6, "SM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1843
1844
1845// chamber type C (end of type B !!)
1846 tpar[0] =(kXMC1MAX/2)*kZ14;
1847 tpar[1] = (kYMC1MAX/2)*kZ14;
1848
1849 const Float_t kXMC4C=kXMC1C*kZ14;
1850 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1851 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
b74f1c6a 1852 gMC->Gsposp("SC4A", 7, "SM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1853 gMC->Gsposp("SC4A", 8, "SM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1854 gMC->Gsposp("SC4A", 9, "SM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1855 gMC->Gsposp("SC4A", 10, "SM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1856
1857
1858// chamber type D, E and F (same size)
1859 tpar[0] = (kXMC1MAX/2.)*kZ14;
1860 tpar[1] = kYMC1MIN*kZ14;
1861
1862 const Float_t kXMC4D=kXMC1D*kZ14;
1863 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1864 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
b74f1c6a 1865 gMC->Gsposp("SC4A", 11, "SM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1866 gMC->Gsposp("SC4A", 12, "SM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1867 gMC->Gsposp("SC4A", 13, "SM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1868 gMC->Gsposp("SC4A", 14, "SM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1869
1870 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1871 const Float_t kYMC4Em=kYMC1Em*kZ14;
b74f1c6a 1872 gMC->Gsposp("SC4A", 15, "SM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1873 gMC->Gsposp("SC4A", 16, "SM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1874 gMC->Gsposp("SC4A", 17, "SM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1875 gMC->Gsposp("SC4A", 18, "SM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
a9e2aefa 1876
1877 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1878 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
b74f1c6a 1879 gMC->Gsposp("SC4A", 19, "SM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1880 gMC->Gsposp("SC4A", 20, "SM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1881 gMC->Gsposp("SC4A", 21, "SM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1882 gMC->Gsposp("SC4A", 22, "SM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
a9e2aefa 1883
1884
1885// Positioning second plane of station 2 in ALICE
1886
b74f1c6a 1887 gMC->Gspos("SM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
a9e2aefa 1888
1889// End of geometry definition for the second plane of station 2
1890
1891// End of trigger geometry definition
1892
1893}
1894
1895
1896
1897//___________________________________________
1898void AliMUONv1::CreateMaterials()
1899{
1900 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1901 //
b64652f5 1902 // Ar-CO2 gas (80%+20%)
a9e2aefa 1903 Float_t ag1[3] = { 39.95,12.01,16. };
1904 Float_t zg1[3] = { 18.,6.,8. };
1905 Float_t wg1[3] = { .8,.0667,.13333 };
1906 Float_t dg1 = .001821;
1907 //
1908 // Ar-buthane-freon gas -- trigger chambers
1909 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1910 Float_t ztr1[4] = { 18.,6.,1.,9. };
1911 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1912 Float_t dtr1 = .002599;
1913 //
1914 // Ar-CO2 gas
1915 Float_t agas[3] = { 39.95,12.01,16. };
1916 Float_t zgas[3] = { 18.,6.,8. };
1917 Float_t wgas[3] = { .74,.086684,.173316 };
1918 Float_t dgas = .0018327;
1919 //
1920 // Ar-Isobutane gas (80%+20%) -- tracking
1921 Float_t ag[3] = { 39.95,12.01,1.01 };
1922 Float_t zg[3] = { 18.,6.,1. };
1923 Float_t wg[3] = { .8,.057,.143 };
1924 Float_t dg = .0019596;
1925 //
1926 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1927 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1928 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1929 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1930 Float_t dtrig = .0031463;
1931 //
1932 // bakelite
1933
1934 Float_t abak[3] = {12.01 , 1.01 , 16.};
1935 Float_t zbak[3] = {6. , 1. , 8.};
1936 Float_t wbak[3] = {6. , 6. , 1.};
1937 Float_t dbak = 1.4;
1938
1939 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1940
1941 Int_t iSXFLD = gAlice->Field()->Integ();
1942 Float_t sXMGMX = gAlice->Field()->Max();
1943 //
1944 // --- Define the various materials for GEANT ---
1945 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1946 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1947 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1948 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1949 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1950 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1951 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1952 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1953 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1e8fff9c 1954 // materials for slat:
1955 // Sensitive area: gas (already defined)
1956 // PCB: copper
1957 // insulating material and frame: vetronite
1958 // walls: carbon, rohacell, carbon
1959 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1960 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1961 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1962 Float_t dglass=1.74;
1963
1964 // rohacell: C9 H13 N1 O2
1965 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1966 Float_t zrohac[4] = { 6., 1., 7., 8.};
1967 Float_t wrohac[4] = { 9., 13., 1., 2.};
1968 Float_t drohac = 0.03;
1969
1970 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1971 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1972 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1973 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1974
a9e2aefa 1975
1976 epsil = .001; // Tracking precision,
1977 stemax = -1.; // Maximum displacement for multiple scat
1978 tmaxfd = -20.; // Maximum angle due to field deflection
1979 deemax = -.3; // Maximum fractional energy loss, DLS
1980 stmin = -.8;
1981 //
1982 // Air
1983 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1984 //
1985 // Aluminum
1986
1987 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1988 fMaxDestepAlu, epsil, stmin);
1989 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1990 fMaxDestepAlu, epsil, stmin);
1991 //
1992 // Ar-isoC4H10 gas
1993
1994 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1995 fMaxDestepGas, epsil, stmin);
1996//
1997 // Ar-Isobuthane-Forane-SF6 gas
1998
1999 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
2000
2001 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
2002 fMaxDestepAlu, epsil, stmin);
2003
2004 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
2005 fMaxDestepAlu, epsil, stmin);
1e8fff9c 2006 // tracking media for slats: check the parameters!!
2007 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
2008 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2009 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
2010 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2011 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
2012 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
2013 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
2014 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
a9e2aefa 2015}
2016
2017//___________________________________________
2018
2019void AliMUONv1::Init()
2020{
2021 //
2022 // Initialize Tracking Chambers
2023 //
2024
9e1a0ddb 2025 if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName());
e17592e9 2026 Int_t i;
f665c1ea 2027 for (i=0; i<AliMUONConstants::NCh(); i++) {
a9e2aefa 2028 ( (AliMUONChamber*) (*fChambers)[i])->Init();
2029 }
2030
2031 //
2032 // Set the chamber (sensitive region) GEANT identifier
2033 AliMC* gMC = AliMC::GetMC();
b74f1c6a 2034 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("S01G"));
2035 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("S02G"));
b17c0c87 2036
b74f1c6a 2037 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
2038 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
b17c0c87 2039
1e8fff9c 2040 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
2041 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
b17c0c87 2042
1e8fff9c 2043 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
2044 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
b17c0c87 2045
1e8fff9c 2046 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
2047 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
b17c0c87 2048
b74f1c6a 2049 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
2050 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
2051 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
2052 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
a9e2aefa 2053
9e1a0ddb 2054 if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
a9e2aefa 2055
2056 //cp
9e1a0ddb 2057 if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName());
f665c1ea 2058 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
a9e2aefa 2059 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
2060 }
9e1a0ddb 2061 if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
a9e2aefa 2062 //cp
2063
2064}
2065
2066//___________________________________________
2067void AliMUONv1::StepManager()
2068{
2069 Int_t copy, id;
2070 static Int_t idvol;
2071 static Int_t vol[2];
2072 Int_t ipart;
2073 TLorentzVector pos;
2074 TLorentzVector mom;
2075 Float_t theta,phi;
2076 Float_t destep, step;
681d067b 2077
1e8fff9c 2078 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
2eb55fab 2079 const Float_t kBig = 1.e10;
a9e2aefa 2080 static Float_t hits[15];
2081
2082 TClonesArray &lhits = *fHits;
2083
2084 //
a9e2aefa 2085 //
2086 // Only charged tracks
2087 if( !(gMC->TrackCharge()) ) return;
2088 //
2089 // Only gas gap inside chamber
2090 // Tag chambers and record hits when track enters
2091 idvol=-1;
2092 id=gMC->CurrentVolID(copy);
2093
2eb55fab 2094 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
a9e2aefa 2095 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
2eb55fab 2096 vol[0] = i;
2097 idvol = i-1;
a9e2aefa 2098 }
2099 }
2100 if (idvol == -1) return;
2101 //
2102 // Get current particle id (ipart), track position (pos) and momentum (mom)
2103 gMC->TrackPosition(pos);
2104 gMC->TrackMomentum(mom);
2105
2106 ipart = gMC->TrackPid();
a9e2aefa 2107
2108 //
2109 // momentum loss and steplength in last step
2110 destep = gMC->Edep();
2111 step = gMC->TrackStep();
2112
2113 //
2114 // record hits when track enters ...
2115 if( gMC->IsTrackEntering()) {
2116 gMC->SetMaxStep(fMaxStepGas);
2117 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
2118 Double_t rt = TMath::Sqrt(tc);
2119 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
2eb55fab 2120 Double_t tx = mom[0]/pmom;
2121 Double_t ty = mom[1]/pmom;
2122 Double_t tz = mom[2]/pmom;
2123 Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
a9e2aefa 2124 ->ResponseModel()
2125 ->Pitch()/tz;
2126 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
2127 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
2128 hits[0] = Float_t(ipart); // Geant3 particle type
2eb55fab 2129 hits[1] = pos[0]+s*tx; // X-position for hit
2130 hits[2] = pos[1]+s*ty; // Y-position for hit
2131 hits[3] = pos[2]+s*tz; // Z-position for hit
a9e2aefa 2132 hits[4] = theta; // theta angle of incidence
2133 hits[5] = phi; // phi angle of incidence
2eb55fab 2134 hits[8] = (Float_t) fNPadHits; // first padhit
a9e2aefa 2135 hits[9] = -1; // last pad hit
2eb55fab 2136 hits[10] = mom[3]; // hit momentum P
2137 hits[11] = mom[0]; // Px
2138 hits[12] = mom[1]; // Py
2139 hits[13] = mom[2]; // Pz
a9e2aefa 2140 tof=gMC->TrackTime();
2eb55fab 2141 hits[14] = tof; // Time of flight
2142 tlength = 0;
2143 eloss = 0;
2144 eloss2 = 0;
2145 xhit = pos[0];
2146 yhit = pos[1];
2147 zhit = pos[2];
681d067b 2148 Chamber(idvol).ChargeCorrelationInit();
a9e2aefa 2149 // Only if not trigger chamber
1e8fff9c 2150
2151
2152
2153
2eb55fab 2154 if(idvol < AliMUONConstants::NTrackingCh()) {
a9e2aefa 2155 //
2156 // Initialize hit position (cursor) in the segmentation model
2157 ((AliMUONChamber*) (*fChambers)[idvol])
2158 ->SigGenInit(pos[0], pos[1], pos[2]);
2159 } else {
2160 //geant3->Gpcxyz();
2161 //printf("In the Trigger Chamber #%d\n",idvol-9);
2162 }
2163 }
2164 eloss2+=destep;
2165
2166 //
2167 // Calculate the charge induced on a pad (disintegration) in case
2168 //
2169 // Mip left chamber ...
2170 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2171 gMC->SetMaxStep(kBig);
2172 eloss += destep;
2173 tlength += step;
2174
802a864d 2175 Float_t x0,y0,z0;
2176 Float_t localPos[3];
2177 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
802a864d 2178 gMC->Gmtod(globalPos,localPos,1);
2179
2eb55fab 2180 if(idvol < AliMUONConstants::NTrackingCh()) {
a9e2aefa 2181// tracking chambers
2182 x0 = 0.5*(xhit+pos[0]);
2183 y0 = 0.5*(yhit+pos[1]);
1e8fff9c 2184 z0 = 0.5*(zhit+pos[2]);
a9e2aefa 2185 } else {
2186// trigger chambers
2eb55fab 2187 x0 = xhit;
2188 y0 = yhit;
2189 z0 = 0.;
a9e2aefa 2190 }
2191
1e8fff9c 2192
802a864d 2193 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
a9e2aefa 2194
2195
2eb55fab 2196 hits[6] = tlength; // track length
2197 hits[7] = eloss2; // de/dx energy loss
2198
a9e2aefa 2199 if (fNPadHits > (Int_t)hits[8]) {
2eb55fab 2200 hits[8] = hits[8]+1;
2201 hits[9] = (Float_t) fNPadHits;
a9e2aefa 2202 }
2eb55fab 2203//
2204// new hit
2205
a9e2aefa 2206 new(lhits[fNhits++])
2eb55fab 2207 AliMUONHit(fIshunt, gAlice->CurrentTrack(), vol,hits);
a9e2aefa 2208 eloss = 0;
2209 //
2210 // Check additional signal generation conditions
2211 // defined by the segmentation
a75f073c 2212 // model (boundary crossing conditions)
2213 // only for tracking chambers
a9e2aefa 2214 } else if
a75f073c 2215 ((idvol < AliMUONConstants::NTrackingCh()) &&
2216 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
a9e2aefa 2217 {
2218 ((AliMUONChamber*) (*fChambers)[idvol])
2219 ->SigGenInit(pos[0], pos[1], pos[2]);
802a864d 2220
2221 Float_t localPos[3];
2222 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2223 gMC->Gmtod(globalPos,localPos,1);
2224
e0f71fb7 2225 eloss += destep;
802a864d 2226
a75f073c 2227 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1e8fff9c 2228 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
a9e2aefa 2229 xhit = pos[0];
2230 yhit = pos[1];
e0f71fb7 2231 zhit = pos[2];
2232 eloss = 0;
a9e2aefa 2233 tlength += step ;
2234 //
2235 // nothing special happened, add up energy loss
2236 } else {
2237 eloss += destep;
2238 tlength += step ;
2239 }
2240}
2241
2242