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>
49 #include <TLorentzVector.h>
51 #include <TVirtualMC.h>
56 #include "AliTOFConstants.h" // AdC
61 //_____________________________________________________________________________
65 // Default constructor
69 //_____________________________________________________________________________
70 AliTOFv0::AliTOFv0(const char *name, const char *title)
74 // Standard constructor
77 // Check that FRAME is there otherwise we have no place where to
79 AliModule* frame=gAlice->GetModule("FRAME");
81 Error("Ctor","TOF needs FRAME to be present\n");
84 if(frame->IsVersion()!=1) {
85 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
91 //_____________________________________________________________________________
92 void AliTOFv0::CreateGeometry()
95 // Create geometry for Time Of Flight version 0
99 <img src="picts/AliTOFv0.gif">
103 // Creates common geometry
105 AliTOF::CreateGeometry();
108 //_____________________________________________________________________________
109 void AliTOFv0::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, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
159 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
161 Float_t db = 0.5;//cm
162 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
170 xFST = xFLT-fDeadBndX*2;//cm
172 // Sizes of MRPC pads
174 Float_t yPad = 0.505;//cm
176 // Large not sensitive volumes with Insensitive Freon
180 cout <<"************************* TOF geometry **************************"<<endl;
182 par[2] = (zFLTA *0.5);
183 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
184 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
186 par[2] = (zFLTB * 0.5);
187 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
188 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
190 par[2] = (zFLTC * 0.5);
191 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
192 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
194 ////////// Layers of Aluminum before and after detector //////////
195 ////////// Aluminum Box for Modules (2.0 mm thickness) /////////
196 ////////// lateral walls not simulated
199 ycoor = -yFLT/2 + par[1];
200 par[2] = (zFLTA *0.5);
201 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
202 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
203 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
204 par[2] = (zFLTB *0.5);
205 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
206 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
207 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
208 par[2] = (zFLTC *0.5);
209 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
210 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
211 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
213 ///////////////// Detector itself //////////////////////
214 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
215 //and the boundary of the strip
216 const Int_t knx = fNpadX; // number of pads along x
217 const Int_t knz = fNpadZ; // number of pads along z
218 const Float_t kspace = fSpace; //cm distance from the front plate of the box
220 Float_t zSenStrip = fZpad*fNpadZ;//cm
221 Float_t stripWidth = zSenStrip + 2*kdeadBound;
224 par[2] = stripWidth*0.5;
226 // new description for strip volume -double stack strip-
227 // -- all constants are expressed in cm
228 // heigth of different layers
229 const Float_t khhony = 1. ; // heigth of HONY Layer
230 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
231 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
232 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
233 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
234 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
235 const Float_t kwsensmz = 2*3.5 ; // cm
236 const Float_t klsensmx = 48*2.5; // cm
237 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
238 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
240 // heigth of the FSTR Volume (the strip volume)
241 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
242 // width of the FSTR Volume (the strip volume)
243 const Float_t kwstripz = 10.;
244 // length of the FSTR Volume (the strip volume)
245 const Float_t klstripx = 122.;
247 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
248 // coordinates of the strip center in the strip reference frame; used for positioning
249 // internal strip volumes
250 Float_t posfp[3]={0.,0.,0.};
253 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
254 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
255 //-- HONY Layer definition
257 parfp[1] = khhony*0.5;
259 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
260 // positioning 2 HONY Layers on FSTR volume
262 posfp[1]=-khstripy*0.5+parfp[1];
263 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
264 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
266 //-- PCB Layer definition
267 parfp[1] = khpcby*0.5;
268 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
269 // positioning 2 PCB Layers on FSTR volume
270 posfp[1]=-khstripy*0.5+khhony+parfp[1];
271 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
272 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
273 // positioning the central PCB layer
274 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
278 //-- MYLAR Layer definition
279 parfp[1] = khmyly*0.5;
280 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
281 // positioning 2 MYLAR Layers on FSTR volume
282 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
283 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
284 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
285 // adding further 2 MYLAR Layers on FSTR volume
286 posfp[1] = khpcby*0.5+parfp[1];
287 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
288 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
291 //-- Graphite Layer definition
292 parfp[1] = khgraphy*0.5;
293 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
294 // positioning 2 Graphite Layers on FSTR volume
295 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
296 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
297 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
298 // adding further 2 Graphite Layers on FSTR volume
299 posfp[1] = khpcby*0.5+khmyly+parfp[1];
300 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
301 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
304 //-- Glass (EXT. +Semi INT.) Layer definition
305 parfp[1] = khglasseiy*0.5;
306 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
307 // positioning 2 Glass Layers on FSTR volume
308 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
309 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
310 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
311 // adding further 2 Glass Layers on FSTR volume
312 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
313 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
314 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
317 //-- Sensitive Mixture Layer definition
318 parfp[0] = klsensmx*0.5;
319 parfp[1] = khsensmy*0.5;
320 parfp[2] = kwsensmz*0.5;
321 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
322 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
323 // positioning 2 gas Layers on FSTR volume
324 // the upper is insensitive freon
325 // while the remaining is sensitive
326 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
327 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
328 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
330 // dividing FSEN along z in knz=2 and along x in knx=48
331 gMC->Gsdvn("FSEZ","FSEN",knz,3);
332 gMC->Gsdvn("FSEX","FSEZ",knx,1);
334 // FPAD volume definition
335 parfp[0] = klpadx*0.5;
336 parfp[1] = khsensmy*0.5;
337 parfp[2] = kwpadz*0.5;
338 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
339 // positioning the FPAD volumes on previous divisions
340 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
342 //// Positioning the Strips (FSTR) in the FLT volumes /////
346 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
348 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
354 ycoor = -14.5 + kspace ; //2 cm over front plate
356 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
358 Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
360 //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
361 gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC
363 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
364 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
368 Int_t upDown = -1; // upDown=-1 -> Upper strip
369 // upDown=+1 -> Lower strip
371 ang = atan(zcoor/radius);
373 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
374 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
376 ycoor = -14.5+ kspace; //2 cm over front plate
377 ycoor += (1-(upDown+1)/2)*gap;
378 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
379 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
380 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
381 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
383 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
384 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
387 upDown*= -1; // Alternate strips
388 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
389 upDown*gap*TMath::Tan(ang)-
390 (zSenStrip/2)/TMath::Cos(ang);
391 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
393 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
394 upDown*gap*TMath::Tan(ang)+
395 (zSenStrip/2)/TMath::Cos(ang);
398 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
399 upDown*gap*TMath::Tan(ang)-
400 (zSenStrip/2)/TMath::Cos(ang);
402 ang = atan(zcoor/radius);
404 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
405 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
408 ycoor = -14.5+ kspace; //2 cm over front plate
409 ycoor += (1-(upDown+1)/2)*gap;
410 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
411 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
412 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
413 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
415 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
416 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
418 ycoor = -hTof/2.+ kspace;//2 cm over front plate
425 Float_t deadRegion = 1.0;//cm
427 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
428 upDown*gap*TMath::Tan(ang)-
429 (zSenStrip/2)/TMath::Cos(ang)-
430 deadRegion/TMath::Cos(ang);
432 ang = atan(zpos/radius);
434 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
436 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
437 ycoor += (1-(upDown+1)/2)*gap;
438 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
439 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
441 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
442 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
448 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
449 upDown*gap*TMath::Tan(ang)-
450 (zSenStrip/2)/TMath::Cos(ang);
451 ang = atan(zpos/radius);
453 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
455 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
456 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
457 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
458 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
459 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
460 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
462 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
463 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
467 } while (TMath::Abs(ang*kRaddeg)<22.5);
468 //till we reach a tilting angle of 22.5 degrees
470 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
471 zpos = zpos - zSenStrip/TMath::Cos(ang);
472 // this avoid overlaps in between outer strips in plate B
473 Float_t deltaMovingUp=0.8; // [cm]
474 Float_t deltaMovingDown=-0.5; // [cm]
477 ang = atan(zpos/radius);
479 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
481 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
482 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
483 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
484 zpos = zpos - zSenStrip/TMath::Cos(ang);
486 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
487 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
490 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
494 zpos = zpos + zSenStrip/TMath::Cos(ang);
496 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
498 (zSenStrip/2)/TMath::Cos(ang);
502 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
503 ycoor= -hTof*0.5+kspace+gap+deltaGap;
507 ang = atan(zpos/radius);
509 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
511 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
512 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
514 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
515 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
517 zpos = zpos - zSenStrip/TMath::Cos(ang);
518 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
521 ////////// Layers after strips /////////////////
522 // honeycomb (Polyethilene) Layer after (1.2cm)
524 Float_t overSpace = fOverSpc;//cm
528 par[2] = (zFLTA *0.5);
529 ycoor = -yFLT/2 + overSpace + par[1];
530 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
531 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
532 par[2] = (zFLTB *0.5);
533 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
534 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
535 par[2] = (zFLTC *0.5);
536 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
537 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
539 // Electronics (Cu) after
542 par[1] = 1.43*0.05*0.5; // 5% of X0
543 par[2] = (zFLTA *0.5);
545 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
546 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
547 par[2] = (zFLTB *0.5);
548 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
549 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
550 par[2] = (zFLTC *0.5);
551 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
552 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
554 // cooling WAter after
557 par[1] = 36.1*0.02*0.5; // 2% of X0
558 par[2] = (zFLTA *0.5);
560 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
561 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
562 par[2] = (zFLTB *0.5);
563 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
564 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
565 par[2] = (zFLTC *0.5);
566 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
567 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
572 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
573 par[2] = (zFLTA *0.5);
575 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
576 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
577 par[2] = (zFLTB *0.5);
578 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
579 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
580 par[2] = (zFLTC *0.5);
581 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
582 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
584 //Back Plate honycomb (2cm)
588 ycoor = yFLT/2 - par[1];
589 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
590 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
591 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
592 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
593 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
594 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
598 //_____________________________________________________________________________
599 void AliTOFv0::DrawModule() const
602 // Draw a shaded view of the Time Of Flight version 0
604 // Set everything unseen
605 gMC->Gsatt("*", "seen", -1);
607 // Set ALIC mother transparent
608 gMC->Gsatt("ALIC","SEEN",0);
610 // Set the volumes visible
611 gMC->Gsatt("ALIC","SEEN",0);
613 gMC->Gsatt("FTOA","SEEN",1);
614 gMC->Gsatt("FTOB","SEEN",1);
615 gMC->Gsatt("FTOC","SEEN",1);
616 gMC->Gsatt("FLTA","SEEN",1);
617 gMC->Gsatt("FLTB","SEEN",1);
618 gMC->Gsatt("FLTC","SEEN",1);
619 gMC->Gsatt("FPLA","SEEN",1);
620 gMC->Gsatt("FPLB","SEEN",1);
621 gMC->Gsatt("FPLC","SEEN",1);
622 gMC->Gsatt("FSTR","SEEN",1);
623 gMC->Gsatt("FPEA","SEEN",1);
624 gMC->Gsatt("FPEB","SEEN",1);
625 gMC->Gsatt("FPEC","SEEN",1);
627 gMC->Gsatt("FLZ1","SEEN",0);
628 gMC->Gsatt("FLZ2","SEEN",0);
629 gMC->Gsatt("FLZ3","SEEN",0);
630 gMC->Gsatt("FLX1","SEEN",0);
631 gMC->Gsatt("FLX2","SEEN",0);
632 gMC->Gsatt("FLX3","SEEN",0);
633 gMC->Gsatt("FPAD","SEEN",0);
635 gMC->Gdopt("hide", "on");
636 gMC->Gdopt("shad", "on");
637 gMC->Gsatt("*", "fill", 7);
638 gMC->SetClipBox(".");
639 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
641 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
642 gMC->Gdhead(1111, "Time Of Flight");
643 gMC->Gdman(18, 4, "MAN");
644 gMC->Gdopt("hide","off");
646 //_____________________________________________________________________________
647 void AliTOFv0::DrawDetectorModules()
650 // Draw a shaded view of the TOF detector version 0
653 //Set ALIC mother transparent
654 gMC->Gsatt("ALIC","SEEN",0);
657 //Set volumes visible
660 // Level 1 for TOF volumes
661 gMC->Gsatt("B077","seen",0);
664 //==========> Level 2
666 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
667 gMC->Gsatt("B071","seen",0);
668 gMC->Gsatt("B074","seen",0);
669 gMC->Gsatt("B075","seen",0);
670 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
674 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
675 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
676 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
677 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
678 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
679 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
680 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
681 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
682 gMC->Gsatt("BTO1","seen",0);
686 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
687 gMC->Gsatt("BTO2","seen",0);
690 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
691 gMC->Gsatt("BTO3","seen",0);
693 // ==================> Level 3
694 // Level 3 of B071 / Level 2 of BTO1
695 gMC->Gsatt("FTOC","seen",-2);
696 gMC->Gsatt("FTOB","seen",-2);
697 gMC->Gsatt("FTOA","seen",-2);
699 // Level 3 of B074 / Level 2 of BTO2
700 // -> cfr previous settings
702 // Level 3 of B075 / Level 2 of BTO3
703 // -> cfr previous settings
705 gMC->Gdopt("hide","on");
706 gMC->Gdopt("shad","on");
707 gMC->Gsatt("*", "fill", 5);
708 gMC->SetClipBox(".");
709 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
711 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
712 gMC->Gdhead(1111,"TOF detector V1");
713 gMC->Gdman(18, 4, "MAN");
714 gMC->Gdopt("hide","off");
717 //_____________________________________________________________________________
718 void AliTOFv0::DrawDetectorStrips()
721 // Draw a shaded view of the TOF strips for version 0
724 //Set ALIC mother transparent
725 gMC->Gsatt("ALIC","SEEN",0);
728 //Set volumes visible
730 // Level 1 for TOF volumes
731 gMC->Gsatt("B077","seen",0);
733 //==========> Level 2
735 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
736 gMC->Gsatt("B071","seen",0);
737 gMC->Gsatt("B074","seen",0);
738 gMC->Gsatt("B075","seen",0);
739 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
742 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
743 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
744 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
745 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
746 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
747 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
748 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
749 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
750 gMC->Gsatt("BTO1","seen",0);
752 // ==================> Level 3
753 // Level 3 of B071 / Level 2 of BTO1
754 gMC->Gsatt("FTOC","seen",0);
755 gMC->Gsatt("FTOB","seen",0);
756 gMC->Gsatt("FTOA","seen",0);
758 // Level 3 of B074 / Level 2 of BTO2
759 // -> cfr previous settings
761 // Level 3 of B075 / Level 2 of BTO3
762 // -> cfr previous settings
765 // ==========================> Level 4
766 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
767 gMC->Gsatt("FLTC","seen",0);
768 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
769 gMC->Gsatt("FLTB","seen",0);
770 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
771 gMC->Gsatt("FLTA","seen",0);
773 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
774 // -> cfr previous settings
775 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
776 // -> cfr previous settings
778 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
779 // -> cfr previous settings
781 //======================================> Level 5
782 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
783 gMC->Gsatt("FALC","seen",0); // no children for FALC
784 gMC->Gsatt("FSTR","seen",-2);
785 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
786 gMC->Gsatt("FECC","seen",0); // no children for FECC
787 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
788 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
790 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
791 gMC->Gsatt("FALB","seen",0); // no children for FALB
792 //--> gMC->Gsatt("FSTR","seen",-2);
795 // -> cfr previous settings
796 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
797 gMC->Gsatt("FECB","seen",0); // no children for FECB
798 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
799 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
801 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
802 gMC->Gsatt("FALA","seen",0); // no children for FALB
803 //--> gMC->Gsatt("FSTR","seen",-2);
804 // -> cfr previous settings
805 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
806 gMC->Gsatt("FECA","seen",0); // no children for FECA
807 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
808 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
811 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
812 gMC->Gsatt("BTO2","seen",0);
815 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
816 gMC->Gsatt("BTO3","seen",0);
818 // for others Level 5, cfr. previous settings
820 gMC->Gdopt("hide","on");
821 gMC->Gdopt("shad","on");
822 gMC->Gsatt("*", "fill", 5);
823 gMC->SetClipBox(".");
824 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
826 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
827 gMC->Gdhead(1111,"TOF Strips V1");
828 gMC->Gdman(18, 4, "MAN");
829 gMC->Gdopt("hide","off");
832 //_____________________________________________________________________________
833 void AliTOFv0::CreateMaterials()
836 // Define materials for the Time Of Flight
838 AliTOF::CreateMaterials();
841 //_____________________________________________________________________________
842 void AliTOFv0::Init()
845 // Initialise the detector after the geometry has been defined
847 printf("**************************************"
849 "**************************************\n");
850 printf("\n Version 0 of TOF initialing, "
851 "symmetric TOF - Full Coverage version\n");
855 fIdFTOA = gMC->VolId("FTOA");
856 fIdFTOB = gMC->VolId("FTOB");
857 fIdFTOC = gMC->VolId("FTOC");
858 fIdFLTA = gMC->VolId("FLTA");
859 fIdFLTB = gMC->VolId("FLTB");
860 fIdFLTC = gMC->VolId("FLTC");
863 printf("%s: **************************************"
865 "**************************************\n",ClassName());
869 //_____________________________________________________________________________
870 void AliTOFv0::StepManager()
873 // Procedure called at each step in the Time Of Flight
875 TLorentzVector mom, pos;
876 Float_t xm[3],pm[3],xpad[3],ppad[3];
877 Float_t hits[13],phi,phid,z;
879 Int_t sector, plate, padx, padz, strip;
880 Int_t copy, padzid, padxid, stripid, i;
881 Int_t *idtmed = fIdtmed->GetArray()-499;
882 Float_t incidenceAngle;
884 if(gMC->CurrentMedium()==idtmed[513] &&
885 gMC->IsTrackEntering() && gMC->TrackCharge()
886 && gMC->CurrentVolID(copy)==fIdSens)
888 // getting information about hit volumes
890 padzid=gMC->CurrentVolOffID(2,copy);
893 padxid=gMC->CurrentVolOffID(1,copy);
896 stripid=gMC->CurrentVolOffID(4,copy);
899 gMC->TrackPosition(pos);
900 gMC->TrackMomentum(mom);
902 // Double_t NormPos=1./pos.Rho();
903 Double_t normMom=1./mom.Rho();
905 // getting the cohordinates in pad ref system
906 xm[0] = (Float_t)pos.X();
907 xm[1] = (Float_t)pos.Y();
908 xm[2] = (Float_t)pos.Z();
910 pm[0] = (Float_t)mom.X()*normMom;
911 pm[1] = (Float_t)mom.Y()*normMom;
912 pm[2] = (Float_t)mom.Z()*normMom;
914 gMC->Gmtod(xm,xpad,1);
915 gMC->Gmtod(pm,ppad,2);
917 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
922 if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
923 if (z < (fZlenA*0.5+fZlenB) &&
924 z > fZlenA*0.5) plate = 1; //4; // AdC
925 if (z >-(fZlenA*0.5+fZlenB) &&
926 z < -fZlenA*0.5) plate = 3; //2; // AdC
927 if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
928 if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
930 if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
931 else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
934 if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
937 if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
941 if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
942 else phid = phi*kRaddeg + 360.; // AdC
943 sector = Int_t (phid/20.);
956 hits[11]= incidenceAngle;
957 hits[12]= gMC->Edep();
965 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);