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 ///////////////////////////////////////////////////////////////////////////////
20 // Time Of Flight: design of C.Williams
22 // This class contains the functions for version 2 of the Time Of Flight //
25 // VERSION WITH 5 MODULES AND TILTED STRIPS
27 // HOLES FOR PHOS AND RICH DETECTOR
29 // !Not Official version!
31 // Requested by Andreas Morsch to have TOFv2 full compliant
32 // with FRAME version 0
37 // University of Bologna - Italy
42 <img src="picts/AliTOFv2FHolesClass.gif">
46 ///////////////////////////////////////////////////////////////////////////////
51 #include "AliTOFv2FHoles.h"
53 #include "TGeometry.h"
55 #include <TLorentzVector.h>
63 ClassImp(AliTOFv2FHoles)
65 //_____________________________________________________________________________
66 AliTOFv2FHoles::AliTOFv2FHoles()
69 // Default constructor
73 //_____________________________________________________________________________
74 AliTOFv2FHoles::AliTOFv2FHoles(const char *name, const char *title)
78 // Standard constructor
81 // Check that FRAME is there otherwise we have no place where to
83 AliModule* frame=gAlice->GetModule("FRAME");
85 Error("Ctor","TOF needs FRAME to be present\n");
88 if(frame->IsVersion()!=0) {
89 Error("Ctor","FRAME version 0 needed with this version of TOF\n");
94 //____________________________________________________________________________
96 void AliTOFv2FHoles::BuildGeometry()
99 // Build TOF ROOT geometry for the ALICE event display
102 const int kColorTOF = 27;
105 top = gAlice->GetGeometry()->GetNode("alice");
107 // Position the different copies
108 const Float_t krTof =(fRmax+fRmin)/2;
109 const Float_t khTof = fRmax-fRmin;
110 const Int_t kNTof = fNTof;
111 const Float_t kPi = TMath::Pi();
112 const Float_t kangle = 2*kPi/kNTof;
115 // Define TOF basic volume
117 char nodeName0[6], nodeName1[6], nodeName2[6];
118 char nodeName3[6], nodeName4[6], rotMatNum[6];
120 new TBRIK("S_TOF_C","TOF box","void",
121 120*0.5,khTof*0.5,fZlenC*0.5);
122 new TBRIK("S_TOF_B","TOF box","void",
123 120*0.5,khTof*0.5,fZlenB*0.5);
124 new TBRIK("S_TOF_A","TOF box","void",
125 120*0.5,khTof*0.5,fZlenA*0.5);
127 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
130 sprintf(rotMatNum,"rot50%i",nodeNum);
131 sprintf(nodeName0,"FTO00%i",nodeNum);
132 sprintf(nodeName1,"FTO10%i",nodeNum);
133 sprintf(nodeName2,"FTO20%i",nodeNum);
134 sprintf(nodeName3,"FTO30%i",nodeNum);
135 sprintf(nodeName4,"FTO40%i",nodeNum);
138 sprintf(rotMatNum,"rot5%i",nodeNum);
139 sprintf(nodeName0,"FTO0%i",nodeNum);
140 sprintf(nodeName1,"FTO1%i",nodeNum);
141 sprintf(nodeName2,"FTO2%i",nodeNum);
142 sprintf(nodeName3,"FTO3%i",nodeNum);
143 sprintf(nodeName4,"FTO4%i",nodeNum);
146 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
147 ang = (4.5-nodeNum) * kangle;
150 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),299.15,rotMatNum);
151 node->SetLineColor(kColorTOF);
155 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-299.15,rotMatNum);
156 node->SetLineColor(kColorTOF);
158 if (nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
161 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),146.45,rotMatNum);
162 node->SetLineColor(kColorTOF);
166 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-146.45,rotMatNum);
167 node->SetLineColor(kColorTOF);
169 } // Holes for RICH detector
171 if ((nodeNum<8 || nodeNum>12) && nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
174 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),0.,rotMatNum);
175 node->SetLineColor(kColorTOF);
177 } // Holes for PHOS detector (+ Holes for RICH detector, central part)
178 } // end loop on nodeNum
182 //_____________________________________________________________________________
183 void AliTOFv2FHoles::CreateGeometry()
186 // Create geometry for Time Of Flight version 0
190 <img src="picts/AliTOFv2FHoles.gif">
194 // Creates common geometry
196 AliTOF::CreateGeometry();
199 //_____________________________________________________________________________
200 void AliTOFv2FHoles::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
201 Float_t zlenB, Float_t zlenA, Float_t ztof0)
204 // Definition of the Time Of Fligh Resistive Plate Chambers
205 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
207 Float_t ycoor, zcoor;
209 Int_t *idtmed = fIdtmed->GetArray()-499;
212 Float_t hTof = fRmax-fRmin;
214 Float_t radius = fRmin+2.;//cm
216 // fixing parameters as requested by FRAME v0 (Morsch 16-10-2001)
217 zlenA = 124.; // cm (A module length) original size 106. enlarged
218 zlenB = 154.; // cm (B module length) original size 141. enlarged
219 zlenC = 159.5; // cm (C module length) original size 175.5 reduced
220 ztof0 = 375.5; // total half-length of a TOF sector original size 371.5cm
225 par[2] = zlenC * 0.5;
226 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
227 par[2] = zlenB * 0.5;
228 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
229 par[2] = zlenA * 0.5;
230 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
233 // Positioning of modules
235 Float_t zcor1 = ztof0 - zlenC*0.5;
236 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
237 Float_t zcor3 = 0.00;
238 Float_t zcor4 = 156.75 - zlenC*0.5;
239 Float_t zcor5 = -156.75 + zlenB*0.5;
241 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
242 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
243 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
244 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
245 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor4, 0, idrotm[0], "ONLY");
246 gMC->Gspos("FTOC", 1, "BTO3", 0, 0., 0, idrotm[0], "ONLY");
248 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
249 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
250 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor5, 0, idrotm[0], "ONLY");
252 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
254 Float_t db = 0.5;//cm
255 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
263 xFST = xFLT-fDeadBndX*2; //cm
265 // Sizes of MRPC pads
267 Float_t yPad = 0.505; //cm
269 // Large not sensitive volumes with Insensitive Freon
275 <<": ************************* TOF geometry **************************"
278 par[2] = (zFLTA *0.5);
279 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
280 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
282 par[2] = (zFLTB * 0.5);
283 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
284 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
286 par[2] = (zFLTC * 0.5);
287 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
288 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
290 ////////// Layers of Aluminum before and after detector //////////
291 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
292 ////////// lateral walls not simulated
295 ycoor = -yFLT/2 + par[1];
296 par[2] = (zFLTA *0.5);
297 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
298 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
299 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
300 par[2] = (zFLTB *0.5);
301 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
302 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
303 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
304 par[2] = (zFLTC *0.5);
305 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
306 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
307 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
309 ///////////////// Detector itself //////////////////////
311 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
312 //and the boundary of the strip
313 const Int_t knx = fNpadX; // number of pads along x
314 const Int_t knz = fNpadZ; // number of pads along z
315 const Float_t kspace = fSpace; //cm distance from the front plate of the box
317 Float_t zSenStrip = fZpad*fNpadZ;//cm
318 Float_t stripWidth = zSenStrip + 2*kdeadBound;
322 par[2] = stripWidth*0.5;
324 // new description for strip volume -double stack strip-
325 // -- all constants are expressed in cm
326 // heigth of different layers
327 const Float_t khhony = 1. ; // heigth of HONY Layer
328 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
329 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
330 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
331 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
332 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
333 const Float_t kwsensmz = 2*3.5 ; // cm
334 const Float_t klsensmx = 48*2.5; // cm
335 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
336 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
338 // heigth of the FSTR Volume (the strip volume)
339 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
340 // width of the FSTR Volume (the strip volume)
341 const Float_t kwstripz = 10.;
342 // length of the FSTR Volume (the strip volume)
343 const Float_t klstripx = 122.;
345 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
346 // coordinates of the strip center in the strip reference frame; used for positioning
347 // internal strip volumes
348 Float_t posfp[3]={0.,0.,0.};
351 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
352 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
353 //-- HONY Layer definition
355 parfp[1] = khhony*0.5;
357 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
358 // positioning 2 HONY Layers on FSTR volume
360 posfp[1]=-khstripy*0.5+parfp[1];
361 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
362 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
364 //-- PCB Layer definition
365 parfp[1] = khpcby*0.5;
366 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
367 // positioning 2 PCB Layers on FSTR volume
368 posfp[1]=-khstripy*0.5+khhony+parfp[1];
369 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
370 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
371 // positioning the central PCB layer
372 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
376 //-- MYLAR Layer definition
377 parfp[1] = khmyly*0.5;
378 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
379 // positioning 2 MYLAR Layers on FSTR volume
380 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
381 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
382 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
383 // adding further 2 MYLAR Layers on FSTR volume
384 posfp[1] = khpcby*0.5+parfp[1];
385 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
386 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
389 //-- Graphite Layer definition
390 parfp[1] = khgraphy*0.5;
391 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
392 // positioning 2 Graphite Layers on FSTR volume
393 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
394 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
395 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
396 // adding further 2 Graphite Layers on FSTR volume
397 posfp[1] = khpcby*0.5+khmyly+parfp[1];
398 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
399 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
402 //-- Glass (EXT. +Semi INT.) Layer definition
403 parfp[1] = khglasseiy*0.5;
404 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
405 // positioning 2 Glass Layers on FSTR volume
406 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
407 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
408 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
409 // adding further 2 Glass Layers on FSTR volume
410 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
411 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
412 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
415 //-- Sensitive Mixture Layer definition
416 parfp[0] = klsensmx*0.5;
417 parfp[1] = khsensmy*0.5;
418 parfp[2] = kwsensmz*0.5;
419 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
420 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
421 // positioning 2 gas Layers on FSTR volume
422 // the upper is insensitive freon
423 // while the remaining is sensitive
424 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
425 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
426 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
428 // dividing FSEN along z in knz=2 and along x in knx=48
429 gMC->Gsdvn("FSEZ","FSEN",knz,3);
430 gMC->Gsdvn("FSEX","FSEZ",knx,1);
432 // FPAD volume definition
433 parfp[0] = klpadx*0.5;
434 parfp[1] = khsensmy*0.5;
435 parfp[2] = kwpadz*0.5;
436 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
437 // positioning the FPAD volumes on previous divisions
438 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
440 //// Positioning the Strips (FSTR) in the FLT volumes /////
444 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
446 // Float_t gap = fGapA; //cm distance between the strip axis
448 Float_t gap = fGapA+1.; //cm distance between the strip axis
454 ycoor = -14.5 + kspace ; //2 cm over front plate
456 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
457 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
460 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
461 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
466 Int_t upDown = -1; // upDown=-1 -> Upper strip
467 // upDown=+1 -> Lower strip
469 ang = atan(zcoor/radius);
471 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
472 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
474 ycoor = -14.5+ kspace; //2 cm over front plate
475 ycoor += (1-(upDown+1)/2)*gap;
476 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
477 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
480 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
481 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
485 upDown*= -1; // Alternate strips
486 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
487 upDown*gap*TMath::Tan(ang)-
488 (zSenStrip/2)/TMath::Cos(ang);
489 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
491 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
492 upDown*gap*TMath::Tan(ang)+
493 (zSenStrip/2)/TMath::Cos(ang);
496 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
497 upDown*gap*TMath::Tan(ang)-
498 (zSenStrip/2)/TMath::Cos(ang);
500 ang = atan(zcoor/radius);
502 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
503 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
506 ycoor = -14.5+ kspace; //2 cm over front plate
507 ycoor += (1-(upDown+1)/2)*gap;
510 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
511 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
515 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
516 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
519 ycoor = -hTof/2.+ kspace;//2 cm over front plate
526 Float_t deadRegion = 1.0;//cm
528 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
529 upDown*gap*TMath::Tan(ang)-
530 (zSenStrip/2)/TMath::Cos(ang)-
531 deadRegion/TMath::Cos(ang);
533 ang = atan(zpos/radius);
535 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
537 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
538 ycoor += (1-(upDown+1)/2)*gap;
539 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
540 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
543 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
544 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
551 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
552 upDown*gap*TMath::Tan(ang)-
553 (zSenStrip/2)/TMath::Cos(ang);
554 ang = atan(zpos/radius);
556 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
558 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
559 ycoor += (1-(upDown+1)/2)*gap;
560 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
561 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
564 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
565 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
570 } while (TMath::Abs(ang*kRaddeg)<22.5);
571 //till we reach a tilting angle of 22.5 degrees
573 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
574 zpos = zpos - zSenStrip/TMath::Cos(ang);
577 ycoor+=0.6; // fp to avoid overlaps
578 ang = atan(zpos/radius);
580 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
582 // zcoor = zpos+(zFLTB/2+zFLTA/2+db)+1.; // fp to avoid overlaps
583 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
584 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
585 zpos = zpos - zSenStrip/TMath::Cos(ang);
587 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
588 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
592 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
596 zpos = zpos + zSenStrip/TMath::Cos(ang);
598 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
600 (zSenStrip/2)/TMath::Cos(ang);
604 ycoor= -hTof*0.5+kspace+gap;
608 ang = atan(zpos/radius);
610 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
612 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
614 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
617 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
618 printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
621 zpos = zpos - zSenStrip/TMath::Cos(ang);
622 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
625 ////////// Layers after strips /////////////////
626 // honeycomb (Polyethilene) Layer after (1.2cm)
628 Float_t overSpace = fOverSpc;//cm
632 par[2] = (zFLTA *0.5);
633 ycoor = -yFLT/2 + overSpace + par[1];
634 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
635 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
636 par[2] = (zFLTB *0.5);
637 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
638 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
639 par[2] = (zFLTC *0.5);
640 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
641 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
643 // Electronics (Cu) after
646 par[1] = 1.43*0.05*0.5; // 5% of X0
647 par[2] = (zFLTA *0.5);
649 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
650 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
651 par[2] = (zFLTB *0.5);
652 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
653 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
654 par[2] = (zFLTC *0.5);
655 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
656 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
658 // cooling WAter after
661 par[1] = 36.1*0.02*0.5; // 2% of X0
662 par[2] = (zFLTA *0.5);
664 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
665 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
666 par[2] = (zFLTB *0.5);
667 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
668 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
669 par[2] = (zFLTC *0.5);
670 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
671 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
676 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
677 par[2] = (zFLTA *0.5);
679 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
680 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
681 par[2] = (zFLTB *0.5);
682 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
683 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
684 par[2] = (zFLTC *0.5);
685 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
686 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
688 //Back Plate honycomb (2cm)
692 ycoor = yFLT/2 - par[1];
693 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
694 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
695 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
696 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
697 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
698 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
702 //_____________________________________________________________________________
703 void AliTOFv2FHoles::DrawModule() const
706 // Draw a shaded view of the Time Of Flight version 2
708 // Set everything unseen
709 gMC->Gsatt("*", "seen", -1);
711 // Set ALIC mother transparent
712 gMC->Gsatt("ALIC","SEEN",0);
714 // Set the volumes visible
715 gMC->Gsatt("ALIC","SEEN",0);
717 gMC->Gsatt("FTOA","SEEN",1);
718 gMC->Gsatt("FTOB","SEEN",1);
719 gMC->Gsatt("FTOC","SEEN",1);
720 gMC->Gsatt("FLTA","SEEN",1);
721 gMC->Gsatt("FLTB","SEEN",1);
722 gMC->Gsatt("FLTC","SEEN",1);
723 gMC->Gsatt("FPLA","SEEN",1);
724 gMC->Gsatt("FPLB","SEEN",1);
725 gMC->Gsatt("FPLC","SEEN",1);
726 gMC->Gsatt("FSTR","SEEN",1);
727 gMC->Gsatt("FPEA","SEEN",1);
728 gMC->Gsatt("FPEB","SEEN",1);
729 gMC->Gsatt("FPEC","SEEN",1);
731 gMC->Gsatt("FLZ1","SEEN",0);
732 gMC->Gsatt("FLZ2","SEEN",0);
733 gMC->Gsatt("FLZ3","SEEN",0);
734 gMC->Gsatt("FLX1","SEEN",0);
735 gMC->Gsatt("FLX2","SEEN",0);
736 gMC->Gsatt("FLX3","SEEN",0);
737 gMC->Gsatt("FPAD","SEEN",0);
739 gMC->Gdopt("hide", "on");
740 gMC->Gdopt("shad", "on");
741 gMC->Gsatt("*", "fill", 7);
742 gMC->SetClipBox(".");
743 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
745 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
746 gMC->Gdhead(1111, "Time Of Flight");
747 gMC->Gdman(18, 4, "MAN");
748 gMC->Gdopt("hide","off");
750 //_____________________________________________________________________________
751 void AliTOFv2FHoles::DrawDetectorModules()
754 // Draw a shaded view of the TOF detector version 2
757 AliMC* pMC = AliMC::GetMC();
759 //Set ALIC mother transparent
760 pMC->Gsatt("ALIC","SEEN",0);
763 //Set volumes visible
766 // Level 1 for TOF volumes
767 gMC->Gsatt("B077","seen",0);
770 //==========> Level 2
772 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
773 gMC->Gsatt("B071","seen",0);
774 gMC->Gsatt("B074","seen",0);
775 gMC->Gsatt("B075","seen",0);
776 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
780 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
781 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
782 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
783 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
784 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
785 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
786 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
787 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
788 gMC->Gsatt("BTO1","seen",0);
792 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
793 gMC->Gsatt("BTO2","seen",0);
796 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
797 gMC->Gsatt("BTO3","seen",0);
799 // ==================> Level 3
800 // Level 3 of B071 / Level 2 of BTO1
801 gMC->Gsatt("FTOC","seen",-2);
802 gMC->Gsatt("FTOB","seen",-2);
803 gMC->Gsatt("FTOA","seen",-2);
805 // Level 3 of B074 / Level 2 of BTO2
806 // -> cfr previous settings
808 // Level 3 of B075 / Level 2 of BTO3
809 // -> cfr previous settings
811 gMC->Gdopt("hide","on");
812 gMC->Gdopt("shad","on");
813 gMC->Gsatt("*", "fill", 5);
814 gMC->SetClipBox(".");
815 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
817 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
818 gMC->Gdhead(1111,"TOF detector V1");
819 gMC->Gdman(18, 4, "MAN");
820 gMC->Gdopt("hide","off");
823 //_____________________________________________________________________________
824 void AliTOFv2FHoles::DrawDetectorStrips()
827 // Draw a shaded view of the TOF strips for version 2
830 AliMC* pMC = AliMC::GetMC();
832 //Set ALIC mother transparent
833 pMC->Gsatt("ALIC","SEEN",0);
836 //Set volumes visible
838 // Level 1 for TOF volumes
839 gMC->Gsatt("B077","seen",0);
841 //==========> Level 2
843 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
844 gMC->Gsatt("B071","seen",0);
845 gMC->Gsatt("B074","seen",0);
846 gMC->Gsatt("B075","seen",0);
847 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
850 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
851 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
852 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
853 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
854 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
855 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
856 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
857 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
858 gMC->Gsatt("BTO1","seen",0);
860 // ==================> Level 3
861 // Level 3 of B071 / Level 2 of BTO1
862 gMC->Gsatt("FTOC","seen",0);
863 gMC->Gsatt("FTOB","seen",0);
864 gMC->Gsatt("FTOA","seen",0);
866 // Level 3 of B074 / Level 2 of BTO2
867 // -> cfr previous settings
869 // Level 3 of B075 / Level 2 of BTO3
870 // -> cfr previous settings
873 // ==========================> Level 4
874 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
875 gMC->Gsatt("FLTC","seen",0);
876 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
877 gMC->Gsatt("FLTB","seen",0);
878 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
879 gMC->Gsatt("FLTA","seen",0);
881 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
882 // -> cfr previous settings
883 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
884 // -> cfr previous settings
886 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
887 // -> cfr previous settings
889 //======================================> Level 5
890 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
891 gMC->Gsatt("FALC","seen",0); // no children for FALC
892 gMC->Gsatt("FSTR","seen",-2);
893 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
894 gMC->Gsatt("FECC","seen",0); // no children for FECC
895 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
896 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
898 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
899 gMC->Gsatt("FALB","seen",0); // no children for FALB
900 //--> gMC->Gsatt("FSTR","seen",-2);
903 // -> cfr previous settings
904 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
905 gMC->Gsatt("FECB","seen",0); // no children for FECB
906 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
907 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
909 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
910 gMC->Gsatt("FALA","seen",0); // no children for FALB
911 //--> gMC->Gsatt("FSTR","seen",-2);
912 // -> cfr previous settings
913 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
914 gMC->Gsatt("FECA","seen",0); // no children for FECA
915 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
916 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
919 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
920 gMC->Gsatt("BTO2","seen",0);
923 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
924 gMC->Gsatt("BTO3","seen",0);
926 // for others Level 5, cfr. previous settings
928 gMC->Gdopt("hide","on");
929 gMC->Gdopt("shad","on");
930 gMC->Gsatt("*", "fill", 5);
931 gMC->SetClipBox(".");
932 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
934 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
935 gMC->Gdhead(1111,"TOF Strips V1");
936 gMC->Gdman(18, 4, "MAN");
937 gMC->Gdopt("hide","off");
940 //_____________________________________________________________________________
941 void AliTOFv2FHoles::CreateMaterials()
944 // Define materials for the Time Of Flight
946 AliTOF::CreateMaterials();
949 //_____________________________________________________________________________
950 void AliTOFv2FHoles::Init()
953 // Initialise the detector after the geometry has been defined
956 printf("%s: **************************************"
958 "**************************************\n",ClassName());
959 printf("\n%s: Version 2 of TOF initialing, "
960 "TOF with holes for PHOS and RICH \n",ClassName());
965 fIdFTOA = gMC->VolId("FTOA");
966 fIdFTOB = gMC->VolId("FTOB");
967 fIdFTOC = gMC->VolId("FTOC");
968 fIdFLTA = gMC->VolId("FLTA");
969 fIdFLTB = gMC->VolId("FLTB");
970 fIdFLTC = gMC->VolId("FLTC");
973 printf("%s: **************************************"
975 "**************************************\n",ClassName());
979 //_____________________________________________________________________________
980 void AliTOFv2FHoles::StepManager()
983 // Procedure called at each step in the Time Of Flight
985 TLorentzVector mom, pos;
986 Float_t xm[3],pm[3],xpad[3],ppad[3];
987 Float_t hits[13],phi,phid,z;
989 Int_t sector, plate, padx, padz, strip;
990 Int_t copy, padzid, padxid, stripid, i;
991 Int_t *idtmed = fIdtmed->GetArray()-499;
992 Float_t incidenceAngle;
994 if(gMC->GetMedium()==idtmed[513] &&
995 gMC->IsTrackEntering() && gMC->TrackCharge()
996 && gMC->CurrentVolID(copy)==fIdSens)
998 // getting information about hit volumes
1000 padzid=gMC->CurrentVolOffID(2,copy);
1003 padxid=gMC->CurrentVolOffID(1,copy);
1006 stripid=gMC->CurrentVolOffID(4,copy);
1009 gMC->TrackPosition(pos);
1010 gMC->TrackMomentum(mom);
1012 // Double_t NormPos=1./pos.Rho();
1013 Double_t normMom=1./mom.Rho();
1015 // getting the cohordinates in pad ref system
1016 xm[0] = (Float_t)pos.X();
1017 xm[1] = (Float_t)pos.Y();
1018 xm[2] = (Float_t)pos.Z();
1020 pm[0] = (Float_t)mom.X()*normMom;
1021 pm[1] = (Float_t)mom.Y()*normMom;
1022 pm[2] = (Float_t)mom.Z()*normMom;
1024 gMC->Gmtod(xm,xpad,1);
1025 gMC->Gmtod(pm,ppad,2);
1026 if(ppad[1]>1.) ppad[1]=1.;
1027 if(ppad[1]<-1.) ppad[1]=-1.;
1028 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1035 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
1036 if (z < (fZlenA*0.5+fZlenB) &&
1037 z > fZlenA*0.5) plate = 4;
1038 if (z >-(fZlenA*0.5+fZlenB) &&
1039 z < -fZlenA*0.5) plate = 2;
1040 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
1041 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
1042 end to be changed */
1044 if (TMath::Abs(z) <= 124.*0.5) plate = 3;
1045 if (z < (124.*0.5+154.) &&
1046 z > 124.*0.5) plate = 4;
1047 if (z >-(124.*0.5+154.) &&
1048 z < -124.*0.5) plate = 2;
1049 if (z > (124.*0.5+154.)) plate = 5;
1050 if (z <-(124.*0.5+154.)) plate = 1;
1054 phid = phi*kRaddeg+180.;
1055 sector = Int_t (phid/20.);
1063 hits[6] = mom.Rho();
1068 hits[11]= incidenceAngle;
1069 hits[12]= gMC->Edep();
1077 AddHit(gAlice->CurrentTrack(),vol, hits);