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 //
30 // Domenico Vicinanza //
32 // University of Salerno - Italy //
34 // Fabrizio Pierella //
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>
59 #include "AliTOFConstants.h" // AdC
64 //_____________________________________________________________________________
68 // Default constructor
72 //_____________________________________________________________________________
73 AliTOFv0::AliTOFv0(const char *name, const char *title)
77 // Standard constructor
80 // Check that FRAME is there otherwise we have no place where to
82 AliModule* frame=gAlice->GetModule("FRAME");
84 Error("Ctor","TOF needs FRAME to be present\n");
87 if(frame->IsVersion()!=1) {
88 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
94 //____________________________________________________________________________
96 void AliTOFv0::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 offset for nodes
116 Float_t zOffsetC = fZtof - fZlenC*0.5;
117 Float_t zOffsetB = fZtof - fZlenC - fZlenB*0.5;
118 Float_t zOffsetA = 0.;
119 // Define TOF basic volume
121 char nodeName0[7], nodeName1[7], nodeName2[7];
122 char nodeName3[7], nodeName4[7], rotMatNum[7];
124 new TBRIK("S_TOF_C","TOF box","void",
125 fStripLn*0.5,khTof*0.5,fZlenC*0.5);
126 new TBRIK("S_TOF_B","TOF box","void",
127 fStripLn*0.5,khTof*0.5,fZlenB*0.5);
128 new TBRIK("S_TOF_A","TOF box","void",
129 fStripLn*0.5,khTof*0.5,fZlenA*0.5);
131 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
134 sprintf(rotMatNum,"rot50%i",nodeNum);
135 sprintf(nodeName0,"FTO00%i",nodeNum);
136 sprintf(nodeName1,"FTO10%i",nodeNum);
137 sprintf(nodeName2,"FTO20%i",nodeNum);
138 sprintf(nodeName3,"FTO30%i",nodeNum);
139 sprintf(nodeName4,"FTO40%i",nodeNum);
142 sprintf(rotMatNum,"rot5%i",nodeNum);
143 sprintf(nodeName0,"FTO0%i",nodeNum);
144 sprintf(nodeName1,"FTO1%i",nodeNum);
145 sprintf(nodeName2,"FTO2%i",nodeNum);
146 sprintf(nodeName3,"FTO3%i",nodeNum);
147 sprintf(nodeName4,"FTO4%i",nodeNum);
150 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
151 ang = (4.5-nodeNum) * kangle;
154 node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetC,rotMatNum);
155 node->SetLineColor(kColorTOF);
159 node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetC,rotMatNum);
160 node->SetLineColor(kColorTOF);
164 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum);
165 node->SetLineColor(kColorTOF);
169 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
170 node->SetLineColor(kColorTOF);
174 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum);
175 node->SetLineColor(kColorTOF);
177 } // end loop on nodeNum
182 //_____________________________________________________________________________
183 void AliTOFv0::CreateGeometry()
186 // Create geometry for Time Of Flight version 0
190 <img src="picts/AliTOFv0.gif">
194 // Creates common geometry
196 AliTOF::CreateGeometry();
199 //_____________________________________________________________________________
200 void AliTOFv0::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
218 par[2] = zlenC * 0.5;
219 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
220 par[2] = zlenB * 0.5;
221 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
222 par[2] = zlenA * 0.5;
223 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
226 // Positioning of modules
228 Float_t zcor1 = ztof0 - zlenC*0.5;
229 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
232 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
233 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
234 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
235 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
236 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
237 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
238 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
239 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
241 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
242 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
243 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
244 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
245 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
246 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
248 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
249 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
250 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
252 Float_t db = 0.5;//cm
253 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
261 xFST = xFLT-fDeadBndX*2;//cm
263 // Sizes of MRPC pads
265 Float_t yPad = 0.505;//cm
267 // Large not sensitive volumes with Insensitive Freon
271 cout <<"************************* TOF geometry **************************"<<endl;
273 par[2] = (zFLTA *0.5);
274 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
275 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
277 par[2] = (zFLTB * 0.5);
278 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
279 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
281 par[2] = (zFLTC * 0.5);
282 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
283 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
285 ////////// Layers of Aluminum before and after detector //////////
286 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
287 ////////// lateral walls not simulated
290 ycoor = -yFLT/2 + par[1];
291 par[2] = (zFLTA *0.5);
292 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
293 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
294 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
295 par[2] = (zFLTB *0.5);
296 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
297 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
298 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
299 par[2] = (zFLTC *0.5);
300 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
301 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
302 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
304 ///////////////// Detector itself //////////////////////
305 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
306 //and the boundary of the strip
307 const Int_t knx = fNpadX; // number of pads along x
308 const Int_t knz = fNpadZ; // number of pads along z
309 const Float_t kspace = fSpace; //cm distance from the front plate of the box
311 Float_t zSenStrip = fZpad*fNpadZ;//cm
312 Float_t stripWidth = zSenStrip + 2*kdeadBound;
315 par[2] = stripWidth*0.5;
317 // new description for strip volume -double stack strip-
318 // -- all constants are expressed in cm
319 // heigth of different layers
320 const Float_t khhony = 1. ; // heigth of HONY Layer
321 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
322 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
323 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
324 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
325 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
326 const Float_t kwsensmz = 2*3.5 ; // cm
327 const Float_t klsensmx = 48*2.5; // cm
328 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
329 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
331 // heigth of the FSTR Volume (the strip volume)
332 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
333 // width of the FSTR Volume (the strip volume)
334 const Float_t kwstripz = 10.;
335 // length of the FSTR Volume (the strip volume)
336 const Float_t klstripx = 122.;
338 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
339 // coordinates of the strip center in the strip reference frame; used for positioning
340 // internal strip volumes
341 Float_t posfp[3]={0.,0.,0.};
344 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
345 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
346 //-- HONY Layer definition
348 parfp[1] = khhony*0.5;
350 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
351 // positioning 2 HONY Layers on FSTR volume
353 posfp[1]=-khstripy*0.5+parfp[1];
354 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
355 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
357 //-- PCB Layer definition
358 parfp[1] = khpcby*0.5;
359 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
360 // positioning 2 PCB Layers on FSTR volume
361 posfp[1]=-khstripy*0.5+khhony+parfp[1];
362 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
363 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
364 // positioning the central PCB layer
365 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
369 //-- MYLAR Layer definition
370 parfp[1] = khmyly*0.5;
371 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
372 // positioning 2 MYLAR Layers on FSTR volume
373 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
374 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
375 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
376 // adding further 2 MYLAR Layers on FSTR volume
377 posfp[1] = khpcby*0.5+parfp[1];
378 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
379 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
382 //-- Graphite Layer definition
383 parfp[1] = khgraphy*0.5;
384 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
385 // positioning 2 Graphite Layers on FSTR volume
386 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
387 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
388 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
389 // adding further 2 Graphite Layers on FSTR volume
390 posfp[1] = khpcby*0.5+khmyly+parfp[1];
391 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
392 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
395 //-- Glass (EXT. +Semi INT.) Layer definition
396 parfp[1] = khglasseiy*0.5;
397 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
398 // positioning 2 Glass Layers on FSTR volume
399 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
400 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
401 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
402 // adding further 2 Glass Layers on FSTR volume
403 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
404 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
405 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
408 //-- Sensitive Mixture Layer definition
409 parfp[0] = klsensmx*0.5;
410 parfp[1] = khsensmy*0.5;
411 parfp[2] = kwsensmz*0.5;
412 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
413 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
414 // positioning 2 gas Layers on FSTR volume
415 // the upper is insensitive freon
416 // while the remaining is sensitive
417 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
418 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
419 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
421 // dividing FSEN along z in knz=2 and along x in knx=48
422 gMC->Gsdvn("FSEZ","FSEN",knz,3);
423 gMC->Gsdvn("FSEX","FSEZ",knx,1);
425 // FPAD volume definition
426 parfp[0] = klpadx*0.5;
427 parfp[1] = khsensmy*0.5;
428 parfp[2] = kwpadz*0.5;
429 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
430 // positioning the FPAD volumes on previous divisions
431 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
433 //// Positioning the Strips (FSTR) in the FLT volumes /////
437 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
439 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
445 ycoor = -14.5 + kspace ; //2 cm over front plate
447 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
449 Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
451 //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
452 gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC
454 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
455 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
459 Int_t upDown = -1; // upDown=-1 -> Upper strip
460 // upDown=+1 -> Lower strip
462 ang = atan(zcoor/radius);
464 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
465 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
467 ycoor = -14.5+ kspace; //2 cm over front plate
468 ycoor += (1-(upDown+1)/2)*gap;
469 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
470 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
471 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
472 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
474 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
475 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
478 upDown*= -1; // Alternate strips
479 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
480 upDown*gap*TMath::Tan(ang)-
481 (zSenStrip/2)/TMath::Cos(ang);
482 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
484 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
485 upDown*gap*TMath::Tan(ang)+
486 (zSenStrip/2)/TMath::Cos(ang);
489 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
490 upDown*gap*TMath::Tan(ang)-
491 (zSenStrip/2)/TMath::Cos(ang);
493 ang = atan(zcoor/radius);
495 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
496 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
499 ycoor = -14.5+ kspace; //2 cm over front plate
500 ycoor += (1-(upDown+1)/2)*gap;
501 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
502 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
503 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
504 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
506 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
507 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
509 ycoor = -hTof/2.+ kspace;//2 cm over front plate
516 Float_t deadRegion = 1.0;//cm
518 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
519 upDown*gap*TMath::Tan(ang)-
520 (zSenStrip/2)/TMath::Cos(ang)-
521 deadRegion/TMath::Cos(ang);
523 ang = atan(zpos/radius);
525 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
527 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
528 ycoor += (1-(upDown+1)/2)*gap;
529 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
530 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
532 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
533 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
539 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
540 upDown*gap*TMath::Tan(ang)-
541 (zSenStrip/2)/TMath::Cos(ang);
542 ang = atan(zpos/radius);
544 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
546 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
547 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
548 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
549 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
550 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
551 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
553 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
554 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
558 } while (TMath::Abs(ang*kRaddeg)<22.5);
559 //till we reach a tilting angle of 22.5 degrees
561 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
562 zpos = zpos - zSenStrip/TMath::Cos(ang);
563 // this avoid overlaps in between outer strips in plate B
564 Float_t deltaMovingUp=0.8; // [cm]
565 Float_t deltaMovingDown=-0.5; // [cm]
568 ang = atan(zpos/radius);
570 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
572 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
573 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
574 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
575 zpos = zpos - zSenStrip/TMath::Cos(ang);
577 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
578 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
581 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
585 zpos = zpos + zSenStrip/TMath::Cos(ang);
587 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
589 (zSenStrip/2)/TMath::Cos(ang);
593 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
594 ycoor= -hTof*0.5+kspace+gap+deltaGap;
598 ang = atan(zpos/radius);
600 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
602 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
603 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
605 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
606 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
608 zpos = zpos - zSenStrip/TMath::Cos(ang);
609 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
612 ////////// Layers after strips /////////////////
613 // honeycomb (Polyethilene) Layer after (1.2cm)
615 Float_t overSpace = fOverSpc;//cm
619 par[2] = (zFLTA *0.5);
620 ycoor = -yFLT/2 + overSpace + par[1];
621 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
622 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
623 par[2] = (zFLTB *0.5);
624 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
625 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
626 par[2] = (zFLTC *0.5);
627 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
628 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
630 // Electronics (Cu) after
633 par[1] = 1.43*0.05*0.5; // 5% of X0
634 par[2] = (zFLTA *0.5);
636 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
637 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
638 par[2] = (zFLTB *0.5);
639 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
640 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
641 par[2] = (zFLTC *0.5);
642 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
643 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
645 // cooling WAter after
648 par[1] = 36.1*0.02*0.5; // 2% of X0
649 par[2] = (zFLTA *0.5);
651 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
652 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
653 par[2] = (zFLTB *0.5);
654 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
655 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
656 par[2] = (zFLTC *0.5);
657 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
658 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
663 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
664 par[2] = (zFLTA *0.5);
666 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
667 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
668 par[2] = (zFLTB *0.5);
669 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
670 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
671 par[2] = (zFLTC *0.5);
672 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
673 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
675 //Back Plate honycomb (2cm)
679 ycoor = yFLT/2 - par[1];
680 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
681 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
682 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
683 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
684 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
685 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
689 //_____________________________________________________________________________
690 void AliTOFv0::DrawModule() const
693 // Draw a shaded view of the Time Of Flight version 0
695 // Set everything unseen
696 gMC->Gsatt("*", "seen", -1);
698 // Set ALIC mother transparent
699 gMC->Gsatt("ALIC","SEEN",0);
701 // Set the volumes visible
702 gMC->Gsatt("ALIC","SEEN",0);
704 gMC->Gsatt("FTOA","SEEN",1);
705 gMC->Gsatt("FTOB","SEEN",1);
706 gMC->Gsatt("FTOC","SEEN",1);
707 gMC->Gsatt("FLTA","SEEN",1);
708 gMC->Gsatt("FLTB","SEEN",1);
709 gMC->Gsatt("FLTC","SEEN",1);
710 gMC->Gsatt("FPLA","SEEN",1);
711 gMC->Gsatt("FPLB","SEEN",1);
712 gMC->Gsatt("FPLC","SEEN",1);
713 gMC->Gsatt("FSTR","SEEN",1);
714 gMC->Gsatt("FPEA","SEEN",1);
715 gMC->Gsatt("FPEB","SEEN",1);
716 gMC->Gsatt("FPEC","SEEN",1);
718 gMC->Gsatt("FLZ1","SEEN",0);
719 gMC->Gsatt("FLZ2","SEEN",0);
720 gMC->Gsatt("FLZ3","SEEN",0);
721 gMC->Gsatt("FLX1","SEEN",0);
722 gMC->Gsatt("FLX2","SEEN",0);
723 gMC->Gsatt("FLX3","SEEN",0);
724 gMC->Gsatt("FPAD","SEEN",0);
726 gMC->Gdopt("hide", "on");
727 gMC->Gdopt("shad", "on");
728 gMC->Gsatt("*", "fill", 7);
729 gMC->SetClipBox(".");
730 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
732 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
733 gMC->Gdhead(1111, "Time Of Flight");
734 gMC->Gdman(18, 4, "MAN");
735 gMC->Gdopt("hide","off");
737 //_____________________________________________________________________________
738 void AliTOFv0::DrawDetectorModules()
741 // Draw a shaded view of the TOF detector version 0
744 //Set ALIC mother transparent
745 gMC->Gsatt("ALIC","SEEN",0);
748 //Set volumes visible
751 // Level 1 for TOF volumes
752 gMC->Gsatt("B077","seen",0);
755 //==========> Level 2
757 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
758 gMC->Gsatt("B071","seen",0);
759 gMC->Gsatt("B074","seen",0);
760 gMC->Gsatt("B075","seen",0);
761 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
765 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
766 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
767 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
768 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
769 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
770 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
771 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
772 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
773 gMC->Gsatt("BTO1","seen",0);
777 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
778 gMC->Gsatt("BTO2","seen",0);
781 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
782 gMC->Gsatt("BTO3","seen",0);
784 // ==================> Level 3
785 // Level 3 of B071 / Level 2 of BTO1
786 gMC->Gsatt("FTOC","seen",-2);
787 gMC->Gsatt("FTOB","seen",-2);
788 gMC->Gsatt("FTOA","seen",-2);
790 // Level 3 of B074 / Level 2 of BTO2
791 // -> cfr previous settings
793 // Level 3 of B075 / Level 2 of BTO3
794 // -> cfr previous settings
796 gMC->Gdopt("hide","on");
797 gMC->Gdopt("shad","on");
798 gMC->Gsatt("*", "fill", 5);
799 gMC->SetClipBox(".");
800 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
802 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
803 gMC->Gdhead(1111,"TOF detector V1");
804 gMC->Gdman(18, 4, "MAN");
805 gMC->Gdopt("hide","off");
808 //_____________________________________________________________________________
809 void AliTOFv0::DrawDetectorStrips()
812 // Draw a shaded view of the TOF strips for version 0
815 //Set ALIC mother transparent
816 gMC->Gsatt("ALIC","SEEN",0);
819 //Set volumes visible
821 // Level 1 for TOF volumes
822 gMC->Gsatt("B077","seen",0);
824 //==========> Level 2
826 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
827 gMC->Gsatt("B071","seen",0);
828 gMC->Gsatt("B074","seen",0);
829 gMC->Gsatt("B075","seen",0);
830 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
833 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
834 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
835 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
836 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
837 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
838 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
839 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
840 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
841 gMC->Gsatt("BTO1","seen",0);
843 // ==================> Level 3
844 // Level 3 of B071 / Level 2 of BTO1
845 gMC->Gsatt("FTOC","seen",0);
846 gMC->Gsatt("FTOB","seen",0);
847 gMC->Gsatt("FTOA","seen",0);
849 // Level 3 of B074 / Level 2 of BTO2
850 // -> cfr previous settings
852 // Level 3 of B075 / Level 2 of BTO3
853 // -> cfr previous settings
856 // ==========================> Level 4
857 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
858 gMC->Gsatt("FLTC","seen",0);
859 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
860 gMC->Gsatt("FLTB","seen",0);
861 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
862 gMC->Gsatt("FLTA","seen",0);
864 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
865 // -> cfr previous settings
866 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
867 // -> cfr previous settings
869 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
870 // -> cfr previous settings
872 //======================================> Level 5
873 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
874 gMC->Gsatt("FALC","seen",0); // no children for FALC
875 gMC->Gsatt("FSTR","seen",-2);
876 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
877 gMC->Gsatt("FECC","seen",0); // no children for FECC
878 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
879 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
881 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
882 gMC->Gsatt("FALB","seen",0); // no children for FALB
883 //--> gMC->Gsatt("FSTR","seen",-2);
886 // -> cfr previous settings
887 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
888 gMC->Gsatt("FECB","seen",0); // no children for FECB
889 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
890 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
892 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
893 gMC->Gsatt("FALA","seen",0); // no children for FALB
894 //--> gMC->Gsatt("FSTR","seen",-2);
895 // -> cfr previous settings
896 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
897 gMC->Gsatt("FECA","seen",0); // no children for FECA
898 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
899 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
902 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
903 gMC->Gsatt("BTO2","seen",0);
906 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
907 gMC->Gsatt("BTO3","seen",0);
909 // for others Level 5, cfr. previous settings
911 gMC->Gdopt("hide","on");
912 gMC->Gdopt("shad","on");
913 gMC->Gsatt("*", "fill", 5);
914 gMC->SetClipBox(".");
915 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
917 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
918 gMC->Gdhead(1111,"TOF Strips V1");
919 gMC->Gdman(18, 4, "MAN");
920 gMC->Gdopt("hide","off");
923 //_____________________________________________________________________________
924 void AliTOFv0::CreateMaterials()
927 // Define materials for the Time Of Flight
929 AliTOF::CreateMaterials();
932 //_____________________________________________________________________________
933 void AliTOFv0::Init()
936 // Initialise the detector after the geometry has been defined
938 printf("**************************************"
940 "**************************************\n");
941 printf("\n Version 0 of TOF initialing, "
942 "symmetric TOF - Full Coverage version\n");
946 fIdFTOA = gMC->VolId("FTOA");
947 fIdFTOB = gMC->VolId("FTOB");
948 fIdFTOC = gMC->VolId("FTOC");
949 fIdFLTA = gMC->VolId("FLTA");
950 fIdFLTB = gMC->VolId("FLTB");
951 fIdFLTC = gMC->VolId("FLTC");
954 printf("%s: **************************************"
956 "**************************************\n",ClassName());
960 //_____________________________________________________________________________
961 void AliTOFv0::StepManager()
964 // Procedure called at each step in the Time Of Flight
966 TLorentzVector mom, pos;
967 Float_t xm[3],pm[3],xpad[3],ppad[3];
968 Float_t hits[13],phi,phid,z;
970 Int_t sector, plate, padx, padz, strip;
971 Int_t copy, padzid, padxid, stripid, i;
972 Int_t *idtmed = fIdtmed->GetArray()-499;
973 Float_t incidenceAngle;
975 if(gMC->CurrentMedium()==idtmed[513] &&
976 gMC->IsTrackEntering() && gMC->TrackCharge()
977 && gMC->CurrentVolID(copy)==fIdSens)
979 // getting information about hit volumes
981 padzid=gMC->CurrentVolOffID(2,copy);
984 padxid=gMC->CurrentVolOffID(1,copy);
987 stripid=gMC->CurrentVolOffID(4,copy);
990 gMC->TrackPosition(pos);
991 gMC->TrackMomentum(mom);
993 // Double_t NormPos=1./pos.Rho();
994 Double_t normMom=1./mom.Rho();
996 // getting the cohordinates in pad ref system
997 xm[0] = (Float_t)pos.X();
998 xm[1] = (Float_t)pos.Y();
999 xm[2] = (Float_t)pos.Z();
1001 pm[0] = (Float_t)mom.X()*normMom;
1002 pm[1] = (Float_t)mom.Y()*normMom;
1003 pm[2] = (Float_t)mom.Z()*normMom;
1005 gMC->Gmtod(xm,xpad,1);
1006 gMC->Gmtod(pm,ppad,2);
1008 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1013 if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
1014 if (z < (fZlenA*0.5+fZlenB) &&
1015 z > fZlenA*0.5) plate = 1; //4; // AdC
1016 if (z >-(fZlenA*0.5+fZlenB) &&
1017 z < -fZlenA*0.5) plate = 3; //2; // AdC
1018 if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
1019 if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
1021 if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
1022 else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
1023 else strip--; // AdC
1025 if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
1028 if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
1032 if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
1033 else phid = phi*kRaddeg + 360.; // AdC
1034 sector = Int_t (phid/20.);
1042 hits[6] = mom.Rho();
1047 hits[11]= incidenceAngle;
1048 hits[12]= gMC->Edep();
1056 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);