Some problems with the HP compiler fixed.
[u/mrichter/AliRoot.git] / MUON / AliMUONv0.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
18*/
19
fe4da5cc 20/////////////////////////////////////////////////////////
21// Manager and hits classes for set:MUON version 0 //
22/////////////////////////////////////////////////////////
23
24#include <TTUBE.h>
25#include <TNode.h>
26#include <TRandom.h>
a897a37a 27#include <TLorentzVector.h>
fe4da5cc 28
29#include "AliMUONv0.h"
30#include "AliRun.h"
31#include "AliMC.h"
32#include "iostream.h"
33#include "AliCallf77.h"
34#include "AliConst.h"
35
36#define trig trig_
37
38extern "C" void type_of_call trig(float (*)[4], float (*)[4], int& iflag);
39
40ClassImp(AliMUONv0)
41
42//___________________________________________
43AliMUONv0::AliMUONv0() : AliMUON()
44{
45 fChambers = 0;
46}
47
48//___________________________________________
49AliMUONv0::AliMUONv0(const char *name, const char *title)
50 : AliMUON(name,title)
51{
52//
53// z-Positions of Chambers
a897a37a 54// const Float_t zch[7]={515., 690., 962.85, 1249., 1449., 1610, 1710.};
55 const Float_t zch[7]={515., 690., 975., 1249., 1449., 1610, 1710.};
fe4da5cc 56//
57// inner diameter
a897a37a 58 const Float_t dmi[7]={ 35., 47., 66., 80., 80., 96., 101.96};
fe4da5cc 59//
60// outer diameter
a897a37a 61 const Float_t dma[7]={183., 245., 316.6, 520., 520., 824., 874.};
fe4da5cc 62//
63 Int_t k;
64
65 fChambers = new TObjArray(14);
66
67 for (Int_t i=0; i<7; i++) {
68 for (Int_t j=0; j< 2; j++) {
69//
70//
71// Default Parameters for Muon Tracking Stations
72 k=2*i+j;
73//
74 (*fChambers)[k] = new AliMUONchamber();
75 AliMUONchamber* chamber = (AliMUONchamber*) (*fChambers)[k];
76 chamber->SetGid(0);
77 chamber->SetZPOS(zch[i]);
78//
79 chamber->InitGeo(zch[i]);
a897a37a 80 chamber->SetRInner(dmi[i]/2);
81 chamber->SetROuter(dma[i]/2);
fe4da5cc 82//
83 } // Chamber j in
84 } // Station i
85 fMaxStepGas=0.01;
86 fMaxStepAlu=0.1;
87 fMaxDestepGas=-1;
88 fMaxDestepAlu=-1;
89}
90
91//___________________________________________
92void AliMUONv0::Trigger(Float_t (*x)[4], Float_t (*y)[4], Int_t& iflag)
93{
94 trig(x,y,iflag);
95}
96
97//___________________________________________
98void AliMUONv0::CreateGeometry()
99{
a897a37a 100 Int_t *idtmed = fIdtmed->GetArray()-1099;
fe4da5cc 101//
102// Note: all chambers have the same structure, which could be
103// easily parameterised. This was intentionally not done in order
104// to give a starting point for the implementation of the actual
105// design of each station.
a897a37a 106
fe4da5cc 107// Distance between Stations
fe4da5cc 108//
109 Float_t bpar[3];
110 Float_t tpar[3];
a897a37a 111 Float_t pgpar[10];
fe4da5cc 112 Float_t zpos1, zpos2, zfpos;
a897a37a 113 Float_t dframep=3.; // Value for station 3 should be 6 ...
114 Float_t dframep1=3.;
a6f39961 115 Bool_t frames=kTRUE;
a897a37a 116
117
fe4da5cc 118 Float_t dframez=0.9;
a897a37a 119 Float_t dr;
120 Float_t dstation[5]={8., 8., 24.3, 8., 8.};
121 // Float_t dstation[5]={20., 20., 24.3, 20., 20.};
122 // Float_t dstation[5]={20., 100., 100., 100., 100.};
123
fe4da5cc 124//
125// Rotation matrices in the x-y plane
126 Int_t idrotm[1199];
127// phi= 0 deg
128 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
129// phi= 90 deg
130 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
131// phi= 180 deg
132 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
133// phi= 270 deg
134 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
135//
136 Float_t phi=2*TMath::Pi()/12/2;
137
138//
139// pointer to the current chamber
a897a37a 140// pointer to the current chamber
141 Int_t idAlu1=idtmed[1103];
142 Int_t idAlu2=idtmed[1104];
143// Int_t idAlu1=idtmed[1100];
144// Int_t idAlu2=idtmed[1100];
145 Int_t idAir=idtmed[1100];
146 Int_t idGas=idtmed[1105];
147
148
fe4da5cc 149 AliMUONchamber *iChamber;
150//********************************************************************
151// Station 1 **
152//********************************************************************
153// CONCENTRIC
154 iChamber=(AliMUONchamber*) (*fChambers)[0];
a897a37a 155 zpos1=iChamber->ZPosition()-dstation[0]/2;
156 zpos2=zpos1+dstation[0];
fe4da5cc 157 zfpos=-(iChamber->fdGas+dframez)/2;
158
159//
160// Mother volume
a897a37a 161 tpar[0] = iChamber->RInner()-dframep1;
162 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
163 //tpar[2] = dstation[0]/2;
164 tpar[2] = dstation[0]/4;
fe4da5cc 165
a897a37a 166 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
167 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
cfce8870 168 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
169 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
fe4da5cc 170// Aluminium frames
171// Outer frames
172 pgpar[0] = 360/12/2;
173 pgpar[1] = 360.;
174 pgpar[2] = 12.;
175 pgpar[3] = 2;
176 pgpar[4] = -dframez/2;
a897a37a 177 pgpar[5] = iChamber->ROuter();
178 pgpar[6] = pgpar[5]+dframep1;
fe4da5cc 179 pgpar[7] = +dframez/2;
180 pgpar[8] = pgpar[5];
181 pgpar[9] = pgpar[6];
a897a37a 182 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
183 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
cfce8870 184 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
185 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
186 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
187 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 188//
189// Inner frame
a897a37a 190 tpar[0]= iChamber->RInner()-dframep1;
191 tpar[1]= iChamber->RInner();
fe4da5cc 192 tpar[2]= dframez/2;
a897a37a 193 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
194 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
fe4da5cc 195
cfce8870 196 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
197 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
198 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
199 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 200//
201// Frame Crosses
a897a37a 202 if (frames) {
203
204 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
205 bpar[1] = dframep1/2;
fe4da5cc 206 bpar[2] = dframez/2;
a897a37a 207 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
208 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
fe4da5cc 209
a897a37a 210 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 211idrotm[1100],"ONLY");
a897a37a 212 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 213idrotm[1100],"ONLY");
a897a37a 214 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 215idrotm[1101],"ONLY");
a897a37a 216 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 217idrotm[1101],"ONLY");
a897a37a 218 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 219idrotm[1100],"ONLY");
a897a37a 220 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 221idrotm[1100],"ONLY");
a897a37a 222 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 223idrotm[1101],"ONLY");
a897a37a 224 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 225idrotm[1101],"ONLY");
226
a897a37a 227 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 228idrotm[1100],"ONLY");
a897a37a 229 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 230idrotm[1100],"ONLY");
a897a37a 231 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 232idrotm[1101],"ONLY");
a897a37a 233 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 234idrotm[1101],"ONLY");
a897a37a 235 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 236idrotm[1100],"ONLY");
a897a37a 237 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 238idrotm[1100],"ONLY");
a897a37a 239 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 240idrotm[1101],"ONLY");
a897a37a 241 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 242idrotm[1101],"ONLY");
a897a37a 243 }
fe4da5cc 244//
245// Chamber Material represented by Alu sheet
a897a37a 246 tpar[0]= iChamber->RInner();
247 tpar[1]= iChamber->ROuter();
fe4da5cc 248 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
a897a37a 249 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
250 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
cfce8870 251 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
252 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
fe4da5cc 253//
254// Sensitive volumes
255 // tpar[2] = iChamber->fdGas;
256 tpar[2] = iChamber->fdGas/2;
a897a37a 257 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
258 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
cfce8870 259 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
260 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
fe4da5cc 261//
262// Frame Crosses to be placed inside gas
a897a37a 263 if (frames) {
264
265 dr = (iChamber->ROuter() - iChamber->RInner());
266 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
267 bpar[1] = dframep1/2;
fe4da5cc 268 bpar[2] = iChamber->fdGas/2;
a897a37a 269 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
270 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
fe4da5cc 271
a897a37a 272 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 273idrotm[1100],"ONLY");
a897a37a 274 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 275idrotm[1100],"ONLY");
a897a37a 276 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 277idrotm[1101],"ONLY");
a897a37a 278 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 279idrotm[1101],"ONLY");
280
a897a37a 281 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 282idrotm[1100],"ONLY");
a897a37a 283 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 284idrotm[1100],"ONLY");
a897a37a 285 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 286idrotm[1101],"ONLY");
a897a37a 287 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
288 idrotm[1101],"ONLY");
289 }
290
fe4da5cc 291//
292//
293//********************************************************************
294// Station 2 **
295//********************************************************************
296 iChamber=(AliMUONchamber*) (*fChambers)[2];
a897a37a 297 zpos1=iChamber->ZPosition()-dstation[1]/2;
298 zpos2=zpos1+dstation[1];
fe4da5cc 299 zfpos=-(iChamber->fdGas+dframez)/2;
300
301//
302// Mother volume
a897a37a 303 tpar[0] = iChamber->RInner()-dframep;
304 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
305 //tpar[2] = dstation[1]/2;
306 tpar[2] = dstation[1]/4;
fe4da5cc 307
a897a37a 308 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
309 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
cfce8870 310 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
311 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
fe4da5cc 312// Aluminium frames
313// Outer frames
314 pgpar[0] = 360/12/2;
315 pgpar[1] = 360.;
316 pgpar[2] = 12.;
317 pgpar[3] = 2;
318 pgpar[4] = -dframez/2;
a897a37a 319 pgpar[5] = iChamber->ROuter();
fe4da5cc 320 pgpar[6] = pgpar[5]+dframep;
321 pgpar[7] = +dframez/2;
322 pgpar[8] = pgpar[5];
323 pgpar[9] = pgpar[6];
a897a37a 324 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
325 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
cfce8870 326 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
327 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
328 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
329 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 330//
331// Inner frame
a897a37a 332 tpar[0]= iChamber->RInner()-dframep;
333 tpar[1]= iChamber->RInner();
fe4da5cc 334 tpar[2]= dframez/2;
a897a37a 335 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
336 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
fe4da5cc 337
cfce8870 338 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
339 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
340 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
341 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 342//
343// Frame Crosses
a897a37a 344 if (frames) {
345
346 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
fe4da5cc 347 bpar[1] = dframep/2;
348 bpar[2] = dframez/2;
a897a37a 349 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
350 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
fe4da5cc 351
a897a37a 352 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 353idrotm[1100],"ONLY");
a897a37a 354 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 355idrotm[1100],"ONLY");
a897a37a 356 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 357idrotm[1101],"ONLY");
a897a37a 358 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 359idrotm[1101],"ONLY");
a897a37a 360 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 361idrotm[1100],"ONLY");
a897a37a 362 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 363idrotm[1100],"ONLY");
a897a37a 364 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 365idrotm[1101],"ONLY");
a897a37a 366 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 367idrotm[1101],"ONLY");
368
a897a37a 369 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 370idrotm[1100],"ONLY");
a897a37a 371 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 372idrotm[1100],"ONLY");
a897a37a 373 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 374idrotm[1101],"ONLY");
a897a37a 375 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 376idrotm[1101],"ONLY");
a897a37a 377 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 378idrotm[1100],"ONLY");
a897a37a 379 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 380idrotm[1100],"ONLY");
a897a37a 381 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 382idrotm[1101],"ONLY");
a897a37a 383 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 384idrotm[1101],"ONLY");
a897a37a 385 }
fe4da5cc 386//
387// Chamber Material represented by Alu sheet
a897a37a 388 tpar[0]= iChamber->RInner();
389 tpar[1]= iChamber->ROuter();
fe4da5cc 390 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
a897a37a 391 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
392 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
cfce8870 393 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
394 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
fe4da5cc 395//
396// Sensitive volumes
397 // tpar[2] = iChamber->fdGas;
398 tpar[2] = iChamber->fdGas/2;
a897a37a 399 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
400 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
cfce8870 401 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
402 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
a897a37a 403
404 if (frames) {
fe4da5cc 405//
406// Frame Crosses to be placed inside gas
a897a37a 407 dr = (iChamber->ROuter() - iChamber->RInner());
fe4da5cc 408 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
409 bpar[1] = dframep/2;
410 bpar[2] = iChamber->fdGas/2;
a897a37a 411 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
412 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
fe4da5cc 413
a897a37a 414 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 415idrotm[1100],"ONLY");
a897a37a 416 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 417idrotm[1100],"ONLY");
a897a37a 418 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 419idrotm[1101],"ONLY");
a897a37a 420 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 421idrotm[1101],"ONLY");
422
a897a37a 423 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 424idrotm[1100],"ONLY");
a897a37a 425 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 426idrotm[1100],"ONLY");
a897a37a 427 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 428idrotm[1101],"ONLY");
a897a37a 429 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
430 idrotm[1101],"ONLY");
431 }
432
fe4da5cc 433
a897a37a 434#ifdef FUTURE
fe4da5cc 435//********************************************************************
436// Station 3 **
437//********************************************************************
438// CONCENTRIC
439 iChamber=(AliMUONchamber*) (*fChambers)[4];
440 zpos1=iChamber->ZPosition(); // 975-13.75
441 zpos2=zpos1 // +dstation;
a897a37a 442 +24.3;
fe4da5cc 443//
444// Mother volume
a897a37a 445 tpar[0] = iChamber->RInner()-dframep;
446 tpar[1]= TMath::Sqrt((iChamber->ROuter()+dframep)*(iChamber->ROuter()+dframep) + dframep*dframep) ;
447
fe4da5cc 448 tpar[2] = // 3.;
449 5.325*2;
a897a37a 450 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
451 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
cfce8870 452 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
453 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
fe4da5cc 454//
455// Mother volume for one quadrant
a897a37a 456 tspar[0]= tpar[0];
457 tspar[1]= tpar[1];
fe4da5cc 458 tspar[2]= // dframez;
459 5.325;
a897a37a 460 tspar[3] = 0.-TMath::ATan2(dframep/2.,iChamber->RInner()-dframep)*180/kPI;
461 tspar[4] = 90.+TMath::ATan2(dframep/2,iChamber->RInner()-dframep)*180/kPI;
462 gMC->Gsvolu("C05Q", "TUBS", idAir, tspar, 5);
463 gMC->Gsvolu("C06Q", "TUBS", idAir, tspar, 5);
fe4da5cc 464// Position the four quadrants
cfce8870 465 gMC->Gspos("C05Q",1,"C05M", 0., 0., 5.325, idrotm[1100], "ONLY");
466 gMC->Gspos("C05Q",2,"C05M", 0., 0.,-5.325, idrotm[1101], "ONLY");
467 gMC->Gspos("C05Q",3,"C05M", 0., 0., 5.325, idrotm[1102], "ONLY");
468 gMC->Gspos("C05Q",4,"C05M", 0., 0.,-5.325, idrotm[1103], "ONLY");
469
470 gMC->Gspos("C06Q",1,"C06M", 0., 0., 5.325, idrotm[1100], "ONLY");
471 gMC->Gspos("C06Q",2,"C06M", 0., 0.,-5.325, idrotm[1101], "ONLY");
472 gMC->Gspos("C06Q",3,"C06M", 0., 0., 5.325, idrotm[1102], "ONLY");
473 gMC->Gspos("C06Q",4,"C06M", 0., 0.,-5.325, idrotm[1103], "ONLY");
fe4da5cc 474// Aluminium frames
475// Outer frame
a897a37a 476 tspar[0]= iChamber->ROuter();
477 tspar[1]= iChamber->ROuter()+dframep;
fe4da5cc 478 tspar[3] = 0.;
479 tspar[4] = 90.;
a897a37a 480 gMC->Gsvolu("C05O", "TUBS", idAir, tspar, 5);
481 gMC->Gsvolu("C06O", "TUBS", idAir, tspar, 5);
cfce8870 482 gMC->Gspos("C05O",1,"C05Q", 0.,0.,0., 0,"ONLY");
483 gMC->Gspos("C06O",1,"C06Q", 0.,0.,0., 0,"ONLY");
fe4da5cc 484//
485// Inner frame
a897a37a 486 tspar[0]= iChamber->RInner()-dframep;
487 tspar[1]= iChamber->RInner();
488 gMC->Gsvolu("C05I", "TUBS", idAir, tspar, 5);
489 gMC->Gsvolu("C06I", "TUBS", idAir, tspar, 5);
cfce8870 490 gMC->Gspos("C05I",1,"C05Q", 0.,0.,0., 0,"ONLY");
491 gMC->Gspos("C06I",1,"C06Q", 0.,0.,0., 0,"ONLY");
fe4da5cc 492//
493// Boundary half frame
a897a37a 494 bpar[0] = (iChamber->ROuter() +dframep*2 - iChamber->RInner())/2;
495 bpar[1] = dframep/4;
fe4da5cc 496 bpar[2] = 5.325;
a897a37a 497 gMC->Gsvolu("C05B", "BOX", idAlu1, bpar, 3);
498 gMC->Gsvolu("C06B", "BOX", idAlu1, bpar, 3);
fe4da5cc 499//place 2 boudaries
a897a37a 500 gMC->Gspos("C05B",1,"C05Q", iChamber->RInner()+bpar[0] ,-bpar[1],0., idrotm[1100],"ONLY");
501 gMC->Gspos("C05B",2,"C05Q", -bpar[1],iChamber->RInner()+bpar[0] ,0., idrotm[1101],"ONLY");
502 gMC->Gspos("C06B",1,"C06Q", iChamber->RInner()+bpar[0] ,-bpar[1],0., idrotm[1100],"ONLY");
503 gMC->Gspos("C06B",2,"C06Q", -bpar[1],iChamber->RInner()+bpar[0] ,0., idrotm[1101],"ONLY");
fe4da5cc 504//
505// Boundary second half frame (should not overlapp with sensitive surface, nor frames)
a897a37a 506// Effective outer radius due to circle effect
507 rMax = TMath::Sqrt(
508 iChamber->ROuter()*iChamber->ROuter() - dframep*dframep );
509 bpar[0] = (rMax - iChamber->RInner() ) /2;
fe4da5cc 510 bpar[2] = (5.325- (0.055 + 0.325)) / 2;
a897a37a 511 gMC->Gsvolu("C05H", "BOX", idAlu1, bpar, 3);
512 gMC->Gsvolu("C06H", "BOX", idAlu1, bpar, 3);
fe4da5cc 513//place 2 boudaries
cfce8870 514 gMC->Gspos("C05H",1,"C05Q", rMin+bpar[0],bpar[1], 0.055+0.325+bpar[2] , idrotm[1100],"ONLY");
515 gMC->Gspos("C05H",2,"C05Q", rMin+bpar[0],bpar[1],-(0.055+0.325+bpar[2]), idrotm[1100],"ONLY");
516 gMC->Gspos("C05H",3,"C05Q", bpar[1],rMin+bpar[0], 0.055+0.325+bpar[2] , idrotm[1101],"ONLY");
517 gMC->Gspos("C05H",4,"C05Q", bpar[1],rMin+bpar[0],-(0.055+0.325+bpar[2]), idrotm[1101],"ONLY");
518 gMC->Gspos("C06H",1,"C06Q", rMin+bpar[0],bpar[1], 0.055+0.325+bpar[2] , idrotm[1100],"ONLY");
519 gMC->Gspos("C06H",2,"C06Q", rMin+bpar[0],bpar[1],-(0.055+0.325+bpar[2]), idrotm[1100],"ONLY");
520 gMC->Gspos("C06H",3,"C06Q", bpar[1],rMin+bpar[0], 0.055+0.325+bpar[2] , idrotm[1101],"ONLY");
521 gMC->Gspos("C06H",4,"C06Q", bpar[1],rMin+bpar[0],-(0.055+0.325+bpar[2]), idrotm[1101],"ONLY");
fe4da5cc 522//
523// Chamber Material represented by Alu sheet
524 // tspar[2] = (iChamber->fdAlu)+(iChamber->fdGas);
a897a37a 525 tspar[0]= iChamber->RInner();
526 tspar[1]= iChamber->ROuter();
fe4da5cc 527 tspar[2] = 0.055 + 0.325;
a897a37a 528 gMC->Gsvolu("C05A", "TUBS", idAlu2, tspar, 5);
529 gMC->Gsvolu("C06A", "TUBS", idAlu2, tspar, 5);
cfce8870 530 gMC->Gspos("C05A", 1, "C05Q", 0., 0., 0., 0, "ONLY");
531 gMC->Gspos("C06A", 1, "C06Q", 0., 0., 0., 0, "ONLY");
fe4da5cc 532//
533// Sensitive volumes
534 // tpar[2] = iChamber->fdGas;
535 tspar[2] = 0.325;
a897a37a 536 gMC->Gsvolu("C05G", "TUBS", idGas, tspar, 5);
537 gMC->Gsvolu("C06G", "TUBS", idGas, tspar, 5);
cfce8870 538 gMC->Gspos("C05G", 1, "C05A", 0., 0., 0., 0, "ONLY");
539 gMC->Gspos("C06G", 1, "C06A", 0., 0., 0., 0, "ONLY");
fe4da5cc 540//
541// Overwrite sensitive volume with ALU
542// Overwrite Gaz volume
543 bpar[2] = 0.325;
a897a37a 544 gMC->Gsvolu("C05Z", "BOX", idAlu1, bpar, 3);
545 gMC->Gsvolu("C06Z", "BOX", idAlu1, bpar, 3);
cfce8870 546 gMC->Gspos("C05Z",1,"C05G", rMin+bpar[0] ,bpar[1],0., idrotm[1100],"ONLY");
547 gMC->Gspos("C05Z",2,"C05G", bpar[1], rMin+bpar[0] ,0., idrotm[1101],"ONLY");
548 gMC->Gspos("C06Z",1,"C06G", rMin+bpar[0] ,bpar[1],0., idrotm[1100],"ONLY");
549 gMC->Gspos("C06Z",2,"C06G", bpar[1], rMin+bpar[0] ,0., idrotm[1101],"ONLY");
a897a37a 550#else
551//********************************************************************
552// Station 3 **
553//********************************************************************
554 iChamber=(AliMUONchamber*) (*fChambers)[4];
555 zpos1=iChamber->ZPosition()-dstation[2]/2;
556 zpos2=zpos1+dstation[2];
557 zfpos= // -(iChamber->fdGas+dframez)/2;
558 - ( 0.65 + 5.)/2;
559//
560// Mother volume
561 tpar[0] = iChamber->RInner()-dframep;
562 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
563 tpar[2] = // dstation[3]/2;
564 dstation[2]/4;
565 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
566 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
567 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
568 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
569// Aluminium frames
570// Outer frames
571 pgpar[0] = 360/12/2;
572 pgpar[1] = 360.;
573 pgpar[2] = 12.;
574 pgpar[3] = 2;
575 pgpar[4] = // -dframez/2;
576 - 5./2;
577 pgpar[5] = iChamber->ROuter();
578 pgpar[6] = pgpar[5]+dframep;
579 pgpar[7] = // +dframez/2;
580 5./2;
581 pgpar[8] = pgpar[5];
582 pgpar[9] = pgpar[6];
583 gMC->Gsvolu("C05O", "PGON", idAlu1, pgpar, 10);
584 gMC->Gsvolu("C06O", "PGON", idAlu1, pgpar, 10);
585 gMC->Gspos("C05O",1,"C05M", 0.,0.,-zfpos, 0,"ONLY");
586 gMC->Gspos("C05O",2,"C05M", 0.,0.,+zfpos, 0,"ONLY");
587 gMC->Gspos("C06O",1,"C06M", 0.,0.,-zfpos, 0,"ONLY");
588 gMC->Gspos("C06O",2,"C06M", 0.,0.,+zfpos, 0,"ONLY");
589//
590// Inner frame
591 tpar[0]= iChamber->RInner()-dframep;
592 tpar[1]= iChamber->RInner();
593 tpar[2]= // dframez/2;
594 5./2;
595 gMC->Gsvolu("C05I", "TUBE", idAlu1, tpar, 3);
596 gMC->Gsvolu("C06I", "TUBE", idAlu1, tpar, 3);
597
598 gMC->Gspos("C05I",1,"C05M", 0.,0.,-zfpos, 0,"ONLY");
599 gMC->Gspos("C05I",2,"C05M", 0.,0.,+zfpos, 0,"ONLY");
600 gMC->Gspos("C06I",1,"C06M", 0.,0.,-zfpos, 0,"ONLY");
601 gMC->Gspos("C06I",2,"C06M", 0.,0.,+zfpos, 0,"ONLY");
602//
603// Frame Crosses
604 if (frames) {
605 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
606 bpar[1] = dframep/2;
607 bpar[2] = // dframez/2;
608 5./2;
609 gMC->Gsvolu("C05B", "BOX", idAlu1, bpar, 3);
610 gMC->Gsvolu("C06B", "BOX", idAlu1, bpar, 3);
611
612 gMC->Gspos("C05B",1,"C05M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
613idrotm[1100],"ONLY");
614 gMC->Gspos("C05B",2,"C05M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
615idrotm[1100],"ONLY");
616 gMC->Gspos("C05B",3,"C05M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
617idrotm[1101],"ONLY");
618 gMC->Gspos("C05B",4,"C05M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
619idrotm[1101],"ONLY");
620 gMC->Gspos("C05B",5,"C05M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
621idrotm[1100],"ONLY");
622 gMC->Gspos("C05B",6,"C05M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
623idrotm[1100],"ONLY");
624 gMC->Gspos("C05B",7,"C05M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
625idrotm[1101],"ONLY");
626 gMC->Gspos("C05B",8,"C05M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
627idrotm[1101],"ONLY");
628
629 gMC->Gspos("C06B",1,"C06M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
630idrotm[1100],"ONLY");
631 gMC->Gspos("C06B",2,"C06M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
632idrotm[1100],"ONLY");
633 gMC->Gspos("C06B",3,"C06M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
634idrotm[1101],"ONLY");
635 gMC->Gspos("C06B",4,"C06M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
636idrotm[1101],"ONLY");
637 gMC->Gspos("C06B",5,"C06M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
638idrotm[1100],"ONLY");
639 gMC->Gspos("C06B",6,"C06M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
640idrotm[1100],"ONLY");
641 gMC->Gspos("C06B",7,"C06M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
642idrotm[1101],"ONLY");
643 gMC->Gspos("C06B",8,"C06M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
644 idrotm[1101],"ONLY");
645 }
646
647
648//
649// Chamber Material represented by Alu sheet
650 tpar[0]= iChamber->RInner();
651 tpar[1]= iChamber->ROuter();
652 tpar[2] = // (iChamber->fdGas+iChamber->fdAlu)/2;
653 0.65 + 0.055;
654 gMC->Gsvolu("C05A", "TUBE", idAlu2, tpar, 3);
655 gMC->Gsvolu("C06A", "TUBE", idAlu2, tpar, 3);
656 gMC->Gspos("C05A", 1, "C05M", 0., 0., 0., 0, "ONLY");
657 gMC->Gspos("C06A", 1, "C06M", 0., 0., 0., 0, "ONLY");
658//
659// Sensitive volumes
660 tpar[2] = // iChamber->fdGas/2;
661 0.65/2;
662 gMC->Gsvolu("C05G", "TUBE", idGas, tpar, 3);
663 gMC->Gsvolu("C06G", "TUBE", idGas, tpar, 3);
664 gMC->Gspos("C05G", 1, "C05A", 0., 0., 0., 0, "ONLY");
665 gMC->Gspos("C06G", 1, "C06A", 0., 0., 0., 0, "ONLY");
666//
667// Frame Crosses to be placed inside gas
668 if (frames) {
669 dr = (iChamber->ROuter() - iChamber->RInner());
670 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
671 bpar[1] = dframep/2;
672 bpar[2] = // iChamber->fdGas/2;
673 0.65/2;
674 gMC->Gsvolu("C05F", "BOX", idAlu1, bpar, 3);
675 gMC->Gsvolu("C06F", "BOX", idAlu1, bpar, 3);
676
677 gMC->Gspos("C05F",1,"C05G", +iChamber->RInner()+bpar[0] , 0, 0,
678idrotm[1100],"ONLY");
679 gMC->Gspos("C05F",2,"C05G", -iChamber->RInner()-bpar[0] , 0, 0,
680idrotm[1100],"ONLY");
681 gMC->Gspos("C05F",3,"C05G", 0, +iChamber->RInner()+bpar[0] , 0,
682idrotm[1101],"ONLY");
683 gMC->Gspos("C05F",4,"C05G", 0, -iChamber->RInner()-bpar[0] , 0,
684idrotm[1101],"ONLY");
685
686 gMC->Gspos("C06F",1,"C06G", +iChamber->RInner()+bpar[0] , 0, 0,
687idrotm[1100],"ONLY");
688 gMC->Gspos("C06F",2,"C06G", -iChamber->RInner()-bpar[0] , 0, 0,
689idrotm[1100],"ONLY");
690 gMC->Gspos("C06F",3,"C06G", 0, +iChamber->RInner()+bpar[0] , 0,
691idrotm[1101],"ONLY");
692 gMC->Gspos("C06F",4,"C06G", 0, -iChamber->RInner()-bpar[0] , 0,
693 idrotm[1101],"ONLY");
694}
695
696#endif
fe4da5cc 697
698//********************************************************************
699// Station 4 **
700//********************************************************************
701 iChamber=(AliMUONchamber*) (*fChambers)[6];
a897a37a 702 zpos1=iChamber->ZPosition()-dstation[3]/2;
703 zpos2=zpos1+dstation[3];
fe4da5cc 704 zfpos=-(iChamber->fdGas+dframez)/2;
705
706//
707// Mother volume
a897a37a 708 tpar[0] = iChamber->RInner()-dframep;
709 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
710 //tpar[2] = dstation[3]/2;
711 tpar[2] = dstation[3]/4;
fe4da5cc 712
a897a37a 713 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
714 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
cfce8870 715 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
716 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
fe4da5cc 717// Aluminium frames
718// Outer frames
719 pgpar[0] = 360/12/2;
720 pgpar[1] = 360.;
721 pgpar[2] = 12.;
722 pgpar[3] = 2;
723 pgpar[4] = -dframez/2;
a897a37a 724 pgpar[5] = iChamber->ROuter();
fe4da5cc 725 pgpar[6] = pgpar[5]+dframep;
726 pgpar[7] = +dframez/2;
727 pgpar[8] = pgpar[5];
728 pgpar[9] = pgpar[6];
a897a37a 729 gMC->Gsvolu("C07O", "PGON", idAlu1, pgpar, 10);
730 gMC->Gsvolu("C08O", "PGON", idAlu1, pgpar, 10);
cfce8870 731 gMC->Gspos("C07O",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
732 gMC->Gspos("C07O",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
733 gMC->Gspos("C08O",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
734 gMC->Gspos("C08O",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 735//
736// Inner frame
a897a37a 737 tpar[0]= iChamber->RInner()-dframep;
738 tpar[1]= iChamber->RInner();
fe4da5cc 739 tpar[2]= dframez/2;
a897a37a 740 gMC->Gsvolu("C07I", "TUBE", idAlu1, tpar, 3);
741 gMC->Gsvolu("C08I", "TUBE", idAlu1, tpar, 3);
fe4da5cc 742
cfce8870 743 gMC->Gspos("C07I",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
744 gMC->Gspos("C07I",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
745 gMC->Gspos("C08I",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
746 gMC->Gspos("C08I",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 747//
748// Frame Crosses
a897a37a 749 if (frames) {
750 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
fe4da5cc 751 bpar[1] = dframep/2;
752 bpar[2] = dframez/2;
a897a37a 753 gMC->Gsvolu("C07B", "BOX", idAlu1, bpar, 3);
754 gMC->Gsvolu("C08B", "BOX", idAlu1, bpar, 3);
fe4da5cc 755
a897a37a 756 gMC->Gspos("C07B",1,"C07M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 757idrotm[1100],"ONLY");
a897a37a 758 gMC->Gspos("C07B",2,"C07M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 759idrotm[1100],"ONLY");
a897a37a 760 gMC->Gspos("C07B",3,"C07M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 761idrotm[1101],"ONLY");
a897a37a 762 gMC->Gspos("C07B",4,"C07M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 763idrotm[1101],"ONLY");
a897a37a 764 gMC->Gspos("C07B",5,"C07M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 765idrotm[1100],"ONLY");
a897a37a 766 gMC->Gspos("C07B",6,"C07M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 767idrotm[1100],"ONLY");
a897a37a 768 gMC->Gspos("C07B",7,"C07M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 769idrotm[1101],"ONLY");
a897a37a 770 gMC->Gspos("C07B",8,"C07M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 771idrotm[1101],"ONLY");
772
a897a37a 773 gMC->Gspos("C08B",1,"C08M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 774idrotm[1100],"ONLY");
a897a37a 775 gMC->Gspos("C08B",2,"C08M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 776idrotm[1100],"ONLY");
a897a37a 777 gMC->Gspos("C08B",3,"C08M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 778idrotm[1101],"ONLY");
a897a37a 779 gMC->Gspos("C08B",4,"C08M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 780idrotm[1101],"ONLY");
a897a37a 781 gMC->Gspos("C08B",5,"C08M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 782idrotm[1100],"ONLY");
a897a37a 783 gMC->Gspos("C08B",6,"C08M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 784idrotm[1100],"ONLY");
a897a37a 785 gMC->Gspos("C08B",7,"C08M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 786idrotm[1101],"ONLY");
a897a37a 787 gMC->Gspos("C08B",8,"C08M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
788 idrotm[1101],"ONLY");
789 }
790
fe4da5cc 791
792//
793// Chamber Material represented by Alu sheet
a897a37a 794 tpar[0]= iChamber->RInner();
795 tpar[1]= iChamber->ROuter();
fe4da5cc 796 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
a897a37a 797 gMC->Gsvolu("C07A", "TUBE", idAlu2, tpar, 3);
798 gMC->Gsvolu("C08A", "TUBE", idAlu2, tpar, 3);
cfce8870 799 gMC->Gspos("C07A", 1, "C07M", 0., 0., 0., 0, "ONLY");
800 gMC->Gspos("C08A", 1, "C08M", 0., 0., 0., 0, "ONLY");
fe4da5cc 801//
802// Sensitive volumes
803 // tpar[2] = iChamber->fdGas;
804 tpar[2] = iChamber->fdGas/2;
a897a37a 805 gMC->Gsvolu("C07G", "TUBE", idGas, tpar, 3);
806 gMC->Gsvolu("C08G", "TUBE", idGas, tpar, 3);
cfce8870 807 gMC->Gspos("C07G", 1, "C07A", 0., 0., 0., 0, "ONLY");
808 gMC->Gspos("C08G", 1, "C08A", 0., 0., 0., 0, "ONLY");
fe4da5cc 809//
810// Frame Crosses to be placed inside gas
a897a37a 811 if (frames) {
812 dr = (iChamber->ROuter() - iChamber->RInner());
fe4da5cc 813 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
814 bpar[1] = dframep/2;
815 bpar[2] = iChamber->fdGas/2;
a897a37a 816 gMC->Gsvolu("C07F", "BOX", idAlu1, bpar, 3);
817 gMC->Gsvolu("C08F", "BOX", idAlu1, bpar, 3);
fe4da5cc 818
a897a37a 819 gMC->Gspos("C07F",1,"C07G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 820idrotm[1100],"ONLY");
a897a37a 821 gMC->Gspos("C07F",2,"C07G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 822idrotm[1100],"ONLY");
a897a37a 823 gMC->Gspos("C07F",3,"C07G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 824idrotm[1101],"ONLY");
a897a37a 825 gMC->Gspos("C07F",4,"C07G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 826idrotm[1101],"ONLY");
827
a897a37a 828 gMC->Gspos("C08F",1,"C08G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 829idrotm[1100],"ONLY");
a897a37a 830 gMC->Gspos("C08F",2,"C08G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 831idrotm[1100],"ONLY");
a897a37a 832 gMC->Gspos("C08F",3,"C08G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 833idrotm[1101],"ONLY");
a897a37a 834 gMC->Gspos("C08F",4,"C08G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 835idrotm[1101],"ONLY");
a897a37a 836 }
fe4da5cc 837//********************************************************************
838// Station 5 **
839//********************************************************************
840 iChamber=(AliMUONchamber*) (*fChambers)[8];
a897a37a 841 zpos1=iChamber->ZPosition()-dstation[4]/2;
842 zpos2=zpos1+dstation[4];
fe4da5cc 843 zfpos=-(iChamber->fdGas+dframez)/2;
844
845//
846// Mother volume
a897a37a 847 tpar[0] = iChamber->RInner()-dframep;
848 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
849 //tpar[2] = dstation[4]/2;
850 tpar[2] = dstation[4]/4;
fe4da5cc 851
a897a37a 852 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
853 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
cfce8870 854 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
855 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
fe4da5cc 856// Aluminium frames
857// Outer frames
858 pgpar[0] = 360/12/2;
859 pgpar[1] = 360.;
860 pgpar[2] = 12.;
861 pgpar[3] = 2;
862 pgpar[4] = -dframez/2;
a897a37a 863 pgpar[5] = iChamber->ROuter();
fe4da5cc 864 pgpar[6] = pgpar[5]+dframep;
865 pgpar[7] = +dframez/2;
866 pgpar[8] = pgpar[5];
867 pgpar[9] = pgpar[6];
a897a37a 868 gMC->Gsvolu("C09O", "PGON", idAlu1, pgpar, 10);
869 gMC->Gsvolu("C10O", "PGON", idAlu1, pgpar, 10);
cfce8870 870 gMC->Gspos("C09O",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
871 gMC->Gspos("C09O",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
872 gMC->Gspos("C10O",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
873 gMC->Gspos("C10O",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
fe4da5cc 874//
875// Inner frame
a897a37a 876 tpar[0]= iChamber->RInner()-dframep;
877 tpar[1]= iChamber->RInner();
fe4da5cc 878 tpar[2]= dframez/2;
a897a37a 879 gMC->Gsvolu("C09I", "TUBE", idAlu1, tpar, 3);
880 gMC->Gsvolu("C10I", "TUBE", idAlu1, tpar, 3);
fe4da5cc 881
cfce8870 882 gMC->Gspos("C09I",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
883 gMC->Gspos("C09I",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
884 gMC->Gspos("C10I",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
885 gMC->Gspos("C10I",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
a897a37a 886
887 if (frames) {
fe4da5cc 888//
889// Frame Crosses
a897a37a 890
891 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
fe4da5cc 892 bpar[1] = dframep/2;
893 bpar[2] = dframez/2;
a897a37a 894 gMC->Gsvolu("C09B", "BOX", idAlu1, bpar, 3);
895 gMC->Gsvolu("C10B", "BOX", idAlu1, bpar, 3);
fe4da5cc 896
a897a37a 897 gMC->Gspos("C09B",1,"C09M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 898idrotm[1100],"ONLY");
a897a37a 899 gMC->Gspos("C09B",2,"C09M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 900idrotm[1100],"ONLY");
a897a37a 901 gMC->Gspos("C09B",3,"C09M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 902idrotm[1101],"ONLY");
a897a37a 903 gMC->Gspos("C09B",4,"C09M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 904idrotm[1101],"ONLY");
a897a37a 905 gMC->Gspos("C09B",5,"C09M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 906idrotm[1100],"ONLY");
a897a37a 907 gMC->Gspos("C09B",6,"C09M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 908idrotm[1100],"ONLY");
a897a37a 909 gMC->Gspos("C09B",7,"C09M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 910idrotm[1101],"ONLY");
a897a37a 911 gMC->Gspos("C09B",8,"C09M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
fe4da5cc 912idrotm[1101],"ONLY");
913
a897a37a 914 gMC->Gspos("C10B",1,"C10M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
fe4da5cc 915idrotm[1100],"ONLY");
a897a37a 916 gMC->Gspos("C10B",2,"C10M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
fe4da5cc 917idrotm[1100],"ONLY");
a897a37a 918 gMC->Gspos("C10B",3,"C10M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
fe4da5cc 919idrotm[1101],"ONLY");
a897a37a 920 gMC->Gspos("C10B",4,"C10M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
fe4da5cc 921idrotm[1101],"ONLY");
a897a37a 922 gMC->Gspos("C10B",5,"C10M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
fe4da5cc 923idrotm[1100],"ONLY");
a897a37a 924 gMC->Gspos("C10B",6,"C10M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
fe4da5cc 925idrotm[1100],"ONLY");
a897a37a 926 gMC->Gspos("C10B",7,"C10M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
fe4da5cc 927idrotm[1101],"ONLY");
a897a37a 928 gMC->Gspos("C10B",8,"C10M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
929 idrotm[1101],"ONLY");
930 }
931
fe4da5cc 932
933//
934// Chamber Material represented by Alu sheet
a897a37a 935 tpar[0]= iChamber->RInner();
936 tpar[1]= iChamber->ROuter();
fe4da5cc 937 tpar[2] = (iChamber->fdGas+iChamber->fdAlu)/2;
a897a37a 938 gMC->Gsvolu("C09A", "TUBE", idAlu2, tpar, 3);
939 gMC->Gsvolu("C10A", "TUBE", idAlu2, tpar, 3);
cfce8870 940 gMC->Gspos("C09A", 1, "C09M", 0., 0., 0., 0, "ONLY");
941 gMC->Gspos("C10A", 1, "C10M", 0., 0., 0., 0, "ONLY");
fe4da5cc 942//
943// Sensitive volumes
944 // tpar[2] = iChamber->fdGas;
945 tpar[2] = iChamber->fdGas/2;
a897a37a 946 gMC->Gsvolu("C09G", "TUBE", idGas, tpar, 3);
947 gMC->Gsvolu("C10G", "TUBE", idGas, tpar, 3);
cfce8870 948 gMC->Gspos("C09G", 1, "C09A", 0., 0., 0., 0, "ONLY");
949 gMC->Gspos("C10G", 1, "C10A", 0., 0., 0., 0, "ONLY");
fe4da5cc 950//
951// Frame Crosses to be placed inside gas
a897a37a 952 if (frames) {
953 dr = (iChamber->ROuter() - iChamber->RInner());
fe4da5cc 954 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
955 bpar[1] = dframep/2;
956 bpar[2] = iChamber->fdGas/2;
a897a37a 957 gMC->Gsvolu("C09F", "BOX", idAlu1, bpar, 3);
958 gMC->Gsvolu("C10F", "BOX", idAlu1, bpar, 3);
fe4da5cc 959
a897a37a 960 gMC->Gspos("C09F",1,"C09G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 961idrotm[1100],"ONLY");
a897a37a 962 gMC->Gspos("C09F",2,"C09G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 963idrotm[1100],"ONLY");
a897a37a 964 gMC->Gspos("C09F",3,"C09G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 965idrotm[1101],"ONLY");
a897a37a 966 gMC->Gspos("C09F",4,"C09G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 967idrotm[1101],"ONLY");
968
a897a37a 969 gMC->Gspos("C10F",1,"C10G", +iChamber->RInner()+bpar[0] , 0, 0,
fe4da5cc 970idrotm[1100],"ONLY");
a897a37a 971 gMC->Gspos("C10F",2,"C10G", -iChamber->RInner()-bpar[0] , 0, 0,
fe4da5cc 972idrotm[1100],"ONLY");
a897a37a 973 gMC->Gspos("C10F",3,"C10G", 0, +iChamber->RInner()+bpar[0] , 0,
fe4da5cc 974idrotm[1101],"ONLY");
a897a37a 975 gMC->Gspos("C10F",4,"C10G", 0, -iChamber->RInner()-bpar[0] , 0,
fe4da5cc 976idrotm[1101],"ONLY");
a897a37a 977 }
fe4da5cc 978
979///////////////////////////////////////
980// GEOMETRY FOR THE TRIGGER CHAMBERS //
981///////////////////////////////////////
982
983// Distance between planes inside each trigger station
984 const Float_t DTPLANES = 15.;
985
986// Parameters of the Trigger Chambers
987 //Station 1
988
989 const Float_t X_MC1_MIN=38.;
990 const Float_t X_MC1_MED=51.;
991 const Float_t X_MC1_MAX=272.;
992 const Float_t Y_MC1_MIN=34.;
993 const Float_t Y_MC1_MAX=51.;
994 const Float_t R_MIN1=48.;
995 const Float_t R_MAX1=64.;
996
997// Station 1
998 iChamber=(AliMUONchamber*) (*fChambers)[10];
999 zpos1=iChamber->ZPosition();
1000 zpos2=zpos1+DTPLANES;
1001
1002// Mother volume definition
a897a37a 1003 tpar[0] = iChamber->RInner();
1004 tpar[1] = iChamber->ROuter();
fe4da5cc 1005 tpar[2] = 0.4;
a897a37a 1006 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1007 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
fe4da5cc 1008
1009// Definition of the flange between the beam shielding and the RPC
1010 tpar[0]= R_MIN1;
1011 tpar[1]= R_MAX1;
1012 tpar[2]= 0.4;
1013
a897a37a 1014 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
cfce8870 1015 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1016 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
fe4da5cc 1017
1018// Definition of prototype for chambers in the first plane
1019
1020 tpar[0]= 0.;
1021 tpar[1]= 0.;
1022 tpar[2]= 0.;
1023
a897a37a 1024 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
cfce8870 1025 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1026 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
fe4da5cc 1027
1028// chamber type A
1029 tpar[0] = -1.;
1030 tpar[1] = -1.;
1031
1032 const Float_t X_MC1A=X_MC1_MED+(X_MC1_MAX-X_MC1_MED)/2.;
1033 const Float_t Y_MC1A=0.;
1034 const Float_t Z_MC1A=0.;
1035
1036 tpar[2] = 0.1;
cfce8870 1037 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1038 tpar[2] = 0.3;
cfce8870 1039 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1040 tpar[2] = 0.4;
1041 tpar[0] = (X_MC1_MAX-X_MC1_MED)/2.;
1042 tpar[1] = Y_MC1_MIN;
cfce8870 1043 gMC->Gsposp("CC1A", 1, "CM11",X_MC1A,Y_MC1A,Z_MC1A, 0, "ONLY", tpar, 3);
1044 gMC->Gsposp("CC1A", 2, "CM11",-X_MC1A,Y_MC1A,Z_MC1A, 0, "ONLY", tpar, 3);
fe4da5cc 1045
1046// chamber type B
1047 tpar[0] = (X_MC1_MAX-X_MC1_MIN)/2.;
1048 tpar[1] = (Y_MC1_MAX-Y_MC1_MIN)/2.;
1049
1050 const Float_t X_MC1B=X_MC1_MIN+tpar[0];
1051 const Float_t Y_MC1B=Y_MC1_MIN+tpar[1];
1052 const Float_t Z_MC1B=0.;
1053
cfce8870 1054 gMC->Gsposp("CC1A", 3, "CM11",X_MC1B,Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
1055 gMC->Gsposp("CC1A", 4, "CM11",-X_MC1B,Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
1056 gMC->Gsposp("CC1A", 5, "CM11",X_MC1B,-Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
1057 gMC->Gsposp("CC1A", 6, "CM11",-X_MC1B,-Y_MC1B,Z_MC1B, 0, "ONLY", tpar, 3);
fe4da5cc 1058
1059// chamber type C
1060 tpar[0] = X_MC1_MAX/2;
1061 tpar[1] = Y_MC1_MAX/2;
1062
1063 const Float_t X_MC1C=tpar[0];
1064 const Float_t Y_MC1C=Y_MC1_MAX+tpar[1];
1065 const Float_t Z_MC1C=0.;
1066
cfce8870 1067 gMC->Gsposp("CC1A", 7, "CM11",X_MC1C,Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
1068 gMC->Gsposp("CC1A", 8, "CM11",-X_MC1C,Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
1069 gMC->Gsposp("CC1A", 9, "CM11",X_MC1C,-Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
1070 gMC->Gsposp("CC1A", 10, "CM11",-X_MC1C,-Y_MC1C,Z_MC1C, 0, "ONLY", tpar, 3);
fe4da5cc 1071
1072// chamber type D
1073 tpar[0] = X_MC1_MAX/2.;
1074 tpar[1] = Y_MC1_MIN;
1075
1076 const Float_t X_MC1D=tpar[0];
1077 const Float_t Z_MC1D=0.;
1078
1079 Float_t Y_MC1D=4.*Y_MC1_MIN;
cfce8870 1080 gMC->Gsposp("CC1A", 11, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1081 gMC->Gsposp("CC1A", 12, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1082 gMC->Gsposp("CC1A", 13, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1083 gMC->Gsposp("CC1A", 14, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
fe4da5cc 1084
1085 Y_MC1D=6.*Y_MC1_MIN;
cfce8870 1086 gMC->Gsposp("CC1A", 15, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1087 gMC->Gsposp("CC1A", 16, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1088 gMC->Gsposp("CC1A", 17, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1089 gMC->Gsposp("CC1A", 18, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
fe4da5cc 1090
1091 Y_MC1D=8.*Y_MC1_MIN;
cfce8870 1092 gMC->Gsposp("CC1A", 19, "CM11",X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1093 gMC->Gsposp("CC1A", 20, "CM11",X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1094 gMC->Gsposp("CC1A", 21, "CM11",-X_MC1D,Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
1095 gMC->Gsposp("CC1A", 22, "CM11",-X_MC1D,-Y_MC1D,Z_MC1D, 0, "ONLY", tpar, 3);
fe4da5cc 1096
1097// Positioning first plane in ALICE
cfce8870 1098 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
fe4da5cc 1099
1100// End of geometry definition for the first plane
1101
1102// Station 1 - plan 2 - same RPCs as plan 1 ==> small non covered area
1103// Y position moved (ratio zpos2/zpos1)
1104 const Float_t Z_1S2=zpos2/zpos1;
1105
1106// Definition of prototype for chambers in the second plane
1107
1108 tpar[0]= 0.;
1109 tpar[1]= 0.;
1110 tpar[2]= 0.;
1111
a897a37a 1112 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
cfce8870 1113 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1114 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
fe4da5cc 1115
1116// chamber type A
1117 tpar[0] = -1.;
1118 tpar[1] = -1.;
1119
1120 const Float_t X_MC2A=X_MC1A;
1121 const Float_t Y_MC2A=0.;
1122 const Float_t Z_MC2A=0.;
1123
1124 tpar[2] = 0.1;
cfce8870 1125 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1126 tpar[2] = 0.3;
cfce8870 1127 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1128 tpar[2] = 0.4;
1129 tpar[0] = (X_MC1_MAX-X_MC1_MED)/2.;
1130 tpar[1] = Y_MC1_MIN;
cfce8870 1131 gMC->Gsposp("CC2A", 1, "CM12",X_MC2A,Y_MC2A,Z_MC2A, 0, "ONLY", tpar, 3);
1132 gMC->Gsposp("CC2A", 2, "CM12",-X_MC2A,Y_MC2A,Z_MC2A, 0, "ONLY", tpar, 3);
fe4da5cc 1133
1134// chamber type B
1135 tpar[0] = (X_MC1_MAX-X_MC1_MIN)/2.;
1136 tpar[1] = (Y_MC1_MAX-Y_MC1_MIN)/2.;
1137
1138 const Float_t X_MC2B=X_MC1B;
1139 const Float_t Y_MC2B=2.*Y_MC1_MIN*Z_1S2-Y_MC1_MIN*1.5+Y_MC1_MAX*0.5;
1140 const Float_t Z_MC2B=0.;
1141
cfce8870 1142 gMC->Gsposp("CC2A", 3, "CM12",X_MC2B,Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
1143 gMC->Gsposp("CC2A", 4, "CM12",-X_MC2B,Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
1144 gMC->Gsposp("CC2A", 5, "CM12",X_MC2B,-Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
1145 gMC->Gsposp("CC2A", 6, "CM12",-X_MC2B,-Y_MC2B,Z_MC2B, 0, "ONLY", tpar, 3);
fe4da5cc 1146
1147// chamber type C
1148 tpar[0] = X_MC1_MAX/2;
1149 tpar[1] = Y_MC1_MAX/2;
1150
1151 const Float_t X_MC2C=X_MC1C;
1152 const Float_t Y_MC2C=2.*Y_MC1_MIN*Z_1S2-Y_MC1_MIN*2.+Y_MC1_MAX*1.5;
1153 const Float_t Z_MC2C=0.;
1154
cfce8870 1155 gMC->Gsposp("CC2A", 7, "CM12",X_MC2C,Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
1156 gMC->Gsposp("CC2A", 8, "CM12",-X_MC2C,Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
1157 gMC->Gsposp("CC2A", 9, "CM12",X_MC2C,-Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
1158 gMC->Gsposp("CC2A", 10, "CM12",-X_MC2C,-Y_MC2C,Z_MC2C, 0, "ONLY", tpar, 3);
fe4da5cc 1159
1160// chamber type D
1161 tpar[0] = X_MC1_MAX/2.;
1162 tpar[1] = Y_MC1_MIN;
1163
1164 const Float_t X_MC2D=X_MC1D;
1165 const Float_t Z_MC2D=0.;
1166
1167 Float_t Y_MC2D=4.*Y_MC1_MIN*Z_1S2;
cfce8870 1168 gMC->Gsposp("CC2A", 11, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1169 gMC->Gsposp("CC2A", 12, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1170 gMC->Gsposp("CC2A", 13, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1171 gMC->Gsposp("CC2A", 14, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
fe4da5cc 1172
1173 Y_MC2D=6.*Y_MC1_MIN*Z_1S2;
cfce8870 1174 gMC->Gsposp("CC2A", 15, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1175 gMC->Gsposp("CC2A", 16, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1176 gMC->Gsposp("CC2A", 17, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1177 gMC->Gsposp("CC2A", 18, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
fe4da5cc 1178
1179 Y_MC2D=8.*Y_MC1_MIN*Z_1S2;
cfce8870 1180 gMC->Gsposp("CC2A", 19, "CM12",X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1181 gMC->Gsposp("CC2A", 20, "CM12",X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1182 gMC->Gsposp("CC2A", 21, "CM12",-X_MC2D,Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
1183 gMC->Gsposp("CC2A", 22, "CM12",-X_MC2D,-Y_MC2D,Z_MC2D, 0, "ONLY", tpar, 3);
fe4da5cc 1184
cfce8870 1185 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
fe4da5cc 1186
1187// Station 2
1188 iChamber=(AliMUONchamber*) (*fChambers)[12];
1189 Float_t zpos3=iChamber->ZPosition();
1190 Float_t zpos4=zpos3+DTPLANES;
1191
1192// Parameters of the Trigger Chambers
1193 //Station 2
1194 const Float_t X_MC3_MIN=X_MC1_MIN*zpos3/zpos1;
1195 const Float_t X_MC3_MED=X_MC1_MED*zpos3/zpos1;
1196 const Float_t X_MC3_MAX=X_MC1_MAX*zpos3/zpos1;
1197 const Float_t Y_MC3_MIN=Y_MC1_MIN*zpos3/zpos1;
1198 const Float_t Y_MC3_MAX=Y_MC1_MAX*zpos3/zpos1;
1199 const Float_t R_MIN3=R_MIN1*zpos3/zpos1;
1200 const Float_t R_MAX3=R_MAX1*zpos3/zpos1;
1201
1202// Mother volume definition
a897a37a 1203 tpar[0] = iChamber->RInner();
1204 tpar[1] = iChamber->ROuter();
fe4da5cc 1205 tpar[2] = 0.4;
a897a37a 1206 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1207 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
fe4da5cc 1208
1209// Definition of the flange between the beam shielding and the RPC
1210 tpar[0]= R_MIN3;
1211 tpar[1]= R_MAX3;
1212 tpar[2]= 0.4;
1213
a897a37a 1214 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
cfce8870 1215 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1216 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
fe4da5cc 1217
1218// Definition of prototype for chambers in the third plane
1219
1220 tpar[0]= 0.;
1221 tpar[1]= 0.;
1222 tpar[2]= 0.;
1223
a897a37a 1224 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
cfce8870 1225 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1226 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
fe4da5cc 1227
1228// chamber type A
1229 tpar[0] = -1.;
1230 tpar[1] = -1.;
1231
1232 const Float_t X_MC3A=X_MC3_MED+(X_MC3_MAX-X_MC3_MED)/2.;
1233 const Float_t Y_MC3A=0.;
1234 const Float_t Z_MC3A=0.;
1235
1236 tpar[2] = 0.1;
cfce8870 1237 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1238 tpar[2] = 0.3;
cfce8870 1239 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1240 tpar[0] = (X_MC3_MAX-X_MC3_MED)/2.;
1241 tpar[1] = Y_MC3_MIN;
1242 tpar[2] = 0.4;
cfce8870 1243 gMC->Gsposp("CC3A", 1, "CM21",X_MC3A,Y_MC3A,Z_MC3A, 0, "ONLY", tpar, 3);
1244 gMC->Gsposp("CC3A", 2, "CM21",-X_MC3A,Y_MC3A,Z_MC3A, 0, "ONLY", tpar, 3);
fe4da5cc 1245
1246// chamber type B
1247 tpar[0] = (X_MC3_MAX-X_MC3_MIN)/2.;
1248 tpar[1] = (Y_MC3_MAX-Y_MC3_MIN)/2.;
1249
1250 const Float_t X_MC3B=X_MC3_MIN+tpar[0];
1251 const Float_t Y_MC3B=Y_MC3_MIN+tpar[1];
1252 const Float_t Z_MC3B=0.;
1253
cfce8870 1254 gMC->Gsposp("CC3A", 3, "CM21",X_MC3B,Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1255 gMC->Gsposp("CC3A", 4, "CM21",-X_MC3B,Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1256 gMC->Gsposp("CC3A", 5, "CM21",X_MC3B,-Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
1257 gMC->Gsposp("CC3A", 6, "CM21",-X_MC3B,-Y_MC3B,Z_MC3B, 0, "ONLY", tpar, 3);
fe4da5cc 1258
1259// chamber type C
1260 tpar[0] = X_MC3_MAX/2.;
1261 tpar[1] = Y_MC3_MAX/2.;
1262
1263 const Float_t X_MC3C=tpar[0];
1264 const Float_t Y_MC3C=Y_MC3_MAX+tpar[1];
1265 const Float_t Z_MC3C=0.;
1266
cfce8870 1267 gMC->Gsposp("CC3A", 7, "CM21",X_MC3C,Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1268 gMC->Gsposp("CC3A", 8, "CM21",-X_MC3C,Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1269 gMC->Gsposp("CC3A", 9, "CM21",X_MC3C,-Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
1270 gMC->Gsposp("CC3A", 10, "CM21",-X_MC3C,-Y_MC3C,Z_MC3C, 0, "ONLY", tpar, 3);
fe4da5cc 1271
1272// chamber type D
1273 tpar[0] = X_MC3_MAX/2.;
1274 tpar[1] = Y_MC3_MIN;
1275
1276 const Float_t X_MC3D=tpar[0];
1277 const Float_t Z_MC3D=0.;
1278
1279 Float_t Y_MC3D=4.*Y_MC3_MIN;
cfce8870 1280 gMC->Gsposp("CC3A", 11, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1281 gMC->Gsposp("CC3A", 12, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1282 gMC->Gsposp("CC3A", 13, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1283 gMC->Gsposp("CC3A", 14, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
fe4da5cc 1284
1285 Y_MC3D=6.*Y_MC3_MIN;
cfce8870 1286 gMC->Gsposp("CC3A", 15, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1287 gMC->Gsposp("CC3A", 16, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1288 gMC->Gsposp("CC3A", 17, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1289 gMC->Gsposp("CC3A", 18, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
fe4da5cc 1290
1291 Y_MC3D=8.*Y_MC3_MIN;
cfce8870 1292 gMC->Gsposp("CC3A", 19, "CM21",X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1293 gMC->Gsposp("CC3A", 20, "CM21",X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1294 gMC->Gsposp("CC3A", 21, "CM21",-X_MC3D,Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
1295 gMC->Gsposp("CC3A", 22, "CM21",-X_MC3D,-Y_MC3D,Z_MC3D, 0, "ONLY", tpar, 3);
fe4da5cc 1296
1297// Positioning third plane in ALICE
cfce8870 1298 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
fe4da5cc 1299
1300// End of geometry definition for the third plane
1301
1302// Station 2 - plan 4 - same RPCs as plan 3 ==> small non covered area
1303// Y position moved (ratio zpos4/zpos3)
1304 const Float_t Z_3S4=zpos4/zpos3;
1305
1306// Definition of prototype for chambers in the fourth plane
1307
1308 tpar[0]= 0.;
1309 tpar[1]= 0.;
1310 tpar[2]= 0.;
1311
a897a37a 1312 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
cfce8870 1313 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1314 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
fe4da5cc 1315
1316// chamber type A
1317 tpar[0] = -1.;
1318 tpar[1] = -1.;
1319
1320 const Float_t X_MC4A=X_MC3A;
1321 const Float_t Y_MC4A=0.;
1322 const Float_t Z_MC4A=0.;
1323
1324 tpar[2] = 0.1;
cfce8870 1325 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1326 tpar[2] = 0.3;
cfce8870 1327 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
fe4da5cc 1328 tpar[2] = 0.4;
1329 tpar[0] = (X_MC3_MAX-X_MC3_MED)/2.;
1330 tpar[1] = Y_MC3_MIN;
cfce8870 1331 gMC->Gsposp("CC4A", 1, "CM22",X_MC4A,Y_MC4A,Z_MC4A, 0, "ONLY", tpar, 3);
1332 gMC->Gsposp("CC4A", 2, "CM22",-X_MC4A,Y_MC4A,Z_MC4A, 0, "ONLY", tpar, 3);
fe4da5cc 1333
1334// chamber type B
1335 tpar[0] = (X_MC3_MAX-X_MC3_MIN)/2.;
1336 tpar[1] = (Y_MC3_MAX-Y_MC3_MIN)/2.;
1337
1338 const Float_t X_MC4B=X_MC3B;
1339 const Float_t Y_MC4B=2.*Y_MC3_MIN*Z_3S4-Y_MC3_MIN*1.5+Y_MC3_MAX*0.5;
1340 const Float_t Z_MC4B=0.;
1341
cfce8870 1342 gMC->Gsposp("CC4A", 3, "CM22",X_MC4B,Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1343 gMC->Gsposp("CC4A", 4, "CM22",-X_MC4B,Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1344 gMC->Gsposp("CC4A", 5, "CM22",X_MC4B,-Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
1345 gMC->Gsposp("CC4A", 6, "CM22",-X_MC4B,-Y_MC4B,Z_MC4B, 0, "ONLY", tpar, 3);
fe4da5cc 1346
1347// chamber type C
1348 tpar[0] = X_MC3_MAX/2;
1349 tpar[1] = Y_MC3_MAX/2;
1350
1351 const Float_t X_MC4C=X_MC3C;
1352 const Float_t Y_MC4C=2.*Y_MC3_MIN*Z_3S4-Y_MC3_MIN*2.+Y_MC3_MAX*1.5;
1353 const Float_t Z_MC4C=0.;
1354
cfce8870 1355 gMC->Gsposp("CC4A", 7, "CM22",X_MC4C,Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1356 gMC->Gsposp("CC4A", 8, "CM22",-X_MC4C,Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1357 gMC->Gsposp("CC4A", 9, "CM22",X_MC4C,-Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
1358 gMC->Gsposp("CC4A", 10, "CM22",-X_MC4C,-Y_MC4C,Z_MC4C, 0, "ONLY", tpar, 3);
fe4da5cc 1359
1360// chamber type D
1361 tpar[0] = X_MC3_MAX/2.;
1362 tpar[1] = Y_MC3_MIN;
1363
1364 const Float_t X_MC4D=X_MC3D;
1365 const Float_t Z_MC4D=0.;
1366
1367 Float_t Y_MC4D=4.*Y_MC3_MIN*Z_3S4;
cfce8870 1368 gMC->Gsposp("CC4A", 11, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1369 gMC->Gsposp("CC4A", 12, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1370 gMC->Gsposp("CC4A", 13, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1371 gMC->Gsposp("CC4A", 14, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
fe4da5cc 1372
1373 Y_MC4D=6.*Y_MC3_MIN*Z_3S4;
cfce8870 1374 gMC->Gsposp("CC4A", 15, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1375 gMC->Gsposp("CC4A", 16, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1376 gMC->Gsposp("CC4A", 17, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1377 gMC->Gsposp("CC4A", 18, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
fe4da5cc 1378
1379 Y_MC4D=8.*Y_MC3_MIN*Z_3S4;
cfce8870 1380 gMC->Gsposp("CC4A", 19, "CM22",X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1381 gMC->Gsposp("CC4A", 20, "CM22",X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1382 gMC->Gsposp("CC4A", 21, "CM22",-X_MC4D,Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
1383 gMC->Gsposp("CC4A", 22, "CM22",-X_MC4D,-Y_MC4D,Z_MC4D, 0, "ONLY", tpar, 3);
fe4da5cc 1384
cfce8870 1385 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
a897a37a 1386
fe4da5cc 1387}
1388
1389
1390//___________________________________________
1391void AliMUONv0::CreateMaterials()
1392{
1393 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1394 //
1395 // Ar-CO2 gas
1396 Float_t ag1[3] = { 39.95,12.01,16. };
1397 Float_t zg1[3] = { 18.,6.,8. };
1398 Float_t wg1[3] = { .8,.0667,.13333 };
1399 Float_t dg1 = .001821;
1400 //
1401 // Ar-buthane-freon gas -- trigger chambers
1402 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1403 Float_t ztr1[4] = { 18.,6.,1.,9. };
1404 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1405 Float_t dtr1 = .002599;
1406 //
1407 // Ar-CO2 gas
1408 Float_t agas[3] = { 39.95,12.01,16. };
1409 Float_t zgas[3] = { 18.,6.,8. };
1410 Float_t wgas[3] = { .74,.086684,.173316 };
1411 Float_t dgas = .0018327;
1412 //
1413 // Ar-Isobutane gas (80%+20%) -- tracking
1414 Float_t ag[3] = { 39.95,12.01,1.01 };
1415 Float_t zg[3] = { 18.,6.,1. };
1416 Float_t wg[3] = { .8,.057,.143 };
1417 Float_t dg = .0019596;
1418 //
1419 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1420 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1421 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1422 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1423 Float_t dtrig = .0031463;
1424 //
1425 // bakelite
1426
1427 Float_t abak[3] = {12.01 , 1.01 , 16.};
1428 Float_t zbak[3] = {6. , 1. , 8.};
1429 Float_t wbak[3] = {6. , 6. , 1.};
1430 Float_t dbak = 1.4;
1431
1432 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1433
1434 Int_t ISXFLD = gAlice->Field()->Integ();
1435 Float_t SXMGMX = gAlice->Field()->Max();
1436 //
1437 // --- Define the various materials for GEANT ---
1438 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
a897a37a 1439 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
fe4da5cc 1440 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1441 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1442 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1443 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1444 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1445 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1446 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1447
1448 epsil = .001; // Tracking precision,
1449 stemax = -1.; // Maximum displacement for multiple scat
1450 tmaxfd = -20.; // Maximum angle due to field deflection
1451 deemax = -.3; // Maximum fractional energy loss, DLS
1452 stmin = -.8;
1453 //
1454 // Air
ad51aeb0 1455 AliMedium(1, "AIR_CH_US ", 15, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 1456 //
1457 // Aluminum
1458
ad51aeb0 1459 AliMedium(4, "ALU_CH_US ", 9, 0, ISXFLD, SXMGMX, tmaxfd, fMaxStepAlu,
fe4da5cc 1460 fMaxDestepAlu, epsil, stmin);
a897a37a 1461 AliMedium(5, "ALU_CH_US ", 10, 0, ISXFLD, SXMGMX, tmaxfd, fMaxStepAlu,
1462 fMaxDestepAlu, epsil, stmin);
fe4da5cc 1463 //
1464 // Ar-isoC4H10 gas
1465
ad51aeb0 1466 AliMedium(6, "AR_CH_US ", 20, 1, ISXFLD, SXMGMX, tmaxfd, fMaxStepGas,
fe4da5cc 1467 fMaxDestepGas, epsil, stmin);
1468//
1469 // Ar-Isobuthane-Forane-SF6 gas
1470
ad51aeb0 1471 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 1472
ad51aeb0 1473 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, ISXFLD, SXMGMX, tmaxfd, fMaxStepAlu,
fe4da5cc 1474 fMaxDestepAlu, epsil, stmin);
1475
a897a37a 1476 AliMedium(9, "ARG_CO2 ", 22, 1, ISXFLD, SXMGMX, tmaxfd, fMaxStepGas,
1477 fMaxDestepAlu, epsil, stmin);
1478
fe4da5cc 1479}
1480
1481//___________________________________________
1482
1483void AliMUONv0::Init()
1484{
1485 printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
1486
1487 //
1488 // Initialize Tracking Chambers
1489 //
1490 for (Int_t i=0; i<NCH; i++) {
1491 ( (AliMUONchamber*) (*fChambers)[i])->Init();
1492 }
a897a37a 1493
fe4da5cc 1494 //
1495 // Set the chamber (sensitive region) GEANT identifier
a897a37a 1496 AliMC* gMC = AliMC::GetMC();
cfce8870 1497 ((AliMUONchamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1498 ((AliMUONchamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1499 ((AliMUONchamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1500 ((AliMUONchamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1501 ((AliMUONchamber*)(*fChambers)[4])->SetGid(gMC->VolId("C05G"));
1502 ((AliMUONchamber*)(*fChambers)[5])->SetGid(gMC->VolId("C06G"));
1503 ((AliMUONchamber*)(*fChambers)[6])->SetGid(gMC->VolId("C07G"));
1504 ((AliMUONchamber*)(*fChambers)[7])->SetGid(gMC->VolId("C08G"));
1505 ((AliMUONchamber*)(*fChambers)[8])->SetGid(gMC->VolId("C09G"));
1506 ((AliMUONchamber*)(*fChambers)[9])->SetGid(gMC->VolId("C10G"));
1507 ((AliMUONchamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1508 ((AliMUONchamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1509 ((AliMUONchamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1510 ((AliMUONchamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
fe4da5cc 1511
1512 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1513}
1514
1515//___________________________________________
1516void AliMUONv0::StepManager()
1517{
1518 Int_t copy, id;
1519 static Int_t idvol;
1520 static Int_t vol[2];
1521 Int_t ipart;
a897a37a 1522 TLorentzVector pos;
1523 TLorentzVector mom;
1524 Float_t theta,phi;
fe4da5cc 1525 Float_t destep, step;
a897a37a 1526
1527 static Float_t eloss, eloss2, xhit, yhit, tlength;
fe4da5cc 1528 const Float_t big=1.e10;
1529
a897a37a 1530 // modifs perso
1531 static Float_t hits[14];
1532
fe4da5cc 1533 TClonesArray &lhits = *fHits;
fe4da5cc 1534
1535 //
1536 // Set maximum step size for gas
cfce8870 1537 // numed=gMC->GetMedium();
fe4da5cc 1538 //
1539 // Only charged tracks
cfce8870 1540 if( !(gMC->TrackCharge()) ) return;
fe4da5cc 1541 //
1542 // Only gas gap inside chamber
1543 // Tag chambers and record hits when track enters
1544 idvol=-1;
0a6d8768 1545 id=gMC->CurrentVolID(copy);
fe4da5cc 1546
1547 for (Int_t i=1; i<=NCH; i++) {
1548 if(id==((AliMUONchamber*)(*fChambers)[i-1])->GetGid()){
1549 vol[0]=i;
1550 idvol=i-1;
1551 }
1552 }
1553 if (idvol == -1) return;
1554 //
1555 // Get current particle id (ipart), track position (pos) and momentum (mom)
cfce8870 1556 gMC->TrackPosition(pos);
1557 gMC->TrackMomentum(mom);
fe4da5cc 1558
cfce8870 1559 ipart = gMC->TrackPid();
a897a37a 1560 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1561 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1562
fe4da5cc 1563 //
1564 // momentum loss and steplength in last step
cfce8870 1565 destep = gMC->Edep();
1566 step = gMC->TrackStep();
fe4da5cc 1567
1568 //
1569 // record hits when track enters ...
0a6d8768 1570 if( gMC->IsTrackEntering()) {
cfce8870 1571 gMC->SetMaxStep(fMaxStepGas);
a897a37a 1572 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1573 Double_t rt = TMath::Sqrt(tc);
1574 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1575 Double_t tx=mom[0]/pmom;
1576 Double_t ty=mom[1]/pmom;
1577 Double_t tz=mom[2]/pmom;
1578 Double_t s=((AliMUONchamber*)(*fChambers)[idvol])
1579 ->GetResponseModel()
1580 ->Pitch()/tz;
1581 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1582 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
fe4da5cc 1583 hits[0] = Float_t(ipart); // Geant3 particle type
a897a37a 1584 hits[1] = pos[0]+s*tx; // X-position for hit
1585 hits[2] = pos[1]+s*ty; // Y-position for hit
1586 hits[3] = pos[2]+s*tz; // Z-position for hit
1587 hits[4] = theta; // theta angle of incidence
1588 hits[5] = phi; // phi angle of incidence
fe4da5cc 1589 hits[8] = (Float_t) fNclusters; // first padhit
1590 hits[9] = -1; // last pad hit
a897a37a 1591
1592 // modifs perso
1593 hits[10] = mom[3]; // hit momentum P
1594 hits[11] = mom[0]; // Px/P
1595 hits[12] = mom[1]; // Py/P
1596 hits[13] = mom[2]; // Pz/P
1597 // fin modifs perso
1598
fe4da5cc 1599 // phi angle of incidence
1600 tlength = 0;
1601 eloss = 0;
a897a37a 1602 eloss2 = 0;
fe4da5cc 1603 xhit = pos[0];
1604 yhit = pos[1];
1605 // Only if not trigger chamber
1606 if(idvol<10) {
1607 //
1608 // Initialize hit position (cursor) in the segmentation model
1609 ((AliMUONchamber*) (*fChambers)[idvol])
1610 ->SigGenInit(pos[0], pos[1], pos[2]);
1611 } else {
1612 //geant3->Gpcxyz();
1613 //printf("In the Trigger Chamber #%d\n",idvol-9);
1614 }
1615 }
a897a37a 1616 eloss2+=destep;
fe4da5cc 1617
1618 //
1619 // Calculate the charge induced on a pad (disintegration) in case
1620 //
1621 // Mip left chamber ...
0a6d8768 1622 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
cfce8870 1623 gMC->SetMaxStep(big);
fe4da5cc 1624 eloss += destep;
1625 tlength += step;
1626
1627 // Only if not trigger chamber
1628 if(idvol<10) {
a897a37a 1629 if (eloss > 0)
1630 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),eloss,idvol);
fe4da5cc 1631 }
1632
1633 hits[6]=tlength;
a897a37a 1634 hits[7]=eloss2;
fe4da5cc 1635 if (fNclusters > (Int_t)hits[8]) {
1636 hits[8]= hits[8]+1;
1637 hits[9]= (Float_t) fNclusters;
1638 }
1639
1640 new(lhits[fNhits++])
1641 AliMUONhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1642 eloss = 0;
1643 //
1644 // Check additional signal generation conditions
1645 // defined by the segmentation
1646 // model (boundary crossing conditions)
1647 } else if
1648 (((AliMUONchamber*) (*fChambers)[idvol])
1649 ->SigGenCond(pos[0], pos[1], pos[2]))
1650 {
1651 ((AliMUONchamber*) (*fChambers)[idvol])
1652 ->SigGenInit(pos[0], pos[1], pos[2]);
1653// printf("\n-> MakePadHits, reason special %d",ipart);
a897a37a 1654 if (eloss > 0)
1655 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),eloss,idvol);
fe4da5cc 1656 xhit = pos[0];
1657 yhit = pos[1];
1658 eloss = destep;
1659 tlength += step ;
1660 //
1661 // nothing special happened, add up energy loss
1662 } else {
1663 eloss += destep;
1664 tlength += step ;
1665 }
1666}