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 2000/12/04 08:48:20 alibrary
19 Fixing problems in the HEAD
21 Revision 1.18 2000/10/02 21:28:17 fca
22 Removal of useless dependecies via forward declarations
24 Revision 1.17 2000/06/06 07:52:09 vicinanz
25 NodeName array dimension enlarged
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 DETECTOR
72 // University of Salerno - Italy
75 // University of Bologna - Italy
80 <img src="picts/AliTOFv1Class.gif">
84 ///////////////////////////////////////////////////////////////////////////////
91 #include "TGeometry.h"
94 #include <TLorentzVector.h>
103 //_____________________________________________________________________________
107 // Default constructor
111 //_____________________________________________________________________________
112 AliTOFv1::AliTOFv1(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");
135 //____________________________________________________________________________
136 AliTOFv1::~AliTOFv1()
160 //_____________________________________________________________________________
161 void AliTOFv1::BuildGeometry()
164 // Build TOF ROOT geometry for the ALICE event display
167 const int kColorTOF = 27;
170 top = gAlice->GetGeometry()->GetNode("alice");
172 // Position the different copies
173 const Float_t krTof =(fRmax+fRmin)/2;
174 const Float_t khTof = fRmax-fRmin;
175 const Int_t kNTof = fNTof;
176 const Float_t kPi = TMath::Pi();
177 const Float_t kangle = 2*kPi/kNTof;
180 // Define TOF basic volume
182 char nodeName0[7], nodeName1[7], nodeName2[7];
183 char nodeName3[7], nodeName4[7], rotMatNum[7];
185 new TBRIK("S_TOF_C","TOF box","void",
186 120*0.5,khTof*0.5,fZlenC*0.5);
187 new TBRIK("S_TOF_B","TOF box","void",
188 120*0.5,khTof*0.5,fZlenB*0.5);
189 new TBRIK("S_TOF_A","TOF box","void",
190 120*0.5,khTof*0.5,fZlenA*0.5);
192 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
195 sprintf(rotMatNum,"rot50%i",nodeNum);
196 sprintf(nodeName0,"FTO00%i",nodeNum);
197 sprintf(nodeName1,"FTO10%i",nodeNum);
198 sprintf(nodeName2,"FTO20%i",nodeNum);
199 sprintf(nodeName3,"FTO30%i",nodeNum);
200 sprintf(nodeName4,"FTO40%i",nodeNum);
203 sprintf(rotMatNum,"rot5%i",nodeNum);
204 sprintf(nodeName0,"FTO0%i",nodeNum);
205 sprintf(nodeName1,"FTO1%i",nodeNum);
206 sprintf(nodeName2,"FTO2%i",nodeNum);
207 sprintf(nodeName3,"FTO3%i",nodeNum);
208 sprintf(nodeName4,"FTO4%i",nodeNum);
211 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
212 ang = (4.5-nodeNum) * kangle;
215 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),299.15,rotMatNum);
216 node->SetLineColor(kColorTOF);
220 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-299.15,rotMatNum);
221 node->SetLineColor(kColorTOF);
225 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),146.45,rotMatNum);
226 node->SetLineColor(kColorTOF);
230 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-146.45,rotMatNum);
231 node->SetLineColor(kColorTOF);
234 if (nodeNum<8 || nodeNum>12) {
236 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),0.,rotMatNum);
237 node->SetLineColor(kColorTOF);
239 } // Modules A which are not to be installed for PHOS holes.
240 } // end loop on nodeNum
244 //_____________________________________________________________________________
245 void AliTOFv1::CreateGeometry()
248 // Create geometry for Time Of Flight version 0
252 <img src="picts/AliTOFv1.gif">
256 // Creates common geometry
258 AliTOF::CreateGeometry();
261 //_____________________________________________________________________________
262 void AliTOFv1::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
263 Float_t zlenB, Float_t zlenA, Float_t ztof0)
266 // Definition of the Time Of Fligh Resistive Plate Chambers
267 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
269 Float_t ycoor, zcoor;
271 Int_t *idtmed = fIdtmed->GetArray()-499;
274 Float_t hTof = fRmax-fRmin;
276 Float_t radius = fRmin+2.;//cm
280 par[2] = zlenC * 0.5;
281 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
282 par[2] = zlenB * 0.5;
283 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
284 par[2] = zlenA * 0.5;
285 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
288 // Positioning of modules
290 Float_t zcor1 = ztof0 - zlenC*0.5;
291 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
294 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
295 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
296 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
297 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
298 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
299 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
300 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
301 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
303 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
304 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
305 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
306 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
307 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
308 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
310 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
311 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
313 Float_t db = 0.5;//cm
314 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
322 xFST = xFLT-fDeadBndX*2;//cm
324 // Sizes of MRPC pads
326 Float_t yPad = 0.505;//cm
328 // Large not sensitive volumes with Insensitive Freon
332 cout <<"************************* TOF geometry **************************"<<endl;
334 par[2] = (zFLTA *0.5);
335 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
336 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
338 par[2] = (zFLTB * 0.5);
339 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
340 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
342 par[2] = (zFLTC * 0.5);
343 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
344 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
346 ////////// Layers of Aluminum before and after detector //////////
347 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
348 ////////// lateral walls not simulated
351 ycoor = -yFLT/2 + par[1];
352 par[2] = (zFLTA *0.5);
353 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
354 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
355 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
356 par[2] = (zFLTB *0.5);
357 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
358 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
359 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
360 par[2] = (zFLTC *0.5);
361 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
362 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
363 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
365 ///////////////// Detector itself //////////////////////
367 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
368 //and the boundary of the strip
369 const Int_t knx = fNpadX; // number of pads along x
370 const Int_t knz = fNpadZ; // number of pads along z
371 const Float_t kspace = fSpace; //cm distance from the front plate of the box
373 Float_t zSenStrip = fZpad*fNpadZ;//cm
374 Float_t stripWidth = zSenStrip + 2*kdeadBound;
378 par[2] = stripWidth*0.5;
380 // new description for strip volume
381 // -- all constants are expressed in cm
382 // heigth of different layers
383 const Float_t khhony = 1. ; // heigth of HONY Layer
384 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
385 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
386 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
387 const Float_t khglasseiy = 0.32; // 2.2 Ext. Glass + 1. Semi Int. Glass (mm)
388 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
389 const Float_t kwsensmz = 2*3.5 ; // cm
390 const Float_t klsensmx = 48*2.5; // cm
391 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
392 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
394 // heigth of the FSTR Volume (the strip volume)
395 const Float_t khstripy = 2*(khhony+khpcby+khmyly+khgraphy+khglasseiy)+khsensmy;
396 // width of the FSTR Volume (the strip volume)
397 const Float_t kwstripz = 10.;
398 // length of the FSTR Volume (the strip volume)
399 const Float_t klstripx = 122.;
401 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
402 // coordinates of the strip center in the strip reference frame; used for positioning
403 // internal strip volumes
404 Float_t posfp[3]={0.,0.,0.};
406 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
407 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
408 //-- HONY Layer definition
410 parfp[1] = khhony*0.5;
412 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
413 // positioning 2 HONY Layers on FSTR volume
414 posfp[1]=-khstripy*0.5+parfp[1];
415 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
416 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
418 //-- PCB Layer definition
419 parfp[1] = khpcby*0.5;
420 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
421 // positioning 2 PCB Layers on FSTR volume
422 posfp[1]=-khstripy*0.5+khhony+parfp[1];
423 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
424 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
426 //-- MYLAR Layer definition
427 parfp[1] = khmyly*0.5;
428 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
429 // positioning 2 MYLAR Layers on FSTR volume
430 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
431 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
432 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
434 //-- Graphite Layer definition
435 parfp[1] = khgraphy*0.5;
436 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
437 // positioning 2 Graphite Layers on FSTR volume
438 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
439 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
440 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
442 //-- Glass (EXT. +Semi INT.) Layer definition
443 parfp[1] = khglasseiy*0.5;
444 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
445 // positioning 2 Glass Layers on FSTR volume
446 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
447 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
448 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
450 //-- Sensitive Mixture Layer definition
451 parfp[0] = klsensmx*0.5;
452 parfp[1] = khsensmy*0.5;
453 parfp[2] = kwsensmz*0.5;
454 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
455 // positioning the sensitive gas Layer on FSTR volume
456 gMC->Gspos("FSEN",0,"FSTR",0.,0.,0.,0,"ONLY");
458 // dividing FSEN along z in knz=2 and along x in knx=48
459 gMC->Gsdvn("FSEZ","FSEN",knz,3);
460 gMC->Gsdvn("FSEX","FSEZ",knx,1);
462 // FPAD volume definition
463 parfp[0] = klpadx*0.5;
464 parfp[1] = khsensmy*0.5;
465 parfp[2] = kwpadz*0.5;
466 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
467 // positioning the FPAD volumes on previous divisions
468 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
470 //// Positioning the Strips (FSTR) in the FLT volumes /////
474 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
476 Float_t gap = fGapA; //cm distance between the strip axis
482 ycoor = -14.5 + kspace ; //2 cm over front plate
484 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
485 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
487 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
488 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
492 Int_t upDown = -1; // upDown=-1 -> Upper strip
493 // upDown=+1 -> Lower strip
495 ang = atan(zcoor/radius);
497 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
498 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
500 ycoor = -14.5+ kspace; //2 cm over front plate
501 ycoor += (1-(upDown+1)/2)*gap;
502 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
503 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
505 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
506 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
509 upDown*= -1; // Alternate strips
510 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
511 upDown*gap*TMath::Tan(ang)-
512 (zSenStrip/2)/TMath::Cos(ang);
513 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
515 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
516 upDown*gap*TMath::Tan(ang)+
517 (zSenStrip/2)/TMath::Cos(ang);
520 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
521 upDown*gap*TMath::Tan(ang)-
522 (zSenStrip/2)/TMath::Cos(ang);
524 ang = atan(zcoor/radius);
526 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
527 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
530 ycoor = -14.5+ kspace; //2 cm over front plate
531 ycoor += (1-(upDown+1)/2)*gap;
532 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
533 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
535 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
536 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
538 ycoor = -hTof/2.+ kspace;//2 cm over front plate
545 Float_t deadRegion = 1.0;//cm
547 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
548 upDown*gap*TMath::Tan(ang)-
549 (zSenStrip/2)/TMath::Cos(ang)-
550 deadRegion/TMath::Cos(ang);
552 ang = atan(zpos/radius);
554 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
556 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
557 ycoor += (1-(upDown+1)/2)*gap;
558 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
559 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
561 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
562 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
568 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
569 upDown*gap*TMath::Tan(ang)-
570 (zSenStrip/2)/TMath::Cos(ang);
571 ang = atan(zpos/radius);
573 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
575 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
576 ycoor += (1-(upDown+1)/2)*gap;
577 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
578 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
580 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
581 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
585 } while (TMath::Abs(ang*kRaddeg)<22.5);
586 //till we reach a tilting angle of 22.5 degrees
588 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
589 zpos = zpos - zSenStrip/TMath::Cos(ang);
592 ang = atan(zpos/radius);
594 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
596 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
597 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
598 zpos = zpos - zSenStrip/TMath::Cos(ang);
599 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
600 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
603 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
607 zpos = zpos + zSenStrip/TMath::Cos(ang);
609 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
611 (zSenStrip/2)/TMath::Cos(ang);
615 ycoor= -hTof*0.5+kspace+gap;
619 ang = atan(zpos/radius);
621 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
623 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
624 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
626 printf("%f, St. %2i, Pl.5 ",ang*kRaddeg,i);
627 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
629 zpos = zpos - zSenStrip/TMath::Cos(ang);
630 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
633 ////////// Layers after strips /////////////////
634 // honeycomb (Polyethilene) Layer after (1.2cm)
636 Float_t overSpace = fOverSpc;//cm
640 par[2] = (zFLTA *0.5);
641 ycoor = -yFLT/2 + overSpace + par[1];
642 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
643 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
644 par[2] = (zFLTB *0.5);
645 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
646 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
647 par[2] = (zFLTC *0.5);
648 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
649 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
651 // Electronics (Cu) after
654 par[1] = 1.43*0.05*0.5; // 5% of X0
655 par[2] = (zFLTA *0.5);
657 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
658 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
659 par[2] = (zFLTB *0.5);
660 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
661 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
662 par[2] = (zFLTC *0.5);
663 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
664 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
666 // cooling WAter after
669 par[1] = 36.1*0.02*0.5; // 2% of X0
670 par[2] = (zFLTA *0.5);
672 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
673 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
674 par[2] = (zFLTB *0.5);
675 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
676 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
677 par[2] = (zFLTC *0.5);
678 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
679 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
684 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
685 par[2] = (zFLTA *0.5);
687 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
688 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
689 par[2] = (zFLTB *0.5);
690 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
691 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
692 par[2] = (zFLTC *0.5);
693 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
694 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
696 //Back Plate honycomb (2cm)
700 ycoor = yFLT/2 - par[1];
701 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
702 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
703 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
704 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
705 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
706 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
710 //_____________________________________________________________________________
711 void AliTOFv1::DrawModule()
714 // Draw a shaded view of the Time Of Flight version 1
716 // Set everything unseen
717 gMC->Gsatt("*", "seen", -1);
719 // Set ALIC mother transparent
720 gMC->Gsatt("ALIC","SEEN",0);
722 // Set the volumes visible
723 gMC->Gsatt("ALIC","SEEN",0);
725 gMC->Gsatt("FTOA","SEEN",1);
726 gMC->Gsatt("FTOB","SEEN",1);
727 gMC->Gsatt("FTOC","SEEN",1);
728 gMC->Gsatt("FLTA","SEEN",1);
729 gMC->Gsatt("FLTB","SEEN",1);
730 gMC->Gsatt("FLTC","SEEN",1);
731 gMC->Gsatt("FPLA","SEEN",1);
732 gMC->Gsatt("FPLB","SEEN",1);
733 gMC->Gsatt("FPLC","SEEN",1);
734 gMC->Gsatt("FSTR","SEEN",1);
735 gMC->Gsatt("FPEA","SEEN",1);
736 gMC->Gsatt("FPEB","SEEN",1);
737 gMC->Gsatt("FPEC","SEEN",1);
739 gMC->Gsatt("FLZ1","SEEN",0);
740 gMC->Gsatt("FLZ2","SEEN",0);
741 gMC->Gsatt("FLZ3","SEEN",0);
742 gMC->Gsatt("FLX1","SEEN",0);
743 gMC->Gsatt("FLX2","SEEN",0);
744 gMC->Gsatt("FLX3","SEEN",0);
745 gMC->Gsatt("FPAD","SEEN",0);
747 gMC->Gdopt("hide", "on");
748 gMC->Gdopt("shad", "on");
749 gMC->Gsatt("*", "fill", 7);
750 gMC->SetClipBox(".");
751 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
753 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
754 gMC->Gdhead(1111, "Time Of Flight");
755 gMC->Gdman(18, 4, "MAN");
756 gMC->Gdopt("hide","off");
759 //_____________________________________________________________________________
760 void AliTOFv1::CreateMaterials()
763 // Define materials for the Time Of Flight
765 AliTOF::CreateMaterials();
768 //_____________________________________________________________________________
769 void AliTOFv1::Init()
772 // Initialise the detector after the geometry has been defined
774 printf("**************************************"
776 "**************************************\n");
777 printf("\n Version 1 of TOF initialing, "
778 "TOF with holes for PHOS detector\n");
782 fIdFTOA = gMC->VolId("FTOA");
783 fIdFTOB = gMC->VolId("FTOB");
784 fIdFTOC = gMC->VolId("FTOC");
785 fIdFLTA = gMC->VolId("FLTA");
786 fIdFLTB = gMC->VolId("FLTB");
787 fIdFLTC = gMC->VolId("FLTC");
789 printf("**************************************"
791 "**************************************\n");
794 //_____________________________________________________________________________
795 void AliTOFv1::StepManager()
798 // Procedure called at each step in the Time Of Flight
800 TLorentzVector mom, pos;
801 Float_t xm[3],pm[3],xpad[3],ppad[3];
802 Float_t hits[13],phi,phid,z;
804 Int_t sector, plate, padx, padz, strip;
805 Int_t copy, padzid, padxid, stripid, i;
806 Int_t *idtmed = fIdtmed->GetArray()-499;
807 Float_t incidenceAngle;
809 if(gMC->GetMedium()==idtmed[513] &&
810 gMC->IsTrackEntering() && gMC->TrackCharge()
811 && gMC->CurrentVolID(copy)==fIdSens)
813 // getting information about hit volumes
815 padzid=gMC->CurrentVolOffID(2,copy);
818 padxid=gMC->CurrentVolOffID(1,copy);
821 stripid=gMC->CurrentVolOffID(4,copy);
824 gMC->TrackPosition(pos);
825 gMC->TrackMomentum(mom);
827 // Double_t NormPos=1./pos.Rho();
828 Double_t normMom=1./mom.Rho();
830 // getting the cohordinates in pad ref system
831 xm[0] = (Float_t)pos.X();
832 xm[1] = (Float_t)pos.Y();
833 xm[2] = (Float_t)pos.Z();
835 pm[0] = (Float_t)mom.X()*normMom;
836 pm[1] = (Float_t)mom.Y()*normMom;
837 pm[2] = (Float_t)mom.Z()*normMom;
839 gMC->Gmtod(xm,xpad,1);
840 gMC->Gmtod(pm,ppad,2);
842 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
847 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
848 if (z < (fZlenA*0.5+fZlenB) &&
849 z > fZlenA*0.5) plate = 4;
850 if (z >-(fZlenA*0.5+fZlenB) &&
851 z < -fZlenA*0.5) plate = 2;
852 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
853 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
856 phid = phi*kRaddeg+180.;
857 sector = Int_t (phid/20.);
870 hits[11]= incidenceAngle;
871 hits[12]= gMC->Edep();
879 AddHit(gAlice->CurrentTrack(),vol, hits);