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 1 of the Time Of Flight //
23 // VERSION WITH 5 MODULES AND TILTED STRIPS //
25 // HOLES FOR PHOS DETECTOR //
30 // Domenico Vicinanza //
32 // University of Salerno - Italy //
34 // Fabrizio Pierella //
35 // University of Bologna - Italy //
40 <img src="picts/AliTOFv1Class.gif"> //
44 ///////////////////////////////////////////////////////////////////////////////
46 #include <Riostream.h>
49 #include <TLorentzVector.h>
51 #include <TVirtualMC.h>
57 #include "AliTOFConstants.h" // AdC
62 //_____________________________________________________________________________
66 // Default constructor
70 //_____________________________________________________________________________
71 AliTOFv1::AliTOFv1(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");
91 //_____________________________________________________________________________
92 void AliTOFv1::CreateGeometry()
95 // Create geometry for Time Of Flight version 0
99 <img src="picts/AliTOFv1.gif">
103 // Creates common geometry
105 AliTOF::CreateGeometry();
108 //_____________________________________________________________________________
109 void AliTOFv1::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
110 Float_t zlenB, Float_t zlenA, Float_t ztof0)
113 // Definition of the Time Of Fligh Resistive Plate Chambers
114 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
116 Float_t ycoor, zcoor;
118 Int_t *idtmed = fIdtmed->GetArray()-499;
121 Float_t hTof = fRmax-fRmin;
123 Float_t radius = fRmin+2.;//cm
127 par[2] = zlenC * 0.5;
128 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
129 par[2] = zlenB * 0.5;
130 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
131 par[2] = zlenA * 0.5;
132 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
135 // Positioning of modules
137 Float_t zcor1 = ztof0 - zlenC*0.5;
138 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
141 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
142 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
143 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
144 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
145 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
146 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
147 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
148 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
150 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
151 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
152 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
153 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
154 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
155 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
157 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
158 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
160 Float_t db = 0.5;//cm
161 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
169 xFST = xFLT-fDeadBndX*2;//cm
171 // Sizes of MRPC pads
173 Float_t yPad = 0.505;//cm
175 // Large not sensitive volumes with Insensitive Freon
179 if(fDebug) cout << ClassName()
180 << ": ************************* TOF geometry **************************"
183 par[2] = (zFLTA *0.5);
184 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
185 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
187 par[2] = (zFLTB * 0.5);
188 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
189 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
191 par[2] = (zFLTC * 0.5);
192 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
193 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
195 ///// Layers of Aluminum before and after detector /////
196 ///// Aluminum Box for Modules (1.8 mm thickness) /////
197 ///// lateral walls not simulated for the time being
198 //const Float_t khAlWall = 0.18;
200 const Float_t khAlWall = 0.11;
202 par[1] = khAlWall/2.;//cm
203 ycoor = -yFLT/2 + par[1];
204 par[2] = (zFLTA *0.5);
205 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
206 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
207 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
208 par[2] = (zFLTB *0.5);
209 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
210 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
211 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
212 par[2] = (zFLTC *0.5);
213 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
214 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
215 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
217 ///////////////// Detector itself //////////////////////
219 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
220 //and the boundary of the strip
221 const Int_t knx = fNpadX; // number of pads along x
222 const Int_t knz = fNpadZ; // number of pads along z
223 const Float_t kspace = fSpace; //cm distance from the front plate of the box
225 Float_t zSenStrip = fZpad*fNpadZ;//cm
226 Float_t stripWidth = zSenStrip + 2*kdeadBound;
230 par[2] = stripWidth*0.5;
232 // new description for strip volume -double stack strip-
233 // -- all constants are expressed in cm
234 // heigth of different layers
235 const Float_t khhony = 0.8 ; // heigth of HONY Layer
236 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
237 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
238 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
239 const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
240 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
241 const Float_t kwsensmz = 2*3.5 ; // cm
242 const Float_t klsensmx = 48*2.5; // cm
243 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
244 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
246 // heigth of the FSTR Volume (the strip volume)
247 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
248 // width of the FSTR Volume (the strip volume)
249 const Float_t kwstripz = 10.;
250 // length of the FSTR Volume (the strip volume)
251 const Float_t klstripx = 122.;
253 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
254 // coordinates of the strip center in the strip reference frame; used for positioning
255 // internal strip volumes
256 Float_t posfp[3]={0.,0.,0.};
259 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
260 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
261 //-- HONY Layer definition
263 parfp[1] = khhony*0.5;
265 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
266 // positioning 2 HONY Layers on FSTR volume
268 posfp[1]=-khstripy*0.5+parfp[1];
269 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
270 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
272 //-- PCB Layer definition
273 parfp[1] = khpcby*0.5;
274 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
275 // positioning 2 PCB Layers on FSTR volume
276 posfp[1]=-khstripy*0.5+khhony+parfp[1];
277 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
278 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
279 // positioning the central PCB layer
280 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
284 //-- MYLAR Layer definition
285 parfp[1] = khmyly*0.5;
286 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
287 // positioning 2 MYLAR Layers on FSTR volume
288 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
289 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
290 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
291 // adding further 2 MYLAR Layers on FSTR volume
292 posfp[1] = khpcby*0.5+parfp[1];
293 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
294 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
297 //-- Graphite Layer definition
298 parfp[1] = khgraphy*0.5;
299 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
300 // positioning 2 Graphite Layers on FSTR volume
301 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
302 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
303 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
304 // adding further 2 Graphite Layers on FSTR volume
305 posfp[1] = khpcby*0.5+khmyly+parfp[1];
306 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
307 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
310 //-- Glass (EXT. +Semi INT.) Layer definition
311 parfp[1] = khglasseiy*0.5;
312 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
313 // positioning 2 Glass Layers on FSTR volume
314 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
315 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
316 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
317 // adding further 2 Glass Layers on FSTR volume
318 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
319 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
320 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
323 //-- Sensitive Mixture Layer definition
324 parfp[0] = klsensmx*0.5;
325 parfp[1] = khsensmy*0.5;
326 parfp[2] = kwsensmz*0.5;
327 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
328 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
329 // positioning 2 gas Layers on FSTR volume
330 // the upper is insensitive freon
331 // while the remaining is sensitive
332 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
333 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
334 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
336 // dividing FSEN along z in knz=2 and along x in knx=48
337 gMC->Gsdvn("FSEZ","FSEN",knz,3);
338 gMC->Gsdvn("FSEX","FSEZ",knx,1);
340 // FPAD volume definition
341 parfp[0] = klpadx*0.5;
342 parfp[1] = khsensmy*0.5;
343 parfp[2] = kwpadz*0.5;
344 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
345 // positioning the FPAD volumes on previous divisions
346 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
348 //// Positioning the Strips (FSTR) in the FLT volumes /////
352 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
354 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
360 ycoor = -14.5 + kspace ; //2 cm over front plate
362 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
364 Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
366 //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
367 gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC
369 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
370 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
374 Int_t upDown = -1; // upDown=-1 -> Upper strip
375 // upDown=+1 -> Lower strip
377 ang = atan(zcoor/radius);
379 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
380 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
382 ycoor = -14.5+ kspace; //2 cm over front plate
383 ycoor += (1-(upDown+1)/2)*gap;
384 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
385 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
386 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
387 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
389 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
390 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
392 j++; //j += 2; // AdC
393 upDown*= -1; // Alternate strips
394 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
395 upDown*gap*TMath::Tan(ang)-
396 (zSenStrip/2)/TMath::Cos(ang);
397 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
399 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
400 upDown*gap*TMath::Tan(ang)+
401 (zSenStrip/2)/TMath::Cos(ang);
404 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
405 upDown*gap*TMath::Tan(ang)-
406 (zSenStrip/2)/TMath::Cos(ang);
408 ang = atan(zcoor/radius);
410 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
411 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
414 ycoor = -14.5+ kspace; //2 cm over front plate
415 ycoor += (1-(upDown+1)/2)*gap;
416 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
417 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
418 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
419 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
421 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
422 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
424 ycoor = -hTof/2.+ kspace;//2 cm over front plate
431 Float_t deadRegion = 1.0;//cm
433 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
434 upDown*gap*TMath::Tan(ang)-
435 (zSenStrip/2)/TMath::Cos(ang)-
436 deadRegion/TMath::Cos(ang);
438 ang = atan(zpos/radius);
440 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
442 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
443 ycoor += (1-(upDown+1)/2)*gap;
444 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
445 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
447 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
448 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
454 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
455 upDown*gap*TMath::Tan(ang)-
456 (zSenStrip/2)/TMath::Cos(ang);
457 ang = atan(zpos/radius);
459 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
461 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
462 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
463 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
464 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
465 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
466 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
468 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
469 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
473 } while (TMath::Abs(ang*kRaddeg)<22.5);
474 //till we reach a tilting angle of 22.5 degrees
476 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
477 zpos = zpos - zSenStrip/TMath::Cos(ang);
478 // this avoid overlaps in between outer strips in plate B
479 Float_t deltaMovingUp=0.8; // [cm]
480 Float_t deltaMovingDown=-0.5; // [cm]
483 ang = atan(zpos/radius);
485 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
487 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
488 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
489 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
490 zpos = zpos - zSenStrip/TMath::Cos(ang);
492 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
493 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
497 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
501 zpos = zpos + zSenStrip/TMath::Cos(ang);
503 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
505 (zSenStrip/2)/TMath::Cos(ang);
509 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
510 ycoor= -hTof*0.5+kspace+gap+deltaGap;
514 ang = atan(zpos/radius);
516 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
518 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
519 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
521 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
522 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
524 zpos = zpos - zSenStrip/TMath::Cos(ang);
525 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
528 ////////// Layers after strips /////////////////
529 // Al Layer thickness (2.3mm) factor 0.7
531 Float_t overSpace = fOverSpc;//cm
534 par[1] = 0.115*0.7; // factor 0.7
535 par[2] = (zFLTA *0.5);
536 ycoor = -yFLT/2 + overSpace + par[1];
537 gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al
538 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
539 par[2] = (zFLTB *0.5);
540 gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al
541 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
542 par[2] = (zFLTC *0.5);
543 gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al
544 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
547 // plexiglass thickness: 1.5 mm ; factor 0.3
550 par[1] = 0.075*0.3; // factor 0.3
551 par[2] = (zFLTA *0.5);
553 gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl.
554 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
555 par[2] = (zFLTB *0.5);
556 gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl.
557 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
558 par[2] = (zFLTC *0.5);
559 gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl.
560 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
565 par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm)
566 par[2] = (zFLTA *0.5);
568 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
569 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
570 par[2] = (zFLTB *0.5);
571 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
572 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
573 par[2] = (zFLTC *0.5);
574 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
575 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
578 // start with cards and cooling tubes
579 // finally, cards, cooling tubes and layer for thermal dispersion
581 // card volume definition
583 // see GEOM200 in GEANT manual
584 AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
590 gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card
591 //alu plate volume definition
594 gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate
597 // central module positioning (FAIA)
598 Float_t cardpos[3], aplpos2, stepforcardA=6.625;
602 Float_t aplpos1 = -2.;
604 for (icard=0; icard<15; ++icard) {
605 cardpos[2]= cardpos[2]+stepforcardA;
606 aplpos2 = cardpos[2]+0.15;
607 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
608 gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
613 // intermediate module positioning (FAIB)
614 Float_t stepforcardB= 7.05;
616 for (icard=0; icard<19; ++icard) {
617 cardpos[2]= cardpos[2]+stepforcardB;
618 aplpos2 = cardpos[2]+0.15;
619 gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
620 gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
624 // outer module positioning (FAIC)
625 Float_t stepforcardC= 8.45238;
627 for (icard=0; icard<20; ++icard) {
628 cardpos[2]= cardpos[2]+stepforcardC;
629 aplpos2 = cardpos[2]+0.15;
630 gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
631 gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
634 // tube volume definition
639 gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel)
643 gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water
644 // positioning water tube into the steel one
645 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
649 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
650 // central module positioning (FAIA)
651 Float_t tubepos[3], tdis=0.6;
653 tubepos[1]= cardpos[1];
654 tubepos[2]= -53.+tdis;
657 for (itub=0; itub<15; ++itub) {
658 tubepos[2]= tubepos[2]+stepforcardA;
659 gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
664 // intermediate module positioning (FAIB)
665 tubepos[2]= -70.5+tdis;
666 for (itub=0; itub<19; ++itub) {
667 tubepos[2]= tubepos[2]+stepforcardB;
668 gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
672 // outer module positioning (FAIC)
673 tubepos[2]= -88.75+tdis;
674 for (itub=0; itub<20; ++itub) {
675 tubepos[2]= tubepos[2]+stepforcardC;
676 gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
682 //_____________________________________________________________________________
683 void AliTOFv1::DrawModule() const
686 // Draw a shaded view of the Time Of Flight version 1
688 // Set everything unseen
689 gMC->Gsatt("*", "seen", -1);
691 // Set ALIC mother transparent
692 gMC->Gsatt("ALIC","SEEN",0);
694 // Set the volumes visible
695 gMC->Gsatt("ALIC","SEEN",0);
697 gMC->Gsatt("FTOA","SEEN",1);
698 gMC->Gsatt("FTOB","SEEN",1);
699 gMC->Gsatt("FTOC","SEEN",1);
700 gMC->Gsatt("FLTA","SEEN",1);
701 gMC->Gsatt("FLTB","SEEN",1);
702 gMC->Gsatt("FLTC","SEEN",1);
703 gMC->Gsatt("FPLA","SEEN",1);
704 gMC->Gsatt("FPLB","SEEN",1);
705 gMC->Gsatt("FPLC","SEEN",1);
706 gMC->Gsatt("FSTR","SEEN",1);
707 gMC->Gsatt("FPEA","SEEN",1);
708 gMC->Gsatt("FPEB","SEEN",1);
709 gMC->Gsatt("FPEC","SEEN",1);
711 gMC->Gsatt("FLZ1","SEEN",0);
712 gMC->Gsatt("FLZ2","SEEN",0);
713 gMC->Gsatt("FLZ3","SEEN",0);
714 gMC->Gsatt("FLX1","SEEN",0);
715 gMC->Gsatt("FLX2","SEEN",0);
716 gMC->Gsatt("FLX3","SEEN",0);
717 gMC->Gsatt("FPAD","SEEN",0);
719 gMC->Gdopt("hide", "on");
720 gMC->Gdopt("shad", "on");
721 gMC->Gsatt("*", "fill", 7);
722 gMC->SetClipBox(".");
723 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
725 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
726 gMC->Gdhead(1111, "Time Of Flight");
727 gMC->Gdman(18, 4, "MAN");
728 gMC->Gdopt("hide","off");
730 //_____________________________________________________________________________
731 void AliTOFv1::DrawDetectorModules()
734 // Draw a shaded view of the TOF detector version 1
737 //Set ALIC mother transparent
738 gMC->Gsatt("ALIC","SEEN",0);
741 //Set volumes visible
744 // Level 1 for TOF volumes
745 gMC->Gsatt("B077","seen",0);
748 //==========> Level 2
750 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
751 gMC->Gsatt("B071","seen",0);
752 gMC->Gsatt("B074","seen",0);
753 gMC->Gsatt("B075","seen",0);
754 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
758 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
759 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
760 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
761 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
762 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
763 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
764 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
765 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
766 gMC->Gsatt("BTO1","seen",0);
770 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
771 gMC->Gsatt("BTO2","seen",0);
774 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
775 gMC->Gsatt("BTO3","seen",0);
777 // ==================> Level 3
778 // Level 3 of B071 / Level 2 of BTO1
779 gMC->Gsatt("FTOC","seen",-2);
780 gMC->Gsatt("FTOB","seen",-2);
781 gMC->Gsatt("FTOA","seen",-2);
783 // Level 3 of B074 / Level 2 of BTO2
784 // -> cfr previous settings
786 // Level 3 of B075 / Level 2 of BTO3
787 // -> cfr previous settings
789 gMC->Gdopt("hide","on");
790 gMC->Gdopt("shad","on");
791 gMC->Gsatt("*", "fill", 5);
792 gMC->SetClipBox(".");
793 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
795 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
796 gMC->Gdhead(1111,"TOF detector V1");
797 gMC->Gdman(18, 4, "MAN");
798 gMC->Gdopt("hide","off");
801 //_____________________________________________________________________________
802 void AliTOFv1::DrawDetectorStrips()
805 // Draw a shaded view of the TOF strips for version 1
808 //Set ALIC mother transparent
809 gMC->Gsatt("ALIC","SEEN",0);
812 //Set volumes visible
814 // Level 1 for TOF volumes
815 gMC->Gsatt("B077","seen",0);
817 //==========> Level 2
819 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
820 gMC->Gsatt("B071","seen",0);
821 gMC->Gsatt("B074","seen",0);
822 gMC->Gsatt("B075","seen",0);
823 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
826 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
827 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
828 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
829 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
830 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
831 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
832 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
833 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
834 gMC->Gsatt("BTO1","seen",0);
836 // ==================> Level 3
837 // Level 3 of B071 / Level 2 of BTO1
838 gMC->Gsatt("FTOC","seen",0);
839 gMC->Gsatt("FTOB","seen",0);
840 gMC->Gsatt("FTOA","seen",0);
842 // Level 3 of B074 / Level 2 of BTO2
843 // -> cfr previous settings
845 // Level 3 of B075 / Level 2 of BTO3
846 // -> cfr previous settings
849 // ==========================> Level 4
850 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
851 gMC->Gsatt("FLTC","seen",0);
852 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
853 gMC->Gsatt("FLTB","seen",0);
854 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
855 gMC->Gsatt("FLTA","seen",0);
857 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
858 // -> cfr previous settings
859 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
860 // -> cfr previous settings
862 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
863 // -> cfr previous settings
865 //======================================> Level 5
866 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
867 gMC->Gsatt("FALC","seen",0); // no children for FALC
868 gMC->Gsatt("FSTR","seen",-2);
869 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
870 gMC->Gsatt("FECC","seen",0); // no children for FECC
871 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
872 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
874 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
875 gMC->Gsatt("FALB","seen",0); // no children for FALB
876 //--> gMC->Gsatt("FSTR","seen",-2);
879 // -> cfr previous settings
880 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
881 gMC->Gsatt("FECB","seen",0); // no children for FECB
882 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
883 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
885 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
886 gMC->Gsatt("FALA","seen",0); // no children for FALB
887 //--> gMC->Gsatt("FSTR","seen",-2);
888 // -> cfr previous settings
889 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
890 gMC->Gsatt("FECA","seen",0); // no children for FECA
891 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
892 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
895 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
896 gMC->Gsatt("BTO2","seen",0);
899 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
900 gMC->Gsatt("BTO3","seen",0);
902 // for others Level 5, cfr. previous settings
904 gMC->Gdopt("hide","on");
905 gMC->Gdopt("shad","on");
906 gMC->Gsatt("*", "fill", 5);
907 gMC->SetClipBox(".");
908 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
910 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
911 gMC->Gdhead(1111,"TOF Strips V1");
912 gMC->Gdman(18, 4, "MAN");
913 gMC->Gdopt("hide","off");
916 //_____________________________________________________________________________
917 void AliTOFv1::CreateMaterials()
920 // Define materials for the Time Of Flight
922 AliTOF::CreateMaterials();
925 //_____________________________________________________________________________
926 void AliTOFv1::Init()
929 // Initialise the detector after the geometry has been defined
931 printf("**************************************"
933 "**************************************\n");
934 printf("\n Version 1 of TOF initialing, "
935 "TOF with holes for PHOS detector\n");
939 fIdFTOA = gMC->VolId("FTOA");
940 fIdFTOB = gMC->VolId("FTOB");
941 fIdFTOC = gMC->VolId("FTOC");
942 fIdFLTA = gMC->VolId("FLTA");
943 fIdFLTB = gMC->VolId("FLTB");
944 fIdFLTC = gMC->VolId("FLTC");
946 printf("**************************************"
948 "**************************************\n");
951 //_____________________________________________________________________________
952 void AliTOFv1::StepManager()
955 // Procedure called at each step in the Time Of Flight
957 TLorentzVector mom, pos;
958 Float_t xm[3],pm[3],xpad[3],ppad[3];
959 Float_t hits[13],phi,phid,z;
961 Int_t sector, plate, padx, padz, strip;
962 Int_t copy, padzid, padxid, stripid, i;
963 Int_t *idtmed = fIdtmed->GetArray()-499;
964 Float_t incidenceAngle;
966 if(gMC->CurrentMedium()==idtmed[513] &&
967 gMC->IsTrackEntering() && gMC->TrackCharge()
968 && gMC->CurrentVolID(copy)==fIdSens)
970 // getting information about hit volumes
972 padzid=gMC->CurrentVolOffID(2,copy);
975 padxid=gMC->CurrentVolOffID(1,copy);
978 stripid=gMC->CurrentVolOffID(4,copy);
981 gMC->TrackPosition(pos);
982 gMC->TrackMomentum(mom);
984 // Double_t NormPos=1./pos.Rho();
985 Double_t normMom=1./mom.Rho();
987 // getting the cohordinates in pad ref system
988 xm[0] = (Float_t)pos.X();
989 xm[1] = (Float_t)pos.Y();
990 xm[2] = (Float_t)pos.Z();
992 pm[0] = (Float_t)mom.X()*normMom;
993 pm[1] = (Float_t)mom.Y()*normMom;
994 pm[2] = (Float_t)mom.Z()*normMom;
996 gMC->Gmtod(xm,xpad,1);
997 gMC->Gmtod(pm,ppad,2);
999 if(ppad[1]>1.) ppad[1]=1.;
1000 if(ppad[1]<-1.) ppad[1]=-1.;
1002 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1007 if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
1008 if (z < (fZlenA*0.5+fZlenB) &&
1009 z > fZlenA*0.5) plate = 1; //4; // AdC
1010 if (z >-(fZlenA*0.5+fZlenB) &&
1011 z < -fZlenA*0.5) plate = 3; //2; // AdC
1012 if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
1013 if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
1015 if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
1016 else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
1017 else strip--; // AdC
1019 if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
1022 if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
1026 if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
1027 else phid = phi*kRaddeg + 360.; // AdC
1028 sector = Int_t (phid/20.);
1036 hits[6] = mom.Rho();
1041 hits[11]= incidenceAngle;
1042 hits[12]= gMC->Edep();
1050 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);