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