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