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