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.16 2000/05/10 16:52:18 vicinanz
19 New TOF version with holes for PHOS/RICH
21 Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz
22 New version with Holes for PHOS/RICH
24 Revision 1.14 1999/11/05 22:39:06 fca
27 Revision 1.13 1999/11/02 11:26:39 fca
28 added stdlib.h for exit
30 Revision 1.12 1999/11/01 20:41:57 fca
31 Added protections against using the wrong version of FRAME
33 Revision 1.11 1999/10/22 08:04:14 fca
34 Correct improper use of negative parameters
36 Revision 1.10 1999/10/16 19:30:06 fca
37 Corrected Rotation Matrix and CVS log
39 Revision 1.9 1999/10/15 15:35:20 fca
40 New version for frame1099 with and without holes
42 Revision 1.8 1999/09/29 09:24:33 fca
43 Introduction of the Copyright and cvs Log
47 ///////////////////////////////////////////////////////////////////////////////
49 // Time Of Flight: design of C.Williams FCA //
50 // This class contains the functions for version 1 of the Time Of Flight //
53 // VERSION WITH 5 MODULES AND TILTED STRIPS
55 // FULL COVERAGE VERSION
62 // University of Salerno - Italy
67 <img src="picts/AliTOFv0Class.gif">
71 ///////////////////////////////////////////////////////////////////////////////
78 #include "TGeometry.h"
87 //_____________________________________________________________________________
91 // Default constructor
95 // Check that FRAME is there otherwise we have no place where to
97 AliModule* FRAME=gAlice->GetModule("FRAME");
99 Error("Ctor","TOF needs FRAME to be present\n");
102 if(FRAME->IsVersion()!=1) {
103 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
110 //_____________________________________________________________________________
111 AliTOFv0::AliTOFv0(const char *name, const char *title)
115 // Standard constructor
119 //_____________________________________________________________________________
120 void AliTOFv0::BuildGeometry()
122 // Build TOF ROOT geometry for the ALICE event viewver
125 const int kColorTOF = 27;
128 Top = gAlice->GetGeometry()->GetNode("alice");
130 // Position the different copies
131 const Float_t rTof =(fRmax+fRmin)/2;
132 const Float_t hTof = fRmax-fRmin;
133 const Int_t fNTof = 18;
134 const Float_t kPi = TMath::Pi();
135 const Float_t angle = 2*kPi/fNTof;
138 // Define TOF basic volume
140 char NodeName0[6], NodeName1[6], NodeName2[6];
141 char NodeName3[6], NodeName4[6], RotMatNum[6];
143 new TBRIK("S_TOF_C","TOF box","void",
144 120*0.5,hTof*0.5,fZlenC*0.5);
145 new TBRIK("S_TOF_B","TOF box","void",
146 120*0.5,hTof*0.5,fZlenB*0.5);
147 new TBRIK("S_TOF_A","TOF box","void",
148 120*0.5,hTof*0.5,fZlenA*0.5);
150 for (Int_t NodeNum=1;NodeNum<19;NodeNum++){
153 sprintf(RotMatNum,"rot50%i",NodeNum);
154 sprintf(NodeName0,"FTO00%i",NodeNum);
155 sprintf(NodeName1,"FTO10%i",NodeNum);
156 sprintf(NodeName2,"FTO20%i",NodeNum);
157 sprintf(NodeName3,"FTO30%i",NodeNum);
158 sprintf(NodeName4,"FTO40%i",NodeNum);
161 sprintf(RotMatNum,"rot5%i",NodeNum);
162 sprintf(NodeName0,"FTO0%i",NodeNum);
163 sprintf(NodeName1,"FTO1%i",NodeNum);
164 sprintf(NodeName2,"FTO2%i",NodeNum);
165 sprintf(NodeName3,"FTO3%i",NodeNum);
166 sprintf(NodeName4,"FTO4%i",NodeNum);
169 new TRotMatrix(RotMatNum,RotMatNum,90,-20*NodeNum,90,90-20*NodeNum,0,0);
170 ang = (4.5-NodeNum) * angle;
173 Node = new TNode(NodeName0,NodeName0,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),299.15,RotMatNum);
174 Node->SetLineColor(kColorTOF);
178 Node = new TNode(NodeName1,NodeName1,"S_TOF_C",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-299.15,RotMatNum);
179 Node->SetLineColor(kColorTOF);
183 Node = new TNode(NodeName2,NodeName2,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),146.45,RotMatNum);
184 Node->SetLineColor(kColorTOF);
188 Node = new TNode(NodeName3,NodeName3,"S_TOF_B",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),-146.45,RotMatNum);
189 Node->SetLineColor(kColorTOF);
193 Node = new TNode(NodeName4,NodeName4,"S_TOF_A",rTof*TMath::Cos(ang),rTof*TMath::Sin(ang),0.,RotMatNum);
194 Node->SetLineColor(kColorTOF);
199 //_____________________________________________________________________________
200 void AliTOFv0::CreateGeometry()
203 // Create geometry for Time Of Flight version 0
207 <img src="picts/AliTOFv0.gif">
211 // Creates common geometry
213 AliTOF::CreateGeometry();
216 //_____________________________________________________________________________
217 void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
218 Float_t zlenB, Float_t zlenA, Float_t ztof0)
221 // Definition of the Time Of Fligh Resistive Plate Chambers
222 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
224 Float_t ycoor, zcoor;
226 Int_t *idtmed = fIdtmed->GetArray()-499;
230 Float_t Radius = fRmin+2.;//cm
234 par[2] = zlenC * 0.5;
235 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
236 par[2] = zlenB * 0.5;
237 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
238 par[2] = zlenA * 0.5;
239 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
242 // Positioning of modules
244 Float_t zcor1 = ztof0 - zlenC*0.5;
245 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
248 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
249 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
250 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
251 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
252 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
253 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
254 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
255 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
257 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
258 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
259 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
260 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
261 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
262 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
264 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
265 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
266 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
268 Float_t db = 0.5;//cm
269 Float_t xFLT, yFLT, zFLTA, zFLTB, zFLTC;
273 zFLTA = zlenA - db*0.5;
274 zFLTB = zlenB - db*0.5;
275 zFLTC = zlenC - db*0.5;
277 // Sizes of MRPC pads
279 Float_t yPad = 0.505;//cm
281 // Large not sensitive volumes with CO2
285 cout <<"************************* TOF geometry **************************"<<endl;
287 par[2] = (zFLTA *0.5);
288 gMC->Gsvolu("FLTA", "BOX ", idtmed[506], par, 3); // CO2
289 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
291 par[2] = (zFLTB * 0.5);
292 gMC->Gsvolu("FLTB", "BOX ", idtmed[506], par, 3); // CO2
293 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
295 par[2] = (zFLTC * 0.5);
296 gMC->Gsvolu("FLTC", "BOX ", idtmed[506], par, 3); // CO2
297 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
299 ////////// Layers before detector ////////////////////
301 // MYlar layer in front 1.0 mm thick at the beginning
305 ycoor = -yFLT/2 + par[1];
306 gMC->Gsvolu("FMYA", "BOX ", idtmed[508], par, 3); // Alluminium
307 gMC->Gspos ("FMYA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
308 gMC->Gsvolu("FMYB", "BOX ", idtmed[508], par, 3); // Alluminium
309 gMC->Gspos ("FMYB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
310 gMC->Gsvolu("FMYC", "BOX ", idtmed[508], par, 3); // Alluminium
311 gMC->Gspos ("FMYC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
313 // honeycomb (special Polyethilene Layer of 1cm)
314 ycoor = ycoor + par[1];
318 ycoor = ycoor + par[1];
319 gMC->Gsvolu("FPLA", "BOX ", idtmed[503], par, 3); // Hony
320 gMC->Gspos ("FPLA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
321 gMC->Gsvolu("FPLB", "BOX ", idtmed[503], par, 3); // Hony
322 gMC->Gspos ("FPLB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
323 gMC->Gsvolu("FPLC", "BOX ", idtmed[503], par, 3); // Hony
324 gMC->Gspos ("FPLC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
326 ///////////////// Detector itself //////////////////////
328 const Float_t StripWidth = 10.0;//cm
329 const Float_t DeadBound = 1.5;//cm non-sensitive between the pad edge
330 //and the boundary of the strip
331 const Int_t nx = 48; // number of pads along x
332 const Int_t nz = 2; // number of pads along z
333 const Float_t Space= 5.5; //cm distance from the front plate of the box
336 zSenStrip = StripWidth-2*DeadBound;//cm
340 par[2] = StripWidth/2.;
342 // glass layer of detector STRip
343 gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
345 // Non-Sesitive Freon boundaries
347 par[1] = 0.110*0.5;//cm
349 gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
350 gMC->Gspos ("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
352 // MYlar for Internal non-sesitive boundaries
354 gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3);
355 gMC->Gspos ("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
357 // MYlar eXternal layers
358 par[1] = 0.035*0.5;//cm
359 ycoor = -yPad*0.5+par[1];
360 gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
361 gMC->Gspos ("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
362 gMC->Gspos ("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
368 gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
369 gMC->Gspos ("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
370 gMC->Gspos ("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
372 // freon sensitive layer (Chlorine-Fluorine-Carbon)
375 par[2] = zSenStrip*0.5;
376 gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
377 gMC->Gspos ("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
379 // Pad definition x & z
380 gMC->Gsdvn("FLZ","FCFC", nz, 3);
381 gMC->Gsdvn("FLX","FLZ" , nx, 1);
387 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
388 gMC->Gspos ("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
390 //// Positioning the Strips (FSTR) in the FLT volumes /////
394 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
396 Float_t Gap = 4.; //cm distance between the strip axis
403 ycoor = -14.5 + Space ; //2 cm over front plate
405 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
406 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
410 Int_t UpDown = -1; // UpDown=-1 -> Upper strip
411 // UpDown=+1 -> Lower strip
413 ang = atan(zcoor/Radius);
415 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
416 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
418 ycoor = -14.5+ Space; //2 cm over front plate
419 ycoor += (1-(UpDown+1)/2)*Gap;
420 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
421 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
423 UpDown*= -1; // Alternate strips
424 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
425 UpDown*Gap*TMath::Tan(ang)-
426 (zSenStrip/2)/TMath::Cos(ang);
427 } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
429 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)-
430 UpDown*Gap*TMath::Tan(ang)+
431 (zSenStrip/2)/TMath::Cos(ang);
434 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
435 UpDown*Gap*TMath::Tan(ang)-
436 (zSenStrip/2)/TMath::Cos(ang);
438 ang = atan(zcoor/Radius);
440 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
441 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
444 ycoor = -14.5+ Space; //2 cm over front plate
445 ycoor += (1-(UpDown+1)/2)*Gap;
446 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
447 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
449 ycoor = -29./2.+ Space;//2 cm over front plate
457 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
458 UpDown*Gap*TMath::Tan(ang)-
459 (zSenStrip/2)/TMath::Cos(ang)-0.5/TMath::Cos(ang);
461 ang = atan(zpos/Radius);
463 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
465 ycoor = -29.*0.5+ Space ; //2 cm over front plate
466 ycoor += (1-(UpDown+1)/2)*Gap;
467 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
468 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
473 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
474 UpDown*Gap*TMath::Tan(ang)-
475 (zSenStrip/2)/TMath::Cos(ang);
476 ang = atan(zpos/Radius);
478 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
480 ycoor = -29.*0.5+ Space ; //2 cm over front plate
481 ycoor += (1-(UpDown+1)/2)*Gap;
482 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
483 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
486 } while (TMath::Abs(ang*kRaddeg)<22.5);//till we reach a tilting angle of 22.5 degrees
488 ycoor = -29.*0.5+ Space ; //2 cm over front plate
492 ang = atan(zpos/Radius);
494 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
496 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
497 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
498 zpos = zpos - zSenStrip/TMath::Cos(ang);
499 last = StripWidth*TMath::Cos(ang)/2.;
500 } while (zpos>-t+zFLTC+db);
504 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
506 (zSenStrip/2)/TMath::Cos(ang);
510 ycoor= -29.*0.5+Space+Gap;
514 ang = atan(zpos/Radius);
516 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
518 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
519 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
520 zpos = zpos - zSenStrip/TMath::Cos(ang);
521 last = StripWidth*TMath::Cos(ang)*0.5;
522 } while (zpos>-t+last);
525 ////////// Layers after detector /////////////////
527 // honeycomb (Polyethilene) Layer after (3cm)
529 Float_t OverSpace = 15.30;//cm
534 ycoor = -yFLT/2 + OverSpace + par[1];
535 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
536 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
537 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
538 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
539 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
540 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
542 // Electronics (Cu) after
545 par[1] = 1.43*0.05*0.5; // 5% of X0
548 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
549 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
550 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
551 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
552 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
553 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
555 // cooling WAter after
558 par[1] = 36.1*0.02*0.5; // 2% of X0
561 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
562 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
563 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
564 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
565 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
566 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
568 //Back Plate honycomb (2cm)
572 ycoor = yFLT/2 - par[1];
573 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
574 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
575 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
576 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
577 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
578 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
581 //_____________________________________________________________________________
582 void AliTOFv0::DrawModule()
585 // Draw a shaded view of the Time Of Flight version 1
587 // Set everything unseen
588 gMC->Gsatt("*", "seen", -1);
590 // Set ALIC mother transparent
591 gMC->Gsatt("ALIC","SEEN",0);
593 // Set the volumes visible
594 gMC->Gsatt("ALIC","SEEN",0);
596 gMC->Gsatt("FTOA","SEEN",1);
597 gMC->Gsatt("FTOB","SEEN",1);
598 gMC->Gsatt("FTOC","SEEN",1);
599 gMC->Gsatt("FLTA","SEEN",1);
600 gMC->Gsatt("FLTB","SEEN",1);
601 gMC->Gsatt("FLTC","SEEN",1);
602 gMC->Gsatt("FPLA","SEEN",1);
603 gMC->Gsatt("FPLB","SEEN",1);
604 gMC->Gsatt("FPLC","SEEN",1);
605 gMC->Gsatt("FSTR","SEEN",1);
606 gMC->Gsatt("FPEA","SEEN",1);
607 gMC->Gsatt("FPEB","SEEN",1);
608 gMC->Gsatt("FPEC","SEEN",1);
610 gMC->Gsatt("FLZ1","SEEN",0);
611 gMC->Gsatt("FLZ2","SEEN",0);
612 gMC->Gsatt("FLZ3","SEEN",0);
613 gMC->Gsatt("FLX1","SEEN",0);
614 gMC->Gsatt("FLX2","SEEN",0);
615 gMC->Gsatt("FLX3","SEEN",0);
616 gMC->Gsatt("FPAD","SEEN",0);
618 gMC->Gdopt("hide", "on");
619 gMC->Gdopt("shad", "on");
620 gMC->Gsatt("*", "fill", 7);
621 gMC->SetClipBox(".");
622 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
624 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
625 gMC->Gdhead(1111, "Time Of Flight");
626 gMC->Gdman(18, 4, "MAN");
627 gMC->Gdopt("hide","off");
630 //_____________________________________________________________________________
631 void AliTOFv0::CreateMaterials()
634 // Define materials for the Time Of Flight
636 AliTOF::CreateMaterials();
639 //_____________________________________________________________________________
640 void AliTOFv0::Init()
643 // Initialise the detector after the geometry has been defined
645 printf("**************************************"
647 "**************************************\n");
648 printf("\n Version 0 of TOF initialing, "
653 fIdFTOA = gMC->VolId("FTOA");
654 fIdFTOB = gMC->VolId("FTOB");
655 fIdFTOC = gMC->VolId("FTOC");
656 fIdFLTA = gMC->VolId("FLTA");
657 fIdFLTB = gMC->VolId("FLTB");
658 fIdFLTC = gMC->VolId("FLTC");
660 printf("**************************************"
662 "**************************************\n");
665 //_____________________________________________________________________________
666 void AliTOFv0::StepManager()
669 // Procedure called at each step in the Time Of Flight
671 Float_t hits[8],rho,phi,phid,z;
672 Int_t sector, plate, pad_x, pad_z, strip;
673 Int_t copy, pad_z_id, pad_x_id, strip_id, i;
675 Int_t *idtmed = fIdtmed->GetArray()-499;
676 TLorentzVector mom, pos;
679 if(gMC->GetMedium()==idtmed[513] &&
680 gMC->IsTrackEntering() && gMC->TrackCharge()
681 && gMC->CurrentVolID(copy)==fIdSens)
683 // getting information about hit volumes
685 pad_z_id=gMC->CurrentVolOffID(2,copy);
688 pad_x_id=gMC->CurrentVolOffID(1,copy);
691 strip_id=gMC->CurrentVolOffID(5,copy);
694 pad_z = (strip-1)*2+pad_z;
696 gMC->TrackPosition(pos);
697 gMC->TrackMomentum(mom);
699 rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
700 phi = TMath::ACos(pos[0]/rho);
701 Float_t as = TMath::ASin(pos[1]/rho);
702 if (as<0) phi = 2*3.141592654-phi;
707 Float_t limA = fZlenA*0.5;
708 Float_t limB = fZlenB+limA;
710 if (TMath::Abs(z)<=limA) plate = 3;
711 if (z<= limB && z> limA) plate = 2;
712 if (z>=-limB && z<-limA) plate = 4;
713 if (z> limB) plate = 1;
714 if (z<-limB) plate = 5;
716 if (plate==3) pad_z -= 2;
719 sector = Int_t (phid/20.);
722 Double_t ptot = mom.Rho();
723 Double_t norm = 1/ptot;
726 hits[i+3] = mom[i]*norm;
736 Int_t track = gAlice->CurrentTrack();
737 AliTOF::AddHit(track,vol, hits);