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