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 Revision 1.2 2006/02/27 18:12:14 decaro
19 Remove in StepManager the dependence of hit indexes from parametrized TOF position
21 Revision 1.1 2005/12/15 08:55:33 decaro
22 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
25 Revision 0.1 2004 November G. Cara Romeo and A. De Caro
26 Implement new TOF geometry version
28 suppress few volume overlaps
29 (in the 4th TOF geometry version),
30 insert the realistic strip numbers and positions
34 ///////////////////////////////////////////////////////////////////////////////
36 // This class contains the functions for version 5 of the Time Of Flight //
39 // VERSION WITH 5 MODULES AND TILTED STRIPS //
41 // FULL COVERAGE VERSION + OPTION for PHOS holes //
46 <img src="picts/AliTOFv5T0Class.gif"> //
50 ///////////////////////////////////////////////////////////////////////////////
52 #include "Riostream.h"
55 #include "TVirtualMC.h"
57 #include <TGeometry.h>
58 #include <TLorentzVector.h>
61 #include <TVirtualMC.h>
69 #include "AliTOFGeometry.h"
70 #include "AliTOFGeometryV5.h"
71 #include "AliTOFv5T0.h"
75 //_____________________________________________________________________________
76 AliTOFv5T0::AliTOFv5T0()
79 // Default constructor
83 //_____________________________________________________________________________
84 AliTOFv5T0::AliTOFv5T0(const char *name, const char *title)
85 : AliTOF(name,title,"tzero")
88 // Standard constructor
91 // Check that FRAME is there otherwise we have no place where to
95 AliModule* frame=gAlice->GetModule("FRAME");
97 AliFatal("TOF needs FRAME to be present");
100 if (fTOFGeometry) delete fTOFGeometry;
101 fTOFGeometry = new AliTOFGeometryV5();
103 if(frame->IsVersion()==1) {
104 AliInfo(Form("Frame version %d", frame->IsVersion()));
105 AliInfo("Full Coverage for TOF");
108 AliInfo(Form("Frame version %d", frame->IsVersion()));
109 AliInfo("TOF with Holes for PHOS");
112 fTOFGeometry->SetHoles(fTOFHoles);
114 //AliTOF::fTOFGeometry = fTOFGeometry;
117 TDirectory* saveDir = gDirectory;
118 gAlice->GetRunLoader()->CdGAFile();
119 fTOFGeometry->Write("TOFgeometry");
124 //____________________________________________________________________________
125 void AliTOFv5T0::BuildGeometry()
128 // Build TOF ROOT geometry for the ALICE event display
131 const int kColorTOF = 27;
134 top = gAlice->GetGeometry()->GetNode("alice");
136 // Position the different copies
137 const Float_t krTof =(fTOFGeometry->Rmax()+fTOFGeometry->Rmin())/2.;
138 const Float_t khTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin();
139 const Int_t kNTof = fTOFGeometry->NSectors();
140 const Float_t kangle = k2PI/kNTof;
142 const Float_t kInterCentrModBorder1 = 49.5;
143 const Float_t kInterCentrModBorder2 = 57.5;
147 // define offset for nodes
148 Float_t zOffsetB = (fTOFGeometry->ZlenA()*0.5 + (kInterCentrModBorder1+kInterCentrModBorder2)*0.5)*0.5;
149 Float_t zOffsetA = 0.;
150 // Define TOF basic volume
152 char nodeName0[7], nodeName1[7], nodeName2[7];
153 char nodeName3[7], nodeName4[7], rotMatNum[7];
156 new TBRIK("S_TOF_B","TOF box","void",
157 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
158 new TBRIK("S_TOF_C","TOF box","void",
159 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
161 new TBRIK("S_TOF_A","TOF box","void",
162 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenA()*0.5);
164 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
167 sprintf(rotMatNum,"rot50%i",nodeNum);
168 sprintf(nodeName0,"FTO00%i",nodeNum);
169 sprintf(nodeName1,"FTO10%i",nodeNum);
170 sprintf(nodeName2,"FTO20%i",nodeNum);
171 sprintf(nodeName3,"FTO30%i",nodeNum);
172 sprintf(nodeName4,"FTO40%i",nodeNum);
175 sprintf(rotMatNum,"rot5%i",nodeNum);
176 sprintf(nodeName0,"FTO0%i",nodeNum);
177 sprintf(nodeName1,"FTO1%i",nodeNum);
178 sprintf(nodeName2,"FTO2%i",nodeNum);
179 sprintf(nodeName3,"FTO3%i",nodeNum);
180 sprintf(nodeName4,"FTO4%i",nodeNum);
183 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
184 ang = (4.5-nodeNum) * kangle;
188 node = new TNode(nodeName2,nodeName2,"S_TOF_B", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetB,rotMatNum);
189 node->SetLineColor(kColorTOF);
193 node = new TNode(nodeName3,nodeName3,"S_TOF_C", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
194 node->SetLineColor(kColorTOF);
199 node = new TNode(nodeName4,nodeName4,"S_TOF_A", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetA,rotMatNum);
200 node->SetLineColor(kColorTOF);
202 } // end loop on nodeNum
206 //_____________________________________________________________________________
207 void AliTOFv5T0::CreateGeometry()
210 // Create geometry for Time Of Flight version 0
214 <img src="picts/AliTOFv5T0.gif">
218 // Creates common geometry
220 AliTOF::CreateGeometry();
224 //_____________________________________________________________________________
225 void AliTOFv5T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenA,
229 const Float_t kPi = TMath::Pi();
231 const Float_t kInterCentrModBorder1 = 49.5;
232 const Float_t kInterCentrModBorder2 = 57.5;
233 const Float_t kExterInterModBorder1 = 196.0;
234 const Float_t kExterInterModBorder2 = 203.5;
236 const Float_t kLengthExInModBorder = 4.7;
237 const Float_t kLengthInCeModBorder = 7.0;
239 const Float_t khAlWall = 0.1;
241 // module wall thickness
242 const Float_t kModuleWallThickness = 0.3;
244 // 1.5 cm Al honeycomb layer between strips and cards
245 const Float_t kHoneycombLayerThickness = 1.5;
247 AliDebug(2,Form("zlenA*0.5 = %d", zlenA*0.5));
248 AliDebug(1, "************************* TOF geometry **************************");
250 // Definition of the Time Of Fligh Resistive Plate Chambers
251 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
253 Float_t ycoor, zcoor;
255 Int_t *idtmed = fIdtmed->GetArray()-499;
260 par[2] = zlenA * 0.5;
261 gMC->Gsvolu("FTOA", "BOX ", idtmed[503], par, 3); // fibre glass
264 par[2] = (zlenA*0.5 - kInterCentrModBorder1)*0.5;
265 gMC->Gsvolu("FTOB", "BOX ", idtmed[503], par, 3);
266 gMC->Gsvolu("FTOC", "BOX ", idtmed[503], par, 3);
269 // Positioning of modules
271 //AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
272 AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,270.); // adc
276 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
277 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
280 zcor3 = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
281 gMC->Gspos("FTOB", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
282 gMC->Gspos("FTOC", 0, "BTO2", 0,-zcor3, 0, idrotm[0], "ONLY");
284 else gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
286 // Large not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
288 Float_t xFLT, yFLT, zFLTA;
290 xFLT = xtof - kModuleWallThickness*2.;
291 yFLT = ytof - kModuleWallThickness*2.;
292 zFLTA = zlenA - kModuleWallThickness*2.;
298 gMC->Gsvolu("FLTA", "BOX ", idtmed[507], par, 3); // Freon mix ok
299 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
302 par[2] = (zlenA*0.5 - kInterCentrModBorder1-kModuleWallThickness)*0.5;
303 gMC->Gsvolu("FLTB", "BOX ", idtmed[507], par, 3); // Freon mix
304 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., kModuleWallThickness*0.5, 0, "ONLY");
305 gMC->Gsvolu("FLTC", "BOX ", idtmed[507], par, 3); // Freon mix
306 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., -kModuleWallThickness*0.5, 0, "ONLY");
309 // Layer of Aluminum after detector
311 par[1] = khAlWall*0.5;
314 ycoor = (-yFLT + khAlWall)*0.5;
315 gMC->Gsvolu("FALA", "BOX ", idtmed[505], par, 3); // Alluminium ok
316 gMC->Gspos ("FALA", 0, "FLTA", 0., -ycoor, 0., 0, "ONLY");
319 par[2] = (zlenA*0.5 - kInterCentrModBorder2-kModuleWallThickness)*0.5;
320 gMC->Gsvolu("FALB", "BOX ", idtmed[505], par, 3); // Alluminium
321 gMC->Gspos ("FALB", 1, "FLTB", 0.,-ycoor, -(kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
322 gMC->Gspos ("FALB", 2, "FLTC", 0.,-ycoor, (kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
325 Float_t y0, alpha, beta, tgbe, trpa[11], dy, zcoo;
328 // wall between central and intermediate modules
329 y0 = kLengthInCeModBorder;
330 zcoor = kInterCentrModBorder1;
331 zcoo = kInterCentrModBorder2;
332 alpha = TMath::ATan((dy-2.*y0)/(zcoo-zcoor));
333 beta = (kPi*0.5-alpha)*0.5;
334 tgbe = TMath::Tan(beta);
335 trpa[0] = xFLT*0.5;//par[0];
338 trpa[3] = kModuleWallThickness;
339 trpa[4] = (y0-kModuleWallThickness*tgbe)*0.5;
340 trpa[5] = (y0+kModuleWallThickness*tgbe)*0.5;
341 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg;
342 trpa[7] = kModuleWallThickness;
343 trpa[8] = (y0-kModuleWallThickness*tgbe)*0.5;
344 trpa[9] = (y0+kModuleWallThickness*tgbe)*0.5;
345 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg;
347 gMC->Gsvolu("FWZ1","TRAP", idtmed[503], trpa, 11); // fibre glass
349 AliMatrix (idrotm[1],90., 90.,180.,0.,90.,180.);
350 ycoor = -dy + y0*0.5;
351 gMC->Gspos("FWZ1", 1,"FLTA",0.,ycoor, zcoor,idrotm[1],"ONLY");
353 AliMatrix (idrotm[4],90., 90., 0.,0.,90., 0.);
354 gMC->Gspos("FWZ1", 2,"FLTA",0.,ycoor,-zcoor,idrotm[4],"ONLY");
357 Float_t y0B = y0 - kModuleWallThickness*0.5*tgbe;
358 Float_t ycoorB = ycoor - kModuleWallThickness*0.25/tgbe;
359 trpa[0] = xFLT*0.5;//par[0];
362 trpa[3] = kModuleWallThickness*0.5;
363 trpa[4] = (y0B-kModuleWallThickness*0.5*tgbe)*0.5;
364 trpa[5] = (y0B+kModuleWallThickness*0.5*tgbe)*0.5;
365 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg;
366 trpa[7] = kModuleWallThickness*0.5;
367 trpa[8] = (y0B-kModuleWallThickness*0.5*tgbe)*0.5;
368 trpa[9] = (y0B+kModuleWallThickness*0.5*tgbe)*0.5;
369 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg;
370 gMC->Gsvolu("FZ1B","TRAP", idtmed[503], trpa, 11); // fibre glass
371 gMC->Gspos("FZ1B", 5,"FLTB",0.,ycoorB,-zcoor+(zlenA*0.5+kInterCentrModBorder1)*0.5-kModuleWallThickness,idrotm[4],"ONLY");
372 gMC->Gspos("FZ1B", 6,"FLTC",0.,ycoorB,+zcoor-(zlenA*0.5+kInterCentrModBorder1)*0.5+kModuleWallThickness,idrotm[1],"ONLY");
375 AliMatrix (idrotm[2],90.,270., 0.,0.,90.,180.);
377 gMC->Gspos("FWZ1", 3,"FLTA",0.,ycoor, zcoo,idrotm[2],"ONLY");
378 AliMatrix (idrotm[5],90.,270.,180.,0.,90., 0.);
379 gMC->Gspos("FWZ1", 4,"FLTA",0.,ycoor,-zcoo,idrotm[5],"ONLY");
382 Float_t y0B = y0 + kModuleWallThickness*0.5*tgbe;
383 Float_t ycoorB = ycoor - kModuleWallThickness*0.25/tgbe;
384 trpa[0] = xFLT*0.5;//par[0];
387 trpa[3] = kModuleWallThickness*0.5;
388 trpa[4] = (y0B-kModuleWallThickness*0.5*tgbe)*0.5;
389 trpa[5] = (y0B+kModuleWallThickness*0.5*tgbe)*0.5;
390 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg;
391 trpa[7] = kModuleWallThickness*0.5;
392 trpa[8] = (y0B-kModuleWallThickness*0.5*tgbe)*0.5;
393 trpa[9] = (y0B+kModuleWallThickness*0.5*tgbe)*0.5;
394 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg;
395 gMC->Gsvolu("FZ1C","TRAP", idtmed[503], trpa, 11); // fibre glass
396 gMC->Gspos("FZ1C", 7,"FLTB",0.,ycoorB,-zcoo+(zlenA*0.5+kInterCentrModBorder1)*0.5-kModuleWallThickness,idrotm[5],"ONLY");
397 gMC->Gspos("FZ1C", 8,"FLTC",0.,ycoorB, zcoo-(zlenA*0.5+kInterCentrModBorder1)*0.5+kModuleWallThickness,idrotm[2],"ONLY");
400 trpa[0] = 0.5*(zcoo-zcoor)/TMath::Cos(alpha);
401 trpa[1] = kModuleWallThickness;
402 trpa[2] = xFLT*0.5;//par[0];
403 trpa[3] = -beta*kRaddeg;
406 gMC->Gsvolu("FWZ2","PARA", idtmed[503], trpa, 6); // fibre glass
407 AliMatrix (idrotm[3], alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
408 gMC->Gspos("FWZ2", 1,"FLTA",0.,-dy*0.5, (zcoo+zcoor)*0.5,idrotm[3],"ONLY");
409 AliMatrix (idrotm[6],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90., 0.);
410 gMC->Gspos("FWZ2", 2,"FLTA",0.,-dy*0.5,-(zcoo+zcoor)*0.5,idrotm[6],"ONLY");
413 trpa[0] = 0.5*(zcoo-zcoor)/TMath::Cos(alpha);
414 trpa[1] = kModuleWallThickness*0.5;
415 trpa[2] = xFLT*0.5;//par[0];
416 trpa[3] = -beta*kRaddeg;
419 gMC->Gsvolu("FZ2B","PARA", idtmed[503], trpa, 6); // fibre glass
420 gMC->Gspos("FZ2B", 3,"FLTB",0.,-dy*0.5-kModuleWallThickness*0.5/tgbe,-(zcoo+zcoor)*0.5+(zlenA*0.5+kInterCentrModBorder1)*0.5-kModuleWallThickness,idrotm[6],"ONLY");
421 gMC->Gspos("FZ2B", 4,"FLTC",0.,-dy*0.5-kModuleWallThickness*0.5/tgbe,+(zcoo+zcoor)*0.5-(zlenA*0.5+kInterCentrModBorder1)*0.5+kModuleWallThickness,idrotm[3],"ONLY");
424 // wall between intermediate and lateral modules
425 y0 = kLengthExInModBorder;//4.7;
426 zcoor = kExterInterModBorder1;//196.;
427 zcoo = kExterInterModBorder2;//203.5;
428 alpha = TMath::ATan((dy-2.*y0)/(zcoo-zcoor));
429 beta = (kPi*0.5-alpha)*0.5;
430 tgbe = TMath::Tan(beta);
431 trpa[0] = xFLT*0.5;//par[0];
434 trpa[3] = kModuleWallThickness;
435 trpa[4] = (y0-kModuleWallThickness*tgbe)*0.5;
436 trpa[5] = (y0+kModuleWallThickness*tgbe)*0.5;
437 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg;
438 trpa[7] = kModuleWallThickness;
439 trpa[8] = (y0-kModuleWallThickness*tgbe)*0.5;
440 trpa[9] = (y0+kModuleWallThickness*tgbe)*0.5;
441 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg;
442 gMC->Gsvolu("FWZ3","TRAP", idtmed[503], trpa, 11); // fibre glass
444 gMC->Gspos("FWZ3", 1,"FLTA",0.,ycoor, zcoor,idrotm[5],"ONLY");
445 gMC->Gspos("FWZ3", 2,"FLTA",0.,ycoor,-zcoor,idrotm[2],"ONLY");
448 gMC->Gspos("FWZ3", 5,"FLTB",0.,ycoor,-zcoor+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[2],"ONLY");
449 gMC->Gspos("FWZ3", 6,"FLTC",0.,ycoor, zcoor-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[5],"ONLY");
452 gMC->Gspos("FWZ3", 3,"FLTA",0.,ycoor, zcoo,idrotm[4],"ONLY");
453 gMC->Gspos("FWZ3", 4,"FLTA",0.,ycoor,-zcoo,idrotm[1],"ONLY");
456 gMC->Gspos("FWZ3", 7,"FLTB",0.,ycoor,-zcoo+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[1],"ONLY");
457 gMC->Gspos("FWZ3", 8,"FLTC",0.,ycoor, zcoo-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[4],"ONLY");
460 trpa[0] = 0.5*(zcoo-zcoor)/TMath::Cos(alpha);
461 trpa[1] = kModuleWallThickness;
462 trpa[2] = xFLT*0.5;//par[0];
463 trpa[3] = -beta*kRaddeg;
466 gMC->Gsvolu("FWZ4","PARA", idtmed[503], trpa, 6); // fibre glass
467 AliMatrix (idrotm[3],alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
468 AliMatrix (idrotm[6],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90.,0.);
469 gMC->Gspos("FWZ4", 1,"FLTA",0.,-dy*0.5, (zcoo+zcoor)*0.5,idrotm[6],"ONLY");
470 gMC->Gspos("FWZ4", 2,"FLTA",0.,-dy*0.5,-(zcoo+zcoor)*0.5,idrotm[3],"ONLY");
473 gMC->Gspos("FWZ4", 3,"FLTB",0.,-dy*0.5,-(zcoo+zcoor)*0.5+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[3],"ONLY");
474 gMC->Gspos("FWZ4", 4,"FLTC",0.,-dy*0.5, (zcoo+zcoor)*0.5-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[6],"ONLY");
477 ///////////////// Detector itself //////////////////////
479 const Int_t knx = fTOFGeometry->NpadX(); // number of pads along x
480 const Int_t knz = fTOFGeometry->NpadZ(); // number of pads along z
481 const Float_t kPadX = fTOFGeometry->XPad(); // pad length along x
482 const Float_t kPadZ = fTOFGeometry->ZPad(); // pad length along z
484 // new description for strip volume -double stack strip-
485 // -- all constants are expressed in cm
486 // heigth of different layers
487 const Float_t khhony = 1.0 ; // heigth of HONY Layer
488 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
489 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
490 const Float_t khglfy = 0.285 ; // heigth of GLASS+FISHLINE Layer
491 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
492 const Float_t kwhonz = 8.1 ; // z dimension of HONEY Layer
493 const Float_t kwpcbz1 = 10.6 ; // z dimension of PCB Lower Layer
494 const Float_t kwpcbz2 = 11.6 ; // z dimension of PCB Upper Layer
495 const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
496 const Float_t kwrglz = 8. ; // z dimension of RED GLASS Layer
497 const Float_t kwglfz = 7. ; // z dimension of GLASS+FISHLN Layer
498 const Float_t klsensmx = knx*kPadX; // length of Sensitive Layer
499 const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer // ADC
500 const Float_t kwsensmz = knz*kPadZ; // width of Sensitive Layer
502 // heigth of the FSTR Volume (the strip volume)
503 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;
505 // width of the FSTR Volume (the strip volume)
506 const Float_t kwstripz = kwcpcbz;
507 // length of the FSTR Volume (the strip volume)
508 const Float_t klstripx = fTOFGeometry->StripLength();//122.;
510 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
511 // Coordinates of the strip center in the strip reference frame;
512 // used for positioning internal strip volumes
513 Float_t posfp[3]={0.,0.,0.};
515 // FSTR volume definition-filling this volume with non sensitive Gas Mixture
516 gMC->Gsvolu("FSTR","BOX",idtmed[507],parfp,3); // Freon mix
518 //-- HONY Layer definition
519 parfp[1] = khhony*0.5;
520 parfp[2] = kwhonz*0.5;
521 gMC->Gsvolu("FHON","BOX",idtmed[501],parfp,3); // honeycomb (Nomex)
522 // positioning 2 HONY Layers on FSTR volume
523 posfp[1] =-khstripy*0.5+parfp[1];
524 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
525 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
527 //-- PCB Layer definition
528 parfp[1] = khpcby*0.5;
529 parfp[2] = kwpcbz1*0.5;
530 gMC->Gsvolu("FPC1","BOX",idtmed[502],parfp,3); // G10
531 parfp[2] = kwpcbz2*0.5;
532 gMC->Gsvolu("FPC2","BOX",idtmed[502],parfp,3); // G10
533 // positioning 2 PCB Layers on FSTR volume
534 posfp[1] =-khstripy*0.5+khhony+parfp[1];
535 gMC->Gspos("FPC1",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
536 gMC->Gspos("FPC2",1,"FSTR",0., posfp[1],0.,0,"ONLY");
538 //-- central PCB layer definition
539 parfp[1] = khcpcby*0.5;
540 parfp[2] = kwcpcbz*0.5;
541 gMC->Gsvolu("FPCB","BOX",idtmed[502],parfp,3); // G10
542 // positioning the central PCB layer
543 gMC->Gspos("FPCB",1,"FSTR",0.,0.,0.,0,"ONLY");
546 Float_t parfs[3] = {klsensmx*0.5, khsensmy*0.5, kwsensmz*0.5};
547 gMC->Gsvolu("FSEN","BOX",idtmed[508],parfs,3); // sensitive ...
548 // dividing FSEN along z in knz=2 and along x in knx=48
549 gMC->Gsdvn("FSEZ","FSEN",knz,3);
550 gMC->Gsdvn("FPAD","FSEZ",knx,1);
551 // positioning a Sensitive layer inside FPCB
552 gMC->Gspos("FSEN",1,"FPCB",0.,0.,0.,0,"ONLY");
554 //-- RED GLASS Layer definition
555 parfp[1] = khrgly*0.5;
556 parfp[2] = kwrglz*0.5;
557 gMC->Gsvolu("FRGL","BOX",idtmed[509],parfp,3); // glass
558 // positioning 4 RED GLASS Layers on FSTR volume
559 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
560 gMC->Gspos("FRGL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
561 gMC->Gspos("FRGL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
562 posfp[1] = (khcpcby+khrgly)*0.5;
563 gMC->Gspos("FRGL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
564 gMC->Gspos("FRGL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
566 //-- GLASS+FISHLINE Layer definition
567 parfp[1] = khglfy*0.5;
568 parfp[2] = kwglfz*0.5;
569 gMC->Gsvolu("FGLF","BOX",idtmed[504],parfp,3);
571 // positioning 2 GLASS+FISHLINE Layers on FSTR volume
572 posfp[1] = (khcpcby+khglfy)*0.5+khrgly;
573 gMC->Gspos("FGLF",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
574 gMC->Gspos("FGLF",2,"FSTR",0., posfp[1],0.,0,"ONLY");
577 // Positioning the Strips (FSTR) in the FLT volumes
578 Int_t maxStripNumbers [5] ={fTOFGeometry->NStripC(),
579 fTOFGeometry->NStripB(),
580 fTOFGeometry->NStripA(),
581 fTOFGeometry->NStripB(),
582 fTOFGeometry->NStripC()};
584 Int_t totalStrip = 0;
585 Float_t zpos, ypos, ang;
586 for(Int_t iplate =0; iplate < fTOFGeometry->NPlates(); iplate++){
587 if (iplate>0) totalStrip += maxStripNumbers[iplate-1];
588 for(Int_t istrip =0; istrip < maxStripNumbers[iplate]; istrip++){
590 ang = fTOFGeometry->GetAngles(iplate,istrip);
591 AliDebug(1, Form(" iplate = %1i, istrip = %2i ---> ang = %f", iplate, istrip, ang));
593 if (ang>0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90., ang, 90.);
594 else if (ang==0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.,90., 0., 0.);
595 else if (ang<0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90.,-ang,270.);
598 zpos = fTOFGeometry->GetDistances(iplate,istrip);
599 ypos = fTOFGeometry->GetHeights(iplate,istrip);
601 gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTA",0.,ypos,-zpos,idrotm[istrip+totalStrip+1], "ONLY");
604 if (istrip+totalStrip+1>53) gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTC",0.,ypos,-zpos-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
605 if (istrip+totalStrip+1<39) gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTB",0.,ypos,-zpos+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
610 // 1.5 cm Al honeycomb layer between strips and cards
612 par[1] = kHoneycombLayerThickness*0.5;
614 ycoor = kHoneycombLayerThickness*0.5;
615 gMC->Gsvolu("FPEA", "BOX ", idtmed[506], par, 3); // Al honeycomb ok giovanni cara romeo
616 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
619 par[2] = (zlenA*0.5 - kInterCentrModBorder2-kModuleWallThickness)*0.5;
620 ycoor = kHoneycombLayerThickness*0.5;
621 gMC->Gsvolu("FPEB", "BOX ", idtmed[506], par, 3); // Al honeycomb ok giovanni cara romeo
622 gMC->Gspos ("FPEB", 1, "FLTB", 0., ycoor, -(kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
623 gMC->Gspos ("FPEB", 2, "FLTC", 0., ycoor, (kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
627 ycoor += kHoneycombLayerThickness*0.5;
629 par[1] = (yFLT*0.5-kHoneycombLayerThickness-khAlWall)*0.5;
631 ycoor += (yFLT*0.5-kHoneycombLayerThickness-khAlWall)*0.5;
632 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
633 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
636 par[2] = (zlenA*0.5 - kInterCentrModBorder2 - kModuleWallThickness)*0.5;
637 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
638 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, -(kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
639 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
640 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, (kInterCentrModBorder2-kInterCentrModBorder1)*0.5, 0, "ONLY");
643 // start with cards and cooling tubes
644 // finally, cards, cooling tubes and layer for thermal dispersion
647 // see GEOM200 in GEANT manual
649 //AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
653 // card volume definition
654 cardpar[0]= xFLT*0.5;
657 gMC->Gsvolu("FCAR", "BOX ", idtmed[502], cardpar, 3); // PCB Card
659 //alu plate volume definition
662 gMC->Gsvolu("FALP", "BOX ", idtmed[505], cardpar, 3); // Alu Plate
664 // tube volume definition
669 gMC->Gsvolu("FTUB", "TUBE", idtmed[511], tubepar, 3); // cooling tubes (steel)
674 gMC->Gsvolu("FITU", "TUBE", idtmed[510], tubepar, 3); // cooling water
675 // positioning water tube into the steel one
676 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
679 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
681 // central module positioning
682 Float_t cardpos[3], aplpos2;
683 Float_t stepforcardA=6.625;
685 Float_t aplpos1 = -2.;
690 // tubepos= -53.+tdis;
692 for (icard=39; icard<54; ++icard) {
693 cardpos[2]= cardpos[2]+stepforcardA;
694 aplpos2 = cardpos[2]+0.15;
695 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
696 gMC->Gspos("FALP",icard,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
697 gMC->Gspos("FTUB",icard,"FAIA", 0.,cardpos[1],cardpos[2]+tdis,idrotm[99],"ONLY");
700 // intermediate module positioning
701 Float_t stepforcardB= 7.05;
705 for (icard=20; icard<39; ++icard) {
706 cardpos[2]= cardpos[2]+stepforcardB;
707 aplpos2 = cardpos[2]+0.15;
709 gMC->Gspos("FCAR",icard+34,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
710 gMC->Gspos("FALP",icard+34,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
711 gMC->Gspos("FTUB",icard+34,"FAIA", 0.,cardpos[1], cardpos[2]+tdis,idrotm[99],"ONLY");
712 gMC->Gspos("FCAR",58-icard,"FAIA",cardpos[0],cardpos[1], -cardpos[2], 0,"ONLY");
713 gMC->Gspos("FALP",58-icard,"FAIA",cardpos[0], aplpos1, -aplpos2, 0,"ONLY");
714 gMC->Gspos("FTUB",58-icard,"FAIA", 0.,cardpos[1],-cardpos[2]-tdis,idrotm[99],"ONLY");
717 gMC->Gspos("FCAR",icard+34+182,"FAIC",cardpos[0],cardpos[1], cardpos[2]-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
718 gMC->Gspos("FALP",icard+34+182,"FAIC",cardpos[0], aplpos1, aplpos2-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
719 gMC->Gspos("FTUB",icard+34+182,"FAIC", 0.,cardpos[1], cardpos[2]+tdis-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
720 gMC->Gspos("FCAR",58-icard+ 91,"FAIB",cardpos[0],cardpos[1], -cardpos[2]+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
721 gMC->Gspos("FALP",58-icard+ 91,"FAIB",cardpos[0], aplpos1, -aplpos2+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
722 gMC->Gspos("FTUB",58-icard+ 91,"FAIB", 0.,cardpos[1],-cardpos[2]-tdis+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
727 // outer module positioning
728 Float_t stepforcardC= 8.45238;
731 for (icard=1; icard<20; ++icard) {
732 cardpos[2]= cardpos[2]+stepforcardC;
733 aplpos2 = cardpos[2]+0.15;
735 gMC->Gspos("FCAR",icard+72,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
736 gMC->Gspos("FALP",icard+72,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
737 gMC->Gspos("FTUB",icard+72,"FAIA", 0.,cardpos[1], cardpos[2]+tdis,idrotm[99],"ONLY");
738 gMC->Gspos("FCAR",20-icard,"FAIA",cardpos[0],cardpos[1], -cardpos[2], 0,"ONLY");
739 gMC->Gspos("FALP",20-icard,"FAIA",cardpos[0], aplpos1, -aplpos2, 0,"ONLY");
740 gMC->Gspos("FTUB",20-icard,"FAIA", 0.,cardpos[1],-cardpos[2]-tdis,idrotm[99],"ONLY");
743 gMC->Gspos("FCAR",icard+72+182,"FAIC",cardpos[0],cardpos[1], cardpos[2]-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
744 gMC->Gspos("FALP",icard+72+182,"FAIC",cardpos[0], aplpos1, aplpos2-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
745 gMC->Gspos("FTUB",icard+72+182,"FAIC", 0.,cardpos[1], cardpos[2]+tdis-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
746 gMC->Gspos("FCAR",20-icard+ 91,"FAIB",cardpos[0],cardpos[1], -cardpos[2]+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
747 gMC->Gspos("FALP",20-icard+ 91,"FAIB",cardpos[0], aplpos1, -aplpos2+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
748 gMC->Gspos("FTUB",20-icard+ 91,"FAIB", 0.,cardpos[1],-cardpos[2]-tdis+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
753 //_____________________________________________________________________________
754 void AliTOFv5T0::DrawModule() const
757 // Draw a shaded view of the Time Of Flight version 4
760 // Set everything unseen
761 gMC->Gsatt("*", "seen", -1);
764 //Set volumes visible
767 //Set ALIC mother transparent
768 gMC->Gsatt("ALIC","SEEN", 0);
771 // Level 1 for TOF volumes
772 gMC->Gsatt("B077","seen", 0);
775 // Level 2 for TOF volumes
776 gMC->Gsatt("B071","seen", 0);
777 gMC->Gsatt("B074","seen", 0);
778 gMC->Gsatt("B075","seen", 0);
779 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
780 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
783 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
784 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
785 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
786 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
787 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
789 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
790 gMC->Gsatt("BTO1","seen", 0);
793 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
794 gMC->Gsatt("BTO2","seen", 0);
797 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
798 gMC->Gsatt("BTO3","seen", 0);
800 // Level 3 of B071, B074 and B075
801 gMC->Gsatt("FTOA","SEEN", 0);
802 if (fTOFHoles) gMC->Gsatt("FTOB","SEEN", 0);
804 // Level 4 of B071, B074 and B075
805 gMC->Gsatt("FLTA","SEEN", 0);
806 if (fTOFHoles) gMC->Gsatt("FLTB","SEEN",0);
807 if (fTOFHoles) gMC->Gsatt("FLTC","SEEN",0);
809 // Level 5 of B071, B074 and B075
810 gMC->Gsatt("FAIA","SEEN",-1); // all FAIA sub-levels skipped -
811 if (fTOFHoles) gMC->Gsatt("FAIB","SEEN",-1); // all FAIB sub-levels skipped -
812 if (fTOFHoles) gMC->Gsatt("FAIC","SEEN",-1); // all FAIC sub-levels skipped -
814 gMC->Gsatt("FALA","SEEN", 0);
815 if (fTOFHoles) gMC->Gsatt("FALB","SEEN", 0);
817 gMC->Gsatt("FPEA","SEEN", 1);
818 if (fTOFHoles) gMC->Gsatt("FPEB","SEEN", 1);
820 gMC->Gsatt("FSTR","SEEN",-1); // all FSTR sub-levels skipped -
822 gMC->Gsatt("FWZ1","SEEN", 0);
823 gMC->Gsatt("FWZ2","SEEN", 0);
824 gMC->Gsatt("FWZ3","SEEN", 0);
825 gMC->Gsatt("FWZ4","SEEN", 0);
827 gMC->Gsatt("FZ1B","SEEN", 0);
828 gMC->Gsatt("FZ1C","SEEN", 0);
829 gMC->Gsatt("FZ2B","SEEN", 0);
832 gMC->Gdopt("hide", "on");
833 gMC->Gdopt("shad", "on");
834 gMC->Gsatt("*", "fill", 7);
835 gMC->SetClipBox(".");
836 gMC->SetClipBox("*", 100, 1000, 100, 1000, 100, 1000);
838 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
839 gMC->Gdhead(1111, "Time Of Flight");
840 gMC->Gdman(18, 3, "MAN");
841 gMC->Gdopt("hide","off");
843 //_____________________________________________________________________________
844 void AliTOFv5T0::DrawDetectorModules()
847 // Draw a shaded view of the TOF detector version 4
850 // Set everything unseen
851 gMC->Gsatt("*", "seen", -1);
854 //Set volumes visible
857 //Set ALIC mother transparent
858 gMC->Gsatt("ALIC","SEEN", 0);
861 // Level 1 for TOF volumes
862 gMC->Gsatt("B077","seen", 0);
865 // Level 2 for TOF volumes
866 gMC->Gsatt("B071","seen", 0);
867 gMC->Gsatt("B074","seen", 0);
868 gMC->Gsatt("B075","seen", 0);
869 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
870 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
873 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
874 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
875 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
876 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
877 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
879 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
880 gMC->Gsatt("BTO1","seen", 0);
883 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
884 gMC->Gsatt("BTO2","seen", 0);
887 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
888 gMC->Gsatt("BTO3","seen", 0);
890 // Level 3 of B071, B075 and B074
891 gMC->Gsatt("FTOA","seen",-2); // all FTOA sub-levels skipped -
893 gMC->Gsatt("FTOB","seen",-2); // all FTOB sub-levels skipped -
894 gMC->Gsatt("FTOC","seen",-2); // all FTOC sub-levels skipped -
897 gMC->Gdopt("hide","on");
898 gMC->Gdopt("shad","on");
899 gMC->Gsatt("*", "fill", 5);
900 gMC->SetClipBox(".");
901 gMC->SetClipBox("*", 100, 1000, 100, 1000, 0, 1000);
903 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
904 gMC->Gdhead(1111,"TOF detector");
905 gMC->Gdman(18, 3, "MAN");
906 gMC->Gdopt("hide","off");
909 //_____________________________________________________________________________
910 void AliTOFv5T0::DrawDetectorStrips()
913 // Draw a shaded view of the TOF strips for version 4
916 // Set everything unseen
917 gMC->Gsatt("*", "seen", -1);
920 //Set volumes visible
923 //Set ALIC mother transparent
924 gMC->Gsatt("ALIC","SEEN", 0);
927 // Level 1 for TOF volumes
928 gMC->Gsatt("B077","seen", 0);
931 // Level 2 for TOF volumes
932 gMC->Gsatt("B071","seen", 0);
933 gMC->Gsatt("B074","seen", 0);
934 gMC->Gsatt("B075","seen", 0);
935 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
936 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
939 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
940 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
941 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
942 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
943 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
945 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
946 gMC->Gsatt("BTO1","seen", 0);
949 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
950 gMC->Gsatt("BTO2","seen", 0);
953 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
954 gMC->Gsatt("BTO3","seen", 0);
956 // Level 3 of B071, B074 and B075
957 gMC->Gsatt("FTOA","SEEN", 0);
959 gMC->Gsatt("FTOB","SEEN", 0);
960 gMC->Gsatt("FTOC","SEEN", 0);
963 // Level 4 of B071, B074 and B075
964 gMC->Gsatt("FLTA","SEEN", 0);
966 gMC->Gsatt("FLTB","SEEN", 0);
967 gMC->Gsatt("FLTC","SEEN", 0);
970 // Level 5 of B071, B074 and B075
971 gMC->Gsatt("FAIA","SEEN",-1); // all FAIA sub-levels skipped -
973 gMC->Gsatt("FAIB","SEEN",-1); // all FAIB sub-levels skipped -
974 gMC->Gsatt("FAIC","SEEN",-1); // all FAIC sub-levels skipped -
977 gMC->Gsatt("FALA","SEEN", 0);
978 if (fTOFHoles) gMC->Gsatt("FALB","SEEN", 0);
980 gMC->Gsatt("FPEA","SEEN", 0);
981 if (fTOFHoles) gMC->Gsatt("FPEB","SEEN", 0);
983 gMC->Gsatt("FSTR","SEEN",-2); // all FSTR sub-levels skipped -
985 gMC->Gsatt("FWZ1","SEEN", 0);
986 gMC->Gsatt("FWZ2","SEEN", 0);
987 gMC->Gsatt("FWZ3","SEEN", 0);
988 gMC->Gsatt("FWZ4","SEEN", 0);
990 gMC->Gsatt("FZ1B","SEEN", 0);
991 gMC->Gsatt("FZ1C","SEEN", 0);
992 gMC->Gsatt("FZ2B","SEEN", 0);
999 gMC->Gsatt("FALP","SEEN",0);
1000 gMC->Gsatt("FCAR","SEEN",0);
1001 gMC->Gsatt("FTUB","SEEN",-1); // all FTUB sub-levels skipped -
1004 gMC->Gsatt("FITU","SEEN",0);
1009 gMC->Gsatt("FGLF","SEEN",0);
1010 gMC->Gsatt("FHON","SEEN",0);
1011 gMC->Gsatt("FPC1","SEEN",0);
1012 gMC->Gsatt("FPC2","SEEN",0);
1013 gMC->Gsatt("FPCB","SEEN",0);
1014 gMC->Gsatt("FRGL","SEEN",0);
1016 // Level 2 of FPCB => Level 3 of FSTR
1017 gMC->Gsatt("FSEN","SEEN",0);
1018 gMC->Gsatt("FSEZ","SEEN",0);
1019 gMC->Gsatt("FPAD","SEEN",1);
1022 gMC->Gdopt("hide","on");
1023 gMC->Gdopt("shad","on");
1024 gMC->Gsatt("*", "fill", 5);
1025 gMC->SetClipBox(".");
1026 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
1027 gMC->DefaultRange();
1028 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1029 gMC->Gdhead(1111,"TOF Strips");
1030 gMC->Gdman(18, 3, "MAN");
1031 gMC->Gdopt("hide","off");
1034 //_____________________________________________________________________________
1035 void AliTOFv5T0::CreateMaterials()
1038 // Define materials for the Time Of Flight
1041 //AliTOF::CreateMaterials();
1043 Int_t isxfld = gAlice->Field()->Integ();
1044 Float_t sxmgmx = gAlice->Field()->Max();
1045 Float_t we[7], ae[7], na[7], fr[7], vl[7];
1049 //--- Quartz (SiO2) to simulate float glass
1050 // density tuned to have correct float glass
1052 Float_t aq[2] = { 28.0855,15.9994 };
1053 Float_t zq[2] = { 14.,8. };
1054 Float_t wq[2] = { 1.,2. };
1055 Float_t dq = 2.55; // std value: 2.2
1059 Float_t anox[4] = {12.01,1.01,16.00,14.01};
1060 Float_t znox[4] = { 6., 1., 8., 7.};
1061 Float_t wnox[4] = {14., 22., 2., 2.};
1062 Float_t dnox = 0.048;
1066 Float_t ag10[4] = {28.09,12.01,1.01,16.00};
1067 Float_t zg10[4] = {14., 6., 1., 8.};
1070 for (i = 0; i < nlmatg10; ++i) {
1086 MaterialMixer(we,ae,na,fr,vl,5);
1092 Float_t densg10 = 1.7;
1095 Float_t awa[2] = { 1., 16. };
1096 Float_t zwa[2] = { 1., 8. };
1097 Float_t wwa[2] = { 2., 1. };
1102 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1103 Float_t zsteel[4] = { 26.,24.,28.,14. };
1104 Float_t wsteel[4] = { .715,.18,.1,.005 };
1107 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1108 Float_t zAir[4]={6.,7.,8.,18.};
1109 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1110 Float_t dAir = 1.20479E-3;
1113 Float_t afg[4] = {28.09,16.00,12.01,1.01};
1114 Float_t zfg[4] = {14., 8., 6., 1.};
1115 Float_t wfg[4] = {0.12906,0.29405,0.51502,0.06187};
1116 Float_t dfg = 1.111;
1119 // --- Freon C2F4H2 + SF6
1120 Float_t afre[4]= {12.01,1.01,19.00,32.07};
1121 Float_t zfre[4]= { 6., 1., 9., 16.};
1122 Float_t wfre[4]= {0.21250,0.01787,0.74827,0.021355};
1123 Float_t densfre= 0.00375;
1126 char namat[15] = " ";
1127 Float_t ama[2], zma[2], dma, radl, absl, buf[1];
1130 AliMixture ( 0, "Air$", aAir, zAir, dAir, 4, wAir);
1131 AliMixture ( 1, "Nomex$", anox, znox, dnox, nnox, wnox);
1132 AliMixture ( 2, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
1133 AliMixture ( 3, "fibre glass$", afg, zfg, dfg, nfg, wfg);
1134 AliMaterial( 4, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
1135 AliMaterial( 5, "Al honeycomb$", 26.98, 13., 0.0496, 483., 2483.);
1136 AliMixture ( 6, "Freon$", afre, zfre, densfre, nfre, wfre);
1137 AliMixture ( 7, "Glass$", aq, zq, dq, nq, wq);
1139 // get freon and glass
1140 gMC->Gfmate((*fIdmate)[6],namat,ama[0],zma[0],dma,radl,absl,buf,nbuf);
1141 gMC->Gfmate((*fIdmate)[7],namat,ama[1],zma[1],dma,radl,absl,buf,nbuf);
1144 Float_t wgfr[2]= {0.0011,0.9989};
1145 Float_t dgfr = 1.434;
1147 AliMixture ( 8, "glass-freon$", ama, zma, dgfr, ngfr, wgfr);
1148 AliMixture ( 9, "Water$", awa, zwa, dwa, nwa, wwa);
1149 AliMixture (10, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
1151 Float_t epsil, stmin, deemax, stemax;
1154 // EPSIL = 0.1 ! Tracking precision,
1155 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
1156 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
1160 epsil = .001; // Tracking precision,
1161 stemax = -1.; // Maximum displacement for multiple scattering
1162 deemax = -.3; // Maximum fractional energy loss, DLS
1165 AliMedium( 1, "Air$", 0, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1166 AliMedium( 2,"Nomex$", 1, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1167 AliMedium( 3,"G10$", 2, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1168 AliMedium( 4,"fibre glass$", 3, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1169 AliMedium( 5,"glass-freon$", 8, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1170 AliMedium( 6,"Al Frame$", 4, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1171 AliMedium( 7,"Al honeycomb$", 5, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1172 AliMedium( 8,"Fre$", 6, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1173 AliMedium( 9,"PCB-S$", 2, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1174 AliMedium(10,"Glass$", 7, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1175 AliMedium(11,"Water$", 9, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1176 AliMedium(12,"STEEL$", 10, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1179 //_____________________________________________________________________________
1180 void AliTOFv5T0::Init()
1183 // Initialise the detector after the geometry has been defined
1185 AliDebug(1, "**************************************"
1187 "**************************************");
1188 AliDebug(1, " Version 4 of TOF initialing, "
1189 "symmetric TOF - Full Coverage version");
1193 fIdFTOA = gMC->VolId("FTOA");
1195 fIdFTOB = gMC->VolId("FTOB");
1196 fIdFTOC = gMC->VolId("FTOC");
1198 fIdFLTA = gMC->VolId("FLTA");
1200 fIdFLTB = gMC->VolId("FLTB");
1201 fIdFLTC = gMC->VolId("FLTC");
1204 AliDebug(1, "**************************************"
1206 "**************************************");
1209 //_____________________________________________________________________________
1210 void AliTOFv5T0::StepManager()
1214 // Procedure called at each step in the Time Of Flight
1217 TLorentzVector mom, pos;
1218 Float_t xm[3],pm[3],xpad[3],ppad[3];
1221 Int_t sector, plate, padx, padz, strip;
1222 Int_t copy, padzid, padxid, stripid, i;
1223 Int_t *idtmed = fIdtmed->GetArray()-499;
1224 Float_t incidenceAngle;
1226 const char * path71 = "B071";
1227 const char * path75 = "B075";
1228 const char * path74 = "B074";
1229 const char* volpath;
1234 gMC->IsTrackEntering()
1235 && gMC->TrackCharge()
1236 //&& gMC->GetMedium()==idtmed[508]
1237 && gMC->CurrentMedium()==idtmed[508]
1238 && gMC->CurrentVolID(copy)==fIdSens
1242 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1244 // getting information about hit volumes
1246 padzid=gMC->CurrentVolOffID(1,copy);
1250 padxid=gMC->CurrentVolOffID(0,copy);
1254 stripid=gMC->CurrentVolOffID(4,copy);
1258 gMC->TrackPosition(pos);
1259 gMC->TrackMomentum(mom);
1261 Double_t normMom=1./mom.Rho();
1263 // getting the coordinates in pad ref system
1265 xm[0] = (Float_t)pos.X();
1266 xm[1] = (Float_t)pos.Y();
1267 xm[2] = (Float_t)pos.Z();
1269 pm[0] = (Float_t)mom.X()*normMom;
1270 pm[1] = (Float_t)mom.Y()*normMom;
1271 pm[2] = (Float_t)mom.Z()*normMom;
1273 gMC->Gmtod(xm,xpad,1); // from MRS to DRS: coordinates convertion
1274 gMC->Gmtod(pm,ppad,2); // from MRS to DRS: direction cosinus convertion
1277 if (TMath::Abs(ppad[1])>1) {
1278 AliWarning("Abs(ppad) > 1");
1279 ppad[1]=TMath::Sign((Float_t)1,ppad[1]);
1281 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1284 if (strip < fTOFGeometry->NStripC()) {
1288 else if (strip >= fTOFGeometry->NStripC() &&
1289 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB()) {
1291 strip = strip - fTOFGeometry->NStripC();
1293 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() &&
1294 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA()) {
1296 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB();
1298 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() &&
1299 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() + fTOFGeometry->NStripB()) {
1301 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA();
1305 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA() - fTOFGeometry->NStripB();
1308 volpath=gMC->CurrentVolOffName(8);
1309 index=gMC->CurrentVolOffID(8,copy);
1313 if(strcmp(path71,volpath)==0 && index <6) sector=12+index;
1314 if(strcmp(path71,volpath)==0 && index >=6) sector=index-3;
1315 if(strcmp(path75,volpath)==0) sector=index-1;
1316 if(strcmp(path74,volpath)==0) sector=10+index;
1323 hits[6] = mom.Rho();
1328 hits[11]= incidenceAngle;
1329 hits[12]= gMC->Edep();
1330 hits[13]= gMC->TrackLength();
1338 AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
1341 //-------------------------------------------------------------------
1342 void AliTOFv5T0::MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n) {
1343 // a[] atomic weights vector (in)
1344 // (atoms present in more compound appear separately)
1345 // m[] number of corresponding atoms in the mixture (in)
1346 // d[] fraction of the compound relative to the corresponding atoms (in)
1347 // s[] further possible weights " " " " (in)
1349 for (Int_t i = 0; i < n; ++i) {
1350 p[i] = a[i]*m[i]*d[i]*s[i];
1353 for (Int_t i = 0; i < n; ++i) {
1355 // AliInfo(Form((\n weight[%i] = %f (,i,p[i]));