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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // Time Of Flight: design of C.Williams
21 // This class contains the functions for version 4 of the Time Of Flight //
24 // VERSION WITH 5 MODULES AND TILTED STRIPS
26 // FULL COVERAGE VERSION
30 // University of Bologna - Italy
35 <img src="picts/AliTOFv4T0Class.gif">
39 ///////////////////////////////////////////////////////////////////////////////
44 #include "AliTOFv4T0.h"
46 #include "TGeometry.h"
48 #include <TLorentzVector.h>
57 //_____________________________________________________________________________
58 AliTOFv4T0::AliTOFv4T0()
61 // Default constructor
65 //_____________________________________________________________________________
66 AliTOFv4T0::AliTOFv4T0(const char *name, const char *title)
67 : AliTOF(name,title,"tzero")
70 // Standard constructor
73 // Check that FRAME is there otherwise we have no place where to
75 AliModule* frame=gAlice->GetModule("FRAME");
77 Error("Ctor","TOF needs FRAME to be present\n");
80 if(frame->IsVersion()!=1) {
81 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
87 //____________________________________________________________________________
89 void AliTOFv4T0::BuildGeometry()
92 // Build TOF ROOT geometry for the ALICE event display
95 const int kColorTOF = 27;
98 top = gAlice->GetGeometry()->GetNode("alice");
100 // Position the different copies
101 const Float_t krTof =(fRmax+fRmin)/2;
102 const Float_t khTof = fRmax-fRmin;
103 const Int_t kNTof = fNTof;
104 const Float_t kPi = TMath::Pi();
105 const Float_t kangle = 2*kPi/kNTof;
108 // Define TOF basic volume
110 char nodeName0[7], nodeName1[7], nodeName2[7];
111 char nodeName3[7], nodeName4[7], rotMatNum[7];
113 new TBRIK("S_TOF_C","TOF box","void",
114 120*0.5,khTof*0.5,fZlenC*0.5);
115 new TBRIK("S_TOF_B","TOF box","void",
116 120*0.5,khTof*0.5,fZlenB*0.5);
117 new TBRIK("S_TOF_A","TOF box","void",
118 120*0.5,khTof*0.5,fZlenA*0.5);
120 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
123 sprintf(rotMatNum,"rot50%i",nodeNum);
124 sprintf(nodeName0,"FTO00%i",nodeNum);
125 sprintf(nodeName1,"FTO10%i",nodeNum);
126 sprintf(nodeName2,"FTO20%i",nodeNum);
127 sprintf(nodeName3,"FTO30%i",nodeNum);
128 sprintf(nodeName4,"FTO40%i",nodeNum);
131 sprintf(rotMatNum,"rot5%i",nodeNum);
132 sprintf(nodeName0,"FTO0%i",nodeNum);
133 sprintf(nodeName1,"FTO1%i",nodeNum);
134 sprintf(nodeName2,"FTO2%i",nodeNum);
135 sprintf(nodeName3,"FTO3%i",nodeNum);
136 sprintf(nodeName4,"FTO4%i",nodeNum);
139 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
140 ang = (4.5-nodeNum) * kangle;
143 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),299.15,rotMatNum);
144 node->SetLineColor(kColorTOF);
148 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-299.15,rotMatNum);
149 node->SetLineColor(kColorTOF);
153 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),146.45,rotMatNum);
154 node->SetLineColor(kColorTOF);
158 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-146.45,rotMatNum);
159 node->SetLineColor(kColorTOF);
163 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),0.,rotMatNum);
164 node->SetLineColor(kColorTOF);
166 } // end loop on nodeNum
171 //_____________________________________________________________________________
172 void AliTOFv4T0::CreateGeometry()
175 // Create geometry for Time Of Flight version 0
179 <img src="picts/AliTOFv4T0.gif">
183 // Creates common geometry
185 AliTOF::CreateGeometry();
188 //_____________________________________________________________________________
189 void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
190 Float_t zlenB, Float_t zlenA, Float_t ztof0)
193 // Definition of the Time Of Fligh Resistive Plate Chambers
194 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
196 Float_t ycoor, zcoor;
198 Int_t *idtmed = fIdtmed->GetArray()-499;
201 Float_t hTof = fRmax-fRmin;
203 Float_t radius = fRmin+2.;//cm
207 par[2] = zlenC * 0.5;
208 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
209 par[2] = zlenB * 0.5;
210 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
211 par[2] = zlenA * 0.5;
212 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
215 // Positioning of modules
217 Float_t zcor1 = ztof0 - zlenC*0.5;
218 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
221 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
222 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
223 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
224 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
225 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
226 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
227 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
228 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
230 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
231 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
232 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
233 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
234 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
235 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
237 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
238 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
239 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
241 Float_t db = 0.5;//cm
242 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
250 xFST = xFLT-fDeadBndX*2;//cm
252 // Sizes of MRPC pads
254 Float_t yPad = 0.505;//cm
256 // Large not sensitive volumes with Insensitive Freon
260 if (fDebug) cout << ClassName() <<
261 ": ************************* TOF geometry **************************"<<endl;
263 par[2] = (zFLTA *0.5);
264 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
265 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
267 par[2] = (zFLTB * 0.5);
268 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
269 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
271 par[2] = (zFLTC * 0.5);
272 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
273 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
275 ////////// Layers of Aluminum before and after detector //////////
276 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
277 ////////// lateral walls not simulated
280 ycoor = -yFLT/2 + par[1];
281 par[2] = (zFLTA *0.5);
282 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
283 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
284 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
285 par[2] = (zFLTB *0.5);
286 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
287 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
288 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
289 par[2] = (zFLTC *0.5);
290 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
291 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
292 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
294 ///////////////// Detector itself //////////////////////
296 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
297 //and the boundary of the strip
298 const Int_t knx = fNpadX; // number of pads along x
299 const Int_t knz = fNpadZ; // number of pads along z
300 const Float_t kspace = fSpace; //cm distance from the front plate of the box
302 Float_t zSenStrip = fZpad*fNpadZ;//cm
303 Float_t stripWidth = zSenStrip + 2*kdeadBound;
307 par[2] = stripWidth*0.5;
309 // new description for strip volume -double stack strip-
310 // -- all constants are expressed in cm
311 // heigth of different layers
312 const Float_t khhony = 1. ; // heigth of HONY Layer
313 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
314 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
315 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
316 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
317 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
318 const Float_t kwsensmz = 2*3.5 ; // cm
319 const Float_t klsensmx = 48*2.5; // cm
320 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
321 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
323 // heigth of the FSTR Volume (the strip volume)
324 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
325 // width of the FSTR Volume (the strip volume)
326 const Float_t kwstripz = 10.;
327 // length of the FSTR Volume (the strip volume)
328 const Float_t klstripx = 122.;
330 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
331 // coordinates of the strip center in the strip reference frame; used for positioning
332 // internal strip volumes
333 Float_t posfp[3]={0.,0.,0.};
336 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
337 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
338 //-- HONY Layer definition
340 parfp[1] = khhony*0.5;
342 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
343 // positioning 2 HONY Layers on FSTR volume
345 posfp[1]=-khstripy*0.5+parfp[1];
346 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
347 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
349 //-- PCB Layer definition
350 parfp[1] = khpcby*0.5;
351 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
352 // positioning 2 PCB Layers on FSTR volume
353 posfp[1]=-khstripy*0.5+khhony+parfp[1];
354 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
355 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
356 // positioning the central PCB layer
357 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
361 //-- MYLAR Layer definition
362 parfp[1] = khmyly*0.5;
363 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
364 // positioning 2 MYLAR Layers on FSTR volume
365 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
366 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
367 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
368 // adding further 2 MYLAR Layers on FSTR volume
369 posfp[1] = khpcby*0.5+parfp[1];
370 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
371 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
374 //-- Graphite Layer definition
375 parfp[1] = khgraphy*0.5;
376 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
377 // positioning 2 Graphite Layers on FSTR volume
378 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
379 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
380 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
381 // adding further 2 Graphite Layers on FSTR volume
382 posfp[1] = khpcby*0.5+khmyly+parfp[1];
383 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
384 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
387 //-- Glass (EXT. +Semi INT.) Layer definition
388 parfp[1] = khglasseiy*0.5;
389 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
390 // positioning 2 Glass Layers on FSTR volume
391 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
392 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
393 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
394 // adding further 2 Glass Layers on FSTR volume
395 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
396 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
397 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
400 //-- Sensitive Mixture Layer definition
401 parfp[0] = klsensmx*0.5;
402 parfp[1] = khsensmy*0.5;
403 parfp[2] = kwsensmz*0.5;
404 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
405 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
406 // positioning 2 gas Layers on FSTR volume
407 // the upper is insensitive freon
408 // while the remaining is sensitive
409 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
410 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
411 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
413 // dividing FSEN along z in knz=2 and along x in knx=48
414 gMC->Gsdvn("FSEZ","FSEN",knz,3);
415 gMC->Gsdvn("FSEX","FSEZ",knx,1);
417 // FPAD volume definition
418 parfp[0] = klpadx*0.5;
419 parfp[1] = khsensmy*0.5;
420 parfp[2] = kwpadz*0.5;
421 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
422 // positioning the FPAD volumes on previous divisions
423 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
425 //// Positioning the Strips (FSTR) in the FLT volumes /////
429 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
431 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
437 ycoor = -14.5 + kspace ; //2 cm over front plate
439 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
440 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
442 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
443 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
447 Int_t upDown = -1; // upDown=-1 -> Upper strip
448 // upDown=+1 -> Lower strip
450 ang = atan(zcoor/radius);
452 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
453 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
455 ycoor = -14.5+ kspace; //2 cm over front plate
456 ycoor += (1-(upDown+1)/2)*gap;
457 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
458 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
460 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
461 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
464 upDown*= -1; // Alternate strips
465 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
466 upDown*gap*TMath::Tan(ang)-
467 (zSenStrip/2)/TMath::Cos(ang);
468 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
470 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
471 upDown*gap*TMath::Tan(ang)+
472 (zSenStrip/2)/TMath::Cos(ang);
475 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
476 upDown*gap*TMath::Tan(ang)-
477 (zSenStrip/2)/TMath::Cos(ang);
479 ang = atan(zcoor/radius);
481 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
482 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
485 ycoor = -14.5+ kspace; //2 cm over front plate
486 ycoor += (1-(upDown+1)/2)*gap;
487 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
488 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
490 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
491 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
493 ycoor = -hTof/2.+ kspace;//2 cm over front plate
500 Float_t deadRegion = 1.0;//cm
502 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
503 upDown*gap*TMath::Tan(ang)-
504 (zSenStrip/2)/TMath::Cos(ang)-
505 deadRegion/TMath::Cos(ang);
507 ang = atan(zpos/radius);
509 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
511 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
512 ycoor += (1-(upDown+1)/2)*gap;
513 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
514 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
516 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
517 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
523 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
524 upDown*gap*TMath::Tan(ang)-
525 (zSenStrip/2)/TMath::Cos(ang);
526 ang = atan(zpos/radius);
528 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
530 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
531 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
532 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
533 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
534 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
535 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
537 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
538 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
542 } while (TMath::Abs(ang*kRaddeg)<22.5);
543 //till we reach a tilting angle of 22.5 degrees
545 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
546 zpos = zpos - zSenStrip/TMath::Cos(ang);
547 // this avoid overlaps in between outer strips in plate B
548 Float_t deltaMovingUp=0.8; // [cm]
549 Float_t deltaMovingDown=-0.5; // [cm]
552 ang = atan(zpos/radius);
554 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
556 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
557 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
558 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
559 zpos = zpos - zSenStrip/TMath::Cos(ang);
561 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
562 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
566 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
570 zpos = zpos + zSenStrip/TMath::Cos(ang);
572 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
574 (zSenStrip/2)/TMath::Cos(ang);
578 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
579 ycoor= -hTof*0.5+kspace+gap+deltaGap;
583 ang = atan(zpos/radius);
585 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
587 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
588 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
590 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
591 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
593 zpos = zpos - zSenStrip/TMath::Cos(ang);
594 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
597 ////////// Layers after strips /////////////////
598 // honeycomb (Polyethilene) Layer after (1.2cm)
600 Float_t overSpace = fOverSpc;//cm
604 par[2] = (zFLTA *0.5);
605 ycoor = -yFLT/2 + overSpace + par[1];
606 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
607 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
608 par[2] = (zFLTB *0.5);
609 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
610 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
611 par[2] = (zFLTC *0.5);
612 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
613 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
615 // Electronics (Cu) after
618 par[1] = 1.43*0.05*0.5; // 5% of X0
619 par[2] = (zFLTA *0.5);
621 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
622 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
623 par[2] = (zFLTB *0.5);
624 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
625 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
626 par[2] = (zFLTC *0.5);
627 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
628 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
630 // cooling WAter after
633 par[1] = 36.1*0.02*0.5; // 2% of X0
634 par[2] = (zFLTA *0.5);
636 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
637 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
638 par[2] = (zFLTB *0.5);
639 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
640 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
641 par[2] = (zFLTC *0.5);
642 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
643 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
648 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
649 par[2] = (zFLTA *0.5);
651 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
652 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
653 par[2] = (zFLTB *0.5);
654 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
655 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
656 par[2] = (zFLTC *0.5);
657 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
658 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
660 //Back Plate honycomb (2cm)
664 ycoor = yFLT/2 - par[1];
665 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
666 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
667 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
668 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
669 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
670 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
674 //_____________________________________________________________________________
675 void AliTOFv4T0::DrawModule() const
678 // Draw a shaded view of the Time Of Flight version 4
680 // Set everything unseen
681 gMC->Gsatt("*", "seen", -1);
683 // Set ALIC mother transparent
684 gMC->Gsatt("ALIC","SEEN",0);
686 // Set the volumes visible
687 gMC->Gsatt("ALIC","SEEN",0);
689 gMC->Gsatt("FTOA","SEEN",1);
690 gMC->Gsatt("FTOB","SEEN",1);
691 gMC->Gsatt("FTOC","SEEN",1);
692 gMC->Gsatt("FLTA","SEEN",1);
693 gMC->Gsatt("FLTB","SEEN",1);
694 gMC->Gsatt("FLTC","SEEN",1);
695 gMC->Gsatt("FPLA","SEEN",1);
696 gMC->Gsatt("FPLB","SEEN",1);
697 gMC->Gsatt("FPLC","SEEN",1);
698 gMC->Gsatt("FSTR","SEEN",1);
699 gMC->Gsatt("FPEA","SEEN",1);
700 gMC->Gsatt("FPEB","SEEN",1);
701 gMC->Gsatt("FPEC","SEEN",1);
703 gMC->Gsatt("FLZ1","SEEN",0);
704 gMC->Gsatt("FLZ2","SEEN",0);
705 gMC->Gsatt("FLZ3","SEEN",0);
706 gMC->Gsatt("FLX1","SEEN",0);
707 gMC->Gsatt("FLX2","SEEN",0);
708 gMC->Gsatt("FLX3","SEEN",0);
709 gMC->Gsatt("FPAD","SEEN",0);
711 gMC->Gdopt("hide", "on");
712 gMC->Gdopt("shad", "on");
713 gMC->Gsatt("*", "fill", 7);
714 gMC->SetClipBox(".");
715 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
717 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
718 gMC->Gdhead(1111, "Time Of Flight");
719 gMC->Gdman(18, 4, "MAN");
720 gMC->Gdopt("hide","off");
722 //_____________________________________________________________________________
723 void AliTOFv4T0::DrawDetectorModules()
726 // Draw a shaded view of the TOF detector version 4
729 AliMC* pMC = AliMC::GetMC();
731 //Set ALIC mother transparent
732 pMC->Gsatt("ALIC","SEEN",0);
735 //Set volumes visible
738 // Level 1 for TOF volumes
739 gMC->Gsatt("B077","seen",0);
742 //==========> Level 2
744 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
745 gMC->Gsatt("B071","seen",0);
746 gMC->Gsatt("B074","seen",0);
747 gMC->Gsatt("B075","seen",0);
748 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
752 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
753 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
754 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
755 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
756 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
757 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
758 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
759 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
760 gMC->Gsatt("BTO1","seen",0);
764 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
765 gMC->Gsatt("BTO2","seen",0);
768 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
769 gMC->Gsatt("BTO3","seen",0);
771 // ==================> Level 3
772 // Level 3 of B071 / Level 2 of BTO1
773 gMC->Gsatt("FTOC","seen",-2);
774 gMC->Gsatt("FTOB","seen",-2);
775 gMC->Gsatt("FTOA","seen",-2);
777 // Level 3 of B074 / Level 2 of BTO2
778 // -> cfr previous settings
780 // Level 3 of B075 / Level 2 of BTO3
781 // -> cfr previous settings
783 gMC->Gdopt("hide","on");
784 gMC->Gdopt("shad","on");
785 gMC->Gsatt("*", "fill", 5);
786 gMC->SetClipBox(".");
787 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
789 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
790 gMC->Gdhead(1111,"TOF detector V1");
791 gMC->Gdman(18, 4, "MAN");
792 gMC->Gdopt("hide","off");
795 //_____________________________________________________________________________
796 void AliTOFv4T0::DrawDetectorStrips()
799 // Draw a shaded view of the TOF strips for version 4
802 AliMC* pMC = AliMC::GetMC();
804 //Set ALIC mother transparent
805 pMC->Gsatt("ALIC","SEEN",0);
808 //Set volumes visible
810 // Level 1 for TOF volumes
811 gMC->Gsatt("B077","seen",0);
813 //==========> Level 2
815 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
816 gMC->Gsatt("B071","seen",0);
817 gMC->Gsatt("B074","seen",0);
818 gMC->Gsatt("B075","seen",0);
819 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
822 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
823 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
824 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
825 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
826 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
827 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
828 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
829 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
830 gMC->Gsatt("BTO1","seen",0);
832 // ==================> Level 3
833 // Level 3 of B071 / Level 2 of BTO1
834 gMC->Gsatt("FTOC","seen",0);
835 gMC->Gsatt("FTOB","seen",0);
836 gMC->Gsatt("FTOA","seen",0);
838 // Level 3 of B074 / Level 2 of BTO2
839 // -> cfr previous settings
841 // Level 3 of B075 / Level 2 of BTO3
842 // -> cfr previous settings
845 // ==========================> Level 4
846 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
847 gMC->Gsatt("FLTC","seen",0);
848 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
849 gMC->Gsatt("FLTB","seen",0);
850 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
851 gMC->Gsatt("FLTA","seen",0);
853 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
854 // -> cfr previous settings
855 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
856 // -> cfr previous settings
858 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
859 // -> cfr previous settings
861 //======================================> Level 5
862 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
863 gMC->Gsatt("FALC","seen",0); // no children for FALC
864 gMC->Gsatt("FSTR","seen",-2);
865 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
866 gMC->Gsatt("FECC","seen",0); // no children for FECC
867 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
868 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
870 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
871 gMC->Gsatt("FALB","seen",0); // no children for FALB
872 //--> gMC->Gsatt("FSTR","seen",-2);
875 // -> cfr previous settings
876 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
877 gMC->Gsatt("FECB","seen",0); // no children for FECB
878 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
879 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
881 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
882 gMC->Gsatt("FALA","seen",0); // no children for FALB
883 //--> gMC->Gsatt("FSTR","seen",-2);
884 // -> cfr previous settings
885 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
886 gMC->Gsatt("FECA","seen",0); // no children for FECA
887 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
888 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
891 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
892 gMC->Gsatt("BTO2","seen",0);
895 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
896 gMC->Gsatt("BTO3","seen",0);
898 // for others Level 5, cfr. previous settings
900 gMC->Gdopt("hide","on");
901 gMC->Gdopt("shad","on");
902 gMC->Gsatt("*", "fill", 5);
903 gMC->SetClipBox(".");
904 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
906 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
907 gMC->Gdhead(1111,"TOF Strips V1");
908 gMC->Gdman(18, 4, "MAN");
909 gMC->Gdopt("hide","off");
912 //_____________________________________________________________________________
913 void AliTOFv4T0::CreateMaterials()
916 // Define materials for the Time Of Flight
918 AliTOF::CreateMaterials();
921 //_____________________________________________________________________________
922 void AliTOFv4T0::Init()
925 // Initialise the detector after the geometry has been defined
928 printf("%s: **************************************"
930 "**************************************\n",ClassName());
931 printf("\n%s: Version 4 of TOF initialing, "
932 "symmetric TOF - Full Coverage version\n",ClassName());
937 fIdFTOA = gMC->VolId("FTOA");
938 fIdFTOB = gMC->VolId("FTOB");
939 fIdFTOC = gMC->VolId("FTOC");
940 fIdFLTA = gMC->VolId("FLTA");
941 fIdFLTB = gMC->VolId("FLTB");
942 fIdFLTC = gMC->VolId("FLTC");
945 printf("%s: **************************************"
947 "**************************************\n",ClassName());
951 //_____________________________________________________________________________
952 void AliTOFv4T0::StepManager()
955 // Procedure called at each step in the Time Of Flight
957 TLorentzVector mom, pos;
958 Float_t xm[3],pm[3],xpad[3],ppad[3];
959 Float_t hits[14],phi,phid,z;
961 Int_t sector, plate, padx, padz, strip;
962 Int_t copy, padzid, padxid, stripid, i;
963 Int_t *idtmed = fIdtmed->GetArray()-499;
964 Float_t incidenceAngle;
966 if(gMC->GetMedium()==idtmed[513] &&
967 gMC->IsTrackEntering() && gMC->TrackCharge()
968 && gMC->CurrentVolID(copy)==fIdSens)
970 // getting information about hit volumes
972 padzid=gMC->CurrentVolOffID(2,copy);
975 padxid=gMC->CurrentVolOffID(1,copy);
978 stripid=gMC->CurrentVolOffID(4,copy);
981 gMC->TrackPosition(pos);
982 gMC->TrackMomentum(mom);
984 // Double_t NormPos=1./pos.Rho();
985 Double_t normMom=1./mom.Rho();
987 // getting the cohordinates in pad ref system
988 xm[0] = (Float_t)pos.X();
989 xm[1] = (Float_t)pos.Y();
990 xm[2] = (Float_t)pos.Z();
992 pm[0] = (Float_t)mom.X()*normMom;
993 pm[1] = (Float_t)mom.Y()*normMom;
994 pm[2] = (Float_t)mom.Z()*normMom;
996 gMC->Gmtod(xm,xpad,1);
997 gMC->Gmtod(pm,ppad,2);
999 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1004 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
1005 if (z < (fZlenA*0.5+fZlenB) &&
1006 z > fZlenA*0.5) plate = 4;
1007 if (z >-(fZlenA*0.5+fZlenB) &&
1008 z < -fZlenA*0.5) plate = 2;
1009 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
1010 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
1013 phid = phi*kRaddeg+180.;
1014 sector = Int_t (phid/20.);
1022 hits[6] = mom.Rho();
1027 hits[11]= incidenceAngle;
1028 hits[12]= gMC->Edep();
1029 hits[13]= gMC->TrackLength();
1037 AddT0Hit(gAlice->CurrentTrack(),vol, hits);