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.19 2001/05/04 10:09:48 vicinanz
19 Major upgrades to the strip structure
21 Revision 1.18 2000/12/04 08:48:20 alibrary
22 Fixing problems in the HEAD
24 Revision 1.17 2000/10/02 21:28:17 fca
25 Removal of useless dependecies via forward declarations
27 Revision 1.16 2000/05/10 16:52:18 vicinanz
28 New TOF version with holes for PHOS/RICH
30 Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz
31 New version with Holes for PHOS/RICH
33 Revision 1.14 1999/11/05 22:39:06 fca
36 Revision 1.13 1999/11/02 11:26:39 fca
37 added stdlib.h for exit
39 Revision 1.12 1999/11/01 20:41:57 fca
40 Added protections against using the wrong version of FRAME
42 Revision 1.11 1999/10/22 08:04:14 fca
43 Correct improper use of negative parameters
45 Revision 1.10 1999/10/16 19:30:06 fca
46 Corrected Rotation Matrix and CVS log
48 Revision 1.9 1999/10/15 15:35:20 fca
49 New version for frame1099 with and without holes
51 Revision 1.8 1999/09/29 09:24:33 fca
52 Introduction of the Copyright and cvs Log
56 ///////////////////////////////////////////////////////////////////////////////
58 // Time Of Flight: design of C.Williams
60 // This class contains the functions for version 1 of the Time Of Flight //
63 // VERSION WITH 5 MODULES AND TILTED STRIPS
65 // HOLES FOR PHOS AND RICH DETECTOR
72 // University of Salerno - Italy
75 // University of Bologna - Italy
80 <img src="picts/AliTOFv2Class.gif">
84 ///////////////////////////////////////////////////////////////////////////////
91 #include "TGeometry.h"
93 #include <TLorentzVector.h>
103 //_____________________________________________________________________________
107 // Default constructor
111 //_____________________________________________________________________________
112 AliTOFv2::AliTOFv2(const char *name, const char *title)
116 // Standard constructor
119 // Check that FRAME is there otherwise we have no place where to
121 AliModule* frame=gAlice->GetModule("FRAME");
123 Error("Ctor","TOF needs FRAME to be present\n");
126 if(frame->IsVersion()!=1) {
127 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
133 //____________________________________________________________________________
134 AliTOFv2::~AliTOFv2()
158 //_____________________________________________________________________________
159 void AliTOFv2::BuildGeometry()
162 // Build TOF ROOT geometry for the ALICE event display
165 const int kColorTOF = 27;
168 top = gAlice->GetGeometry()->GetNode("alice");
170 // Position the different copies
171 const Float_t krTof =(fRmax+fRmin)/2;
172 const Float_t khTof = fRmax-fRmin;
173 const Int_t kNTof = fNTof;
174 const Float_t kPi = TMath::Pi();
175 const Float_t kangle = 2*kPi/kNTof;
178 // Define TOF basic volume
180 char nodeName0[6], nodeName1[6], nodeName2[6];
181 char nodeName3[6], nodeName4[6], rotMatNum[6];
183 new TBRIK("S_TOF_C","TOF box","void",
184 120*0.5,khTof*0.5,fZlenC*0.5);
185 new TBRIK("S_TOF_B","TOF box","void",
186 120*0.5,khTof*0.5,fZlenB*0.5);
187 new TBRIK("S_TOF_A","TOF box","void",
188 120*0.5,khTof*0.5,fZlenA*0.5);
190 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
193 sprintf(rotMatNum,"rot50%i",nodeNum);
194 sprintf(nodeName0,"FTO00%i",nodeNum);
195 sprintf(nodeName1,"FTO10%i",nodeNum);
196 sprintf(nodeName2,"FTO20%i",nodeNum);
197 sprintf(nodeName3,"FTO30%i",nodeNum);
198 sprintf(nodeName4,"FTO40%i",nodeNum);
201 sprintf(rotMatNum,"rot5%i",nodeNum);
202 sprintf(nodeName0,"FTO0%i",nodeNum);
203 sprintf(nodeName1,"FTO1%i",nodeNum);
204 sprintf(nodeName2,"FTO2%i",nodeNum);
205 sprintf(nodeName3,"FTO3%i",nodeNum);
206 sprintf(nodeName4,"FTO4%i",nodeNum);
209 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
210 ang = (4.5-nodeNum) * kangle;
213 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),299.15,rotMatNum);
214 node->SetLineColor(kColorTOF);
218 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-299.15,rotMatNum);
219 node->SetLineColor(kColorTOF);
221 if (nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
224 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),146.45,rotMatNum);
225 node->SetLineColor(kColorTOF);
229 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-146.45,rotMatNum);
230 node->SetLineColor(kColorTOF);
232 } // Holes for RICH detector
234 if ((nodeNum<8 || nodeNum>12) && nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
237 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),0.,rotMatNum);
238 node->SetLineColor(kColorTOF);
240 } // Holes for PHOS detector (+ Holes for RICH detector, central part)
241 } // end loop on nodeNum
245 //_____________________________________________________________________________
246 void AliTOFv2::CreateGeometry()
249 // Create geometry for Time Of Flight version 0
253 <img src="picts/AliTOFv2.gif">
257 // Creates common geometry
259 AliTOF::CreateGeometry();
262 //_____________________________________________________________________________
263 void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
264 Float_t zlenB, Float_t zlenA, Float_t ztof0)
267 // Definition of the Time Of Fligh Resistive Plate Chambers
268 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
270 Float_t ycoor, zcoor;
272 Int_t *idtmed = fIdtmed->GetArray()-499;
275 Float_t hTof = fRmax-fRmin;
277 Float_t radius = fRmin+2.;//cm
281 par[2] = zlenC * 0.5;
282 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
283 par[2] = zlenB * 0.5;
284 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
285 par[2] = zlenA * 0.5;
286 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
289 // Positioning of modules
291 Float_t zcor1 = ztof0 - zlenC*0.5;
292 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
295 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
296 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
297 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
298 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
299 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
300 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
301 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
302 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
304 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
305 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
306 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
307 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
309 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
311 Float_t db = 0.5;//cm
312 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
320 xFST = xFLT-fDeadBndX*2;//cm
322 // Sizes of MRPC pads
324 Float_t yPad = 0.505;//cm
326 // Large not sensitive volumes with Insensitive Freon
332 <<": ************************* TOF geometry **************************"
335 par[2] = (zFLTA *0.5);
336 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
337 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
339 par[2] = (zFLTB * 0.5);
340 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
341 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
343 par[2] = (zFLTC * 0.5);
344 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
345 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
347 ////////// Layers of Aluminum before and after detector //////////
348 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
349 ////////// lateral walls not simulated
352 ycoor = -yFLT/2 + par[1];
353 par[2] = (zFLTA *0.5);
354 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
355 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
356 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
357 par[2] = (zFLTB *0.5);
358 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
359 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
360 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
361 par[2] = (zFLTC *0.5);
362 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
363 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
364 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
366 ///////////////// Detector itself //////////////////////
368 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
369 //and the boundary of the strip
370 const Int_t knx = fNpadX; // number of pads along x
371 const Int_t knz = fNpadZ; // number of pads along z
372 const Float_t kspace = fSpace; //cm distance from the front plate of the box
374 Float_t zSenStrip = fZpad*fNpadZ;//cm
375 Float_t stripWidth = zSenStrip + 2*kdeadBound;
379 par[2] = stripWidth*0.5;
381 // new description for strip volume
382 // -- all constants are expressed in cm
383 // heigth of different layers
384 const Float_t khhony = 1. ; // heigth of HONY Layer
385 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
386 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
387 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
388 const Float_t khglasseiy = 0.32; // 2.2 Ext. Glass + 1. Semi Int. Glass (mm)
389 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
390 const Float_t kwsensmz = 2*3.5 ; // cm
391 const Float_t klsensmx = 48*2.5; // cm
392 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
393 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
395 // heigth of the FSTR Volume (the strip volume)
396 const Float_t khstripy = 2*(khhony+khpcby+khmyly+khgraphy+khglasseiy)+khsensmy;
397 // width of the FSTR Volume (the strip volume)
398 const Float_t kwstripz = 10.;
399 // length of the FSTR Volume (the strip volume)
400 const Float_t klstripx = 122.;
402 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
403 // coordinates of the strip center in the strip reference frame; used for positioning
404 // internal strip volumes
405 Float_t posfp[3]={0.,0.,0.};
407 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
408 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
409 //-- HONY Layer definition
411 parfp[1] = khhony*0.5;
413 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
414 // positioning 2 HONY Layers on FSTR volume
415 posfp[1]=-khstripy*0.5+parfp[1];
416 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
417 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
419 //-- PCB Layer definition
420 parfp[1] = khpcby*0.5;
421 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
422 // positioning 2 PCB Layers on FSTR volume
423 posfp[1]=-khstripy*0.5+khhony+parfp[1];
424 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
425 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
427 //-- MYLAR Layer definition
428 parfp[1] = khmyly*0.5;
429 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
430 // positioning 2 MYLAR Layers on FSTR volume
431 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
432 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
433 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
435 //-- Graphite Layer definition
436 parfp[1] = khgraphy*0.5;
437 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
438 // positioning 2 Graphite Layers on FSTR volume
439 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
440 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
441 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
443 //-- Glass (EXT. +Semi INT.) Layer definition
444 parfp[1] = khglasseiy*0.5;
445 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
446 // positioning 2 Glass Layers on FSTR volume
447 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
448 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
449 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
451 //-- Sensitive Mixture Layer definition
452 parfp[0] = klsensmx*0.5;
453 parfp[1] = khsensmy*0.5;
454 parfp[2] = kwsensmz*0.5;
455 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
456 // positioning the sensitive gas Layer on FSTR volume
457 gMC->Gspos("FSEN",0,"FSTR",0.,0.,0.,0,"ONLY");
459 // dividing FSEN along z in knz=2 and along x in knx=48
460 gMC->Gsdvn("FSEZ","FSEN",knz,3);
461 gMC->Gsdvn("FSEX","FSEZ",knx,1);
463 // FPAD volume definition
464 parfp[0] = klpadx*0.5;
465 parfp[1] = khsensmy*0.5;
466 parfp[2] = kwpadz*0.5;
467 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
468 // positioning the FPAD volumes on previous divisions
469 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
471 //// Positioning the Strips (FSTR) in the FLT volumes /////
475 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
477 Float_t gap = fGapA; //cm distance between the strip axis
483 ycoor = -14.5 + kspace ; //2 cm over front plate
485 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
486 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
489 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
490 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
495 Int_t upDown = -1; // upDown=-1 -> Upper strip
496 // upDown=+1 -> Lower strip
498 ang = atan(zcoor/radius);
500 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
501 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
503 ycoor = -14.5+ kspace; //2 cm over front plate
504 ycoor += (1-(upDown+1)/2)*gap;
505 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
506 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
509 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
510 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
514 upDown*= -1; // Alternate strips
515 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
516 upDown*gap*TMath::Tan(ang)-
517 (zSenStrip/2)/TMath::Cos(ang);
518 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
520 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
521 upDown*gap*TMath::Tan(ang)+
522 (zSenStrip/2)/TMath::Cos(ang);
525 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
526 upDown*gap*TMath::Tan(ang)-
527 (zSenStrip/2)/TMath::Cos(ang);
529 ang = atan(zcoor/radius);
531 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
532 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
535 ycoor = -14.5+ kspace; //2 cm over front plate
536 ycoor += (1-(upDown+1)/2)*gap;
537 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
538 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
541 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
542 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
545 ycoor = -hTof/2.+ kspace;//2 cm over front plate
552 Float_t deadRegion = 1.0;//cm
554 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
555 upDown*gap*TMath::Tan(ang)-
556 (zSenStrip/2)/TMath::Cos(ang)-
557 deadRegion/TMath::Cos(ang);
559 ang = atan(zpos/radius);
561 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
563 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
564 ycoor += (1-(upDown+1)/2)*gap;
565 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
566 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
569 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
570 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
577 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
578 upDown*gap*TMath::Tan(ang)-
579 (zSenStrip/2)/TMath::Cos(ang);
580 ang = atan(zpos/radius);
582 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
584 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
585 ycoor += (1-(upDown+1)/2)*gap;
586 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
587 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
590 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
591 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
596 } while (TMath::Abs(ang*kRaddeg)<22.5);
597 //till we reach a tilting angle of 22.5 degrees
599 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
600 zpos = zpos - zSenStrip/TMath::Cos(ang);
603 ang = atan(zpos/radius);
605 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
607 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
608 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
609 zpos = zpos - zSenStrip/TMath::Cos(ang);
611 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
612 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
616 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
620 zpos = zpos + zSenStrip/TMath::Cos(ang);
622 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
624 (zSenStrip/2)/TMath::Cos(ang);
628 ycoor= -hTof*0.5+kspace+gap;
632 ang = atan(zpos/radius);
634 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
636 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
637 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
640 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
641 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
644 zpos = zpos - zSenStrip/TMath::Cos(ang);
645 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
648 ////////// Layers after strips /////////////////
649 // honeycomb (Polyethilene) Layer after (1.2cm)
651 Float_t overSpace = fOverSpc;//cm
655 par[2] = (zFLTA *0.5);
656 ycoor = -yFLT/2 + overSpace + par[1];
657 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
658 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
659 par[2] = (zFLTB *0.5);
660 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
661 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
662 par[2] = (zFLTC *0.5);
663 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
664 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
666 // Electronics (Cu) after
669 par[1] = 1.43*0.05*0.5; // 5% of X0
670 par[2] = (zFLTA *0.5);
672 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
673 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
674 par[2] = (zFLTB *0.5);
675 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
676 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
677 par[2] = (zFLTC *0.5);
678 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
679 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
681 // cooling WAter after
684 par[1] = 36.1*0.02*0.5; // 2% of X0
685 par[2] = (zFLTA *0.5);
687 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
688 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
689 par[2] = (zFLTB *0.5);
690 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
691 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
692 par[2] = (zFLTC *0.5);
693 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
694 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
699 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
700 par[2] = (zFLTA *0.5);
702 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
703 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
704 par[2] = (zFLTB *0.5);
705 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
706 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
707 par[2] = (zFLTC *0.5);
708 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
709 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
711 //Back Plate honycomb (2cm)
715 ycoor = yFLT/2 - par[1];
716 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
717 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
718 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
719 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
720 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
721 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
725 //_____________________________________________________________________________
726 void AliTOFv2::DrawModule()
729 // Draw a shaded view of the Time Of Flight version 1
731 // Set everything unseen
732 gMC->Gsatt("*", "seen", -1);
734 // Set ALIC mother transparent
735 gMC->Gsatt("ALIC","SEEN",0);
737 // Set the volumes visible
738 gMC->Gsatt("ALIC","SEEN",0);
740 gMC->Gsatt("FTOA","SEEN",1);
741 gMC->Gsatt("FTOB","SEEN",1);
742 gMC->Gsatt("FTOC","SEEN",1);
743 gMC->Gsatt("FLTA","SEEN",1);
744 gMC->Gsatt("FLTB","SEEN",1);
745 gMC->Gsatt("FLTC","SEEN",1);
746 gMC->Gsatt("FPLA","SEEN",1);
747 gMC->Gsatt("FPLB","SEEN",1);
748 gMC->Gsatt("FPLC","SEEN",1);
749 gMC->Gsatt("FSTR","SEEN",1);
750 gMC->Gsatt("FPEA","SEEN",1);
751 gMC->Gsatt("FPEB","SEEN",1);
752 gMC->Gsatt("FPEC","SEEN",1);
754 gMC->Gsatt("FLZ1","SEEN",0);
755 gMC->Gsatt("FLZ2","SEEN",0);
756 gMC->Gsatt("FLZ3","SEEN",0);
757 gMC->Gsatt("FLX1","SEEN",0);
758 gMC->Gsatt("FLX2","SEEN",0);
759 gMC->Gsatt("FLX3","SEEN",0);
760 gMC->Gsatt("FPAD","SEEN",0);
762 gMC->Gdopt("hide", "on");
763 gMC->Gdopt("shad", "on");
764 gMC->Gsatt("*", "fill", 7);
765 gMC->SetClipBox(".");
766 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
768 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
769 gMC->Gdhead(1111, "Time Of Flight");
770 gMC->Gdman(18, 4, "MAN");
771 gMC->Gdopt("hide","off");
774 //_____________________________________________________________________________
775 void AliTOFv2::CreateMaterials()
778 // Define materials for the Time Of Flight
780 AliTOF::CreateMaterials();
783 //_____________________________________________________________________________
784 void AliTOFv2::Init()
787 // Initialise the detector after the geometry has been defined
790 printf("%s: **************************************"
792 "**************************************\n",ClassName());
793 printf("\n%s: Version 2 of TOF initialing, "
794 "TOF with holes for PHOS and RICH \n",ClassName());
799 fIdFTOA = gMC->VolId("FTOA");
800 fIdFTOB = gMC->VolId("FTOB");
801 fIdFTOC = gMC->VolId("FTOC");
802 fIdFLTA = gMC->VolId("FLTA");
803 fIdFLTB = gMC->VolId("FLTB");
804 fIdFLTC = gMC->VolId("FLTC");
807 printf("%s: **************************************"
809 "**************************************\n",ClassName());
813 //_____________________________________________________________________________
814 void AliTOFv2::StepManager()
817 // Procedure called at each step in the Time Of Flight
819 TLorentzVector mom, pos;
820 Float_t xm[3],pm[3],xpad[3],ppad[3];
821 Float_t hits[13],phi,phid,z;
823 Int_t sector, plate, padx, padz, strip;
824 Int_t copy, padzid, padxid, stripid, i;
825 Int_t *idtmed = fIdtmed->GetArray()-499;
826 Float_t incidenceAngle;
828 if(gMC->GetMedium()==idtmed[513] &&
829 gMC->IsTrackEntering() && gMC->TrackCharge()
830 && gMC->CurrentVolID(copy)==fIdSens)
832 // getting information about hit volumes
834 padzid=gMC->CurrentVolOffID(2,copy);
837 padxid=gMC->CurrentVolOffID(1,copy);
840 stripid=gMC->CurrentVolOffID(4,copy);
843 gMC->TrackPosition(pos);
844 gMC->TrackMomentum(mom);
846 // Double_t NormPos=1./pos.Rho();
847 Double_t normMom=1./mom.Rho();
849 // getting the cohordinates in pad ref system
850 xm[0] = (Float_t)pos.X();
851 xm[1] = (Float_t)pos.Y();
852 xm[2] = (Float_t)pos.Z();
854 pm[0] = (Float_t)mom.X()*normMom;
855 pm[1] = (Float_t)mom.Y()*normMom;
856 pm[2] = (Float_t)mom.Z()*normMom;
858 gMC->Gmtod(xm,xpad,1);
859 gMC->Gmtod(pm,ppad,2);
861 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
866 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
867 if (z < (fZlenA*0.5+fZlenB) &&
868 z > fZlenA*0.5) plate = 4;
869 if (z >-(fZlenA*0.5+fZlenB) &&
870 z < -fZlenA*0.5) plate = 2;
871 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
872 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
875 phid = phi*kRaddeg+180.;
876 sector = Int_t (phid/20.);
889 hits[11]= incidenceAngle;
890 hits[12]= gMC->Edep();
898 AddHit(gAlice->CurrentTrack(),vol, hits);