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 // This class contains the functions for version 0 of the Time Of Flight //
23 // VERSION WITH 5 MODULES AND TILTED STRIPS
24 // NO HITS DEFINED BY DEFAULT FOR THIS VERSION
25 // FULL COVERAGE VERSION
32 // University of Salerno - Italy
35 // University of Bologna - Italy
40 <img src="picts/AliTOFv0Class.gif">
44 ///////////////////////////////////////////////////////////////////////////////
46 #include <Riostream.h>
50 #include <TGeometry.h>
51 #include <TLorentzVector.h>
54 #include <TVirtualMC.h>
62 //_____________________________________________________________________________
66 // Default constructor
70 //_____________________________________________________________________________
71 AliTOFv0::AliTOFv0(const char *name, const char *title)
75 // Standard constructor
78 // Check that FRAME is there otherwise we have no place where to
80 AliModule* frame=gAlice->GetModule("FRAME");
82 Error("Ctor","TOF needs FRAME to be present\n");
85 if(frame->IsVersion()!=1) {
86 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
92 //____________________________________________________________________________
94 void AliTOFv0::BuildGeometry()
97 // Build TOF ROOT geometry for the ALICE event display
100 const int kColorTOF = 27;
103 top = gAlice->GetGeometry()->GetNode("alice");
105 // Position the different copies
106 const Float_t krTof =(fRmax+fRmin)/2;
107 const Float_t khTof = fRmax-fRmin;
108 const Int_t kNTof = fNTof;
109 const Float_t kPi = TMath::Pi();
110 const Float_t kangle = 2*kPi/kNTof;
113 // define offset for nodes
114 Float_t zOffsetC = fZtof - fZlenC*0.5;
115 Float_t zOffsetB = fZtof - fZlenC - fZlenB*0.5;
116 Float_t zOffsetA = 0.;
117 // Define TOF basic volume
119 char nodeName0[7], nodeName1[7], nodeName2[7];
120 char nodeName3[7], nodeName4[7], rotMatNum[7];
122 new TBRIK("S_TOF_C","TOF box","void",
123 fStripLn*0.5,khTof*0.5,fZlenC*0.5);
124 new TBRIK("S_TOF_B","TOF box","void",
125 fStripLn*0.5,khTof*0.5,fZlenB*0.5);
126 new TBRIK("S_TOF_A","TOF box","void",
127 fStripLn*0.5,khTof*0.5,fZlenA*0.5);
129 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
132 sprintf(rotMatNum,"rot50%i",nodeNum);
133 sprintf(nodeName0,"FTO00%i",nodeNum);
134 sprintf(nodeName1,"FTO10%i",nodeNum);
135 sprintf(nodeName2,"FTO20%i",nodeNum);
136 sprintf(nodeName3,"FTO30%i",nodeNum);
137 sprintf(nodeName4,"FTO40%i",nodeNum);
140 sprintf(rotMatNum,"rot5%i",nodeNum);
141 sprintf(nodeName0,"FTO0%i",nodeNum);
142 sprintf(nodeName1,"FTO1%i",nodeNum);
143 sprintf(nodeName2,"FTO2%i",nodeNum);
144 sprintf(nodeName3,"FTO3%i",nodeNum);
145 sprintf(nodeName4,"FTO4%i",nodeNum);
148 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
149 ang = (4.5-nodeNum) * kangle;
152 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetC,rotMatNum);
153 node->SetLineColor(kColorTOF);
157 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetC,rotMatNum);
158 node->SetLineColor(kColorTOF);
162 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum);
163 node->SetLineColor(kColorTOF);
167 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
168 node->SetLineColor(kColorTOF);
172 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum);
173 node->SetLineColor(kColorTOF);
175 } // end loop on nodeNum
180 //_____________________________________________________________________________
181 void AliTOFv0::CreateGeometry()
184 // Create geometry for Time Of Flight version 0
188 <img src="picts/AliTOFv0.gif">
192 // Creates common geometry
194 AliTOF::CreateGeometry();
197 //_____________________________________________________________________________
198 void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
199 Float_t zlenB, Float_t zlenA, Float_t ztof0)
202 // Definition of the Time Of Fligh Resistive Plate Chambers
203 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
205 Float_t ycoor, zcoor;
207 Int_t *idtmed = fIdtmed->GetArray()-499;
210 Float_t hTof = fRmax-fRmin;
212 Float_t radius = fRmin+2.;//cm
216 par[2] = zlenC * 0.5;
217 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
218 par[2] = zlenB * 0.5;
219 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
220 par[2] = zlenA * 0.5;
221 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
224 // Positioning of modules
226 Float_t zcor1 = ztof0 - zlenC*0.5;
227 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
230 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
231 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
232 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
233 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
234 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
235 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
236 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
237 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
239 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
240 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
241 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
242 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
243 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
244 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
246 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
247 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
248 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
250 Float_t db = 0.5;//cm
251 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
259 xFST = xFLT-fDeadBndX*2;//cm
261 // Sizes of MRPC pads
263 Float_t yPad = 0.505;//cm
265 // Large not sensitive volumes with Insensitive Freon
269 cout <<"************************* TOF geometry **************************"<<endl;
271 par[2] = (zFLTA *0.5);
272 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
273 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
275 par[2] = (zFLTB * 0.5);
276 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
277 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
279 par[2] = (zFLTC * 0.5);
280 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
281 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
283 ////////// Layers of Aluminum before and after detector //////////
284 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
285 ////////// lateral walls not simulated
288 ycoor = -yFLT/2 + par[1];
289 par[2] = (zFLTA *0.5);
290 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
291 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
292 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
293 par[2] = (zFLTB *0.5);
294 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
295 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
296 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
297 par[2] = (zFLTC *0.5);
298 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
299 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
300 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
302 ///////////////// Detector itself //////////////////////
303 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
304 //and the boundary of the strip
305 const Int_t knx = fNpadX; // number of pads along x
306 const Int_t knz = fNpadZ; // number of pads along z
307 const Float_t kspace = fSpace; //cm distance from the front plate of the box
309 Float_t zSenStrip = fZpad*fNpadZ;//cm
310 Float_t stripWidth = zSenStrip + 2*kdeadBound;
313 par[2] = stripWidth*0.5;
315 // new description for strip volume -double stack strip-
316 // -- all constants are expressed in cm
317 // heigth of different layers
318 const Float_t khhony = 1. ; // heigth of HONY Layer
319 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
320 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
321 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
322 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
323 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
324 const Float_t kwsensmz = 2*3.5 ; // cm
325 const Float_t klsensmx = 48*2.5; // cm
326 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
327 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
329 // heigth of the FSTR Volume (the strip volume)
330 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
331 // width of the FSTR Volume (the strip volume)
332 const Float_t kwstripz = 10.;
333 // length of the FSTR Volume (the strip volume)
334 const Float_t klstripx = 122.;
336 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
337 // coordinates of the strip center in the strip reference frame; used for positioning
338 // internal strip volumes
339 Float_t posfp[3]={0.,0.,0.};
342 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
343 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
344 //-- HONY Layer definition
346 parfp[1] = khhony*0.5;
348 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
349 // positioning 2 HONY Layers on FSTR volume
351 posfp[1]=-khstripy*0.5+parfp[1];
352 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
353 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
355 //-- PCB Layer definition
356 parfp[1] = khpcby*0.5;
357 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
358 // positioning 2 PCB Layers on FSTR volume
359 posfp[1]=-khstripy*0.5+khhony+parfp[1];
360 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
361 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
362 // positioning the central PCB layer
363 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
367 //-- MYLAR Layer definition
368 parfp[1] = khmyly*0.5;
369 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
370 // positioning 2 MYLAR Layers on FSTR volume
371 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
372 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
373 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
374 // adding further 2 MYLAR Layers on FSTR volume
375 posfp[1] = khpcby*0.5+parfp[1];
376 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
377 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
380 //-- Graphite Layer definition
381 parfp[1] = khgraphy*0.5;
382 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
383 // positioning 2 Graphite Layers on FSTR volume
384 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
385 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
386 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
387 // adding further 2 Graphite Layers on FSTR volume
388 posfp[1] = khpcby*0.5+khmyly+parfp[1];
389 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
390 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
393 //-- Glass (EXT. +Semi INT.) Layer definition
394 parfp[1] = khglasseiy*0.5;
395 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
396 // positioning 2 Glass Layers on FSTR volume
397 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
398 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
399 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
400 // adding further 2 Glass Layers on FSTR volume
401 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
402 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
403 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
406 //-- Sensitive Mixture Layer definition
407 parfp[0] = klsensmx*0.5;
408 parfp[1] = khsensmy*0.5;
409 parfp[2] = kwsensmz*0.5;
410 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
411 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
412 // positioning 2 gas Layers on FSTR volume
413 // the upper is insensitive freon
414 // while the remaining is sensitive
415 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
416 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
417 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
419 // dividing FSEN along z in knz=2 and along x in knx=48
420 gMC->Gsdvn("FSEZ","FSEN",knz,3);
421 gMC->Gsdvn("FSEX","FSEZ",knx,1);
423 // FPAD volume definition
424 parfp[0] = klpadx*0.5;
425 parfp[1] = khsensmy*0.5;
426 parfp[2] = kwpadz*0.5;
427 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
428 // positioning the FPAD volumes on previous divisions
429 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
431 //// Positioning the Strips (FSTR) in the FLT volumes /////
435 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
437 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
443 ycoor = -14.5 + kspace ; //2 cm over front plate
445 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
446 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
448 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
449 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
453 Int_t upDown = -1; // upDown=-1 -> Upper strip
454 // upDown=+1 -> Lower strip
456 ang = atan(zcoor/radius);
458 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
459 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
461 ycoor = -14.5+ kspace; //2 cm over front plate
462 ycoor += (1-(upDown+1)/2)*gap;
463 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
464 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
466 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
467 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
470 upDown*= -1; // Alternate strips
471 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
472 upDown*gap*TMath::Tan(ang)-
473 (zSenStrip/2)/TMath::Cos(ang);
474 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
476 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
477 upDown*gap*TMath::Tan(ang)+
478 (zSenStrip/2)/TMath::Cos(ang);
481 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
482 upDown*gap*TMath::Tan(ang)-
483 (zSenStrip/2)/TMath::Cos(ang);
485 ang = atan(zcoor/radius);
487 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
488 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
491 ycoor = -14.5+ kspace; //2 cm over front plate
492 ycoor += (1-(upDown+1)/2)*gap;
493 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
494 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
495 printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i);
496 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
498 ycoor = -hTof/2.+ kspace;//2 cm over front plate
505 Float_t deadRegion = 1.0;//cm
507 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
508 upDown*gap*TMath::Tan(ang)-
509 (zSenStrip/2)/TMath::Cos(ang)-
510 deadRegion/TMath::Cos(ang);
512 ang = atan(zpos/radius);
514 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
516 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
517 ycoor += (1-(upDown+1)/2)*gap;
518 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
519 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
521 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
522 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
528 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
529 upDown*gap*TMath::Tan(ang)-
530 (zSenStrip/2)/TMath::Cos(ang);
531 ang = atan(zpos/radius);
533 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
535 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
536 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
537 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
538 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
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");
542 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
543 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
547 } while (TMath::Abs(ang*kRaddeg)<22.5);
548 //till we reach a tilting angle of 22.5 degrees
550 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
551 zpos = zpos - zSenStrip/TMath::Cos(ang);
552 // this avoid overlaps in between outer strips in plate B
553 Float_t deltaMovingUp=0.8; // [cm]
554 Float_t deltaMovingDown=-0.5; // [cm]
557 ang = atan(zpos/radius);
559 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
561 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
562 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
563 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
564 zpos = zpos - zSenStrip/TMath::Cos(ang);
565 printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i);
566 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
568 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
572 zpos = zpos + zSenStrip/TMath::Cos(ang);
574 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
576 (zSenStrip/2)/TMath::Cos(ang);
580 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
581 ycoor= -hTof*0.5+kspace+gap+deltaGap;
585 ang = atan(zpos/radius);
587 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
589 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
590 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
592 printf("%f, St. %2i, Pl.5 ",ang*kRaddeg,i);
593 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
595 zpos = zpos - zSenStrip/TMath::Cos(ang);
596 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
599 ////////// Layers after strips /////////////////
600 // honeycomb (Polyethilene) Layer after (1.2cm)
602 Float_t overSpace = fOverSpc;//cm
606 par[2] = (zFLTA *0.5);
607 ycoor = -yFLT/2 + overSpace + par[1];
608 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
609 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
610 par[2] = (zFLTB *0.5);
611 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
612 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
613 par[2] = (zFLTC *0.5);
614 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
615 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
617 // Electronics (Cu) after
620 par[1] = 1.43*0.05*0.5; // 5% of X0
621 par[2] = (zFLTA *0.5);
623 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
624 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
625 par[2] = (zFLTB *0.5);
626 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
627 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
628 par[2] = (zFLTC *0.5);
629 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
630 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
632 // cooling WAter after
635 par[1] = 36.1*0.02*0.5; // 2% of X0
636 par[2] = (zFLTA *0.5);
638 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
639 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
640 par[2] = (zFLTB *0.5);
641 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
642 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
643 par[2] = (zFLTC *0.5);
644 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
645 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
650 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
651 par[2] = (zFLTA *0.5);
653 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
654 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
655 par[2] = (zFLTB *0.5);
656 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
657 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
658 par[2] = (zFLTC *0.5);
659 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
660 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
662 //Back Plate honycomb (2cm)
666 ycoor = yFLT/2 - par[1];
667 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
668 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
669 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
670 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
671 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
672 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
676 //_____________________________________________________________________________
677 void AliTOFv0::DrawModule() const
680 // Draw a shaded view of the Time Of Flight version 0
682 // Set everything unseen
683 gMC->Gsatt("*", "seen", -1);
685 // Set ALIC mother transparent
686 gMC->Gsatt("ALIC","SEEN",0);
688 // Set the volumes visible
689 gMC->Gsatt("ALIC","SEEN",0);
691 gMC->Gsatt("FTOA","SEEN",1);
692 gMC->Gsatt("FTOB","SEEN",1);
693 gMC->Gsatt("FTOC","SEEN",1);
694 gMC->Gsatt("FLTA","SEEN",1);
695 gMC->Gsatt("FLTB","SEEN",1);
696 gMC->Gsatt("FLTC","SEEN",1);
697 gMC->Gsatt("FPLA","SEEN",1);
698 gMC->Gsatt("FPLB","SEEN",1);
699 gMC->Gsatt("FPLC","SEEN",1);
700 gMC->Gsatt("FSTR","SEEN",1);
701 gMC->Gsatt("FPEA","SEEN",1);
702 gMC->Gsatt("FPEB","SEEN",1);
703 gMC->Gsatt("FPEC","SEEN",1);
705 gMC->Gsatt("FLZ1","SEEN",0);
706 gMC->Gsatt("FLZ2","SEEN",0);
707 gMC->Gsatt("FLZ3","SEEN",0);
708 gMC->Gsatt("FLX1","SEEN",0);
709 gMC->Gsatt("FLX2","SEEN",0);
710 gMC->Gsatt("FLX3","SEEN",0);
711 gMC->Gsatt("FPAD","SEEN",0);
713 gMC->Gdopt("hide", "on");
714 gMC->Gdopt("shad", "on");
715 gMC->Gsatt("*", "fill", 7);
716 gMC->SetClipBox(".");
717 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
719 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
720 gMC->Gdhead(1111, "Time Of Flight");
721 gMC->Gdman(18, 4, "MAN");
722 gMC->Gdopt("hide","off");
724 //_____________________________________________________________________________
725 void AliTOFv0::DrawDetectorModules()
728 // Draw a shaded view of the TOF detector version 0
731 //Set ALIC mother transparent
732 gMC->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 AliTOFv0::DrawDetectorStrips()
799 // Draw a shaded view of the TOF strips for version 0
802 //Set ALIC mother transparent
803 gMC->Gsatt("ALIC","SEEN",0);
806 //Set volumes visible
808 // Level 1 for TOF volumes
809 gMC->Gsatt("B077","seen",0);
811 //==========> Level 2
813 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
814 gMC->Gsatt("B071","seen",0);
815 gMC->Gsatt("B074","seen",0);
816 gMC->Gsatt("B075","seen",0);
817 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
820 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
821 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
822 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
823 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
824 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
825 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
826 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
827 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
828 gMC->Gsatt("BTO1","seen",0);
830 // ==================> Level 3
831 // Level 3 of B071 / Level 2 of BTO1
832 gMC->Gsatt("FTOC","seen",0);
833 gMC->Gsatt("FTOB","seen",0);
834 gMC->Gsatt("FTOA","seen",0);
836 // Level 3 of B074 / Level 2 of BTO2
837 // -> cfr previous settings
839 // Level 3 of B075 / Level 2 of BTO3
840 // -> cfr previous settings
843 // ==========================> Level 4
844 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
845 gMC->Gsatt("FLTC","seen",0);
846 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
847 gMC->Gsatt("FLTB","seen",0);
848 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
849 gMC->Gsatt("FLTA","seen",0);
851 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
852 // -> cfr previous settings
853 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
854 // -> cfr previous settings
856 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
857 // -> cfr previous settings
859 //======================================> Level 5
860 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
861 gMC->Gsatt("FALC","seen",0); // no children for FALC
862 gMC->Gsatt("FSTR","seen",-2);
863 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
864 gMC->Gsatt("FECC","seen",0); // no children for FECC
865 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
866 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
868 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
869 gMC->Gsatt("FALB","seen",0); // no children for FALB
870 //--> gMC->Gsatt("FSTR","seen",-2);
873 // -> cfr previous settings
874 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
875 gMC->Gsatt("FECB","seen",0); // no children for FECB
876 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
877 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
879 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
880 gMC->Gsatt("FALA","seen",0); // no children for FALB
881 //--> gMC->Gsatt("FSTR","seen",-2);
882 // -> cfr previous settings
883 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
884 gMC->Gsatt("FECA","seen",0); // no children for FECA
885 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
886 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
889 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
890 gMC->Gsatt("BTO2","seen",0);
893 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
894 gMC->Gsatt("BTO3","seen",0);
896 // for others Level 5, cfr. previous settings
898 gMC->Gdopt("hide","on");
899 gMC->Gdopt("shad","on");
900 gMC->Gsatt("*", "fill", 5);
901 gMC->SetClipBox(".");
902 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
904 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
905 gMC->Gdhead(1111,"TOF Strips V1");
906 gMC->Gdman(18, 4, "MAN");
907 gMC->Gdopt("hide","off");
910 //_____________________________________________________________________________
911 void AliTOFv0::CreateMaterials()
914 // Define materials for the Time Of Flight
916 AliTOF::CreateMaterials();
919 //_____________________________________________________________________________
920 void AliTOFv0::Init()
923 // Initialise the detector after the geometry has been defined
925 printf("**************************************"
927 "**************************************\n");
928 printf("\n Version 0 of TOF initialing, "
929 "symmetric TOF - Full Coverage version\n");
933 fIdFTOA = gMC->VolId("FTOA");
934 fIdFTOB = gMC->VolId("FTOB");
935 fIdFTOC = gMC->VolId("FTOC");
936 fIdFLTA = gMC->VolId("FLTA");
937 fIdFLTB = gMC->VolId("FLTB");
938 fIdFLTC = gMC->VolId("FLTC");
941 printf("%s: **************************************"
943 "**************************************\n",ClassName());
947 //_____________________________________________________________________________
948 void AliTOFv0::StepManager()
951 // Procedure called at each step in the Time Of Flight
953 TLorentzVector mom, pos;
954 Float_t xm[3],pm[3],xpad[3],ppad[3];
955 Float_t hits[13],phi,phid,z;
957 Int_t sector, plate, padx, padz, strip;
958 Int_t copy, padzid, padxid, stripid, i;
959 Int_t *idtmed = fIdtmed->GetArray()-499;
960 Float_t incidenceAngle;
962 if(gMC->GetMedium()==idtmed[513] &&
963 gMC->IsTrackEntering() && gMC->TrackCharge()
964 && gMC->CurrentVolID(copy)==fIdSens)
966 // getting information about hit volumes
968 padzid=gMC->CurrentVolOffID(2,copy);
971 padxid=gMC->CurrentVolOffID(1,copy);
974 stripid=gMC->CurrentVolOffID(4,copy);
977 gMC->TrackPosition(pos);
978 gMC->TrackMomentum(mom);
980 // Double_t NormPos=1./pos.Rho();
981 Double_t normMom=1./mom.Rho();
983 // getting the cohordinates in pad ref system
984 xm[0] = (Float_t)pos.X();
985 xm[1] = (Float_t)pos.Y();
986 xm[2] = (Float_t)pos.Z();
988 pm[0] = (Float_t)mom.X()*normMom;
989 pm[1] = (Float_t)mom.Y()*normMom;
990 pm[2] = (Float_t)mom.Z()*normMom;
992 gMC->Gmtod(xm,xpad,1);
993 gMC->Gmtod(pm,ppad,2);
995 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1000 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
1001 if (z < (fZlenA*0.5+fZlenB) &&
1002 z > fZlenA*0.5) plate = 4;
1003 if (z >-(fZlenA*0.5+fZlenB) &&
1004 z < -fZlenA*0.5) plate = 2;
1005 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
1006 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
1009 phid = phi*kRaddeg+180.;
1010 sector = Int_t (phid/20.);
1018 hits[6] = mom.Rho();
1023 hits[11]= incidenceAngle;
1024 hits[12]= gMC->Edep();
1032 AddHit(gAlice->CurrentTrack(),vol, hits);