T0 overlaps
[u/mrichter/AliRoot.git] / START / AliSTARTv1.cxx
CommitLineData
bc46b572 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/////////////////////////////////////////////////////////////////////
18// //
19// START ( T-zero) detector version 1 //
20//
21//Begin Html
22/*
23<img src="gif/AliSTARTv1Class.gif">
24*/
25//End Html
26// //
27// //
28//////////////////////////////////////////////////////////////////////
29
88cb7938 30#include <Riostream.h>
31#include <stdlib.h>
32
bc46b572 33#include <TGeometry.h>
0cc62300 34#include <TLorentzVector.h>
88cb7938 35#include <TMath.h>
36#include <TNode.h>
37#include <TTUBE.h>
38#include <TVirtualMC.h>
bc46b572 39
94de3818 40#include "AliMagF.h"
88cb7938 41#include "AliRun.h"
bc46b572 42#include "AliSTARThit.h"
88cb7938 43#include "AliSTARTv1.h"
5d12ce38 44#include "AliMC.h"
bc46b572 45
46ClassImp(AliSTARTv1)
47
48//--------------------------------------------------------------------
49AliSTARTv1::AliSTARTv1(const char *name, const char *title):
50 AliSTART(name,title)
51{
52 //
53 // Standart constructor for START Detector version 0
54 //
55 fIdSens1=0;
56// setBufferSize(128000);
57}
58//-------------------------------------------------------------------------
59void AliSTARTv1::CreateGeometry()
60{
61 //
62 // Create the geometry of START Detector version 0
63 //
64 // begin Html
65 /*
66 <img src="gif/AliSTARTv0.gif">
67 */
68 //
69
70
71 Int_t *idtmed = fIdtmed->GetArray();
72
73 Int_t is;
74 Int_t idrotm[999];
75 Float_t x,y,z;
76
21bd4caa 77 Float_t pstart[3]={4.2,11.,7.};
d65c9254 78 Float_t pinstart[3]={0.,1.6,6.5};
bc46b572 79 Float_t ppmt[3]={0.,1.3,3.5};
80 Float_t pdivider[3]={0.,1.2,1.75};
81 Float_t pdiv2[3]={0.,1.2,1.25};
82 Float_t pdiv1[3]={0.6,1.2,0.5};
83 Float_t ptop[3]={0.,1.3,1.5};
84 Float_t pbot[3]={0.6,1.2,0.1};
85 Float_t pglass[3]={1.2,1.3,2.};
86 Float_t pcer[3]={0.9,1.1,0.09};
87 Float_t psteel[3]={0.9,1.1,0.01};
88 Float_t ppins[3]={0.6,1.2,0.014};
89 Float_t phole[3]={0.6,1.2,0.015};
90 Float_t pknob[3]={0.5,0.6,0.4};
91 Float_t pknob_vac[3]={0.,0.5,0.4};
92 Float_t pknob_bot[3]={0.,0.6,0.05};
93 Float_t pribber[3] = {0.,1.2,2.413/2.};
94 Float_t presist[3] = {0.,1.2,0.087/2.};
d65c9254 95 Float_t psupport1[3] = {4.5,4.6,4.0};//C kozhuh vnutri
96 Float_t psupport2[3] = {9.4,9.5,4.0};// snaruzhi C
97 Float_t psupport3[3] = {4.5,9.5,0.05};//kryshki C
98 Float_t psupport4[3] = {0,1.6,0.05};// dyrki dlia feu v zadnej kryshke Air
99 Float_t psupport5[3] = {1.54,1.6,6.5}; // stakanchik dlai feu C
100 Float_t psupport6[3] = {0,1.6,0.05}; //kryshechka stakanchika Al
101 Float_t psupport7[3] = {1.5,1.6,0.6}; //kolechko snaruzhu stakanchika Al
102 // Mother Volume katushka dlia krepezha vokrug truby k Absorbru
2ad713c4 103 AliMatrix(idrotm[901], 90., 0., 90., 90., 180., 0.);
d65c9254 104 Float_t ppcon[70];
105 ppcon[0] = 0;
106 ppcon[1] = 360;
107 ppcon[2] = 15;
108// 1:
109 ppcon[3] = 14.1/2;
110 ppcon[4] = 4.4;
50063378 111 ppcon[5] = 4.6;
d65c9254 112// 2
50063378 113 ppcon[6] = ppcon[3]+0.9;
d65c9254 114 ppcon[7] = 4.4;
50063378 115 ppcon[8] = 4.6;
d65c9254 116// 3
117 ppcon[9] = ppcon[6];
118 ppcon[10] = 4.4;
119 ppcon[11] = 5.3;
120
121// 4
122
123 ppcon[12] = ppcon[9]+0.1;
124 ppcon[13] = 4.4;
125 ppcon[14] = 5.3;
126// 5
127
128 ppcon[15] = ppcon[12];
129 ppcon[16] = 5.1;
130 ppcon[17] = 5.3;
131
132// 6
50063378 133 ppcon[18] = ppcon[15]+5.8;
d65c9254 134 ppcon[19] = 5.1;
135 ppcon[20] = 5.3;
136
137// 7
138 ppcon[21] = ppcon[18];
139 ppcon[22] = 5.1;
140 ppcon[23] = 5.9;
141
142// 8
50063378 143 ppcon[24] = ppcon[21]+1.8;
d65c9254 144 ppcon[25] = 5.1;
145 ppcon[26] = 5.9;
146// 9
50063378 147
148 ppcon[27] = ppcon[24];
149 ppcon[28] = 3.15;
d65c9254 150 ppcon[29] = 5.9;
151
152// 10
50063378 153 ppcon[30] = ppcon[27]+0.3;
d65c9254 154 ppcon[31] = 3.15;
155 ppcon[32] = 5.9;
50063378 156
d65c9254 157// 11
158 ppcon[33] = ppcon[30];
159 ppcon[34] = 3.15;
160 ppcon[35] = 5.9;
50063378 161
d65c9254 162// 12
50063378 163 ppcon[36] = ppcon[33];
d65c9254 164 ppcon[37] = 3.15;
165 ppcon[38] = 3.25;
166
167// 13
168 ppcon[39] = ppcon[36]+4.5;
169 ppcon[40] = 3.15;
170 ppcon[41] = 3.25;
171// 14
50063378 172 ppcon[42] = ppcon[39];
d65c9254 173 ppcon[43] = 3.15;
174 ppcon[44] = 7.6;
175// 15
50063378 176 ppcon[45] = ppcon[42]+1.;
d65c9254 177 ppcon[46] = 3.15;
178 ppcon[47] = 7.6;
179
180 gMC->Gsvolu("0SUP", "PCON", idtmed[kAir], ppcon,48);
2ad713c4 181 z=-69.7;//-14.1/2;
182 gMC->Gspos("0SUP",1,"ALIC",0.,0.,z,idrotm[901],"ONLY");
bc46b572 183
50063378 184
185 Float_t zdetRight=69.7,zdetLeft=350;
bc46b572 186 //-------------------------------------------------------------------
187 // START volume
188 //-------------------------------------------------------------------
189
bc46b572 190
d65c9254 191 gMC->Gsvolu("0STR","TUBE",idtmed[kAir],pstart,3);
192 gMC->Gsvolu("0STL","TUBE",idtmed[kAir],pstart,3);
2ad713c4 193 gMC->Gspos("0STR",1,"ALIC",0.,0.,-zdetRight-pstart[2],idrotm[901],"ONLY");
194 gMC->Gspos("0STL",1,"ALIC",0.,0.,zdetLeft+pstart[2],0,"ONLY");
bc46b572 195
196//START interior
d65c9254 197 gMC->Gsvolu("0INS","TUBE",idtmed[kAir],pinstart,3);
198 gMC->Gsvolu("0PMT","TUBE",idtmed[kVac],ppmt,3);
199 gMC->Gsvolu("0DIV","TUBE",idtmed[kVac],pdivider,3);
200 gMC->Gsvolu("0SU1","TUBE",idtmed[kC],psupport1,3);//C kozhuh vnutri
201 gMC->Gsvolu("0SU2","TUBE",idtmed[kC],psupport2,3);// snaruzhi C
202 gMC->Gsvolu("0SU3","TUBE",idtmed[kC],psupport3,3);//kryshka perednaiai C
203 gMC->Gsvolu("0SU4","TUBE",idtmed[kC],psupport3,3);//kryshka zadnaiai C
204 gMC->Gsvolu("0SU5","TUBE",idtmed[kAir],psupport4,3);// dyrki dlia feu v zadnej kryshke Air
205 cout<<" 0Su6 >> "<<psupport5[0]<<" "<<psupport5[1]<<" "<<psupport5[2]<<endl;
206 gMC->Gsvolu("0SU6","TUBE",idtmed[kC],psupport5,3);// stakanchik dlai feu C
207 gMC->Gsvolu("0SU7","TUBE",idtmed[kAl],psupport6,3);//kryshechka stakanchika Al
208 gMC->Gsvolu("0SU8","TUBE",idtmed[kAl],psupport7,3);//kolechko snaruzhu stakanchika Al
209
bc46b572 210// first ring: 12 units of Scintillator+PMT+divider
d65c9254 211 Float_t theta = (180 / TMath::Pi()) * TMath::ATan(6.5 / zdetRight);
212 Float_t angel = 2 * TMath::Pi() / 12;
213 Float_t phi[3];
214 for (is=0; is<12; is++)
bc46b572 215 {
ef51244a 216
d65c9254 217 x = 6.5 * TMath::Sin(is * angel);
218 y = 6.5 * TMath::Cos(is * angel);
219
220 phi[0] = -30 * is;
221 phi[1] = 90 - is * 30;
222 phi[2] = 90 - is * 30;
223 for (Int_t j = 0; j < 3; j++)
224 if (phi[j] < 0) phi[j] += 360;
225
226 AliMatrix (idrotm[902 + is], 90., phi[0],
227 90. + theta, phi[1],
228 theta, phi[2]);
229 z=-pstart[2]+pinstart[2]+0.2;
230 gMC->Gspos ("0INS", is + 1, "0STR", x, y, z, idrotm[902 + is], "ONLY");
231 gMC->Gspos ("0INS", is + 13, "0STL", x, y, z, 0, "ONLY");
9436d88b 232 }
724699e1 233
d65c9254 234
235 x=0;
9436d88b 236 y=0;
d65c9254 237 z=-pinstart[2]+ppmt[2]+2.*psupport6[2];
9436d88b 238 gMC->Gspos("0PMT",1,"0INS",x,y,z,0,"ONLY");
d65c9254 239 z=z+pdivider[2]+ppmt[2];
9436d88b 240 gMC->Gspos("0DIV",1,"0INS",x,y,z,0,"ONLY");
241
bc46b572 242// PMT
243
244 // Entry window (glass)
d65c9254 245 gMC->Gsvolu("0TOP","TUBE",idtmed[kGlass],ptop,3); //glass
a94466c5 246 // gMC->Gsvolu("0TOP","TUBE",idtmed[12],ptop,3); //lucite
247 z=-ppmt[2]+ptop[2];
2ca99a7f 248 gMC->Gspos("0TOP",1,"0PMT",0,0,z,0,"ONLY");
bc46b572 249 // printf("Z PTOP %f -ppmt[2] %f ptop[2] %f\n",z,-ppmt[2],ptop[2]);
a94466c5 250
bc46b572 251 // Bottom glass
d65c9254 252 gMC->Gsvolu("0BOT","TUBE",idtmed[kGlass],pbot,3);
bc46b572 253 z=ppmt[2]-pbot[2];
9e1a0ddb 254 if(fDebug) printf("%s: Z bottom %f\n",ClassName(),z);
2ca99a7f 255 gMC->Gspos("0BOT",1,"0PMT",0,0,z,0,"ONLY");
bc46b572 256 // Side cylinder glass
d65c9254 257 gMC->Gsvolu("0OUT","TUBE",idtmed[kGlass],pglass,3);
bc46b572 258 z=ppmt[2]-pglass[2];
259 // printf("Z glass %f\n",z);
2ca99a7f 260 gMC->Gspos("0OUT",1,"0PMT",0,0,z,0,"ONLY");
bc46b572 261 //PMT electrodes support structure
d65c9254 262 gMC->Gsvolu("0CER","TUBE",idtmed[kCer],pcer,3);
263 gMC->Gsvolu("0STE","TUBE",idtmed[kSteel],psteel,3);
bc46b572 264 z=-ppmt[2]+2*ptop[2]+0.3;;
265 // printf("Z Cer 1 %f\n",z);
266 for (is=1; is<=15; is++)
267 {
268 z=z+psteel[2]+pcer[2];
2ca99a7f 269 gMC->Gspos("0CER",is,"0PMT",0,0,z,0,"ONLY");
bc46b572 270 z=z+psteel[2]+pcer[2];
2ca99a7f 271 gMC->Gspos("0STE",is,"0PMT",0,0,z,0,"ONLY");
bc46b572 272 }
273
274 // Divider
275 // Knob at the bottom of PMT baloon
276
2ca99a7f 277 gMC->Gsvolu("0NB","TUBE",idtmed[6],pknob,3);
bc46b572 278 z=-pdivider[2]+pknob[2];
279 // printf("zknob %f\n",z);
2ca99a7f 280 gMC->Gspos("0NB",1,"0DIV",0,0,z,0,"ONLY");
d65c9254 281 gMC->Gsvolu("0KB","TUBE",idtmed[kGlass],pknob_bot,3);
bc46b572 282 z=-pdivider[2]+2*pknob[2]+pknob_bot[2];
2ca99a7f 283 // printf(knobbot %f\n",z);
284 gMC->Gspos("0KB",1,"0DIV ",0,0,z,0,"ONLY");
d65c9254 285 gMC->Gsvolu("0VAC","TUBE",idtmed[kVac],pknob_vac,3);
bc46b572 286 z=-pdivider[2]+pknob_vac[2];
287 // printf("knobvac %f\n",z);
2ca99a7f 288 gMC->Gspos("0VAC",1,"0DIV",0,0,z,0,"ONLY");
bc46b572 289 //Steel pins + pin holes
d65c9254 290 gMC->Gsvolu("0PIN","TUBE",idtmed[kSteel],ppins,3);
bc46b572 291 z=-pdivider[2]+ppins[2];
2ca99a7f 292 gMC->Gspos("0PIN",1,"0DIV",0,0,z,0,"ONLY");
d65c9254 293 gMC->Gsvolu("0HOL","TUBE",idtmed[kBrass],phole,3);
bc46b572 294 z=-pdivider[2]+2*ppins[2]+phole[2];
2ca99a7f 295 gMC->Gspos("0HOL",1,"0DIV",0,0,z,0,"ONLY");
bc46b572 296
297 //Socket
d65c9254 298 gMC->Gsvolu("0V1","TUBE",idtmed[kCer],pdiv1,3);
bc46b572 299 z=-pdivider[2]+pdiv1[2];
2ca99a7f 300 gMC->Gspos("0V1",1,"0DIV",0,0,z,0,"ONLY");
bc46b572 301 //Resistors
d65c9254 302 gMC->Gsvolu("0V2","TUBE",idtmed[kAir],pdiv2,3);
bc46b572 303 z=pdivider[2]-pdiv2[2];
2ca99a7f 304 gMC->Gspos("0V2",1,"0DIV",0,0,z,0,"ONLY");
d65c9254 305 gMC->Gsvolu("0RS","TUBE",idtmed[kCer],presist,3);
bc46b572 306 z=-pdiv2[2]+presist[2];
2ca99a7f 307 gMC->Gspos("0RS",1,"0V2",0,0,z,0,"ONLY");
d65c9254 308 gMC->Gsvolu("0RB","TUBE",idtmed[kRibber],pribber,3);
bc46b572 309 z=pdiv2[2]-pribber[2];
2ca99a7f 310 gMC->Gspos("0RB",1,"0V2",0,0,z,0,"ONLY");
d65c9254 311
312
313 //Support left side
314
315 z=-pstart[2]+psupport1[2];
316 gMC->Gspos("0SU1",2,"0STL",0,0,z,0,"ONLY"); //C kozhuh snaruzhi
317 gMC->Gspos("0SU2",2,"0STL",0,0,z,0,"ONLY"); //C kozhuh vnutri
318 z=-pstart[2]+psupport3[2];
319 gMC->Gspos("0SU3",2,"0STL",0,0,z,0,"ONLY"); //peredniaia kryshka
320 z=-pstart[2]+2.*psupport1[2];
321 gMC->Gspos("0SU4",2,"0STL",0,0,z,0,"ONLY"); //zadnaiai kryshka
322 //Dyrki dlia feu v zadnej kryshke
323 z=0;
324
325 for (is=1; is<=12; is++)
326 {
327 x=6.5*TMath::Sin(is*angel);
328 y=6.5 *TMath::Cos(is*angel);
329 gMC->Gspos("0SU5",is+12,"0SU4",x,y,z,0,"ONLY");
330
331 }
332
333 //Support right side
334
335 z=-pstart[2]+psupport1[2];
336 gMC->Gspos("0SU1",1,"0STR",0,0,z,0,"ONLY"); //C kozhuh snaruzhi
337 gMC->Gspos("0SU2",1,"0STR",0,0,z,0,"ONLY"); //C kozhuh vnutri
338 z=-pstart[2]+psupport3[2];
339 gMC->Gspos("0SU3",1,"0STR",0,0,z,0,"ONLY"); //peredniaia kryshka
340 z=-pstart[2]+2.*psupport1[2];
341 gMC->Gspos("0SU4",1,"0STR",0,0,z,0,"ONLY"); //zadnaiai kryshka
342 //Dyrki dlia feu v zadnej kryshke
343 z=0;
344
345 for (is=1; is<=12; is++)
346 {
347 x=(6.5+7.8*TMath::Tan(5.4*3.1415/180)) *TMath::Sin(is*angel);
348 y=(6.5+7.8*TMath::Tan(5.4*3.1415/180)) *TMath::Cos(is*angel);
349 gMC->Gspos("0SU5",is,"0SU4",x,y,z,0,"ONLY");
350
351 }
352
353 gMC->Gspos("0SU6",1,"0INS",0,0,0,0,"ONLY");//C stakanchik dlia feu
354 z=-psupport5[2]+psupport6[2];
355 gMC->Gspos("0SU7",1,"0SU6",0,0,z,0,"ONLY"); //Al kryshechka
bc46b572 356
d65c9254 357 z=pinstart[2]-psupport7[2];
358 gMC->Gspos("0SU8",1,"0SU6",0,0,z,0,"ONLY"); //Al kolechko
359
360
361 Float_t par[3];
362 par[0]=4.4;
363 par[1]=4.5;
364 par[2]=0.5;
365 gMC->Gsvolu("0SC0","TUBE",idtmed[kC],par,3);
366 z=ppcon[3]+par[2];
367 gMC->Gspos("0SC0",1,"0SUP",0,0,z,0,"ONLY");
368 z += par[2];
369 par[0]=4.4;
370 par[1]=5.1;
371 par[2]=0.05;
372 gMC->Gsvolu("0SC1","TUBE",idtmed[kC],par,3);
373 z += par[2];
374 gMC->Gspos("0SC1",1,"0SUP",0,0,z,0,"ONLY");
375 z=z+par[2];
376 par[0]=5.1;
377 par[1]=5.2;
378 par[2]=5.8/2;
379 gMC->Gsvolu("0SC2","TUBE",idtmed[kC],par,3);
380 z += par[2];
381 gMC->Gspos("0SC2",1,"0SUP",0,0,z,0,"ONLY");
382 z += par[2];
383 Float_t parC[5];
384 parC[0]=0.25;
385 parC[1]=5.1;
386 parC[2]=5.2;
387 parC[3]=5.5;
388 parC[4]=5.6;
389 gMC->Gsvolu("0SC3","CONE",idtmed[kC],parC,5);
390 z += parC[0];
391 gMC->Gspos("0SC3",1,"0SUP",0,0,z,0,"ONLY");
392 z += parC[0];
393 par[0]=5.5;
394 par[1]=5.6;
395 par[2]=1.2/2;
396 gMC->Gsvolu("0SC4","TUBE",idtmed[kC],par,3);
397 z += par[2];
398 gMC->Gspos("0SC4",1,"0SUP",0,0,z,0,"ONLY");
399 par[0]=5.1;
400 par[1]=5.5;
401 par[2]=1.2/2;
402 gMC->Gsvolu("0SA0","TUBE",idtmed[kAl],par,3);
403 gMC->Gspos("0SA0",1,"0SUP",0,0,z,0,"ONLY");
404 //gvozdi dlia skruchivaniia Al i C parts
405 par[0]=5.75;
406 par[1]=5.78;
407 gMC->Gsvolu("0SN1","TUBE",idtmed[kSteel],par,3);
408 gMC->Gspos("0SN1",1,"0SUP",0,0,z,0,"ONLY");
409 z += par[2];
410 par[0]=3.15;
411 par[1]=5.5;
412 par[2]=0.1;
413 gMC->Gsvolu("0SA1","TUBE",idtmed[kAl],par,3);
414 z += par[2];
415 gMC->Gspos("0SA1",1,"0SUP",0,0,z,0,"ONLY");
416 z=z+par[2];
417 par[0]=3.15;
418 par[1]=3.16;
419 par[2]=4.7/2;
420 gMC->Gsvolu("0SA2","TUBE",idtmed[kAl],par,3);
421 z += par[2];
422 gMC->Gspos("0SA2",1,"0SUP",0,0,z,0,"ONLY");
423 z=z+par[2];
424 par[0]=3.16; // eta chast' prikruchena k absorberu
425 par[1]=7.5;
426 par[2]=0.3;
427 gMC->Gsvolu("0SA3","TUBE",idtmed[kAl],par,3);
428 z += par[2];
429 gMC->Gspos("0SA3",1,"0SUP",0,0,z,0,"ONLY");
430 par[0]=3.16; // gvozdi eta chast' prikruchena k absorberu
431 par[1]=7.5;
432 par[2]=0.01;
433 gMC->Gsvolu("0SN2","TUBE",idtmed[kSteel],par,3);
434 gMC->Gspos("0SN2",1,"0SUP",0,0,z,0,"ONLY");
435
436
bc46b572 437}
438//------------------------------------------------------------------------
439void AliSTARTv1::CreateMaterials()
440{
ef51244a 441 Int_t isxfld = gAlice->Field()->Integ();
442 Float_t sxmgmx = gAlice->Field()->Max();
bc46b572 443 Float_t a,z,d,radl,absl,buf[1];
444 Int_t nbuf;
445
446// Scintillator CH
447 Float_t ascin[2]={1.01,12.01};
448 Float_t zscin[2]={1,6};
449 Float_t wscin[2]={1,1};
450 Float_t denscin=1.03;
a94466c5 451//Lucite C(CH3)CO2CH3
452 Float_t alucite[3]={1.01,12.01,15.999};
453 Float_t zlucite[3]={1,6,8};
454 Float_t wlucite[3]={8,5,2};
455 Float_t denlucite=1.16;
456 // PMT glass SiO2
bc46b572 457 Float_t aglass[2]={28.0855,15.9994};
458 Float_t zglass[2]={14.,8.};
459 Float_t wglass[2]={1.,2.};
460 Float_t dglass=2.65;
461// Ceramic 97.2% Al2O3 , 2.8% SiO2
462 Float_t acer[2],zcer[2],wcer[2]={0.972,0.028};
463 Float_t aal2o3[2] = { 26.981539,15.9994 };
464 Float_t zal2o3[2] = { 13.,8. };
465 Float_t wal2o3[2] = { 2.,3. };
466 Float_t denscer = 3.6;
467
468// Brass 80% Cu, 20% Zn
469 Float_t abrass[2] = {63.546,65.39};
470 Float_t zbrass[2] = {29,30};
471 Float_t wbrass[2] = {0.8,0.2};
472 Float_t denbrass=8.96;
473
474//Ribber C6H12S
475 Float_t aribber[3] = {12.,1.,32.};
476 Float_t zribber[3] = {6.,1.,16.};
477 Float_t wribber[3] = {6.,12.,1.};
478 Float_t denribber=0.8;
d65c9254 479// Support inside
480 Float_t asupport[2] = {12.,1.};
481 Float_t zsupport[2] = {6.,1.};
482 Float_t wsupport[2] = {1.,1.};
483 Float_t densupport=0.1;
bc46b572 484
485//*** Definition Of avaible START materials ***
486 AliMaterial(0, "START Steel$", 55.850,26.,7.87,1.76,999);
487 AliMaterial(1, "START Vacuum$", 1.e-16,1.e-16,1.e-16,1.e16,999);
488 AliMaterial(2, "START Air$", 14.61, 7.3, .001205, 30423.,999);
d65c9254 489 AliMaterial(10, "CarbonPlastic$", 12.01, 6.0, 2.26, 18.8,999);
490 AliMaterial(11, "Aliminium$", 26.98, 13.0, 2.7, 8.9,999);
bc46b572 491
492 AliMixture( 3, "Al2O3 $", aal2o3, zal2o3, denscer, -2, wal2o3);
493 AliMixture( 4, "PMT glass $",aglass,zglass,dglass,-2,wglass);
00d6d986 494 char namate[21]="";
bc46b572 495 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
496 acer[0]=a;
497 zcer[0]=z;
498 gMC->Gfmate((*fIdmate)[4], namate, a, z, d, radl, absl, buf, nbuf);
499 acer[1]=a;
500 zcer[1]=z;
501
502 AliMixture( 9, "Ceramic $", acer, zcer, denscer, 2, wcer);
503 AliMixture( 5, "Scintillator$",ascin,zscin,denscin,-2,wscin);
504 AliMixture( 6, "Brass $", abrass, zbrass, denbrass, 2, wbrass);
505
506 AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
a94466c5 507 AliMixture( 8, "Lucite$",alucite,zlucite,denlucite,-3,wlucite);
d65c9254 508 AliMixture( 9, "Penoplast$",asupport,zsupport,densupport,-2,wsupport);
509
bc46b572 510
ef51244a 511 AliMedium(1, "START Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
512 AliMedium(2, "Scintillator$", 5, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);
513 AliMedium(3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
514 AliMedium(4, "Ceramic$", 9, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
d65c9254 515 AliMedium(6, "Glass$", 4, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003);
ef51244a 516 AliMedium(8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
517 AliMedium(9, "Ribber $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
518 AliMedium(11, "Brass $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
a94466c5 519 AliMedium(12, "Lucite$", 8, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);
d65c9254 520 AliMedium(13, "CarbonPlastic$", 10, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003);
521 AliMedium(14, "PenoPlast$", 9, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003);
522 AliMedium(15, "Aluminium$", 11, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003);
a94466c5 523
9e1a0ddb 524 if(fDebug) cout<<ClassName()<<": ++++++++++++++Medium set++++++++++"<<endl;
bc46b572 525
bc46b572 526}
527//---------------------------------------------------------------------
528void AliSTARTv1::DrawDetector()
529{
530//
531// Draw a shaded view of the Forward multiplicity detector version 0
532//
533
534 //Set ALIC mother transparent
535 gMC->Gsatt("ALIC","SEEN",0);
536 //
537 //Set volumes visible
2ca99a7f 538 // gMC->Gsatt("0ST","SEEN",0);
539 gMC->Gsatt("0INS","SEEN",0);
540 gMC->Gsatt("0PMT","SEEN",1);
541 gMC->Gsatt("0DIV","SEEN",1);
bc46b572 542 //
d65c9254 543 gMC->Gdopt("hide","off");
bc46b572 544 gMC->Gdopt("shad","on");
545 gMC->SetClipBox(".");
546 gMC->SetClipBox("*",0,1000,-1000,1000,-1000,1000);
547 gMC->DefaultRange();
548 gMC->Gdraw("alic",40,30,0,12,9.5,.7,0.7);
549 gMC->Gdhead(1111,"T-Zero detector");
550 gMC->Gdopt("hide","off");
551}
552
553//-------------------------------------------------------------------
554void AliSTARTv1::Init()
555{
556// Initialises version 0 of the Forward Multiplicity Detector
557//
558//Int_t *idtmed = gAlice->Idtmed();
559 AliSTART::Init();
2ca99a7f 560 fIdSens1=gMC->VolId("0TOP");
9e1a0ddb 561 if(fDebug) printf("%s: *** START version 0 initialized ***\n",ClassName());
bc46b572 562
563}
564
565//-------------------------------------------------------------------
566
567void AliSTARTv1::StepManager()
568{
569 //
570 // Called for every step in the START Detector
571 //
572 Int_t id,copy,copy1;
573 static Float_t hits[7];
574 static Float_t edep;
575 static Int_t vol[2];
576 TLorentzVector pos;
577
578 TClonesArray &lhits = *fHits;
579
580 if(!gMC->IsTrackAlive()) return; // particle has disappeared
e73d68f2 581 // Float_t charge = gMC->TrackCharge();
582 // if(TMath::Abs(charge)<=0.) return; //take only charged particles
bc46b572 583 id=gMC->CurrentVolID(copy);
584
585
724699e1 586 // Check the sensetive volume
bc46b572 587 if(id==fIdSens1 ) {
588 if(gMC->IsTrackEntering()) {
589 gMC->CurrentVolOffID(2,copy);
2ca99a7f 590 vol[1]=copy;
591 gMC->CurrentVolOffID(3,copy1);
592 vol[0]=copy1;
a94466c5 593
bc46b572 594 gMC->TrackPosition(pos);
595 hits[0] = pos[0];
596 hits[1] = pos[1];
597 hits[2] = pos[2];
a94466c5 598 if(pos[2]<0) vol[0]=2;
599 if(pos[2]>=0) vol[0]=1;
600
bc46b572 601 Float_t etot=gMC->Etot();
602 hits[4]=etot;
ef51244a 603 Int_t iPart= gMC->TrackPid();
604 Int_t partID=gMC->IdFromPDG(iPart);
605 hits[5]=partID;
bc46b572 606 Float_t ttime=gMC->TrackTime();
607 hits[6]=ttime*1e9;
608 edep=0;
609 }
610 if(gMC->IsTrackInside()) {
611 Float_t de=gMC->Edep();
612 edep=edep+de;
f3ed336b 613 }
724699e1 614
615 if(gMC->IsTrackExiting()) {
616 Float_t de=gMC->Edep();
617 edep=edep+de;
618 hits[3]=edep*1e3;
5d12ce38 619 new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
724699e1 620 }
bc46b572 621 }
622//---------------------------------------------------------------------
623}
624
625
626
627
628
629
630
631
632