]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFv0.cxx
Several changes:
[u/mrichter/AliRoot.git] / TOF / AliTOFv0.cxx
CommitLineData
4c039060 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$ */
4c039060 17
fe4da5cc 18///////////////////////////////////////////////////////////////////////////////
da3d3acd 19// //
68861244 20// This class contains the functions for version 0 of the Time Of Flight //
fe4da5cc 21// detector. //
da3d3acd 22// //
23// VERSION WITH 5 MODULES AND TILTED STRIPS //
24// NO HITS DEFINED BY DEFAULT FOR THIS VERSION //
25// FULL COVERAGE VERSION //
26// //
27// Authors: //
28// //
29// Alessio Seganti //
30// Domenico Vicinanza //
31// //
32// University of Salerno - Italy //
33// //
34// Fabrizio Pierella //
35// University of Bologna - Italy //
36// //
37// //
38//Begin_Html //
39/* //
40<img src="picts/AliTOFv0Class.gif"> //
41*/ //
42//End_Html //
fe4da5cc 43// //
44///////////////////////////////////////////////////////////////////////////////
45
f8014e68 46#include <Riostream.h>
ab76897d 47#include <stdlib.h>
48
88cb7938 49#include <TBRIK.h>
50#include <TGeometry.h>
0cc62300 51#include <TLorentzVector.h>
88cb7938 52#include <TNode.h>
53#include <TObject.h>
54#include <TVirtualMC.h>
68861244 55
88cb7938 56#include "AliConst.h"
57#include "AliRun.h"
58#include "AliTOFv0.h"
da3d3acd 59#include "AliTOFConstants.h" // AdC
5d12ce38 60#include "AliMC.h"
3fe3a833 61
fe4da5cc 62ClassImp(AliTOFv0)
63
64//_____________________________________________________________________________
151e057e 65AliTOFv0::AliTOFv0()
fe4da5cc 66{
67 //
68 // Default constructor
69 //
68861244 70}
71
72//_____________________________________________________________________________
73AliTOFv0::AliTOFv0(const char *name, const char *title)
74 : AliTOF(name,title)
75{
76 //
77 // Standard constructor
78 //
da39da0c 79 //
80 // Check that FRAME is there otherwise we have no place where to
81 // put TOF
b94fa26c 82 AliModule* frame=gAlice->GetModule("FRAME");
83 if(!frame) {
da39da0c 84 Error("Ctor","TOF needs FRAME to be present\n");
85 exit(1);
2cef3cb2 86 } else
b94fa26c 87 if(frame->IsVersion()!=1) {
2cef3cb2 88 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
da39da0c 89 exit(1);
90 }
2cef3cb2 91
2cef3cb2 92}
b94fa26c 93
fe4da5cc 94//_____________________________________________________________________________
95void AliTOFv0::CreateGeometry()
96{
97 //
3fe3a833 98 // Create geometry for Time Of Flight version 0
99 //
fe4da5cc 100 //Begin_Html
101 /*
1439f98e 102 <img src="picts/AliTOFv0.gif">
fe4da5cc 103 */
104 //End_Html
105 //
937fe4a4 106 // Creates common geometry
fe4da5cc 107 //
3fe3a833 108 AliTOF::CreateGeometry();
fe4da5cc 109}
110
111//_____________________________________________________________________________
2cef3cb2 112void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
113 Float_t zlenB, Float_t zlenA, Float_t ztof0)
fe4da5cc 114{
115 //
3fe3a833 116 // Definition of the Time Of Fligh Resistive Plate Chambers
937fe4a4 117 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
3fe3a833 118
2cef3cb2 119 Float_t ycoor, zcoor;
68861244 120 Float_t par[3];
121 Int_t *idtmed = fIdtmed->GetArray()-499;
122 Int_t idrotm[100];
123 Int_t nrot = 0;
124 Float_t hTof = fRmax-fRmin;
3fe3a833 125
b94fa26c 126 Float_t radius = fRmin+2.;//cm
937fe4a4 127
2cef3cb2 128 par[0] = xtof * 0.5;
129 par[1] = ytof * 0.5;
130 par[2] = zlenC * 0.5;
131 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
132 par[2] = zlenB * 0.5;
133 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
134 par[2] = zlenA * 0.5;
135 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
937fe4a4 136
137
138// Positioning of modules
139
2cef3cb2 140 Float_t zcor1 = ztof0 - zlenC*0.5;
141 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
937fe4a4 142 Float_t zcor3 = 0.;
143
68861244 144 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
145 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
2cef3cb2 146 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
147 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
148 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
149 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
150 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
151 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
152
153 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
154 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
155 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
156 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
157 gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY");
158 gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY");
159
160 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
161 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
162 gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY");
163
164 Float_t db = 0.5;//cm
68861244 165 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
2cef3cb2 166
68861244 167 xFLT = fStripLn;
937fe4a4 168 yFLT = ytof;
68861244 169 zFLTA = zlenA;
170 zFLTB = zlenB;
171 zFLTC = zlenC;
172
173 xFST = xFLT-fDeadBndX*2;//cm
2cef3cb2 174
937fe4a4 175// Sizes of MRPC pads
176
2cef3cb2 177 Float_t yPad = 0.505;//cm
3fe3a833 178
b94fa26c 179// Large not sensitive volumes with Insensitive Freon
2cef3cb2 180 par[0] = xFLT*0.5;
68861244 181 par[1] = yFLT*0.5;
b94fa26c 182
68861244 183 cout <<"************************* TOF geometry **************************"<<endl;
184
2cef3cb2 185 par[2] = (zFLTA *0.5);
b94fa26c 186 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
68861244 187 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
188
2cef3cb2 189 par[2] = (zFLTB * 0.5);
b94fa26c 190 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
68861244 191 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
937fe4a4 192
b94fa26c 193 par[2] = (zFLTC * 0.5);
194 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
68861244 195 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
196
197////////// Layers of Aluminum before and after detector //////////
b94fa26c 198////////// Aluminum Box for Modules (2.0 mm thickness) /////////
199////////// lateral walls not simulated
200 par[0] = xFLT*0.5;
2cef3cb2 201 par[1] = 0.1;//cm
937fe4a4 202 ycoor = -yFLT/2 + par[1];
b94fa26c 203 par[2] = (zFLTA *0.5);
204 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
68861244 205 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
206 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
b94fa26c 207 par[2] = (zFLTB *0.5);
68861244 208 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
209 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
210 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
b94fa26c 211 par[2] = (zFLTC *0.5);
212 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
68861244 213 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
214 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
215
3fe3a833 216///////////////// Detector itself //////////////////////
68861244 217 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
218 //and the boundary of the strip
219 const Int_t knx = fNpadX; // number of pads along x
220 const Int_t knz = fNpadZ; // number of pads along z
221 const Float_t kspace = fSpace; //cm distance from the front plate of the box
222
223 Float_t zSenStrip = fZpad*fNpadZ;//cm
224 Float_t stripWidth = zSenStrip + 2*kdeadBound;
225 par[0] = xFLT*0.5;
226 par[1] = yPad*0.5;
227 par[2] = stripWidth*0.5;
228
dfacde63 229// new description for strip volume -double stack strip-
b94fa26c 230// -- all constants are expressed in cm
68861244 231// heigth of different layers
b94fa26c 232 const Float_t khhony = 1. ; // heigth of HONY Layer
233 const Float_t khpcby = 0.15 ; // heigth of PCB Layer
234 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
235 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
dfacde63 236 const Float_t khglasseiy = 0.17; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
b94fa26c 237 const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
238 const Float_t kwsensmz = 2*3.5 ; // cm
239 const Float_t klsensmx = 48*2.5; // cm
240 const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
241 const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
68861244 242
b94fa26c 243 // heigth of the FSTR Volume (the strip volume)
dfacde63 244 const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
b94fa26c 245 // width of the FSTR Volume (the strip volume)
68861244 246 const Float_t kwstripz = 10.;
b94fa26c 247 // length of the FSTR Volume (the strip volume)
248 const Float_t klstripx = 122.;
937fe4a4 249
b94fa26c 250 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
251// coordinates of the strip center in the strip reference frame; used for positioning
252// internal strip volumes
68861244 253 Float_t posfp[3]={0.,0.,0.};
dfacde63 254
937fe4a4 255
b94fa26c 256 // FSTR volume definition and filling this volume with non sensitive Gas Mixture
257 gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
258 //-- HONY Layer definition
259// parfp[0] = -1;
260 parfp[1] = khhony*0.5;
261// parfp[2] = -1;
262 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
263 // positioning 2 HONY Layers on FSTR volume
dfacde63 264
b94fa26c 265 posfp[1]=-khstripy*0.5+parfp[1];
266 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
68861244 267 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
dfacde63 268
68861244 269 //-- PCB Layer definition
b94fa26c 270 parfp[1] = khpcby*0.5;
271 gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
272 // positioning 2 PCB Layers on FSTR volume
273 posfp[1]=-khstripy*0.5+khhony+parfp[1];
274 gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
275 gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
dfacde63 276 // positioning the central PCB layer
277 gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
278
279
280
b94fa26c 281 //-- MYLAR Layer definition
282 parfp[1] = khmyly*0.5;
283 gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
284 // positioning 2 MYLAR Layers on FSTR volume
68861244 285 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
b94fa26c 286 gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
287 gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
dfacde63 288 // adding further 2 MYLAR Layers on FSTR volume
289 posfp[1] = khpcby*0.5+parfp[1];
290 gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
291 gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
292
b94fa26c 293
294 //-- Graphite Layer definition
295 parfp[1] = khgraphy*0.5;
296 gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
297 // positioning 2 Graphite Layers on FSTR volume
68861244 298 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
b94fa26c 299 gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
300 gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
dfacde63 301 // adding further 2 Graphite Layers on FSTR volume
302 posfp[1] = khpcby*0.5+khmyly+parfp[1];
303 gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
304 gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
305
68861244 306
b94fa26c 307 //-- Glass (EXT. +Semi INT.) Layer definition
308 parfp[1] = khglasseiy*0.5;
309 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
68861244 310 // positioning 2 Glass Layers on FSTR volume
b94fa26c 311 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
312 gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
313 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
dfacde63 314 // adding further 2 Glass Layers on FSTR volume
315 posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
316 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
317 gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
318
68861244 319
b94fa26c 320 //-- Sensitive Mixture Layer definition
321 parfp[0] = klsensmx*0.5;
322 parfp[1] = khsensmy*0.5;
dfacde63 323 parfp[2] = kwsensmz*0.5;
b94fa26c 324 gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
dfacde63 325 gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
326 // positioning 2 gas Layers on FSTR volume
327 // the upper is insensitive freon
328 // while the remaining is sensitive
329 posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
330 gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
331 gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
68861244 332
b94fa26c 333 // dividing FSEN along z in knz=2 and along x in knx=48
334 gMC->Gsdvn("FSEZ","FSEN",knz,3);
335 gMC->Gsdvn("FSEX","FSEZ",knx,1);
68861244 336
b94fa26c 337 // FPAD volume definition
68861244 338 parfp[0] = klpadx*0.5;
b94fa26c 339 parfp[1] = khsensmy*0.5;
340 parfp[2] = kwpadz*0.5;
341 gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
342 // positioning the FPAD volumes on previous divisions
343 gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
68861244 344
937fe4a4 345//// Positioning the Strips (FSTR) in the FLT volumes /////
346
2cef3cb2 347 // Plate A (Central)
348
349 Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
350
b213b8bd 351 Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
937fe4a4 352 Float_t zpos = 0;
2cef3cb2 353 Float_t ang = 0;
da3d3acd 354 Int_t j=1; // AdC
2cef3cb2 355 nrot = 0;
356 zcoor = 0;
b94fa26c 357 ycoor = -14.5 + kspace ; //2 cm over front plate
2cef3cb2 358
359 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
2cef3cb2 360
da3d3acd 361 Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
68861244 362
da3d3acd 363 //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
364 gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC
365 if(fDebug>=1) {
366 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
367 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
368 }
68861244 369 zcoor -= zSenStrip;
da3d3acd 370 //j++; // AdC
b94fa26c 371 Int_t upDown = -1; // upDown=-1 -> Upper strip
372 // upDown=+1 -> Lower strip
937fe4a4 373 do{
b94fa26c 374 ang = atan(zcoor/radius);
2cef3cb2 375 ang *= kRaddeg;
826b71ec 376 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
2cef3cb2 377 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
378 ang /= kRaddeg;
b94fa26c 379 ycoor = -14.5+ kspace; //2 cm over front plate
380 ycoor += (1-(upDown+1)/2)*gap;
da3d3acd 381 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
382 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
383 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
384 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
385 if(fDebug>=1) {
386 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
387 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
388 }
389 //j += 2; // AdC
390 upDown*= -1; // Alternate strips
391 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
392 upDown*gap*TMath::Tan(ang)-
393 (zSenStrip/2)/TMath::Cos(ang);
b94fa26c 394 } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2);
937fe4a4 395
68861244 396 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
da3d3acd 397 upDown*gap*TMath::Tan(ang)+
398 (zSenStrip/2)/TMath::Cos(ang);
399
68861244 400 gap = fGapB;
2cef3cb2 401 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
da3d3acd 402 upDown*gap*TMath::Tan(ang)-
403 (zSenStrip/2)/TMath::Cos(ang);
404
b94fa26c 405 ang = atan(zcoor/radius);
2cef3cb2 406 ang *= kRaddeg;
407 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
408 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
409 ang /= kRaddeg;
410
b94fa26c 411 ycoor = -14.5+ kspace; //2 cm over front plate
412 ycoor += (1-(upDown+1)/2)*gap;
da3d3acd 413 //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
414 //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
415 gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
416 gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
417 if(fDebug>=1) {
418 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
419 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
420 }
68861244 421 ycoor = -hTof/2.+ kspace;//2 cm over front plate
2cef3cb2 422
423 // Plate B
937fe4a4 424
937fe4a4 425 nrot = 0;
da3d3acd 426 Int_t i=1; // AdC
68861244 427 upDown = 1;
428 Float_t deadRegion = 1.0;//cm
2cef3cb2 429
430 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
b94fa26c 431 upDown*gap*TMath::Tan(ang)-
68861244 432 (zSenStrip/2)/TMath::Cos(ang)-
433 deadRegion/TMath::Cos(ang);
2cef3cb2 434
b94fa26c 435 ang = atan(zpos/radius);
2cef3cb2 436 ang *= kRaddeg;
437 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
438 ang /= kRaddeg;
68861244 439 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
b94fa26c 440 ycoor += (1-(upDown+1)/2)*gap;
2cef3cb2 441 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
442 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
da3d3acd 443 if(fDebug>=1) {
444 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
445 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
446 }
2cef3cb2 447 i++;
b94fa26c 448 upDown*=-1;
937fe4a4 449
450 do {
2cef3cb2 451 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
b94fa26c 452 upDown*gap*TMath::Tan(ang)-
2cef3cb2 453 (zSenStrip/2)/TMath::Cos(ang);
b94fa26c 454 ang = atan(zpos/radius);
2cef3cb2 455 ang *= kRaddeg;
826b71ec 456 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
2cef3cb2 457 ang /= kRaddeg;
b213b8bd 458 Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame
459 Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips
460 ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate
461 ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB);
2cef3cb2 462 zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB
463 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
da3d3acd 464 if(fDebug>=1) {
465 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
466 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
467 }
b94fa26c 468 upDown*=-1;
2cef3cb2 469 i++;
68861244 470 } while (TMath::Abs(ang*kRaddeg)<22.5);
471 //till we reach a tilting angle of 22.5 degrees
937fe4a4 472
68861244 473 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
474 zpos = zpos - zSenStrip/TMath::Cos(ang);
b213b8bd 475 // this avoid overlaps in between outer strips in plate B
476 Float_t deltaMovingUp=0.8; // [cm]
477 Float_t deltaMovingDown=-0.5; // [cm]
2cef3cb2 478
479 do {
b94fa26c 480 ang = atan(zpos/radius);
2cef3cb2 481 ang *= kRaddeg;
482 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
483 ang /= kRaddeg;
484 zcoor = zpos+(zFLTB/2+zFLTA/2+db);
b213b8bd 485 gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY");
486 deltaMovingUp+=0.8; // update delta moving toward the end of the plate
937fe4a4 487 zpos = zpos - zSenStrip/TMath::Cos(ang);
da3d3acd 488 if(fDebug>=1) {
489 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
490 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
491 }
68861244 492 i++;
493 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
da3d3acd 494
2cef3cb2 495 // Plate C
68861244 496
497 zpos = zpos + zSenStrip/TMath::Cos(ang);
2cef3cb2 498
68861244 499 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
b94fa26c 500 gap*TMath::Tan(ang)-
2cef3cb2 501 (zSenStrip/2)/TMath::Cos(ang);
502
503 nrot = 0;
504 i=0;
b213b8bd 505 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
506 ycoor= -hTof*0.5+kspace+gap+deltaGap;
937fe4a4 507
2cef3cb2 508 do {
509 i++;
b94fa26c 510 ang = atan(zpos/radius);
2cef3cb2 511 ang *= kRaddeg;
512 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
513 ang /= kRaddeg;
514 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
515 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
da3d3acd 516 if(fDebug>=1) {
517 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
518 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
519 }
937fe4a4 520 zpos = zpos - zSenStrip/TMath::Cos(ang);
68861244 521 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
2cef3cb2 522
937fe4a4 523
b94fa26c 524////////// Layers after strips /////////////////
525// honeycomb (Polyethilene) Layer after (1.2cm)
937fe4a4 526
b94fa26c 527 Float_t overSpace = fOverSpc;//cm
937fe4a4 528
b94fa26c 529 par[0] = xFLT*0.5;
937fe4a4 530 par[1] = 0.6;
b94fa26c 531 par[2] = (zFLTA *0.5);
532 ycoor = -yFLT/2 + overSpace + par[1];
2cef3cb2 533 gMC->Gsvolu("FPEA", "BOX ", idtmed[503], par, 3); // Hony
534 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
b94fa26c 535 par[2] = (zFLTB *0.5);
2cef3cb2 536 gMC->Gsvolu("FPEB", "BOX ", idtmed[503], par, 3); // Hony
537 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
b94fa26c 538 par[2] = (zFLTC *0.5);
2cef3cb2 539 gMC->Gsvolu("FPEC", "BOX ", idtmed[503], par, 3); // Hony
540 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
937fe4a4 541
542// Electronics (Cu) after
543 ycoor += par[1];
b94fa26c 544 par[0] = xFLT*0.5;
2cef3cb2 545 par[1] = 1.43*0.05*0.5; // 5% of X0
b94fa26c 546 par[2] = (zFLTA *0.5);
937fe4a4 547 ycoor += par[1];
2cef3cb2 548 gMC->Gsvolu("FECA", "BOX ", idtmed[501], par, 3); // Cu
549 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
b94fa26c 550 par[2] = (zFLTB *0.5);
2cef3cb2 551 gMC->Gsvolu("FECB", "BOX ", idtmed[501], par, 3); // Cu
552 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
b94fa26c 553 par[2] = (zFLTC *0.5);
2cef3cb2 554 gMC->Gsvolu("FECC", "BOX ", idtmed[501], par, 3); // Cu
555 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
556
557// cooling WAter after
937fe4a4 558 ycoor += par[1];
b94fa26c 559 par[0] = xFLT*0.5;
2cef3cb2 560 par[1] = 36.1*0.02*0.5; // 2% of X0
b94fa26c 561 par[2] = (zFLTA *0.5);
937fe4a4 562 ycoor += par[1];
2cef3cb2 563 gMC->Gsvolu("FWAA", "BOX ", idtmed[515], par, 3); // Water
564 gMC->Gspos ("FWAA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
b94fa26c 565 par[2] = (zFLTB *0.5);
2cef3cb2 566 gMC->Gsvolu("FWAB", "BOX ", idtmed[515], par, 3); // Water
567 gMC->Gspos ("FWAB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
b94fa26c 568 par[2] = (zFLTC *0.5);
2cef3cb2 569 gMC->Gsvolu("FWAC", "BOX ", idtmed[515], par, 3); // Water
570 gMC->Gspos ("FWAC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
571
b94fa26c 572// frame of Air
573 ycoor += par[1];
574 par[0] = xFLT*0.5;
575 par[1] = (yFLT/2-ycoor-0.2)*0.5; // Aluminum layer considered (0.2 cm)
576 par[2] = (zFLTA *0.5);
577 ycoor += par[1];
578 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
579 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
580 par[2] = (zFLTB *0.5);
581 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
582 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
583 par[2] = (zFLTC *0.5);
584 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
585 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
586/* fp
2cef3cb2 587//Back Plate honycomb (2cm)
3fe3a833 588 par[0] = -1;
2cef3cb2 589 par[1] = 2 *0.5;
3fe3a833 590 par[2] = -1;
937fe4a4 591 ycoor = yFLT/2 - par[1];
2cef3cb2 592 gMC->Gsvolu("FBPA", "BOX ", idtmed[503], par, 3); // Hony
593 gMC->Gspos ("FBPA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
594 gMC->Gsvolu("FBPB", "BOX ", idtmed[503], par, 3); // Hony
595 gMC->Gspos ("FBPB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
596 gMC->Gsvolu("FBPC", "BOX ", idtmed[503], par, 3); // Hony
597 gMC->Gspos ("FBPC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
b94fa26c 598fp */
3fe3a833 599}
fe4da5cc 600
3fe3a833 601//_____________________________________________________________________________
68861244 602void AliTOFv0::DrawModule() const
3fe3a833 603{
604 //
517b7f8f 605 // Draw a shaded view of the Time Of Flight version 0
3fe3a833 606 //
fe4da5cc 607 // Set everything unseen
cfce8870 608 gMC->Gsatt("*", "seen", -1);
fe4da5cc 609 //
610 // Set ALIC mother transparent
cfce8870 611 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 612 //
613 // Set the volumes visible
3fe3a833 614 gMC->Gsatt("ALIC","SEEN",0);
2cef3cb2 615
616 gMC->Gsatt("FTOA","SEEN",1);
617 gMC->Gsatt("FTOB","SEEN",1);
618 gMC->Gsatt("FTOC","SEEN",1);
619 gMC->Gsatt("FLTA","SEEN",1);
620 gMC->Gsatt("FLTB","SEEN",1);
621 gMC->Gsatt("FLTC","SEEN",1);
622 gMC->Gsatt("FPLA","SEEN",1);
623 gMC->Gsatt("FPLB","SEEN",1);
624 gMC->Gsatt("FPLC","SEEN",1);
625 gMC->Gsatt("FSTR","SEEN",1);
626 gMC->Gsatt("FPEA","SEEN",1);
627 gMC->Gsatt("FPEB","SEEN",1);
628 gMC->Gsatt("FPEC","SEEN",1);
629
630 gMC->Gsatt("FLZ1","SEEN",0);
631 gMC->Gsatt("FLZ2","SEEN",0);
632 gMC->Gsatt("FLZ3","SEEN",0);
633 gMC->Gsatt("FLX1","SEEN",0);
634 gMC->Gsatt("FLX2","SEEN",0);
635 gMC->Gsatt("FLX3","SEEN",0);
636 gMC->Gsatt("FPAD","SEEN",0);
637
cfce8870 638 gMC->Gdopt("hide", "on");
639 gMC->Gdopt("shad", "on");
640 gMC->Gsatt("*", "fill", 7);
cfce8870 641 gMC->SetClipBox(".");
642 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
643 gMC->DefaultRange();
644 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
645 gMC->Gdhead(1111, "Time Of Flight");
646 gMC->Gdman(18, 4, "MAN");
647 gMC->Gdopt("hide","off");
fe4da5cc 648}
517b7f8f 649//_____________________________________________________________________________
650void AliTOFv0::DrawDetectorModules()
651{
652//
653// Draw a shaded view of the TOF detector version 0
654//
655
517b7f8f 656//Set ALIC mother transparent
4c475d27 657 gMC->Gsatt("ALIC","SEEN",0);
517b7f8f 658
659//
660//Set volumes visible
661//
662//=====> Level 1
663 // Level 1 for TOF volumes
664 gMC->Gsatt("B077","seen",0);
665
666
667//==========> Level 2
668 // Level 2
669 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
670 gMC->Gsatt("B071","seen",0);
671 gMC->Gsatt("B074","seen",0);
672 gMC->Gsatt("B075","seen",0);
673 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
674
675
676 // Level 2 of B071
677 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
678 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
679 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
680 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
681 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
682 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
683 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
684 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
685 gMC->Gsatt("BTO1","seen",0);
686
687
688 // Level 2 of B074
689 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
690 gMC->Gsatt("BTO2","seen",0);
691
692 // Level 2 of B075
693 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
694 gMC->Gsatt("BTO3","seen",0);
695
696// ==================> Level 3
697 // Level 3 of B071 / Level 2 of BTO1
698 gMC->Gsatt("FTOC","seen",-2);
699 gMC->Gsatt("FTOB","seen",-2);
700 gMC->Gsatt("FTOA","seen",-2);
701
702 // Level 3 of B074 / Level 2 of BTO2
703 // -> cfr previous settings
704
705 // Level 3 of B075 / Level 2 of BTO3
706 // -> cfr previous settings
707
708 gMC->Gdopt("hide","on");
709 gMC->Gdopt("shad","on");
710 gMC->Gsatt("*", "fill", 5);
711 gMC->SetClipBox(".");
712 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
713 gMC->DefaultRange();
714 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
715 gMC->Gdhead(1111,"TOF detector V1");
716 gMC->Gdman(18, 4, "MAN");
717 gMC->Gdopt("hide","off");
718}
719
720//_____________________________________________________________________________
721void AliTOFv0::DrawDetectorStrips()
722{
723//
724// Draw a shaded view of the TOF strips for version 0
725//
726
517b7f8f 727//Set ALIC mother transparent
4c475d27 728 gMC->Gsatt("ALIC","SEEN",0);
517b7f8f 729
730//
731//Set volumes visible
732//=====> Level 1
733 // Level 1 for TOF volumes
734 gMC->Gsatt("B077","seen",0);
735
736//==========> Level 2
737 // Level 2
738 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
739 gMC->Gsatt("B071","seen",0);
740 gMC->Gsatt("B074","seen",0);
741 gMC->Gsatt("B075","seen",0);
742 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
743
744 // Level 2 of B071
745 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
746 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
747 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
748 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
749 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
750 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
751 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
752 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
753 gMC->Gsatt("BTO1","seen",0);
754
755// ==================> Level 3
756 // Level 3 of B071 / Level 2 of BTO1
757 gMC->Gsatt("FTOC","seen",0);
758 gMC->Gsatt("FTOB","seen",0);
759 gMC->Gsatt("FTOA","seen",0);
760
761 // Level 3 of B074 / Level 2 of BTO2
762 // -> cfr previous settings
763
764 // Level 3 of B075 / Level 2 of BTO3
765 // -> cfr previous settings
766
767
768// ==========================> Level 4
769 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
770 gMC->Gsatt("FLTC","seen",0);
771 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
772 gMC->Gsatt("FLTB","seen",0);
773 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
774 gMC->Gsatt("FLTA","seen",0);
775
776 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
777 // -> cfr previous settings
778 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
779 // -> cfr previous settings
780
781 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
782 // -> cfr previous settings
783
784//======================================> Level 5
785 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
786 gMC->Gsatt("FALC","seen",0); // no children for FALC
787 gMC->Gsatt("FSTR","seen",-2);
788 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
789 gMC->Gsatt("FECC","seen",0); // no children for FECC
790 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
791 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
792
793 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
794 gMC->Gsatt("FALB","seen",0); // no children for FALB
795//--> gMC->Gsatt("FSTR","seen",-2);
796
797
798 // -> cfr previous settings
799 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
800 gMC->Gsatt("FECB","seen",0); // no children for FECB
801 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
802 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
803
804 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
805 gMC->Gsatt("FALA","seen",0); // no children for FALB
806//--> gMC->Gsatt("FSTR","seen",-2);
807 // -> cfr previous settings
808 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
809 gMC->Gsatt("FECA","seen",0); // no children for FECA
810 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
811 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
812
813 // Level 2 of B074
814 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
815 gMC->Gsatt("BTO2","seen",0);
816
817 // Level 2 of B075
818 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
819 gMC->Gsatt("BTO3","seen",0);
820
821// for others Level 5, cfr. previous settings
822
823 gMC->Gdopt("hide","on");
824 gMC->Gdopt("shad","on");
825 gMC->Gsatt("*", "fill", 5);
826 gMC->SetClipBox(".");
827 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
828 gMC->DefaultRange();
829 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
830 gMC->Gdhead(1111,"TOF Strips V1");
831 gMC->Gdman(18, 4, "MAN");
832 gMC->Gdopt("hide","off");
833}
fe4da5cc 834
835//_____________________________________________________________________________
836void AliTOFv0::CreateMaterials()
837{
838 //
839 // Define materials for the Time Of Flight
840 //
841 AliTOF::CreateMaterials();
842}
843
844//_____________________________________________________________________________
845void AliTOFv0::Init()
846{
847 //
3fe3a833 848 // Initialise the detector after the geometry has been defined
fe4da5cc 849 //
68861244 850 printf("**************************************"
851 " TOF "
852 "**************************************\n");
853 printf("\n Version 0 of TOF initialing, "
854 "symmetric TOF - Full Coverage version\n");
ab76897d 855
fe4da5cc 856 AliTOF::Init();
ab76897d 857
2cef3cb2 858 fIdFTOA = gMC->VolId("FTOA");
859 fIdFTOB = gMC->VolId("FTOB");
860 fIdFTOC = gMC->VolId("FTOC");
861 fIdFLTA = gMC->VolId("FLTA");
862 fIdFLTB = gMC->VolId("FLTB");
863 fIdFLTC = gMC->VolId("FLTC");
ab76897d 864
9e1a0ddb 865 if(fDebug) {
866 printf("%s: **************************************"
867 " TOF "
868 "**************************************\n",ClassName());
869 }
fe4da5cc 870}
871
872//_____________________________________________________________________________
873void AliTOFv0::StepManager()
874{
875 //
876 // Procedure called at each step in the Time Of Flight
3fe3a833 877 //
68861244 878 TLorentzVector mom, pos;
879 Float_t xm[3],pm[3],xpad[3],ppad[3];
880 Float_t hits[13],phi,phid,z;
881 Int_t vol[5];
b94fa26c 882 Int_t sector, plate, padx, padz, strip;
883 Int_t copy, padzid, padxid, stripid, i;
2cef3cb2 884 Int_t *idtmed = fIdtmed->GetArray()-499;
68861244 885 Float_t incidenceAngle;
826b71ec 886
fa914fe6 887 if(gMC->CurrentMedium()==idtmed[513] &&
0a6d8768 888 gMC->IsTrackEntering() && gMC->TrackCharge()
826b71ec 889 && gMC->CurrentVolID(copy)==fIdSens)
2cef3cb2 890 {
68861244 891 // getting information about hit volumes
826b71ec 892
b94fa26c 893 padzid=gMC->CurrentVolOffID(2,copy);
894 padz=copy;
826b71ec 895
b94fa26c 896 padxid=gMC->CurrentVolOffID(1,copy);
897 padx=copy;
826b71ec 898
b94fa26c 899 stripid=gMC->CurrentVolOffID(4,copy);
826b71ec 900 strip=copy;
901
0a6d8768 902 gMC->TrackPosition(pos);
903 gMC->TrackMomentum(mom);
826b71ec 904
68861244 905// Double_t NormPos=1./pos.Rho();
906 Double_t normMom=1./mom.Rho();
826b71ec 907
68861244 908// getting the cohordinates in pad ref system
909 xm[0] = (Float_t)pos.X();
910 xm[1] = (Float_t)pos.Y();
911 xm[2] = (Float_t)pos.Z();
912
913 pm[0] = (Float_t)mom.X()*normMom;
914 pm[1] = (Float_t)mom.Y()*normMom;
915 pm[2] = (Float_t)mom.Z()*normMom;
916
917 gMC->Gmtod(xm,xpad,1);
918 gMC->Gmtod(pm,ppad,2);
5919c40c 919
68861244 920 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
2cef3cb2 921
68861244 922 z = pos[2];
826b71ec 923
68861244 924 plate = 0;
da3d3acd 925 if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
68861244 926 if (z < (fZlenA*0.5+fZlenB) &&
da3d3acd 927 z > fZlenA*0.5) plate = 1; //4; // AdC
68861244 928 if (z >-(fZlenA*0.5+fZlenB) &&
da3d3acd 929 z < -fZlenA*0.5) plate = 3; //2; // AdC
930 if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
931 if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
932
933 if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
934 else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
935 else strip--; // AdC
936
937 if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
938 else padx--; // AdC
939
940 if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
941 else padz--; // AdC
68861244 942
943 phi = pos.Phi();
da3d3acd 944 if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
945 else phid = phi*kRaddeg + 360.; // AdC
826b71ec 946 sector = Int_t (phid/20.);
da3d3acd 947 //sector++; // AdC
826b71ec 948
0a6d8768 949 for(i=0;i<3;++i) {
2cef3cb2 950 hits[i] = pos[i];
68861244 951 hits[i+3] = pm[i];
0a6d8768 952 }
68861244 953
954 hits[6] = mom.Rho();
2cef3cb2 955 hits[7] = pos[3];
68861244 956 hits[8] = xpad[0];
957 hits[9] = xpad[1];
958 hits[10]= xpad[2];
959 hits[11]= incidenceAngle;
960 hits[12]= gMC->Edep();
2cef3cb2 961
68861244 962 vol[0]= sector;
963 vol[1]= plate;
964 vol[2]= strip;
965 vol[3]= padx;
966 vol[4]= padz;
967
5d12ce38 968 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
fe4da5cc 969 }
970}
b94fa26c 971
972
973
974
975
976