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.17 2000/10/02 21:28:17 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.16 2000/05/10 16:52:18 vicinanz
22 New TOF version with holes for PHOS/RICH
24 Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz
25 New version with Holes for PHOS/RICH
27 Revision 1.14 1999/11/05 22:39:06 fca
30 Revision 1.13 1999/11/02 11:26:39 fca
31 added stdlib.h for exit
33 Revision 1.12 1999/11/01 20:41:57 fca
34 Added protections against using the wrong version of FRAME
36 Revision 1.11 1999/10/22 08:04:14 fca
37 Correct improper use of negative parameters
39 Revision 1.10 1999/10/16 19:30:06 fca
40 Corrected Rotation Matrix and CVS log
42 Revision 1.9 1999/10/15 15:35:20 fca
43 New version for frame1099 with and without holes
45 Revision 1.8 1999/09/29 09:24:33 fca
46 Introduction of the Copyright and cvs Log
50 ///////////////////////////////////////////////////////////////////////////////
52 // Time Of Flight: design of C.Williams FCA //
53 // This class contains the functions for version 1 of the Time Of Flight //
56 // VERSION WITH 5 MODULES AND TILTED STRIPS
58 // FULL COVERAGE VERSION
65 // University of Salerno - Italy
70 <img src="picts/AliTOFv0Class.gif">
74 ///////////////////////////////////////////////////////////////////////////////
81 #include "TGeometry.h"
84 #include <TLorentzVector.h>
91 //_____________________________________________________________________________
95 // Default constructor
99 // Check that FRAME is there otherwise we have no place where to
101 AliModule* FRAME=gAlice->GetModule("FRAME");
103 Error("Ctor","TOF needs FRAME to be present\n");
106 if(FRAME->IsVersion()!=1) {
107 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
114 //_____________________________________________________________________________
115 AliTOFv0::AliTOFv0(const char *name, const char *title)
119 // Standard constructor
123 //_____________________________________________________________________________
124 void AliTOFv0::BuildGeometry()
126 // Build TOF ROOT geometry for the ALICE event viewver
129 const int kColorTOF = 27;
132 Top = gAlice->GetGeometry()->GetNode("alice");
134 // Position the different copies
135 const Float_t rTof =(fRmax+fRmin)/2;
136 const Float_t hTof = fRmax-fRmin;
137 const Int_t fNTof = 18;
138 const Float_t kPi = TMath::Pi();
139 const Float_t angle = 2*kPi/fNTof;
142 // Define TOF basic volume
144 char NodeName0[6], NodeName1[6], NodeName2[6];
145 char NodeName3[6], NodeName4[6], RotMatNum[6];
147 new TBRIK("S_TOF_C","TOF box","void",
148 120*0.5,hTof*0.5,fZlenC*0.5);
149 new TBRIK("S_TOF_B","TOF box","void",
150 120*0.5,hTof*0.5,fZlenB*0.5);
151 new TBRIK("S_TOF_A","TOF box","void",
152 120*0.5,hTof*0.5,fZlenA*0.5);
154 for (Int_t NodeNum=1;NodeNum<19;NodeNum++){
157 sprintf(RotMatNum,"rot50%i",NodeNum);
158 sprintf(NodeName0,"FTO00%i",NodeNum);
159 sprintf(NodeName1,"FTO10%i",NodeNum);
160 sprintf(NodeName2,"FTO20%i",NodeNum);
161 sprintf(NodeName3,"FTO30%i",NodeNum);
162 sprintf(NodeName4,"FTO40%i",NodeNum);
165 sprintf(RotMatNum,"rot5%i",NodeNum);
166 sprintf(NodeName0,"FTO0%i",NodeNum);
167 sprintf(NodeName1,"FTO1%i",NodeNum);
168 sprintf(NodeName2,"FTO2%i",NodeNum);
169 sprintf(NodeName3,"FTO3%i",NodeNum);
170 sprintf(NodeName4,"FTO4%i",NodeNum);
173 new TRotMatrix(RotMatNum,RotMatNum,90,-20*NodeNum,90,90-20*NodeNum,0,0);
174 ang = (4.5-NodeNum) * angle;
177 Node = new TNode(NodeName0,NodeName0,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),299.15,RotMatNum);
178 Node->SetLineColor(kColorTOF);
182 Node = new TNode(NodeName1,NodeName1,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-299.15,RotMatNum);
183 Node->SetLineColor(kColorTOF);
187 Node = new TNode(NodeName2,NodeName2,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),146.45,RotMatNum);
188 Node->SetLineColor(kColorTOF);
192 Node = new TNode(NodeName3,NodeName3,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-146.45,RotMatNum);
193 Node->SetLineColor(kColorTOF);
197 Node = new TNode(NodeName4,NodeName4,"S_TOF_A",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),0.,RotMatNum);
198 Node->SetLineColor(kColorTOF);
203 //_____________________________________________________________________________
204 void AliTOFv0::CreateGeometry()
207 // Create geometry for Time Of Flight version 0
211 <img src="picts/AliTOFv0.gif">
215 // Creates common geometry
217 AliTOF::CreateGeometry();
220 //_____________________________________________________________________________
221 void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
222 Float_t zlenB, Float_t zlenA, Float_t ztof0)
225 // Definition of the Time Of Fligh Resistive Plate Chambers
226 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
228 Float_t ycoor, zcoor;
230 Int_t *idtmed = fIdtmed->GetArray()-499;
234 Float_t Radius = fRmin+2.;//cm
238 par[2] = zlenC * 0.5;
239 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
240 par[2] = zlenB * 0.5;
241 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
242 par[2] = zlenA * 0.5;
243 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
246 // Positioning of modules
248 Float_t zcor1 = ztof0 - zlenC*0.5;
249 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
252 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
253 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
254 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
255 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
256 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
257 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
258 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
259 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
261 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
262 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
263 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
264 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
265 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
266 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
268 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
269 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
270 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
272 Float_t db = 0.5;//cm
273 Float_t xFLT, yFLT, zFLTA, zFLTB, zFLTC;
277 zFLTA = zlenA - db*0.5;
278 zFLTB = zlenB - db*0.5;
279 zFLTC = zlenC - db*0.5;
281 // Sizes of MRPC pads
283 Float_t yPad = 0.505;//cm
285 // Large not sensitive volumes with CO2
289 cout <<"************************* TOF geometry **************************"<<endl;
291 par[2] = (zFLTA *0.5);
292 gMC->Gsvolu("FLTA", "BOX ", idtmed[506], par, 3); // CO2
293 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
295 par[2] = (zFLTB * 0.5);
296 gMC->Gsvolu("FLTB", "BOX ", idtmed[506], par, 3); // CO2
297 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
299 par[2] = (zFLTC * 0.5);
300 gMC->Gsvolu("FLTC", "BOX ", idtmed[506], par, 3); // CO2
301 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
303 ////////// Layers before detector ////////////////////
305 // MYlar layer in front 1.0 mm thick at the beginning
309 ycoor = -yFLT/2 + par[1];
310 gMC->Gsvolu("FMYA", "BOX ", idtmed[508], par, 3); // Alluminium
311 gMC->Gspos ("FMYA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
312 gMC->Gsvolu("FMYB", "BOX ", idtmed[508], par, 3); // Alluminium
313 gMC->Gspos ("FMYB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
314 gMC->Gsvolu("FMYC", "BOX ", idtmed[508], par, 3); // Alluminium
315 gMC->Gspos ("FMYC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
317 // honeycomb (special Polyethilene Layer of 1cm)
318 ycoor = ycoor + par[1];
322 ycoor = ycoor + par[1];
323 gMC->Gsvolu("FPLA", "BOX ", idtmed[503], par, 3); // Hony
324 gMC->Gspos ("FPLA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
325 gMC->Gsvolu("FPLB", "BOX ", idtmed[503], par, 3); // Hony
326 gMC->Gspos ("FPLB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
327 gMC->Gsvolu("FPLC", "BOX ", idtmed[503], par, 3); // Hony
328 gMC->Gspos ("FPLC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
330 ///////////////// Detector itself //////////////////////
332 const Float_t StripWidth = 10.0;//cm
333 const Float_t DeadBound = 1.5;//cm non-sensitive between the pad edge
334 //and the boundary of the strip
335 const Int_t nx = 48; // number of pads along x
336 const Int_t nz = 2; // number of pads along z
337 const Float_t Space= 5.5; //cm distance from the front plate of the box
340 zSenStrip = StripWidth-2*DeadBound;//cm
344 par[2] = StripWidth/2.;
346 // glass layer of detector STRip
347 gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
349 // Non-Sesitive Freon boundaries
351 par[1] = 0.110*0.5;//cm
353 gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
354 gMC->Gspos ("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
356 // MYlar for Internal non-sesitive boundaries
358 gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3);
359 gMC->Gspos ("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
361 // MYlar eXternal layers
362 par[1] = 0.035*0.5;//cm
363 ycoor = -yPad*0.5+par[1];
364 gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
365 gMC->Gspos ("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
366 gMC->Gspos ("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
372 gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
373 gMC->Gspos ("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
374 gMC->Gspos ("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
376 // freon sensitive layer (Chlorine-Fluorine-Carbon)
379 par[2] = zSenStrip*0.5;
380 gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
381 gMC->Gspos ("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
383 // Pad definition x & z
384 gMC->Gsdvn("FLZ","FCFC", nz, 3);
385 gMC->Gsdvn("FLX","FLZ" , nx, 1);
391 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
392 gMC->Gspos ("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
394 //// Positioning the Strips (FSTR) in the FLT volumes /////
398 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
400 Float_t Gap = 4.; //cm distance between the strip axis
407 ycoor = -14.5 + Space ; //2 cm over front plate
409 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
410 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
414 Int_t UpDown = -1; // UpDown=-1 -> Upper strip
415 // UpDown=+1 -> Lower strip
417 ang = atan(zcoor/Radius);
419 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
420 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
422 ycoor = -14.5+ Space; //2 cm over front plate
423 ycoor += (1-(UpDown+1)/2)*Gap;
424 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
425 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
427 UpDown*= -1; // Alternate strips
428 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
429 UpDown*Gap*TMath::Tan(ang)-
430 (zSenStrip/2)/TMath::Cos(ang);
431 } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
433 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)-
434 UpDown*Gap*TMath::Tan(ang)+
435 (zSenStrip/2)/TMath::Cos(ang);
438 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
439 UpDown*Gap*TMath::Tan(ang)-
440 (zSenStrip/2)/TMath::Cos(ang);
442 ang = atan(zcoor/Radius);
444 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
445 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
448 ycoor = -14.5+ Space; //2 cm over front plate
449 ycoor += (1-(UpDown+1)/2)*Gap;
450 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
451 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
453 ycoor = -29./2.+ Space;//2 cm over front plate
461 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
462 UpDown*Gap*TMath::Tan(ang)-
463 (zSenStrip/2)/TMath::Cos(ang)-0.5/TMath::Cos(ang);
465 ang = atan(zpos/Radius);
467 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
469 ycoor = -29.*0.5+ Space ; //2 cm over front plate
470 ycoor += (1-(UpDown+1)/2)*Gap;
471 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
472 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
477 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
478 UpDown*Gap*TMath::Tan(ang)-
479 (zSenStrip/2)/TMath::Cos(ang);
480 ang = atan(zpos/Radius);
482 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
484 ycoor = -29.*0.5+ Space ; //2 cm over front plate
485 ycoor += (1-(UpDown+1)/2)*Gap;
486 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
487 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
490 } while (TMath::Abs(ang*kRaddeg)<22.5);//till we reach a tilting angle of 22.5 degrees
492 ycoor = -29.*0.5+ Space ; //2 cm over front plate
496 ang = atan(zpos/Radius);
498 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
500 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
501 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
502 zpos = zpos - zSenStrip/TMath::Cos(ang);
503 last = StripWidth*TMath::Cos(ang)/2.;
504 } while (zpos>-t+zFLTC+db);
508 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
510 (zSenStrip/2)/TMath::Cos(ang);
514 ycoor= -29.*0.5+Space+Gap;
518 ang = atan(zpos/Radius);
520 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
522 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
523 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
524 zpos = zpos - zSenStrip/TMath::Cos(ang);
525 last = StripWidth*TMath::Cos(ang)*0.5;
526 } while (zpos>-t+last);
529 ////////// Layers after detector /////////////////
531 // honeycomb (Polyethilene) Layer after (3cm)
533 Float_t OverSpace = 15.30;//cm
538 ycoor = -yFLT/2 + OverSpace + par[1];
539 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
540 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
541 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
542 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
543 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
544 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
546 // Electronics (Cu) after
549 par[1] = 1.43*0.05*0.5; // 5% of X0
552 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
553 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
554 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
555 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
556 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
557 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
559 // cooling WAter after
562 par[1] = 36.1*0.02*0.5; // 2% of X0
565 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
566 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
567 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
568 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
569 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
570 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
572 //Back Plate honycomb (2cm)
576 ycoor = yFLT/2 - par[1];
577 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
578 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
579 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
580 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
581 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
582 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
585 //_____________________________________________________________________________
586 void AliTOFv0::DrawModule()
589 // Draw a shaded view of the Time Of Flight version 1
591 // Set everything unseen
592 gMC->Gsatt("*", "seen", -1);
594 // Set ALIC mother transparent
595 gMC->Gsatt("ALIC","SEEN",0);
597 // Set the volumes visible
598 gMC->Gsatt("ALIC","SEEN",0);
600 gMC->Gsatt("FTOA","SEEN",1);
601 gMC->Gsatt("FTOB","SEEN",1);
602 gMC->Gsatt("FTOC","SEEN",1);
603 gMC->Gsatt("FLTA","SEEN",1);
604 gMC->Gsatt("FLTB","SEEN",1);
605 gMC->Gsatt("FLTC","SEEN",1);
606 gMC->Gsatt("FPLA","SEEN",1);
607 gMC->Gsatt("FPLB","SEEN",1);
608 gMC->Gsatt("FPLC","SEEN",1);
609 gMC->Gsatt("FSTR","SEEN",1);
610 gMC->Gsatt("FPEA","SEEN",1);
611 gMC->Gsatt("FPEB","SEEN",1);
612 gMC->Gsatt("FPEC","SEEN",1);
614 gMC->Gsatt("FLZ1","SEEN",0);
615 gMC->Gsatt("FLZ2","SEEN",0);
616 gMC->Gsatt("FLZ3","SEEN",0);
617 gMC->Gsatt("FLX1","SEEN",0);
618 gMC->Gsatt("FLX2","SEEN",0);
619 gMC->Gsatt("FLX3","SEEN",0);
620 gMC->Gsatt("FPAD","SEEN",0);
622 gMC->Gdopt("hide", "on");
623 gMC->Gdopt("shad", "on");
624 gMC->Gsatt("*", "fill", 7);
625 gMC->SetClipBox(".");
626 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
628 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
629 gMC->Gdhead(1111, "Time Of Flight");
630 gMC->Gdman(18, 4, "MAN");
631 gMC->Gdopt("hide","off");
634 //_____________________________________________________________________________
635 void AliTOFv0::CreateMaterials()
638 // Define materials for the Time Of Flight
640 AliTOF::CreateMaterials();
643 //_____________________________________________________________________________
644 void AliTOFv0::Init()
647 // Initialise the detector after the geometry has been defined
649 printf("**************************************"
651 "**************************************\n");
652 printf("\n Version 0 of TOF initialing, "
657 fIdFTOA = gMC->VolId("FTOA");
658 fIdFTOB = gMC->VolId("FTOB");
659 fIdFTOC = gMC->VolId("FTOC");
660 fIdFLTA = gMC->VolId("FLTA");
661 fIdFLTB = gMC->VolId("FLTB");
662 fIdFLTC = gMC->VolId("FLTC");
664 printf("**************************************"
666 "**************************************\n");
669 //_____________________________________________________________________________
670 void AliTOFv0::StepManager()
673 // Procedure called at each step in the Time Of Flight
675 Float_t hits[8],rho,phi,phid,z;
676 Int_t sector, plate, pad_x, pad_z, strip;
677 Int_t copy, pad_z_id, pad_x_id, strip_id, i;
679 Int_t *idtmed = fIdtmed->GetArray()-499;
680 TLorentzVector mom, pos;
683 if(gMC->GetMedium()==idtmed[513] &&
684 gMC->IsTrackEntering() && gMC->TrackCharge()
685 && gMC->CurrentVolID(copy)==fIdSens)
687 // getting information about hit volumes
689 pad_z_id=gMC->CurrentVolOffID(2,copy);
692 pad_x_id=gMC->CurrentVolOffID(1,copy);
695 strip_id=gMC->CurrentVolOffID(5,copy);
698 pad_z = (strip-1)*2+pad_z;
700 gMC->TrackPosition(pos);
701 gMC->TrackMomentum(mom);
703 rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
704 phi = TMath::ACos(pos[0]/rho);
705 Float_t as = TMath::ASin(pos[1]/rho);
706 if (as<0) phi = 2*3.141592654-phi;
711 Float_t limA = fZlenA*0.5;
712 Float_t limB = fZlenB+limA;
714 if (TMath::Abs(z)<=limA) plate = 3;
715 if (z<= limB && z> limA) plate = 2;
716 if (z>=-limB && z<-limA) plate = 4;
717 if (z> limB) plate = 1;
718 if (z<-limB) plate = 5;
720 if (plate==3) pad_z -= 2;
723 sector = Int_t (phid/20.);
726 Double_t ptot = mom.Rho();
727 Double_t norm = 1/ptot;
730 hits[i+3] = mom[i]*norm;
740 Int_t track = gAlice->CurrentTrack();
741 AliTOF::AddHit(track,vol, hits);