]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFv4T0.cxx
Do not get main runloader from gAlice
[u/mrichter/AliRoot.git] / TOF / AliTOFv4T0.cxx
CommitLineData
d599d913 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
88cb7938 16/* $Id$ */
d599d913 17
18///////////////////////////////////////////////////////////////////////////////
da3d3acd 19// //
d599d913 20// This class contains the functions for version 4 of the Time Of Flight //
21// detector. //
da3d3acd 22// //
23// VERSION WITH 5 MODULES AND TILTED STRIPS //
24// //
0f4a7374 25// FULL COVERAGE VERSION +OPTION for PHOS holes //
da3d3acd 26// //
27// Author: //
28// Fabrizio Pierella //
29// University of Bologna - Italy //
30// //
31// //
32//Begin_Html //
33/* //
34<img src="picts/AliTOFv4T0Class.gif"> //
35*/ //
36//End_Html //
d599d913 37// //
38///////////////////////////////////////////////////////////////////////////////
39
0e46b9ae 40#include "TBRIK.h"
41#include "TGeometry.h"
42#include "TLorentzVector.h"
43#include "TNode.h"
d3c7bfac 44#include "TVirtualMC.h"
d599d913 45
88cb7938 46#include "AliConst.h"
0e46b9ae 47#include "AliLog.h"
d3c7bfac 48#include "AliMagF.h"
0e46b9ae 49#include "AliMC.h"
50#include "AliRun.h"
e6add757 51#include "AliTrackReference.h"
d3c7bfac 52
53#include "AliTOFGeometry.h"
54#include "AliTOFGeometryV4.h"
55#include "AliTOFv4T0.h"
56
0e46b9ae 57extern TDirectory *gDirectory;
58extern TVirtualMC *gMC;
59
60extern AliRun *gAlice;
61
d599d913 62ClassImp(AliTOFv4T0)
d3c7bfac 63
d599d913 64//_____________________________________________________________________________
655e379f 65 AliTOFv4T0::AliTOFv4T0():
66 fIdFTOA(-1),
67 fIdFTOB(-1),
68 fIdFTOC(-1),
69 fIdFLTA(-1),
70 fIdFLTB(-1),
71 fIdFLTC(-1),
72 fTOFHoles(kFALSE)
d599d913 73{
74 //
75 // Default constructor
76 //
77}
78
79//_____________________________________________________________________________
655e379f 80AliTOFv4T0::AliTOFv4T0(const char *name, const char *title):
81 AliTOF(name,title,"tzero"),
82 fIdFTOA(-1),
83 fIdFTOB(-1),
84 fIdFTOC(-1),
85 fIdFLTA(-1),
86 fIdFLTB(-1),
87 fIdFLTC(-1),
88 fTOFHoles(kFALSE)
d599d913 89{
90 //
91 // Standard constructor
92 //
93 //
94 // Check that FRAME is there otherwise we have no place where to
95 // put TOF
0f4a7374 96
97
0e46b9ae 98 AliModule* frame = (AliModule*)gAlice->GetModule("FRAME");
d599d913 99 if(!frame) {
d076c8d5 100 AliFatal("TOF needs FRAME to be present");
0f4a7374 101 } else{
102
103 if (fTOFGeometry) delete fTOFGeometry;
d3c7bfac 104 fTOFGeometry = new AliTOFGeometryV4();
d599d913 105
0f4a7374 106 if(frame->IsVersion()==1) {
d076c8d5 107 AliInfo(Form("Frame version %d", frame->IsVersion()));
108 AliInfo("Full Coverage for TOF");
0f4a7374 109 fTOFHoles=false;}
110 else {
d076c8d5 111 AliInfo(Form("Frame version %d", frame->IsVersion()));
112 AliInfo("TOF with Holes for PHOS");
0f4a7374 113 fTOFHoles=true;}
114 }
74ea065c 115 fTOFGeometry->SetHoles(fTOFHoles);
d3c7bfac 116
117 // Save the geometry
118 TDirectory* saveDir = gDirectory;
2c3fb292 119 AliRunLoader::GetRunLoader()->CdGAFile();
d3c7bfac 120 fTOFGeometry->Write("TOFgeometry");
121 saveDir->cd();
122
0f4a7374 123}
d599d913 124
125//_____________________________________________________________________________
126void AliTOFv4T0::CreateGeometry()
127{
128 //
129 // Create geometry for Time Of Flight version 0
130 //
131 //Begin_Html
132 /*
133 <img src="picts/AliTOFv4T0.gif">
134 */
135 //End_Html
136 //
137 // Creates common geometry
138 //
139 AliTOF::CreateGeometry();
140}
141
0f4a7374 142
d599d913 143//_____________________________________________________________________________
144void AliTOFv4T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
145 Float_t zlenB, Float_t zlenA, Float_t ztof0)
146{
147 //
148 // Definition of the Time Of Fligh Resistive Plate Chambers
149 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
d3c7bfac 150
0f4a7374 151 Float_t ycoor;
d599d913 152 Float_t par[3];
153 Int_t *idtmed = fIdtmed->GetArray()-499;
154 Int_t idrotm[100];
155 Int_t nrot = 0;
0f4a7374 156
d3c7bfac 157 Float_t radius = fTOFGeometry->Rmin()+2.;//cm
0f4a7374 158
d599d913 159 par[0] = xtof * 0.5;
160 par[1] = ytof * 0.5;
161 par[2] = zlenC * 0.5;
162 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
163 par[2] = zlenB * 0.5;
164 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
165 par[2] = zlenA * 0.5;
166 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
43808676 167
168
169 // Positioning of modules
170
171 Float_t zcor1 = ztof0 - zlenC*0.5;
172 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
173 Float_t zcor3 = 0.;
174
175 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
176 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
0f4a7374 177
43808676 178 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
179 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
180 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
181 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
182 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
183 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
184
185 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
186 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
187 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
188 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
189 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
190 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
191
192 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
0f4a7374 193 if(!fTOFHoles)gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
43808676 194 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
195
0f4a7374 196
7e6dce66 197 Float_t db = 0.5; // cm
d599d913 198 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
43808676 199
d3c7bfac 200 xFLT = fTOFGeometry->StripLength();
d599d913 201 yFLT = ytof;
202 zFLTA = zlenA;
203 zFLTB = zlenB;
204 zFLTC = zlenC;
43808676 205
d3c7bfac 206 xFST = xFLT - dynamic_cast<AliTOFGeometryV4*>(fTOFGeometry)->DeadBndX()*2.; // cm
43808676 207
208 // Sizes of MRPC pads
209
7e6dce66 210 Float_t yPad = 0.505; //cm
d599d913 211
43808676 212 // Large not sensitive volumes with Insensitive Freon
d599d913 213 par[0] = xFLT*0.5;
214 par[1] = yFLT*0.5;
215
d076c8d5 216 AliDebug(1, "************************* TOF geometry **************************");
43808676 217
d599d913 218 par[2] = (zFLTA *0.5);
219 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
220 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
43808676 221
d599d913 222 par[2] = (zFLTB * 0.5);
223 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
224 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
43808676 225
d599d913 226 par[2] = (zFLTC * 0.5);
227 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
228 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
43808676 229
230 ///// Layers of Aluminum before and after detector /////
231 ///// Aluminum Box for Modules (1.8 mm thickness) /////
232 ///// lateral walls not simulated for the time being
0f4a7374 233 // const Float_t khAlWall = 0.18;
43808676 234 // fp to be checked
235 const Float_t khAlWall = 0.11;
d599d913 236 par[0] = xFLT*0.5;
7e6dce66 237 par[1] = khAlWall/2.; // cm
d599d913 238 ycoor = -yFLT/2 + par[1];
239 par[2] = (zFLTA *0.5);
240 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
241 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
242 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
243 par[2] = (zFLTB *0.5);
244 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
245 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
246 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
247 par[2] = (zFLTC *0.5);
248 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
249 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
250 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
251
43808676 252 ///////////////// Detector itself //////////////////////
253
d3c7bfac 254 const Float_t kdeadBound = dynamic_cast<AliTOFGeometryV4*>(fTOFGeometry)->DeadBndZ(); //cm non-sensitive between the pad edge
43808676 255 //and the boundary of the strip
d3c7bfac 256 const Int_t knx = fTOFGeometry->NpadX(); // number of pads along x
257 const Int_t knz = fTOFGeometry->NpadZ(); // number of pads along z
43808676 258
d3c7bfac 259 Float_t zSenStrip = fTOFGeometry->ZPad() * fTOFGeometry->NpadZ(); // cm
d599d913 260 Float_t stripWidth = zSenStrip + 2*kdeadBound;
43808676 261
d599d913 262 par[0] = xFLT*0.5;
da3d3acd 263 par[1] = yPad*0.5;
d599d913 264 par[2] = stripWidth*0.5;
265
43808676 266 // new description for strip volume -double stack strip-
267 // -- all constants are expressed in cm
268 // heigth of different layers
269 const Float_t khhony = 0.8 ; // heigth of HONY Layer
270 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
d599d913 271 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
272 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
7e6dce66 273 const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
d599d913 274 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
275 const Float_t kwsensmz = 2*3.5 ; // cm
276 const Float_t klsensmx = 48*2.5; // cm
277 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
278 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
279
280 // heigth of the FSTR Volume (the strip volume)
281 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
282 // width of the FSTR Volume (the strip volume)
283 const Float_t kwstripz = 10.;
284 // length of the FSTR Volume (the strip volume)
285 const Float_t klstripx = 122.;
286
287 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
7e6dce66 288 // Coordinates of the strip center in the strip reference frame;
0f4a7374 289 // used for positioninG internal strip volumes
da3d3acd 290 Float_t posfp[3]={0.,0.,0.};
43808676 291
d599d913 292
0f4a7374 293 // FSTR volume definition-filling this volume with non sensitive Gas Mixture
d599d913 294 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
295 //-- HONY Layer definition
43808676 296 // parfp[0] = -1;
d599d913 297 parfp[1] = khhony*0.5;
43808676 298 // parfp[2] = -1;
d599d913 299 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
300 // positioning 2 HONY Layers on FSTR volume
43808676 301
d599d913 302 posfp[1]=-khstripy*0.5+parfp[1];
303 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
304 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
43808676 305
d599d913 306 //-- PCB Layer definition
0f4a7374 307
d599d913 308 parfp[1] = khpcby*0.5;
309 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
310 // positioning 2 PCB Layers on FSTR volume
311 posfp[1]=-khstripy*0.5+khhony+parfp[1];
312 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
313 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
314 // positioning the central PCB layer
315 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
43808676 316
317
318
d599d913 319 //-- MYLAR Layer definition
0f4a7374 320
d599d913 321 parfp[1] = khmyly*0.5;
322 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
323 // positioning 2 MYLAR Layers on FSTR volume
da3d3acd 324 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
d599d913 325 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
326 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
327 // adding further 2 MYLAR Layers on FSTR volume
328 posfp[1] = khpcby*0.5+parfp[1];
329 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
330 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
43808676 331
332
d599d913 333 //-- Graphite Layer definition
0f4a7374 334
d599d913 335 parfp[1] = khgraphy*0.5;
336 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
337 // positioning 2 Graphite Layers on FSTR volume
338 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
339 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
340 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
341 // adding further 2 Graphite Layers on FSTR volume
342 posfp[1] = khpcby*0.5+khmyly+parfp[1];
343 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
344 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
43808676 345
346
d599d913 347 //-- Glass (EXT. +Semi INT.) Layer definition
0f4a7374 348
d599d913 349 parfp[1] = khglasseiy*0.5;
350 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
351 // positioning 2 Glass Layers on FSTR volume
352 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
353 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
354 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
355 // adding further 2 Glass Layers on FSTR volume
356 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
357 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
358 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
43808676 359
d599d913 360
361 //-- Sensitive Mixture Layer definition
0f4a7374 362
d599d913 363 parfp[0] = klsensmx*0.5;
364 parfp[1] = khsensmy*0.5;
365 parfp[2] = kwsensmz*0.5;
366 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
367 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
368 // positioning 2 gas Layers on FSTR volume
369 // the upper is insensitive freon
370 // while the remaining is sensitive
371 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
372 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
373 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
43808676 374
d599d913 375 // dividing FSEN along z in knz=2 and along x in knx=48
0f4a7374 376
d599d913 377 gMC->Gsdvn("FSEZ","FSEN",knz,3);
378 gMC->Gsdvn("FSEX","FSEZ",knx,1);
379
380 // FPAD volume definition
0f4a7374 381
da3d3acd 382 parfp[0] = klpadx*0.5;
d599d913 383 parfp[1] = khsensmy*0.5;
384 parfp[2] = kwpadz*0.5;
385 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
386 // positioning the FPAD volumes on previous divisions
387 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
388
da3d3acd 389
0f4a7374 390 ///////////////////Positioning A module//////////////////////////
da3d3acd 391
0f4a7374 392
393 for(Int_t istrip =0; istrip < fTOFGeometry->NStripA(); istrip++){
394
395 Float_t ang = fTOFGeometry->GetAngles(2,istrip);
396 AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
43808676 397 ang /= kRaddeg;
0f4a7374 398 Float_t zpos = tan(ang)*radius;
399 Float_t ypos= fTOFGeometry->GetHeights(2,istrip);
d3c7bfac 400 gMC->Gspos("FSTR",fTOFGeometry->NStripA()-istrip,"FLTA",0.,ypos, zpos,idrotm[0], "ONLY");
d076c8d5 401 AliDebug(1, Form("y = %f, z = %f, , z coord = %f, Rot ang = %f, St. %2i",ypos,zpos,tan(ang)*radius ,ang*kRaddeg,istrip));
da3d3acd 402 }
0f4a7374 403
404
405 ///////////////////Positioning B module//////////////////////////
406
407 for(Int_t istrip =0; istrip < fTOFGeometry->NStripB(); istrip++){
408
409 Float_t ang = fTOFGeometry->GetAngles(3,istrip);
410 AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
43808676 411 ang /= kRaddeg;
0f4a7374 412 Float_t zpos = tan(ang)*radius+(zFLTA*0.5+zFLTB*0.5+db);
413 Float_t ypos= fTOFGeometry->GetHeights(3,istrip);
414 gMC->Gspos("FSTR",istrip+1,"FLTB",0.,ypos, zpos,idrotm[nrot], "ONLY");
d076c8d5 415 AliDebug(1, Form("y = %f, z = %f, , z coord = %f, Rot ang = %f, St. %2i",ypos,zpos,tan(ang)*radius,ang*kRaddeg,istrip));
0f4a7374 416 }
417
43808676 418
0f4a7374 419 ///////////////////Positioning C module//////////////////////////
420
421 for(Int_t istrip =0; istrip < fTOFGeometry->NStripC(); istrip++){
422
423 Float_t ang = fTOFGeometry->GetAngles(4,istrip);
424 AliMatrix (idrotm[0],90.,0.,90.-ang,90.,-ang, 90.);
43808676 425 ang /= kRaddeg;
0f4a7374 426 Float_t zpos = tan(ang)*radius+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
427 Float_t ypos= fTOFGeometry->GetHeights(4,istrip);
428 gMC->Gspos("FSTR",istrip+1,"FLTC",0.,ypos, zpos,idrotm[nrot], "ONLY");
d076c8d5 429 AliDebug(1, Form("y = %f, z = %f, z coord = %f, Rot ang = %f, St. %2i",ypos,zpos,tan(ang)*radius,ang*kRaddeg,istrip));
0f4a7374 430 }
431
43808676 432 ////////// Layers after strips /////////////////
433 // Al Layer thickness (2.3mm) factor 0.7
434
d3c7bfac 435 Float_t overSpace = dynamic_cast<AliTOFGeometryV4*>(fTOFGeometry)->OverSpc();//cm
43808676 436
d599d913 437 par[0] = xFLT*0.5;
43808676 438 par[1] = 0.115*0.7; // factor 0.7
d599d913 439 par[2] = (zFLTA *0.5);
440 ycoor = -yFLT/2 + overSpace + par[1];
43808676 441 gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al
d599d913 442 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
443 par[2] = (zFLTB *0.5);
43808676 444 gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al
d599d913 445 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
446 par[2] = (zFLTC *0.5);
43808676 447 gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al
d599d913 448 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
43808676 449
450
451 // plexiglass thickness: 1.5 mm ; factor 0.3
0f4a7374 452
d599d913 453 ycoor += par[1];
454 par[0] = xFLT*0.5;
43808676 455 par[1] = 0.075*0.3; // factor 0.3
d599d913 456 par[2] = (zFLTA *0.5);
457 ycoor += par[1];
43808676 458 gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl.
d599d913 459 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
460 par[2] = (zFLTB *0.5);
43808676 461 gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl.
d599d913 462 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
463 par[2] = (zFLTC *0.5);
43808676 464 gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl.
d599d913 465 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
43808676 466
467 // frame of Air
0f4a7374 468
d599d913 469 ycoor += par[1];
470 par[0] = xFLT*0.5;
43808676 471 par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm)
d599d913 472 par[2] = (zFLTA *0.5);
473 ycoor += par[1];
474 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
475 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
476 par[2] = (zFLTB *0.5);
477 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
478 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
479 par[2] = (zFLTC *0.5);
480 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
481 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
43808676 482
483
484 // start with cards and cooling tubes
485 // finally, cards, cooling tubes and layer for thermal dispersion
486 // 3 volumes
487 // card volume definition
488
489 // see GEOM200 in GEANT manual
0f4a7374 490
491
43808676 492 AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
493
494 Float_t cardpar[3];
495 cardpar[0]= 61.;
496 cardpar[1]= 5.;
497 cardpar[2]= 0.1;
498 gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card
499 //alu plate volume definition
500 cardpar[1]= 3.5;
501 cardpar[2]= 0.05;
502 gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate
503
504
505 // central module positioning (FAIA)
506 Float_t cardpos[3], aplpos2, stepforcardA=6.625;
507 cardpos[0]= 0.;
508 cardpos[1]= -0.5;
509 cardpos[2]= -53.;
510 Float_t aplpos1 = -2.;
511 Int_t icard;
0f4a7374 512 for (icard=0; icard < fTOFGeometry->NStripA(); ++icard) {
43808676 513 cardpos[2]= cardpos[2]+stepforcardA;
514 aplpos2 = cardpos[2]+0.15;
da3d3acd 515 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
43808676 516 gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
517
518 }
519
520
521 // intermediate module positioning (FAIB)
522 Float_t stepforcardB= 7.05;
523 cardpos[2]= -70.5;
0f4a7374 524 for (icard=0; icard < fTOFGeometry->NStripB(); ++icard) {
43808676 525 cardpos[2]= cardpos[2]+stepforcardB;
da3d3acd 526 aplpos2 = cardpos[2]+0.15;
527 gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
528 gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
43808676 529 }
530
531
532 // outer module positioning (FAIC)
533 Float_t stepforcardC= 8.45238;
534 cardpos[2]= -88.75;
0f4a7374 535 for (icard=0; icard < fTOFGeometry->NStripC(); ++icard) {
43808676 536 cardpos[2]= cardpos[2]+stepforcardC;
537 aplpos2 = cardpos[2]+0.15;
da3d3acd 538 gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
43808676 539 gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
540 }
541
542 // tube volume definition
0f4a7374 543
43808676 544 Float_t tubepar[3];
545 tubepar[0]= 0.;
546 tubepar[1]= 0.4;
547 tubepar[2]= 61.;
548 gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel)
549 tubepar[0]= 0.;
550 tubepar[1]= 0.35;
551 tubepar[2]= 61.;
552 gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water
553 // positioning water tube into the steel one
554 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
555
556
557 // rotation matrix
558 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
559 // central module positioning (FAIA)
560 Float_t tubepos[3], tdis=0.6;
561 tubepos[0]= 0.;
562 tubepos[1]= cardpos[1];
563 tubepos[2]= -53.+tdis;
564 // tub1pos = 5.;
565 Int_t itub;
0f4a7374 566 for (itub=0; itub < fTOFGeometry->NStripA(); ++itub) {
43808676 567 tubepos[2]= tubepos[2]+stepforcardA;
568 gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
569 "ONLY");
570 }
571
572
573 // intermediate module positioning (FAIB)
574 tubepos[2]= -70.5+tdis;
0f4a7374 575 for (itub=0; itub < fTOFGeometry->NStripB(); ++itub) {
43808676 576 tubepos[2]= tubepos[2]+stepforcardB;
577 gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
578 "ONLY");
579 }
580
581 // outer module positioning (FAIC)
582 tubepos[2]= -88.75+tdis;
0f4a7374 583 for (itub=0; itub < fTOFGeometry->NStripC(); ++itub) {
43808676 584 tubepos[2]= tubepos[2]+stepforcardC;
585 gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
586 "ONLY");
587 }
588
d599d913 589}
d599d913 590//_____________________________________________________________________________
ba380e33 591void AliTOFv4T0::DrawModule() const
d599d913 592{
593 //
594 // Draw a shaded view of the Time Of Flight version 4
595 //
596 // Set everything unseen
597 gMC->Gsatt("*", "seen", -1);
598 //
599 // Set ALIC mother transparent
600 gMC->Gsatt("ALIC","SEEN",0);
601 //
602 // Set the volumes visible
603 gMC->Gsatt("ALIC","SEEN",0);
604
605 gMC->Gsatt("FTOA","SEEN",1);
606 gMC->Gsatt("FTOB","SEEN",1);
607 gMC->Gsatt("FTOC","SEEN",1);
608 gMC->Gsatt("FLTA","SEEN",1);
609 gMC->Gsatt("FLTB","SEEN",1);
610 gMC->Gsatt("FLTC","SEEN",1);
611 gMC->Gsatt("FPLA","SEEN",1);
612 gMC->Gsatt("FPLB","SEEN",1);
613 gMC->Gsatt("FPLC","SEEN",1);
614 gMC->Gsatt("FSTR","SEEN",1);
615 gMC->Gsatt("FPEA","SEEN",1);
616 gMC->Gsatt("FPEB","SEEN",1);
617 gMC->Gsatt("FPEC","SEEN",1);
618
619 gMC->Gsatt("FLZ1","SEEN",0);
620 gMC->Gsatt("FLZ2","SEEN",0);
621 gMC->Gsatt("FLZ3","SEEN",0);
622 gMC->Gsatt("FLX1","SEEN",0);
623 gMC->Gsatt("FLX2","SEEN",0);
624 gMC->Gsatt("FLX3","SEEN",0);
625 gMC->Gsatt("FPAD","SEEN",0);
626
627 gMC->Gdopt("hide", "on");
628 gMC->Gdopt("shad", "on");
629 gMC->Gsatt("*", "fill", 7);
630 gMC->SetClipBox(".");
631 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
632 gMC->DefaultRange();
633 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
634 gMC->Gdhead(1111, "Time Of Flight");
635 gMC->Gdman(18, 4, "MAN");
636 gMC->Gdopt("hide","off");
637}
638//_____________________________________________________________________________
7aeeaf38 639void AliTOFv4T0::DrawDetectorModules() const
d599d913 640{
641//
642// Draw a shaded view of the TOF detector version 4
643//
644
88cb7938 645
646//Set ALIC mother transparent
4c475d27 647 gMC->Gsatt("ALIC","SEEN",0);
d599d913 648
649//
650//Set volumes visible
651//
652//=====> Level 1
653 // Level 1 for TOF volumes
654 gMC->Gsatt("B077","seen",0);
655
656
657//==========> Level 2
658 // Level 2
659 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
660 gMC->Gsatt("B071","seen",0);
661 gMC->Gsatt("B074","seen",0);
662 gMC->Gsatt("B075","seen",0);
663 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
664
665
666 // Level 2 of B071
667 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
668 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
669 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
670 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
671 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
672 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
673 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
674 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
675 gMC->Gsatt("BTO1","seen",0);
676
677
678 // Level 2 of B074
679 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
680 gMC->Gsatt("BTO2","seen",0);
681
682 // Level 2 of B075
683 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
684 gMC->Gsatt("BTO3","seen",0);
685
686// ==================> Level 3
687 // Level 3 of B071 / Level 2 of BTO1
688 gMC->Gsatt("FTOC","seen",-2);
689 gMC->Gsatt("FTOB","seen",-2);
690 gMC->Gsatt("FTOA","seen",-2);
691
692 // Level 3 of B074 / Level 2 of BTO2
693 // -> cfr previous settings
694
695 // Level 3 of B075 / Level 2 of BTO3
696 // -> cfr previous settings
697
698 gMC->Gdopt("hide","on");
699 gMC->Gdopt("shad","on");
700 gMC->Gsatt("*", "fill", 5);
701 gMC->SetClipBox(".");
702 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
703 gMC->DefaultRange();
704 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
705 gMC->Gdhead(1111,"TOF detector V1");
706 gMC->Gdman(18, 4, "MAN");
707 gMC->Gdopt("hide","off");
708}
709
710//_____________________________________________________________________________
7aeeaf38 711void AliTOFv4T0::DrawDetectorStrips() const
d599d913 712{
713 //
714 // Draw a shaded view of the TOF strips for version 4
715 //
716
d599d913 717 //Set ALIC mother transparent
4c475d27 718 gMC->Gsatt("ALIC","SEEN",0);
d599d913 719
720 //
721 //Set volumes visible
722 //=====> Level 1
723 // Level 1 for TOF volumes
724 gMC->Gsatt("B077","seen",0);
725
726 //==========> Level 2
727 // Level 2
728 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
729 gMC->Gsatt("B071","seen",0);
730 gMC->Gsatt("B074","seen",0);
731 gMC->Gsatt("B075","seen",0);
732 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
733
734 // Level 2 of B071
735 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
736 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
737 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
738 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
739 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
740 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
741 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
742 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
743 gMC->Gsatt("BTO1","seen",0);
744
745 // ==================> Level 3
746 // Level 3 of B071 / Level 2 of BTO1
747 gMC->Gsatt("FTOC","seen",0);
748 gMC->Gsatt("FTOB","seen",0);
749 gMC->Gsatt("FTOA","seen",0);
750
751 // Level 3 of B074 / Level 2 of BTO2
752 // -> cfr previous settings
753
754 // Level 3 of B075 / Level 2 of BTO3
755 // -> cfr previous settings
756
757
758 // ==========================> Level 4
759 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
760 gMC->Gsatt("FLTC","seen",0);
761 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
762 gMC->Gsatt("FLTB","seen",0);
763 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
764 gMC->Gsatt("FLTA","seen",0);
765
766 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
767 // -> cfr previous settings
768 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
769 // -> cfr previous settings
770
771 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
772 // -> cfr previous settings
773
774 //======================================> Level 5
775 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
776 gMC->Gsatt("FALC","seen",0); // no children for FALC
777 gMC->Gsatt("FSTR","seen",-2);
778 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
779 gMC->Gsatt("FECC","seen",0); // no children for FECC
780 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
781 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
782
783 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
784 gMC->Gsatt("FALB","seen",0); // no children for FALB
785 //--> gMC->Gsatt("FSTR","seen",-2);
786
787
788 // -> cfr previous settings
789 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
790 gMC->Gsatt("FECB","seen",0); // no children for FECB
791 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
792 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
793
794 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
795 gMC->Gsatt("FALA","seen",0); // no children for FALB
796 //--> gMC->Gsatt("FSTR","seen",-2);
797 // -> cfr previous settings
798 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
799 gMC->Gsatt("FECA","seen",0); // no children for FECA
800 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
801 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
802
803 // Level 2 of B074
804 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
805 gMC->Gsatt("BTO2","seen",0);
806
807 // Level 2 of B075
808 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
809 gMC->Gsatt("BTO3","seen",0);
810
811 // for others Level 5, cfr. previous settings
812
813 gMC->Gdopt("hide","on");
814 gMC->Gdopt("shad","on");
815 gMC->Gsatt("*", "fill", 5);
816 gMC->SetClipBox(".");
817 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
818 gMC->DefaultRange();
819 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
820 gMC->Gdhead(1111,"TOF Strips V1");
821 gMC->Gdman(18, 4, "MAN");
822 gMC->Gdopt("hide","off");
823}
824
825//_____________________________________________________________________________
826void AliTOFv4T0::CreateMaterials()
827{
828 //
829 // Define materials for the Time Of Flight
830 //
d3c7bfac 831 //AliTOF::CreateMaterials();
832
833 //
834 // Defines TOF materials for all versions
835 // Revision: F. Pierella 18-VI-2002
836 //
837
0e46b9ae 838 AliMagF *magneticField = (AliMagF*)gAlice->Field();
839
840 Int_t isxfld = magneticField->Integ();
841 Float_t sxmgmx = magneticField->Max();
842
d3c7bfac 843 //--- Quartz (SiO2) to simulate float glass
844 // density tuned to have correct float glass
845 // radiation length
846 Float_t aq[2] = { 28.0855,15.9994 };
847 Float_t zq[2] = { 14.,8. };
848 Float_t wq[2] = { 1.,2. };
849 Float_t dq = 2.55; // std value: 2.2
850 Int_t nq = -2;
851
852 // --- Freon C2F4H2 (TOF-TDR pagg.)
853 // Geant Manual CONS110-1, pag. 43 (Geant, Detector Description and Simulation Tool)
854 Float_t afre[3] = {12.011,18.998,1.007};
855 Float_t zfre[3] = { 6., 9., 1.};
856 Float_t wfre[3] = { 2., 4., 2.};
857 Float_t densfre = 0.00375;
858// http://www.fi.infn.it/sezione/prevprot/gas/freon.html
859 Int_t nfre = -3;
860/*
861 //-- Isobutane quencher C4H10 (5% in the sensitive mixture)
862 Float_t aiso[2] = {12.011,1.007};
863 Float_t ziso[2] = { 6., 1.};
864 Float_t wiso[2] = { 4., 10.};
865 Float_t densiso = .......; // (g/cm3) density
866 Int_t nfre = -2; // < 0 i.e. proportion by number of atoms of each kind
867 //-- SF6 (5% in the sensitive mixture)
868 Float_t asf[3] = {32.066,18.998};
869 Float_t zsf[3] = { 16., 9.};
870 Float_t wsf[3] = { 1., 6.};
871 Float_t denssf = .....; // (g/cm3) density
872 Int_t nfre = -2; // < 0 i.e. proportion by number of atoms of each kind
873*/
874 // --- CO2
875 Float_t ac[2] = {12.,16.};
876 Float_t zc[2] = { 6., 8.};
877 Float_t wc[2] = { 1., 2.};
878 Float_t dc = .001977;
879 Int_t nc = -2;
880 // For mylar (C5H4O2)
881 Float_t amy[3] = { 12., 1., 16. };
882 Float_t zmy[3] = { 6., 1., 8. };
883 Float_t wmy[3] = { 5., 4., 2. };
884 Float_t dmy = 1.39;
885 Int_t nmy = -3;
886 // For polyethilene (CH2) - honeycomb -
887 Float_t ape[2] = { 12., 1. };
888 Float_t zpe[2] = { 6., 1. };
889 Float_t wpe[2] = { 1., 2. };
890 Float_t dpe = 0.935*0.479; //To have 1%X0 for 1cm as for honeycomb
891 Int_t npe = -2;
892 // --- G10
893 Float_t ag10[4] = { 12.,1.,16.,28. };
894 Float_t zg10[4] = { 6.,1., 8.,14. };
895 Float_t wmatg10[4] = { .259,.288,.248,.205 };
896 Float_t densg10 = 1.7;
897 Int_t nlmatg10 = -4;
898
899 // plexiglass CH2=C(CH3)CO2CH3
900 Float_t aplex[3] = { 12.,1.,16.};
901 Float_t zplex[3] = { 6.,1., 8.};
902 Float_t wmatplex[3] = {5.,8.,2.};
903 Float_t densplex =1.16;
904 Int_t nplex = -3;
905
906 // ---- ALUMINA (AL203)
907 Float_t aal[2] = { 27.,16.};
908 Float_t zal[2] = { 13., 8.};
909 Float_t wmatal[2] = { 2.,3. };
910 Float_t densal = 2.3;
911 Int_t nlmatal = -2;
912 // -- Water
913 Float_t awa[2] = { 1., 16. };
914 Float_t zwa[2] = { 1., 8. };
915 Float_t wwa[2] = { 2., 1. };
916 Float_t dwa = 1.0;
917 Int_t nwa = -2;
918
919// stainless steel
920 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
921 Float_t zsteel[4] = { 26.,24.,28.,14. };
922 Float_t wsteel[4] = { .715,.18,.1,.005 };
923
924 //AliMaterial(0, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
925
926 // AIR
927 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
928 Float_t zAir[4]={6.,7.,8.,18.};
929 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
930 Float_t dAir = 1.20479E-3;
931
932 AliMixture( 1, "Air$", aAir, zAir, dAir, 4, wAir);
933
934 AliMaterial( 2, "Cu $", 63.54, 29.0, 8.96, 1.43, 14.8);
935 AliMaterial( 3, "C $", 12.01, 6.0, 2.265,18.8, 74.4);
936 AliMixture ( 4, "Polyethilene$", ape, zpe, dpe, npe, wpe);
937 AliMixture ( 5, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
938 AliMixture ( 6, "PLE$", aplex, zplex, densplex, nplex, wmatplex);
939 AliMixture ( 7, "CO2$", ac, zc, dc, nc, wc);
940 AliMixture ( 8, "ALUMINA$", aal, zal, densal, nlmatal, wmatal);
941 AliMaterial( 9, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
942 AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*15./100, 18.8, 74.4); // for 15%
943 AliMixture (11, "Mylar$", amy, zmy, dmy, nmy, wmy);
944 AliMixture (12, "Freon$", afre, zfre, densfre, nfre, wfre);
945 AliMixture (13, "Glass$", aq, zq, dq, nq, wq);
946 AliMixture (14, "Water$", awa, zwa, dwa, nwa, wwa);
947 AliMixture (15, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
948
949 Float_t epsil, stmin, deemax, stemax;
950
951 // Previous data
952 // EPSIL = 0.1 ! Tracking precision,
953 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
954 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
955 // STMIN = 0.1
956 //
957 // New data
958 epsil = .001; // Tracking precision,
959 stemax = -1.; // Maximum displacement for multiple scattering
960 deemax = -.3; // Maximum fractional energy loss, DLS
961 stmin = -.8;
962
963 AliMedium( 1, "Air$" , 1, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
964 AliMedium( 2, "Cu $" , 2, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
965 AliMedium( 3, "C $" , 3, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
966 AliMedium( 4, "Pol$" , 4, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
967 AliMedium( 5, "G10$" , 5, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
968 AliMedium( 6, "PLE$" , 6, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
969 AliMedium( 7, "CO2$" , 7, 0, isxfld, sxmgmx, 10., -.01, -.1, .01, -.01);
970 AliMedium( 8,"ALUMINA$", 8, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
971 AliMedium( 9,"Al Frame$",9, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
972 AliMedium(10, "DME-S$", 6, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
973 AliMedium(11, "C-TRD$", 10, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
974 AliMedium(12, "Myl$" , 11, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
975 AliMedium(13, "Fre$" , 12, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
976 AliMedium(14, "Fre-S$", 12, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
977 AliMedium(15, "Glass$", 13, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
978 AliMedium(16, "Water$", 14, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
979 AliMedium(17, "STEEL$", 15, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
980
d599d913 981}
982
983//_____________________________________________________________________________
984void AliTOFv4T0::Init()
985{
986 //
987 // Initialise the detector after the geometry has been defined
988 //
d076c8d5 989 AliDebug(1, "**************************************"
d599d913 990 " TOF "
d076c8d5 991 "**************************************");
992 AliDebug(1, " Version 4 of TOF initialing, "
993 "symmetric TOF - Full Coverage version");
d599d913 994
995 AliTOF::Init();
996
997 fIdFTOA = gMC->VolId("FTOA");
998 fIdFTOB = gMC->VolId("FTOB");
999 fIdFTOC = gMC->VolId("FTOC");
1000 fIdFLTA = gMC->VolId("FLTA");
1001 fIdFLTB = gMC->VolId("FLTB");
1002 fIdFLTC = gMC->VolId("FLTC");
1003
d076c8d5 1004 AliDebug(1, "**************************************"
d599d913 1005 " TOF "
d076c8d5 1006 "**************************************");
d599d913 1007}
1008
1009//_____________________________________________________________________________
1010void AliTOFv4T0::StepManager()
1011{
0f4a7374 1012
d599d913 1013 //
1014 // Procedure called at each step in the Time Of Flight
1015 //
0f4a7374 1016
d599d913 1017 TLorentzVector mom, pos;
1018 Float_t xm[3],pm[3],xpad[3],ppad[3];
71fc848f 1019 Float_t hits[14];
d599d913 1020 Int_t vol[5];
1021 Int_t sector, plate, padx, padz, strip;
1022 Int_t copy, padzid, padxid, stripid, i;
1023 Int_t *idtmed = fIdtmed->GetArray()-499;
1024 Float_t incidenceAngle;
0f4a7374 1025
d3c7bfac 1026 if(
1027 gMC->IsTrackEntering()
1028 && gMC->TrackCharge()
1ac1b685 1029 //&& gMC->GetMedium()==idtmed[513]
71fc848f 1030 && gMC->CurrentMedium()==idtmed[513]
d3c7bfac 1031 && gMC->CurrentVolID(copy)==fIdSens
1032 )
74ea065c 1033 {
1034
0e46b9ae 1035 AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
1036
e6add757 1037 AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kTOF);
0e46b9ae 1038 //AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
74ea065c 1039
d599d913 1040 // getting information about hit volumes
1041
1042 padzid=gMC->CurrentVolOffID(2,copy);
da3d3acd 1043 padz=copy;
0f4a7374 1044
d599d913 1045
1046 padxid=gMC->CurrentVolOffID(1,copy);
da3d3acd 1047 padx=copy;
d599d913 1048
1049 stripid=gMC->CurrentVolOffID(4,copy);
da3d3acd 1050 strip=copy;
d599d913 1051
1052 gMC->TrackPosition(pos);
1053 gMC->TrackMomentum(mom);
1054
0f4a7374 1055
1056 // Double_t NormPos=1./pos.Rho();
1057
d599d913 1058 Double_t normMom=1./mom.Rho();
1059
0f4a7374 1060 // getting the cohordinates in pad ref system
1061
d599d913 1062 xm[0] = (Float_t)pos.X();
1063 xm[1] = (Float_t)pos.Y();
1064 xm[2] = (Float_t)pos.Z();
1065
1066 pm[0] = (Float_t)mom.X()*normMom;
1067 pm[1] = (Float_t)mom.Y()*normMom;
1068 pm[2] = (Float_t)mom.Z()*normMom;
1069
1070 gMC->Gmtod(xm,xpad,1);
1071 gMC->Gmtod(pm,ppad,2);
1072
644cbb5e 1073
1074 if (TMath::Abs(ppad[1])>1) {
d076c8d5 1075 AliWarning("Abs(ppad) > 1");
644cbb5e 1076 ppad[1]=TMath::Sign((Float_t)1,ppad[1]);
1077 }
d599d913 1078 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1079
0f4a7374 1080
71fc848f 1081 const char * pathA="FTOA";
1082 const char * pathB="FTOB";
1083 const char * pathC="FTOC";
1084 const char * path71="B071";
1085 const char * path75="B075";
1086 const char * path74="B074";
1087 const char* volpath;
d599d913 1088
71fc848f 1089 Int_t index=0;
1090 volpath=gMC->CurrentVolOffName(6);
1091 index=gMC->CurrentVolOffID(6,copy);
1092 index=copy;
1093
1094
1095 plate=-1;
1096 if(strcmp(pathC,volpath)==0 && index==1)plate=0;
1097 if(strcmp(pathB,volpath)==0 && index==1)plate=1;
1098 if(strcmp(pathA,volpath)==0 && index==0)plate=2;
1099 if(strcmp(pathB,volpath)==0 && index==2)plate=3;
1100 if(strcmp(pathC,volpath)==0 && index==2)plate=4;
0f4a7374 1101
da3d3acd 1102
0f4a7374 1103
7e6dce66 1104 if (plate==0) strip=fTOFGeometry->NStripC()-strip;
1105 else if (plate==1) strip=fTOFGeometry->NStripB()-strip;
1106 else strip--;
0f4a7374 1107
7e6dce66 1108 //Apply ALICE conventions for volume numbering increasing with theta, phi
0f4a7374 1109
1110 if (plate==3 || plate==4){
7e6dce66 1111 padx=fTOFGeometry->NpadX()-padx;
1112 padz=fTOFGeometry->NpadZ()-padz;
0f4a7374 1113 xpad[0]=-xpad[0];
1114 xpad[2]=-xpad[2];
1115 }
1116 else {
7e6dce66 1117 padx--;
1118 padz--;
0f4a7374 1119 }
da3d3acd 1120
da3d3acd 1121
d599d913 1122
71fc848f 1123 volpath=gMC->CurrentVolOffName(8);
1124 index=gMC->CurrentVolOffID(8,copy);
1125 index=copy;
0f4a7374 1126
71fc848f 1127 sector=-1;
1128 if(strcmp(path71,volpath)==0 && index <6) sector=12+index;
1129 if(strcmp(path71,volpath)==0 && index >=6) sector=index-3;
1130 if(strcmp(path75,volpath)==0) sector=index-1;
1131 if(strcmp(path74,volpath)==0) sector=10+index;
d599d913 1132
1133 for(i=0;i<3;++i) {
1134 hits[i] = pos[i];
1135 hits[i+3] = pm[i];
1136 }
1137
1138 hits[6] = mom.Rho();
1139 hits[7] = pos[3];
1140 hits[8] = xpad[0];
1141 hits[9] = xpad[1];
1142 hits[10]= xpad[2];
1143 hits[11]= incidenceAngle;
1144 hits[12]= gMC->Edep();
1145 hits[13]= gMC->TrackLength();
1146
1147 vol[0]= sector;
1148 vol[1]= plate;
1149 vol[2]= strip;
1150 vol[3]= padx;
0f4a7374 1151 vol[4]= padz;
1152
0e46b9ae 1153 AddT0Hit(mcApplication->GetCurrentTrackNumber(),vol, hits);
1154 //AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
d599d913 1155 }
1156}