1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz
19 New version with Holes for PHOS/RICH
21 Revision 1.14 1999/11/05 22:39:06 fca
24 Revision 1.13 1999/11/02 11:26:39 fca
25 added stdlib.h for exit
27 Revision 1.12 1999/11/01 20:41:57 fca
28 Added protections against using the wrong version of FRAME
30 Revision 1.11 1999/10/22 08:04:14 fca
31 Correct improper use of negative parameters
33 Revision 1.10 1999/10/16 19:30:06 fca
34 Corrected Rotation Matrix and CVS log
36 Revision 1.9 1999/10/15 15:35:20 fca
37 New version for frame1099 with and without holes
39 Revision 1.8 1999/09/29 09:24:33 fca
40 Introduction of the Copyright and cvs Log
44 ///////////////////////////////////////////////////////////////////////////////
46 // Time Of Flight: design of C.Williams FCA //
47 // This class contains the functions for version 1 of the Time Of Flight //
50 // VERSION WITH 5 MODULES AND TILTED STRIPS
52 // FULL COVERAGE VERSION
59 // University of Salerno - Italy
64 <img src="picts/AliTOFv0Class.gif">
68 ///////////////////////////////////////////////////////////////////////////////
82 //_____________________________________________________________________________
86 // Default constructor
90 // Check that FRAME is there otherwise we have no place where to
92 AliModule* FRAME=gAlice->GetModule("FRAME");
94 Error("Ctor","TOF needs FRAME to be present\n");
97 if(FRAME->IsVersion()!=1) {
98 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
105 //_____________________________________________________________________________
106 AliTOFv0::AliTOFv0(const char *name, const char *title)
110 // Standard constructor
114 //_____________________________________________________________________________
115 void AliTOFv0::BuildGeometry()
117 // Build TOF ROOT geometry for the ALICE event viewver
120 const int kColorTOF = 27;
123 Top = gAlice->GetGeometry()->GetNode("alice");
125 // Position the different copies
126 const Float_t rTof =(fRmax+fRmin)/2;
127 const Float_t hTof = fRmax-fRmin;
128 const Int_t fNTof = 18;
129 const Float_t kPi = TMath::Pi();
130 const Float_t angle = 2*kPi/fNTof;
133 // Define TOF basic volume
135 char NodeName0[6], NodeName1[6], NodeName2[6];
136 char NodeName3[6], NodeName4[6], RotMatNum[6];
138 new TBRIK("S_TOF_C","TOF box","void",
139 120*0.5,hTof*0.5,fZlenC*0.5);
140 new TBRIK("S_TOF_B","TOF box","void",
141 120*0.5,hTof*0.5,fZlenB*0.5);
142 new TBRIK("S_TOF_A","TOF box","void",
143 120*0.5,hTof*0.5,fZlenA*0.5);
145 for (Int_t NodeNum=1;NodeNum<19;NodeNum++){
148 sprintf(RotMatNum,"rot50%i",NodeNum);
149 sprintf(NodeName0,"FTO00%i",NodeNum);
150 sprintf(NodeName1,"FTO10%i",NodeNum);
151 sprintf(NodeName2,"FTO20%i",NodeNum);
152 sprintf(NodeName3,"FTO30%i",NodeNum);
153 sprintf(NodeName4,"FTO40%i",NodeNum);
156 sprintf(RotMatNum,"rot5%i",NodeNum);
157 sprintf(NodeName0,"FTO0%i",NodeNum);
158 sprintf(NodeName1,"FTO1%i",NodeNum);
159 sprintf(NodeName2,"FTO2%i",NodeNum);
160 sprintf(NodeName3,"FTO3%i",NodeNum);
161 sprintf(NodeName4,"FTO4%i",NodeNum);
164 new TRotMatrix(RotMatNum,RotMatNum,90,-20*NodeNum,90,90-20*NodeNum,0,0);
165 ang = (4.5-NodeNum) * angle;
168 Node = new TNode(NodeName0,NodeName0,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),299.15,RotMatNum);
169 Node->SetLineColor(kColorTOF);
173 Node = new TNode(NodeName1,NodeName1,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-299.15,RotMatNum);
174 Node->SetLineColor(kColorTOF);
178 Node = new TNode(NodeName2,NodeName2,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),146.45,RotMatNum);
179 Node->SetLineColor(kColorTOF);
183 Node = new TNode(NodeName3,NodeName3,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-146.45,RotMatNum);
184 Node->SetLineColor(kColorTOF);
188 Node = new TNode(NodeName4,NodeName4,"S_TOF_A",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),0.,RotMatNum);
189 Node->SetLineColor(kColorTOF);
194 //_____________________________________________________________________________
195 void AliTOFv0::CreateGeometry()
198 // Create geometry for Time Of Flight version 0
202 <img src="picts/AliTOFv0.gif">
206 // Creates common geometry
208 AliTOF::CreateGeometry();
211 //_____________________________________________________________________________
212 void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
213 Float_t zlenB, Float_t zlenA, Float_t ztof0)
216 // Definition of the Time Of Fligh Resistive Plate Chambers
217 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
219 Float_t ycoor, zcoor;
221 Int_t *idtmed = fIdtmed->GetArray()-499;
225 Float_t Radius = fRmin+2.;//cm
229 par[2] = zlenC * 0.5;
230 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
231 par[2] = zlenB * 0.5;
232 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
233 par[2] = zlenA * 0.5;
234 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
237 // Positioning of modules
239 Float_t zcor1 = ztof0 - zlenC*0.5;
240 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
243 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
244 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
245 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
246 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
247 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
248 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
249 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
250 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
252 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
253 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
254 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
255 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
256 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
257 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
259 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
260 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
261 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
263 Float_t db = 0.5;//cm
264 Float_t xFLT, yFLT, zFLTA, zFLTB, zFLTC;
268 zFLTA = zlenA - db*0.5;
269 zFLTB = zlenB - db*0.5;
270 zFLTC = zlenC - db*0.5;
272 // Sizes of MRPC pads
274 Float_t yPad = 0.505;//cm
276 // Large not sensitive volumes with CO2
280 cout <<"************************* TOF geometry **************************"<<endl;
282 par[2] = (zFLTA *0.5);
283 gMC->Gsvolu("FLTA", "BOX ", idtmed[506], par, 3); // CO2
284 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
286 par[2] = (zFLTB * 0.5);
287 gMC->Gsvolu("FLTB", "BOX ", idtmed[506], par, 3); // CO2
288 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
290 par[2] = (zFLTC * 0.5);
291 gMC->Gsvolu("FLTC", "BOX ", idtmed[506], par, 3); // CO2
292 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
294 ////////// Layers before detector ////////////////////
296 // MYlar layer in front 1.0 mm thick at the beginning
300 ycoor = -yFLT/2 + par[1];
301 gMC->Gsvolu("FMYA", "BOX ", idtmed[508], par, 3); // Alluminium
302 gMC->Gspos ("FMYA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
303 gMC->Gsvolu("FMYB", "BOX ", idtmed[508], par, 3); // Alluminium
304 gMC->Gspos ("FMYB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
305 gMC->Gsvolu("FMYC", "BOX ", idtmed[508], par, 3); // Alluminium
306 gMC->Gspos ("FMYC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
308 // honeycomb (special Polyethilene Layer of 1cm)
309 ycoor = ycoor + par[1];
313 ycoor = ycoor + par[1];
314 gMC->Gsvolu("FPLA", "BOX ", idtmed[503], par, 3); // Hony
315 gMC->Gspos ("FPLA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
316 gMC->Gsvolu("FPLB", "BOX ", idtmed[503], par, 3); // Hony
317 gMC->Gspos ("FPLB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
318 gMC->Gsvolu("FPLC", "BOX ", idtmed[503], par, 3); // Hony
319 gMC->Gspos ("FPLC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
321 ///////////////// Detector itself //////////////////////
323 const Float_t StripWidth = 10.0;//cm
324 const Float_t DeadBound = 1.5;//cm non-sensitive between the pad edge
325 //and the boundary of the strip
326 const Int_t nx = 48; // number of pads along x
327 const Int_t nz = 2; // number of pads along z
328 const Float_t Space= 5.5; //cm distance from the front plate of the box
331 zSenStrip = StripWidth-2*DeadBound;//cm
335 par[2] = StripWidth/2.;
337 // glass layer of detector STRip
338 gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
340 // Non-Sesitive Freon boundaries
342 par[1] = 0.110*0.5;//cm
344 gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
345 gMC->Gspos ("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
347 // MYlar for Internal non-sesitive boundaries
349 gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3);
350 gMC->Gspos ("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
352 // MYlar eXternal layers
353 par[1] = 0.035*0.5;//cm
354 ycoor = -yPad*0.5+par[1];
355 gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
356 gMC->Gspos ("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
357 gMC->Gspos ("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
363 gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
364 gMC->Gspos ("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
365 gMC->Gspos ("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
367 // freon sensitive layer (Chlorine-Fluorine-Carbon)
370 par[2] = zSenStrip*0.5;
371 gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
372 gMC->Gspos ("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
374 // Pad definition x & z
375 gMC->Gsdvn("FLZ","FCFC", nz, 3);
376 gMC->Gsdvn("FLX","FLZ" , nx, 1);
382 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
383 gMC->Gspos ("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
385 //// Positioning the Strips (FSTR) in the FLT volumes /////
389 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
391 Float_t Gap = 4.; //cm distance between the strip axis
398 ycoor = -14.5 + Space ; //2 cm over front plate
400 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
401 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
405 Int_t UpDown = -1; // UpDown=-1 -> Upper strip
406 // UpDown=+1 -> Lower strip
408 ang = atan(zcoor/Radius);
410 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
411 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
413 ycoor = -14.5+ Space; //2 cm over front plate
414 ycoor += (1-(UpDown+1)/2)*Gap;
415 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
416 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
418 UpDown*= -1; // Alternate strips
419 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
420 UpDown*Gap*TMath::Tan(ang)-
421 (zSenStrip/2)/TMath::Cos(ang);
422 } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
424 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)-
425 UpDown*Gap*TMath::Tan(ang)+
426 (zSenStrip/2)/TMath::Cos(ang);
429 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
430 UpDown*Gap*TMath::Tan(ang)-
431 (zSenStrip/2)/TMath::Cos(ang);
433 ang = atan(zcoor/Radius);
435 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
436 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
439 ycoor = -14.5+ Space; //2 cm over front plate
440 ycoor += (1-(UpDown+1)/2)*Gap;
441 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
442 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
444 ycoor = -29./2.+ Space;//2 cm over front plate
452 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
453 UpDown*Gap*TMath::Tan(ang)-
454 (zSenStrip/2)/TMath::Cos(ang)-0.5/TMath::Cos(ang);
456 ang = atan(zpos/Radius);
458 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
460 ycoor = -29.*0.5+ Space ; //2 cm over front plate
461 ycoor += (1-(UpDown+1)/2)*Gap;
462 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
463 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
468 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
469 UpDown*Gap*TMath::Tan(ang)-
470 (zSenStrip/2)/TMath::Cos(ang);
471 ang = atan(zpos/Radius);
473 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
475 ycoor = -29.*0.5+ Space ; //2 cm over front plate
476 ycoor += (1-(UpDown+1)/2)*Gap;
477 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
478 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
481 } while (TMath::Abs(ang*kRaddeg)<22.5);//till we reach a tilting angle of 22.5 degrees
483 ycoor = -29.*0.5+ Space ; //2 cm over front plate
487 ang = atan(zpos/Radius);
489 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
491 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
492 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
493 zpos = zpos - zSenStrip/TMath::Cos(ang);
494 last = StripWidth*TMath::Cos(ang)/2.;
495 } while (zpos>-t+zFLTC+db);
499 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
501 (zSenStrip/2)/TMath::Cos(ang);
505 ycoor= -29.*0.5+Space+Gap;
509 ang = atan(zpos/Radius);
511 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
513 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
514 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
515 zpos = zpos - zSenStrip/TMath::Cos(ang);
516 last = StripWidth*TMath::Cos(ang)*0.5;
517 } while (zpos>-t+last);
520 ////////// Layers after detector /////////////////
522 // honeycomb (Polyethilene) Layer after (3cm)
524 Float_t OverSpace = 15.30;//cm
529 ycoor = -yFLT/2 + OverSpace + par[1];
530 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
531 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
532 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
533 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
534 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
535 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
537 // Electronics (Cu) after
540 par[1] = 1.43*0.05*0.5; // 5% of X0
543 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
544 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
545 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
546 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
547 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
548 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
550 // cooling WAter after
553 par[1] = 36.1*0.02*0.5; // 2% of X0
556 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
557 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
558 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
559 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
560 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
561 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
563 //Back Plate honycomb (2cm)
567 ycoor = yFLT/2 - par[1];
568 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
569 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
570 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
571 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
572 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
573 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
576 //_____________________________________________________________________________
577 void AliTOFv0::DrawModule()
580 // Draw a shaded view of the Time Of Flight version 1
582 // Set everything unseen
583 gMC->Gsatt("*", "seen", -1);
585 // Set ALIC mother transparent
586 gMC->Gsatt("ALIC","SEEN",0);
588 // Set the volumes visible
589 gMC->Gsatt("ALIC","SEEN",0);
591 gMC->Gsatt("FTOA","SEEN",1);
592 gMC->Gsatt("FTOB","SEEN",1);
593 gMC->Gsatt("FTOC","SEEN",1);
594 gMC->Gsatt("FLTA","SEEN",1);
595 gMC->Gsatt("FLTB","SEEN",1);
596 gMC->Gsatt("FLTC","SEEN",1);
597 gMC->Gsatt("FPLA","SEEN",1);
598 gMC->Gsatt("FPLB","SEEN",1);
599 gMC->Gsatt("FPLC","SEEN",1);
600 gMC->Gsatt("FSTR","SEEN",1);
601 gMC->Gsatt("FPEA","SEEN",1);
602 gMC->Gsatt("FPEB","SEEN",1);
603 gMC->Gsatt("FPEC","SEEN",1);
605 gMC->Gsatt("FLZ1","SEEN",0);
606 gMC->Gsatt("FLZ2","SEEN",0);
607 gMC->Gsatt("FLZ3","SEEN",0);
608 gMC->Gsatt("FLX1","SEEN",0);
609 gMC->Gsatt("FLX2","SEEN",0);
610 gMC->Gsatt("FLX3","SEEN",0);
611 gMC->Gsatt("FPAD","SEEN",0);
613 gMC->Gdopt("hide", "on");
614 gMC->Gdopt("shad", "on");
615 gMC->Gsatt("*", "fill", 7);
616 gMC->SetClipBox(".");
617 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
619 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
620 gMC->Gdhead(1111, "Time Of Flight");
621 gMC->Gdman(18, 4, "MAN");
622 gMC->Gdopt("hide","off");
625 //_____________________________________________________________________________
626 void AliTOFv0::CreateMaterials()
629 // Define materials for the Time Of Flight
631 AliTOF::CreateMaterials();
634 //_____________________________________________________________________________
635 void AliTOFv0::Init()
638 // Initialise the detector after the geometry has been defined
640 printf("**************************************"
642 "**************************************\n");
643 printf("\n Version 0 of TOF initialing, "
648 fIdFTOA = gMC->VolId("FTOA");
649 fIdFTOB = gMC->VolId("FTOB");
650 fIdFTOC = gMC->VolId("FTOC");
651 fIdFLTA = gMC->VolId("FLTA");
652 fIdFLTB = gMC->VolId("FLTB");
653 fIdFLTC = gMC->VolId("FLTC");
655 printf("**************************************"
657 "**************************************\n");
660 //_____________________________________________________________________________
661 void AliTOFv0::StepManager()
664 // Procedure called at each step in the Time Of Flight
666 Float_t hits[8],rho,phi,phid,z;
667 Int_t sector, plate, pad_x, pad_z, strip;
668 Int_t copy, pad_z_id, pad_x_id, strip_id, i;
670 Int_t *idtmed = fIdtmed->GetArray()-499;
671 TLorentzVector mom, pos;
674 if(gMC->GetMedium()==idtmed[513] &&
675 gMC->IsTrackEntering() && gMC->TrackCharge()
676 && gMC->CurrentVolID(copy)==fIdSens)
678 // getting information about hit volumes
680 pad_z_id=gMC->CurrentVolOffID(2,copy);
683 pad_x_id=gMC->CurrentVolOffID(1,copy);
686 strip_id=gMC->CurrentVolOffID(5,copy);
689 pad_z = (strip-1)*2+pad_z;
691 gMC->TrackPosition(pos);
692 gMC->TrackMomentum(mom);
694 rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
695 phi = TMath::ACos(pos[0]/rho);
696 Float_t as = TMath::ASin(pos[1]/rho);
697 if (as<0) phi = 2*3.141592654-phi;
702 Float_t limA = fZlenA*0.5;
703 Float_t limB = fZlenB+limA;
705 if (TMath::Abs(z)<=limA) plate = 3;
706 if (z<= limB && z> limA) plate = 2;
707 if (z>=-limB && z<-limA) plate = 4;
708 if (z> limB) plate = 1;
709 if (z<-limB) plate = 5;
711 if (plate==3) pad_z -= 2;
714 sector = Int_t (phid/20.);
717 Double_t ptot = mom.Rho();
718 Double_t norm = 1/ptot;
721 hits[i+3] = mom[i]*norm;
731 Int_t track = gAlice->CurrentTrack();
732 AliTOF::AddHit(track,vol, hits);