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