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 3 of the Time Of Flight //
23 // VERSION WITH 5 MODULES AND TILTED STRIPS
24 // HITS DEFINED FOR THIS VERSION
25 // HOLES FOR RICH DETECTOR
32 // University of Salerno - Italy
35 // University of Bologna - Italy
40 <img src="picts/AliTOFv3Class.gif">
44 ///////////////////////////////////////////////////////////////////////////////
46 #include <Riostream.h>
50 #include <TGeometry.h>
51 #include <TLorentzVector.h>
54 #include <TVirtualMC.h>
62 //_____________________________________________________________________________
66 // Default constructor
70 //_____________________________________________________________________________
71 AliTOFv3::AliTOFv3(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 AliTOFv3::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);
160 if (nodeNum !=1 && nodeNum!=17 && nodeNum !=18)
163 node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum);
164 node->SetLineColor(kColorTOF);
168 node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
169 node->SetLineColor(kColorTOF);
171 } // Holes for RICH detector
173 if (nodeNum !=1 && nodeNum !=17 && nodeNum !=18)
176 node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum);
177 node->SetLineColor(kColorTOF);
179 } // Holes for RICH detector, central part
185 //_____________________________________________________________________________
186 void AliTOFv3::CreateGeometry()
189 // Create geometry for Time Of Flight version 0
193 <img src="picts/AliTOFv3.gif">
197 // Creates common geometry
199 AliTOF::CreateGeometry();
202 //_____________________________________________________________________________
203 void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
204 Float_t zlenB, Float_t zlenA, Float_t ztof0)
207 // Definition of the Time Of Fligh Resistive Plate Chambers
208 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
210 Float_t ycoor, zcoor;
212 Int_t *idtmed = fIdtmed->GetArray()-499;
215 Float_t hTof = fRmax-fRmin;
217 Float_t radius = fRmin+2.;//cm
221 par[2] = zlenC * 0.5;
222 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
223 par[2] = zlenB * 0.5;
224 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
225 par[2] = zlenA * 0.5;
226 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
229 // Positioning of modules
231 Float_t zcor1 = ztof0 - zlenC*0.5;
232 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
235 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
236 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
237 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
238 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
239 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
240 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
241 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
242 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
244 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
245 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
246 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
247 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
249 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
250 gMC->Gspos("FTOA", 0, "BTO2", 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 if (fDebug) cout << ClassName() <<
272 cout <<": ************************* TOF geometry **************************"<<endl;
274 par[2] = (zFLTA *0.5);
275 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
276 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
278 par[2] = (zFLTB * 0.5);
279 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
280 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
282 par[2] = (zFLTC * 0.5);
283 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
284 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
286 ///// Layers of Aluminum before and after detector /////
287 ///// Aluminum Box for Modules (1.8 mm thickness) /////
288 ///// lateral walls not simulated for the time being
289 //const Float_t khAlWall = 0.18;
291 const Float_t khAlWall = 0.11;
293 par[1] = khAlWall/2.;//cm
294 ycoor = -yFLT/2 + par[1];
295 par[2] = (zFLTA *0.5);
296 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
297 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
298 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
299 par[2] = (zFLTB *0.5);
300 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
301 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
302 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
303 par[2] = (zFLTC *0.5);
304 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
305 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
306 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
308 ///////////////// Detector itself //////////////////////
310 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
311 //and the boundary of the strip
312 const Int_t knx = fNpadX; // number of pads along x
313 const Int_t knz = fNpadZ; // number of pads along z
314 const Float_t kspace = fSpace; //cm distance from the front plate of the box
316 Float_t zSenStrip = fZpad*fNpadZ;//cm
317 Float_t stripWidth = zSenStrip + 2*kdeadBound;
321 par[2] = stripWidth*0.5;
323 // new description for strip volume -double stack strip-
324 // -- all constants are expressed in cm
325 // heigth of different layers
326 const Float_t khhony = 0.8 ; // heigth of HONY Layer
327 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
328 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
329 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
330 const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
331 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
332 const Float_t kwsensmz = 2*3.5 ; // cm
333 const Float_t klsensmx = 48*2.5; // cm
334 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
335 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
337 // heigth of the FSTR Volume (the strip volume)
338 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
339 // width of the FSTR Volume (the strip volume)
340 const Float_t kwstripz = 10.;
341 // length of the FSTR Volume (the strip volume)
342 const Float_t klstripx = 122.;
344 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
345 // coordinates of the strip center in the strip reference frame; used for positioning
346 // internal strip volumes
347 Float_t posfp[3]={0.,0.,0.};
350 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
351 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
352 //-- HONY Layer definition
354 parfp[1] = khhony*0.5;
356 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
357 // positioning 2 HONY Layers on FSTR volume
359 posfp[1]=-khstripy*0.5+parfp[1];
360 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
361 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
363 //-- PCB Layer definition
364 parfp[1] = khpcby*0.5;
365 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
366 // positioning 2 PCB Layers on FSTR volume
367 posfp[1]=-khstripy*0.5+khhony+parfp[1];
368 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
369 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
370 // positioning the central PCB layer
371 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
375 //-- MYLAR Layer definition
376 parfp[1] = khmyly*0.5;
377 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
378 // positioning 2 MYLAR Layers on FSTR volume
379 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
380 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
381 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
382 // adding further 2 MYLAR Layers on FSTR volume
383 posfp[1] = khpcby*0.5+parfp[1];
384 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
385 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
388 //-- Graphite Layer definition
389 parfp[1] = khgraphy*0.5;
390 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
391 // positioning 2 Graphite Layers on FSTR volume
392 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
393 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
394 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
395 // adding further 2 Graphite Layers on FSTR volume
396 posfp[1] = khpcby*0.5+khmyly+parfp[1];
397 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
398 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
401 //-- Glass (EXT. +Semi INT.) Layer definition
402 parfp[1] = khglasseiy*0.5;
403 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
404 // positioning 2 Glass Layers on FSTR volume
405 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
406 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
407 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
408 // adding further 2 Glass Layers on FSTR volume
409 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
410 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
411 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
414 //-- Sensitive Mixture Layer definition
415 parfp[0] = klsensmx*0.5;
416 parfp[1] = khsensmy*0.5;
417 parfp[2] = kwsensmz*0.5;
418 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
419 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
420 // positioning 2 gas Layers on FSTR volume
421 // the upper is insensitive freon
422 // while the remaining is sensitive
423 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
424 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
425 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
427 // dividing FSEN along z in knz=2 and along x in knx=48
428 gMC->Gsdvn("FSEZ","FSEN",knz,3);
429 gMC->Gsdvn("FSEX","FSEZ",knx,1);
431 // FPAD volume definition
432 parfp[0] = klpadx*0.5;
433 parfp[1] = khsensmy*0.5;
434 parfp[2] = kwpadz*0.5;
435 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
436 // positioning the FPAD volumes on previous divisions
437 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
439 //// Positioning the Strips (FSTR) in the FLT volumes /////
443 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
445 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
451 ycoor = -14.5 + kspace ; //2 cm over front plate
453 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
454 gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
456 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
457 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
461 Int_t upDown = -1; // upDown=-1 -> Upper strip
462 // upDown=+1 -> Lower strip
464 ang = atan(zcoor/radius);
466 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
467 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
469 ycoor = -14.5+ kspace; //2 cm over front plate
470 ycoor += (1-(upDown+1)/2)*gap;
471 gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
472 gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
474 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
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");
504 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i);
505 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
507 ycoor = -hTof/2.+ kspace;//2 cm over front plate
514 Float_t deadRegion = 1.0;//cm
516 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
517 upDown*gap*TMath::Tan(ang)-
518 (zSenStrip/2)/TMath::Cos(ang)-
519 deadRegion/TMath::Cos(ang);
521 ang = atan(zpos/radius);
523 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
525 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
526 ycoor += (1-(upDown+1)/2)*gap;
527 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
528 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
530 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
531 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
537 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
538 upDown*gap*TMath::Tan(ang)-
539 (zSenStrip/2)/TMath::Cos(ang);
540 ang = atan(zpos/radius);
542 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
544 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
545 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
546 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
547 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
548 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
549 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
551 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
552 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
556 } while (TMath::Abs(ang*kRaddeg)<22.5);
557 //till we reach a tilting angle of 22.5 degrees
559 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
560 zpos = zpos - zSenStrip/TMath::Cos(ang);
561 // this avoid overlaps in between outer strips in plate B
562 Float_t deltaMovingUp=0.8; // [cm]
563 Float_t deltaMovingDown=-0.5; // [cm]
566 ang = atan(zpos/radius);
568 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
570 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
571 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
572 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
573 zpos = zpos - zSenStrip/TMath::Cos(ang);
575 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
576 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
580 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
584 zpos = zpos + zSenStrip/TMath::Cos(ang);
586 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
588 (zSenStrip/2)/TMath::Cos(ang);
592 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
593 ycoor= -hTof*0.5+kspace+gap+deltaGap;
597 ang = atan(zpos/radius);
599 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
601 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
602 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
604 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
605 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
607 zpos = zpos - zSenStrip/TMath::Cos(ang);
608 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
611 ////////// Layers after strips /////////////////
612 // Al Layer thickness (2.3mm) factor 0.7
614 Float_t overSpace = fOverSpc;//cm
617 par[1] = 0.115*0.7; // factor 0.7
618 par[2] = (zFLTA *0.5);
619 ycoor = -yFLT/2 + overSpace + par[1];
620 gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al
621 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
622 par[2] = (zFLTB *0.5);
623 gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al
624 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
625 par[2] = (zFLTC *0.5);
626 gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al
627 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
630 // plexiglass thickness: 1.5 mm ; factor 0.3
633 par[1] = 0.075*0.3; // factor 0.3
634 par[2] = (zFLTA *0.5);
636 gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl.
637 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
638 par[2] = (zFLTB *0.5);
639 gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl.
640 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
641 par[2] = (zFLTC *0.5);
642 gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl.
643 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
648 par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 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");
661 // start with cards and cooling tubes
662 // finally, cards, cooling tubes and layer for thermal dispersion
664 // card volume definition
666 // see GEOM200 in GEANT manual
667 AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
673 gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card
674 //alu plate volume definition
677 gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate
680 // central module positioning (FAIA)
681 Float_t cardpos[3], aplpos2, stepforcardA=6.625;
685 Float_t aplpos1 = -2.;
687 for (icard=0; icard<15; ++icard) {
688 cardpos[2]= cardpos[2]+stepforcardA;
689 aplpos2 = cardpos[2]+0.15;
690 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
691 gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
696 // intermediate module positioning (FAIB)
697 Float_t stepforcardB= 7.05;
699 for (icard=0; icard<19; ++icard) {
700 cardpos[2]= cardpos[2]+stepforcardB;
701 aplpos2 = cardpos[2]+0.15;
702 gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
703 gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
707 // outer module positioning (FAIC)
708 Float_t stepforcardC= 8.45238;
710 for (icard=0; icard<20; ++icard) {
711 cardpos[2]= cardpos[2]+stepforcardC;
712 aplpos2 = cardpos[2]+0.15;
713 gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
714 gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
717 // tube volume definition
722 gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel)
726 gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water
727 // positioning water tube into the steel one
728 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
732 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
733 // central module positioning (FAIA)
734 Float_t tubepos[3], tdis=0.6;
736 tubepos[1]= cardpos[1];
737 tubepos[2]= -53.+tdis;
740 for (itub=0; itub<15; ++itub) {
741 tubepos[2]= tubepos[2]+stepforcardA;
742 gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
747 // intermediate module positioning (FAIB)
748 tubepos[2]= -70.5+tdis;
749 for (itub=0; itub<19; ++itub) {
750 tubepos[2]= tubepos[2]+stepforcardB;
751 gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
755 // outer module positioning (FAIC)
756 tubepos[2]= -88.75+tdis;
757 for (itub=0; itub<20; ++itub) {
758 tubepos[2]= tubepos[2]+stepforcardC;
759 gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
765 //_____________________________________________________________________________
766 void AliTOFv3::DrawModule() const
769 // Draw a shaded view of the Time Of Flight version 3
771 // Set everything unseen
772 gMC->Gsatt("*", "seen", -1);
774 // Set ALIC mother transparent
775 gMC->Gsatt("ALIC","SEEN",0);
777 // Set the volumes visible
778 gMC->Gsatt("ALIC","SEEN",0);
780 gMC->Gsatt("FTOA","SEEN",1);
781 gMC->Gsatt("FTOB","SEEN",1);
782 gMC->Gsatt("FTOC","SEEN",1);
783 gMC->Gsatt("FLTA","SEEN",1);
784 gMC->Gsatt("FLTB","SEEN",1);
785 gMC->Gsatt("FLTC","SEEN",1);
786 gMC->Gsatt("FPLA","SEEN",1);
787 gMC->Gsatt("FPLB","SEEN",1);
788 gMC->Gsatt("FPLC","SEEN",1);
789 gMC->Gsatt("FSTR","SEEN",1);
790 gMC->Gsatt("FPEA","SEEN",1);
791 gMC->Gsatt("FPEB","SEEN",1);
792 gMC->Gsatt("FPEC","SEEN",1);
794 gMC->Gsatt("FLZ1","SEEN",0);
795 gMC->Gsatt("FLZ2","SEEN",0);
796 gMC->Gsatt("FLZ3","SEEN",0);
797 gMC->Gsatt("FLX1","SEEN",0);
798 gMC->Gsatt("FLX2","SEEN",0);
799 gMC->Gsatt("FLX3","SEEN",0);
800 gMC->Gsatt("FPAD","SEEN",0);
802 gMC->Gdopt("hide", "on");
803 gMC->Gdopt("shad", "on");
804 gMC->Gsatt("*", "fill", 7);
805 gMC->SetClipBox(".");
806 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
808 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
809 gMC->Gdhead(1111, "Time Of Flight");
810 gMC->Gdman(18, 4, "MAN");
811 gMC->Gdopt("hide","off");
813 //_____________________________________________________________________________
814 void AliTOFv3::DrawDetectorModules()
817 // Draw a shaded view of the TOF detector version 3
820 //Set ALIC mother transparent
821 gMC->Gsatt("ALIC","SEEN",0);
824 //Set volumes visible
827 // Level 1 for TOF volumes
828 gMC->Gsatt("B077","seen",0);
831 //==========> Level 2
833 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
834 gMC->Gsatt("B071","seen",0);
835 gMC->Gsatt("B074","seen",0);
836 gMC->Gsatt("B075","seen",0);
837 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
841 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
842 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
843 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
844 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
845 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
846 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
847 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
848 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
849 gMC->Gsatt("BTO1","seen",0);
853 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
854 gMC->Gsatt("BTO2","seen",0);
857 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
858 gMC->Gsatt("BTO3","seen",0);
860 // ==================> Level 3
861 // Level 3 of B071 / Level 2 of BTO1
862 gMC->Gsatt("FTOC","seen",-2);
863 gMC->Gsatt("FTOB","seen",-2);
864 gMC->Gsatt("FTOA","seen",-2);
866 // Level 3 of B074 / Level 2 of BTO2
867 // -> cfr previous settings
869 // Level 3 of B075 / Level 2 of BTO3
870 // -> cfr previous settings
872 gMC->Gdopt("hide","on");
873 gMC->Gdopt("shad","on");
874 gMC->Gsatt("*", "fill", 5);
875 gMC->SetClipBox(".");
876 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
878 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
879 gMC->Gdhead(1111,"TOF detector V1");
880 gMC->Gdman(18, 4, "MAN");
881 gMC->Gdopt("hide","off");
884 //_____________________________________________________________________________
885 void AliTOFv3::DrawDetectorStrips()
888 // Draw a shaded view of the TOF strips for version 3
891 //Set ALIC mother transparent
892 gMC->Gsatt("ALIC","SEEN",0);
895 //Set volumes visible
897 // Level 1 for TOF volumes
898 gMC->Gsatt("B077","seen",0);
900 //==========> Level 2
902 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
903 gMC->Gsatt("B071","seen",0);
904 gMC->Gsatt("B074","seen",0);
905 gMC->Gsatt("B075","seen",0);
906 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
909 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
910 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
911 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
912 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
913 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
914 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
915 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
916 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
917 gMC->Gsatt("BTO1","seen",0);
919 // ==================> Level 3
920 // Level 3 of B071 / Level 2 of BTO1
921 gMC->Gsatt("FTOC","seen",0);
922 gMC->Gsatt("FTOB","seen",0);
923 gMC->Gsatt("FTOA","seen",0);
925 // Level 3 of B074 / Level 2 of BTO2
926 // -> cfr previous settings
928 // Level 3 of B075 / Level 2 of BTO3
929 // -> cfr previous settings
932 // ==========================> Level 4
933 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
934 gMC->Gsatt("FLTC","seen",0);
935 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
936 gMC->Gsatt("FLTB","seen",0);
937 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
938 gMC->Gsatt("FLTA","seen",0);
940 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
941 // -> cfr previous settings
942 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
943 // -> cfr previous settings
945 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
946 // -> cfr previous settings
948 //======================================> Level 5
949 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
950 gMC->Gsatt("FALC","seen",0); // no children for FALC
951 gMC->Gsatt("FSTR","seen",-2);
952 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
953 gMC->Gsatt("FECC","seen",0); // no children for FECC
954 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
955 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
957 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
958 gMC->Gsatt("FALB","seen",0); // no children for FALB
959 //--> gMC->Gsatt("FSTR","seen",-2);
962 // -> cfr previous settings
963 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
964 gMC->Gsatt("FECB","seen",0); // no children for FECB
965 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
966 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
968 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
969 gMC->Gsatt("FALA","seen",0); // no children for FALB
970 //--> gMC->Gsatt("FSTR","seen",-2);
971 // -> cfr previous settings
972 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
973 gMC->Gsatt("FECA","seen",0); // no children for FECA
974 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
975 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
978 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
979 gMC->Gsatt("BTO2","seen",0);
982 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
983 gMC->Gsatt("BTO3","seen",0);
985 // for others Level 5, cfr. previous settings
987 gMC->Gdopt("hide","on");
988 gMC->Gdopt("shad","on");
989 gMC->Gsatt("*", "fill", 5);
990 gMC->SetClipBox(".");
991 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
993 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
994 gMC->Gdhead(1111,"TOF Strips V1");
995 gMC->Gdman(18, 4, "MAN");
996 gMC->Gdopt("hide","off");
999 //_____________________________________________________________________________
1000 void AliTOFv3::CreateMaterials()
1003 // Define materials for the Time Of Flight
1005 AliTOF::CreateMaterials();
1008 //_____________________________________________________________________________
1009 void AliTOFv3::Init()
1012 // Initialise the detector after the geometry has been defined
1015 printf("%s: **************************************"
1017 "**************************************\n",ClassName());
1018 printf("\n%s Version 3 of TOF initialing, "
1019 "TOF with holes for RICH detector\n",ClassName());
1024 fIdFTOA = gMC->VolId("FTOA");
1025 fIdFTOB = gMC->VolId("FTOB");
1026 fIdFTOC = gMC->VolId("FTOC");
1027 fIdFLTA = gMC->VolId("FLTA");
1028 fIdFLTB = gMC->VolId("FLTB");
1029 fIdFLTC = gMC->VolId("FLTC");
1032 printf("%s: **************************************"
1034 "**************************************\n",ClassName());
1038 //_____________________________________________________________________________
1039 void AliTOFv3::StepManager()
1042 // Procedure called at each step in the Time Of Flight
1044 TLorentzVector mom, pos;
1045 Float_t xm[3],pm[3],xpad[3],ppad[3];
1046 Float_t hits[13],phi,phid,z;
1048 Int_t sector, plate, padx, padz, strip;
1049 Int_t copy, padzid, padxid, stripid, i;
1050 Int_t *idtmed = fIdtmed->GetArray()-499;
1051 Float_t incidenceAngle;
1053 if(gMC->GetMedium()==idtmed[513] &&
1054 gMC->IsTrackEntering() && gMC->TrackCharge()
1055 && gMC->CurrentVolID(copy)==fIdSens)
1057 // getting information about hit volumes
1059 padzid=gMC->CurrentVolOffID(2,copy);
1062 padxid=gMC->CurrentVolOffID(1,copy);
1065 stripid=gMC->CurrentVolOffID(4,copy);
1068 gMC->TrackPosition(pos);
1069 gMC->TrackMomentum(mom);
1071 // Double_t NormPos=1./pos.Rho();
1072 Double_t normMom=1./mom.Rho();
1074 // getting the cohordinates in pad ref system
1075 xm[0] = (Float_t)pos.X();
1076 xm[1] = (Float_t)pos.Y();
1077 xm[2] = (Float_t)pos.Z();
1079 pm[0] = (Float_t)mom.X()*normMom;
1080 pm[1] = (Float_t)mom.Y()*normMom;
1081 pm[2] = (Float_t)mom.Z()*normMom;
1083 gMC->Gmtod(xm,xpad,1);
1084 gMC->Gmtod(pm,ppad,2);
1086 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1091 if (TMath::Abs(z) <= fZlenA*0.5) plate = 3;
1092 if (z < (fZlenA*0.5+fZlenB) &&
1093 z > fZlenA*0.5) plate = 4;
1094 if (z >-(fZlenA*0.5+fZlenB) &&
1095 z < -fZlenA*0.5) plate = 2;
1096 if (z > (fZlenA*0.5+fZlenB)) plate = 5;
1097 if (z <-(fZlenA*0.5+fZlenB)) plate = 1;
1100 phid = phi*kRaddeg+180.;
1101 sector = Int_t (phid/20.);
1109 hits[6] = mom.Rho();
1114 hits[11]= incidenceAngle;
1115 hits[12]= gMC->Edep();
1123 AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);