]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFv3.cxx
Minor changes
[u/mrichter/AliRoot.git] / TOF / AliTOFv3.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 3 of the Time Of Flight //
fe4da5cc 21// detector. //
da3d3acd 22// //
23// VERSION WITH 5 MODULES AND TILTED STRIPS //
24// HITS DEFINED FOR THIS VERSION //
f4b3bbb7 25// HOLES FOR HMPID DETECTOR //
da3d3acd 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/AliTOFv3Class.gif"> //
41*/ //
42//End_Html //
fe4da5cc 43// //
44///////////////////////////////////////////////////////////////////////////////
45
f8014e68 46#include <Riostream.h>
0c50193f 47#include <stdlib.h>
48
0cc62300 49#include <TLorentzVector.h>
88cb7938 50#include <TObject.h>
51#include <TVirtualMC.h>
2cef3cb2 52
88cb7938 53#include "AliConst.h"
54#include "AliRun.h"
55#include "AliTOFv3.h"
da3d3acd 56#include "AliTOFConstants.h" // AdC
5d12ce38 57#include "AliMC.h"
fe4da5cc 58
59ClassImp(AliTOFv3)
60
61//_____________________________________________________________________________
ad51aeb0 62AliTOFv3::AliTOFv3()
fe4da5cc 63{
64 //
65 // Default constructor
66 //
67}
68
69//_____________________________________________________________________________
70AliTOFv3::AliTOFv3(const char *name, const char *title)
2cef3cb2 71 : AliTOF(name,title)
fe4da5cc 72{
73 //
74 // Standard constructor
75 //
da39da0c 76 //
77 // Check that FRAME is there otherwise we have no place where to
78 // put TOF
b94fa26c 79 AliModule* frame=gAlice->GetModule("FRAME");
80 if(!frame) {
da39da0c 81 Error("Ctor","TOF needs FRAME to be present\n");
82 exit(1);
2cef3cb2 83 } else
b94fa26c 84 if(frame->IsVersion()!=1) {
da39da0c 85 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
86 exit(1);
87 }
88
fe4da5cc 89}
90
91//_____________________________________________________________________________
92void AliTOFv3::CreateGeometry()
93{
94 //
3fe3a833 95 // Create geometry for Time Of Flight version 0
fe4da5cc 96 //
97 //Begin_Html
98 /*
1439f98e 99 <img src="picts/AliTOFv3.gif">
fe4da5cc 100 */
101 //End_Html
102 //
937fe4a4 103 // Creates common geometry
fe4da5cc 104 //
105 AliTOF::CreateGeometry();
106}
107
108//_____________________________________________________________________________
2cef3cb2 109void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
110 Float_t zlenB, Float_t zlenA, Float_t ztof0)
fe4da5cc 111{
112 //
3fe3a833 113 // Definition of the Time Of Fligh Resistive Plate Chambers
937fe4a4 114 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
3fe3a833 115
937fe4a4 116 Float_t ycoor, zcoor;
b94fa26c 117 Float_t par[3];
2cef3cb2 118 Int_t *idtmed = fIdtmed->GetArray()-499;
119 Int_t idrotm[100];
120 Int_t nrot = 0;
121 Float_t hTof = fRmax-fRmin;
fe4da5cc 122
b94fa26c 123 Float_t radius = fRmin+2.;//cm
43808676 124
2cef3cb2 125 par[0] = xtof * 0.5;
126 par[1] = ytof * 0.5;
127 par[2] = zlenC * 0.5;
128 gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3);
129 par[2] = zlenB * 0.5;
130 gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3);
131 par[2] = zlenA * 0.5;
132 gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3);
43808676 133
134
135 // Positioning of modules
136
137 Float_t zcor1 = ztof0 - zlenC*0.5;
138 Float_t zcor2 = ztof0 - zlenC - zlenB*0.5;
139 Float_t zcor3 = 0.;
140
141 AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.);
142 AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.);
143 gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
144 gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
145 gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
146 gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
147 gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
148 gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
149
150 gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
151 gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
152 gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
153 gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
154
155 gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
156 gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY");
157
2cef3cb2 158 Float_t db = 0.5;//cm
159 Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC;
43808676 160
2cef3cb2 161 xFLT = fStripLn;
937fe4a4 162 yFLT = ytof;
2cef3cb2 163 zFLTA = zlenA;
164 zFLTB = zlenB;
165 zFLTC = zlenC;
43808676 166
2cef3cb2 167 xFST = xFLT-fDeadBndX*2;//cm
43808676 168
169 // Sizes of MRPC pads
170
2cef3cb2 171 Float_t yPad = 0.505;//cm
937fe4a4 172
43808676 173 // Large not sensitive volumes with Insensitive Freon
2cef3cb2 174 par[0] = xFLT*0.5;
175 par[1] = yFLT*0.5;
43808676 176
68861244 177 if (fDebug) cout << ClassName() <<
43808676 178 cout <<": ************************* TOF geometry **************************"<<endl;
179
2cef3cb2 180 par[2] = (zFLTA *0.5);
b94fa26c 181 gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
2cef3cb2 182 gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
43808676 183
2cef3cb2 184 par[2] = (zFLTB * 0.5);
b94fa26c 185 gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
2cef3cb2 186 gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
43808676 187
b94fa26c 188 par[2] = (zFLTC * 0.5);
189 gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
2cef3cb2 190 gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
937fe4a4 191
43808676 192 ///// Layers of Aluminum before and after detector /////
193 ///// Aluminum Box for Modules (1.8 mm thickness) /////
194 ///// lateral walls not simulated for the time being
195 //const Float_t khAlWall = 0.18;
196 // fp to be checked
197 const Float_t khAlWall = 0.11;
b94fa26c 198 par[0] = xFLT*0.5;
43808676 199 par[1] = khAlWall/2.;//cm
937fe4a4 200 ycoor = -yFLT/2 + par[1];
b94fa26c 201 par[2] = (zFLTA *0.5);
202 gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
203 gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
204 gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
205 par[2] = (zFLTB *0.5);
206 gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
207 gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
208 gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
209 par[2] = (zFLTC *0.5);
210 gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
211 gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
212 gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
213
43808676 214 ///////////////// Detector itself //////////////////////
215
b94fa26c 216 const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
43808676 217 //and the boundary of the strip
b94fa26c 218 const Int_t knx = fNpadX; // number of pads along x
219 const Int_t knz = fNpadZ; // number of pads along z
220 const Float_t kspace = fSpace; //cm distance from the front plate of the box
43808676 221
2cef3cb2 222 Float_t zSenStrip = fZpad*fNpadZ;//cm
b94fa26c 223 Float_t stripWidth = zSenStrip + 2*kdeadBound;
43808676 224
2cef3cb2 225 par[0] = xFLT*0.5;
da3d3acd 226 par[1] = yPad*0.5;
b94fa26c 227 par[2] = stripWidth*0.5;
937fe4a4 228
43808676 229 // new description for strip volume -double stack strip-
230 // -- all constants are expressed in cm
231 // heigth of different layers
232 const Float_t khhony = 0.8 ; // heigth of HONY Layer
233 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
b94fa26c 234 const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
235 const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
43808676 236 const Float_t khglasseiy = 0.135; // 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
242
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)
246 const Float_t kwstripz = 10.;
247 // length of the FSTR Volume (the strip volume)
248 const Float_t klstripx = 122.;
249
250 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
43808676 251 // coordinates of the strip center in the strip reference frame; used for positioning
252 // internal strip volumes
da3d3acd 253 Float_t posfp[3]={0.,0.,0.};
43808676 254
b94fa26c 255
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
43808676 259 // parfp[0] = -1;
b94fa26c 260 parfp[1] = khhony*0.5;
43808676 261 // parfp[2] = -1;
b94fa26c 262 gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
263 // positioning 2 HONY Layers on FSTR volume
43808676 264
b94fa26c 265 posfp[1]=-khstripy*0.5+parfp[1];
266 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
267 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
43808676 268
b94fa26c 269 //-- PCB Layer definition
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");
43808676 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
da3d3acd 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");
43808676 292
293
b94fa26c 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
298 posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
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");
43808676 305
306
b94fa26c 307 //-- Glass (EXT. +Semi INT.) Layer definition
308 parfp[1] = khglasseiy*0.5;
309 gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
310 // positioning 2 Glass Layers on FSTR volume
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");
43808676 318
b94fa26c 319
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");
43808676 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);
336
337 // FPAD volume definition
da3d3acd 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");
937fe4a4 344
43808676 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
43808676 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
da3d3acd 359 AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
360
361 Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
362
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
61e4c9ba 365 if(fDebug>=1) {
da3d3acd 366 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
43808676 367 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
9e1a0ddb 368 }
2cef3cb2 369 zcoor -= zSenStrip;
da3d3acd 370 //j++; // AdC
b94fa26c 371 Int_t upDown = -1; // upDown=-1 -> Upper strip
da3d3acd 372 // upDown=+1 -> Lower strip
937fe4a4 373 do{
43808676 374 ang = atan(zcoor/radius);
375 ang *= kRaddeg;
da3d3acd 376 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
43808676 377 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
378 ang /= kRaddeg;
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
61e4c9ba 385 if(fDebug>=1) {
da3d3acd 386 printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
43808676 387 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
388 }
da3d3acd 389 j++; //j += 2; // AdC
43808676 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
2cef3cb2 396 zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+
43808676 397 upDown*gap*TMath::Tan(ang)+
398 (zSenStrip/2)/TMath::Cos(ang);
399
b94fa26c 400 gap = fGapB;
2cef3cb2 401 zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)-
43808676 402 upDown*gap*TMath::Tan(ang)-
403 (zSenStrip/2)/TMath::Cos(ang);
404
b94fa26c 405 ang = atan(zcoor/radius);
2cef3cb2 406 ang *= kRaddeg;
da3d3acd 407 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
2cef3cb2 408 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
409 ang /= kRaddeg;
43808676 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
61e4c9ba 417 if(fDebug>=1) {
da3d3acd 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);
9e1a0ddb 420 }
b94fa26c 421 ycoor = -hTof/2.+ kspace;//2 cm over front plate
43808676 422
2cef3cb2 423 // Plate B
43808676 424
937fe4a4 425 nrot = 0;
da3d3acd 426 Int_t i=1; // AdC
b94fa26c 427 upDown = 1;
428 Float_t deadRegion = 1.0;//cm
2cef3cb2 429
430 zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)-
43808676 431 upDown*gap*TMath::Tan(ang)-
432 (zSenStrip/2)/TMath::Cos(ang)-
433 deadRegion/TMath::Cos(ang);
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;
b94fa26c 439 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
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");
61e4c9ba 443 if(fDebug>=1) {
da3d3acd 444 printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i);
445 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
9e1a0ddb 446 }
2cef3cb2 447 i++;
b94fa26c 448 upDown*=-1;
43808676 449
937fe4a4 450 do {
43808676 451 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)-
452 upDown*gap*TMath::Tan(ang)-
453 (zSenStrip/2)/TMath::Cos(ang);
454 ang = atan(zpos/radius);
455 ang *= kRaddeg;
456 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
457 ang /= kRaddeg;
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);
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");
61e4c9ba 464 if(fDebug>=1) {
43808676 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 }
468 upDown*=-1;
469 i++;
2cef3cb2 470 } while (TMath::Abs(ang*kRaddeg)<22.5);
471 //till we reach a tilting angle of 22.5 degrees
43808676 472
b94fa26c 473 ycoor = -hTof*0.5+ kspace ; //2 cm over front plate
2cef3cb2 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]
43808676 478
2cef3cb2 479 do {
43808676 480 ang = atan(zpos/radius);
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);
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
487 zpos = zpos - zSenStrip/TMath::Cos(ang);
61e4c9ba 488 if(fDebug>=1) {
43808676 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 }
492 i++;
493
b94fa26c 494 } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db);
43808676 495
2cef3cb2 496 // Plate C
497
498 zpos = zpos + zSenStrip/TMath::Cos(ang);
43808676 499
2cef3cb2 500 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+
43808676 501 gap*TMath::Tan(ang)-
502 (zSenStrip/2)/TMath::Cos(ang);
503
937fe4a4 504 nrot = 0;
505 i=0;
b213b8bd 506 Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate
507 ycoor= -hTof*0.5+kspace+gap+deltaGap;
43808676 508
2cef3cb2 509 do {
43808676 510 i++;
511 ang = atan(zpos/radius);
512 ang *= kRaddeg;
513 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
514 ang /= kRaddeg;
515 zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2);
516 gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
61e4c9ba 517 if(fDebug>=1) {
43808676 518 printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i);
519 printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos);
520 }
521 zpos = zpos - zSenStrip/TMath::Cos(ang);
b94fa26c 522 } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t);
2cef3cb2 523
937fe4a4 524
43808676 525 ////////// Layers after strips /////////////////
526 // Al Layer thickness (2.3mm) factor 0.7
527
b94fa26c 528 Float_t overSpace = fOverSpc;//cm
43808676 529
b94fa26c 530 par[0] = xFLT*0.5;
43808676 531 par[1] = 0.115*0.7; // factor 0.7
b94fa26c 532 par[2] = (zFLTA *0.5);
533 ycoor = -yFLT/2 + overSpace + par[1];
43808676 534 gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al
2cef3cb2 535 gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
b94fa26c 536 par[2] = (zFLTB *0.5);
43808676 537 gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al
2cef3cb2 538 gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
b94fa26c 539 par[2] = (zFLTC *0.5);
43808676 540 gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al
2cef3cb2 541 gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
937fe4a4 542
43808676 543
544 // plexiglass thickness: 1.5 mm ; factor 0.3
937fe4a4 545 ycoor += par[1];
b94fa26c 546 par[0] = xFLT*0.5;
43808676 547 par[1] = 0.075*0.3; // factor 0.3
b94fa26c 548 par[2] = (zFLTA *0.5);
937fe4a4 549 ycoor += par[1];
43808676 550 gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl.
2cef3cb2 551 gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
b94fa26c 552 par[2] = (zFLTB *0.5);
43808676 553 gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl.
2cef3cb2 554 gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
b94fa26c 555 par[2] = (zFLTC *0.5);
43808676 556 gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl.
2cef3cb2 557 gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
43808676 558
559 // frame of Air
b94fa26c 560 ycoor += par[1];
561 par[0] = xFLT*0.5;
43808676 562 par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm)
b94fa26c 563 par[2] = (zFLTA *0.5);
564 ycoor += par[1];
565 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
566 gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY");
567 par[2] = (zFLTB *0.5);
568 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
569 gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY");
570 par[2] = (zFLTC *0.5);
571 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
572 gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY");
43808676 573
574
575 // start with cards and cooling tubes
576 // finally, cards, cooling tubes and layer for thermal dispersion
577 // 3 volumes
578 // card volume definition
579
580 // see GEOM200 in GEANT manual
581 AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg
582
583 Float_t cardpar[3];
584 cardpar[0]= 61.;
585 cardpar[1]= 5.;
586 cardpar[2]= 0.1;
587 gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card
588 //alu plate volume definition
589 cardpar[1]= 3.5;
590 cardpar[2]= 0.05;
591 gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate
592
593
594 // central module positioning (FAIA)
595 Float_t cardpos[3], aplpos2, stepforcardA=6.625;
596 cardpos[0]= 0.;
597 cardpos[1]= -0.5;
598 cardpos[2]= -53.;
599 Float_t aplpos1 = -2.;
600 Int_t icard;
601 for (icard=0; icard<15; ++icard) {
602 cardpos[2]= cardpos[2]+stepforcardA;
603 aplpos2 = cardpos[2]+0.15;
604 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
605 gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
606
607 }
608
609
610 // intermediate module positioning (FAIB)
611 Float_t stepforcardB= 7.05;
612 cardpos[2]= -70.5;
613 for (icard=0; icard<19; ++icard) {
614 cardpos[2]= cardpos[2]+stepforcardB;
615 aplpos2 = cardpos[2]+0.15;
da3d3acd 616 gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
617 gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
43808676 618 }
619
620
621 // outer module positioning (FAIC)
622 Float_t stepforcardC= 8.45238;
623 cardpos[2]= -88.75;
624 for (icard=0; icard<20; ++icard) {
625 cardpos[2]= cardpos[2]+stepforcardC;
626 aplpos2 = cardpos[2]+0.15;
da3d3acd 627 gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY");
43808676 628 gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY");
629 }
630
631 // tube volume definition
632 Float_t tubepar[3];
633 tubepar[0]= 0.;
634 tubepar[1]= 0.4;
635 tubepar[2]= 61.;
636 gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel)
637 tubepar[0]= 0.;
638 tubepar[1]= 0.35;
639 tubepar[2]= 61.;
640 gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water
641 // positioning water tube into the steel one
642 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
643
644
645 // rotation matrix
646 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
647 // central module positioning (FAIA)
648 Float_t tubepos[3], tdis=0.6;
649 tubepos[0]= 0.;
650 tubepos[1]= cardpos[1];
651 tubepos[2]= -53.+tdis;
652 // tub1pos = 5.;
653 Int_t itub;
654 for (itub=0; itub<15; ++itub) {
655 tubepos[2]= tubepos[2]+stepforcardA;
656 gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
657 "ONLY");
658 }
659
660
661 // intermediate module positioning (FAIB)
662 tubepos[2]= -70.5+tdis;
663 for (itub=0; itub<19; ++itub) {
664 tubepos[2]= tubepos[2]+stepforcardB;
665 gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
666 "ONLY");
667 }
668
669 // outer module positioning (FAIC)
670 tubepos[2]= -88.75+tdis;
671 for (itub=0; itub<20; ++itub) {
672 tubepos[2]= tubepos[2]+stepforcardC;
673 gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99],
674 "ONLY");
675 }
676
fe4da5cc 677}
678
679//_____________________________________________________________________________
68861244 680void AliTOFv3::DrawModule() const
fe4da5cc 681{
682 //
517b7f8f 683 // Draw a shaded view of the Time Of Flight version 3
fe4da5cc 684 //
fe4da5cc 685 // Set everything unseen
cfce8870 686 gMC->Gsatt("*", "seen", -1);
fe4da5cc 687 //
688 // Set ALIC mother transparent
cfce8870 689 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 690 //
691 // Set the volumes visible
cfce8870 692 gMC->Gsatt("ALIC","SEEN",0);
2cef3cb2 693
694 gMC->Gsatt("FTOA","SEEN",1);
695 gMC->Gsatt("FTOB","SEEN",1);
696 gMC->Gsatt("FTOC","SEEN",1);
697 gMC->Gsatt("FLTA","SEEN",1);
698 gMC->Gsatt("FLTB","SEEN",1);
699 gMC->Gsatt("FLTC","SEEN",1);
700 gMC->Gsatt("FPLA","SEEN",1);
701 gMC->Gsatt("FPLB","SEEN",1);
702 gMC->Gsatt("FPLC","SEEN",1);
703 gMC->Gsatt("FSTR","SEEN",1);
704 gMC->Gsatt("FPEA","SEEN",1);
705 gMC->Gsatt("FPEB","SEEN",1);
706 gMC->Gsatt("FPEC","SEEN",1);
707
708 gMC->Gsatt("FLZ1","SEEN",0);
709 gMC->Gsatt("FLZ2","SEEN",0);
710 gMC->Gsatt("FLZ3","SEEN",0);
711 gMC->Gsatt("FLX1","SEEN",0);
712 gMC->Gsatt("FLX2","SEEN",0);
713 gMC->Gsatt("FLX3","SEEN",0);
714 gMC->Gsatt("FPAD","SEEN",0);
715
cfce8870 716 gMC->Gdopt("hide", "on");
717 gMC->Gdopt("shad", "on");
718 gMC->Gsatt("*", "fill", 7);
719 gMC->SetClipBox(".");
720 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
721 gMC->DefaultRange();
722 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
723 gMC->Gdhead(1111, "Time Of Flight");
724 gMC->Gdman(18, 4, "MAN");
725 gMC->Gdopt("hide","off");
fe4da5cc 726}
517b7f8f 727//_____________________________________________________________________________
728void AliTOFv3::DrawDetectorModules()
729{
730//
731// Draw a shaded view of the TOF detector version 3
732//
733
517b7f8f 734//Set ALIC mother transparent
4c475d27 735 gMC->Gsatt("ALIC","SEEN",0);
517b7f8f 736
737//
738//Set volumes visible
739//
740//=====> Level 1
741 // Level 1 for TOF volumes
742 gMC->Gsatt("B077","seen",0);
743
744
745//==========> Level 2
746 // Level 2
747 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
748 gMC->Gsatt("B071","seen",0);
749 gMC->Gsatt("B074","seen",0);
750 gMC->Gsatt("B075","seen",0);
751 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
752
753
754 // Level 2 of B071
755 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
756 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
757 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
758 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
759 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
760 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
761 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
762 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
763 gMC->Gsatt("BTO1","seen",0);
764
765
766 // Level 2 of B074
767 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
768 gMC->Gsatt("BTO2","seen",0);
769
770 // Level 2 of B075
771 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
772 gMC->Gsatt("BTO3","seen",0);
773
774// ==================> Level 3
775 // Level 3 of B071 / Level 2 of BTO1
776 gMC->Gsatt("FTOC","seen",-2);
777 gMC->Gsatt("FTOB","seen",-2);
778 gMC->Gsatt("FTOA","seen",-2);
779
780 // Level 3 of B074 / Level 2 of BTO2
781 // -> cfr previous settings
782
783 // Level 3 of B075 / Level 2 of BTO3
784 // -> cfr previous settings
785
786 gMC->Gdopt("hide","on");
787 gMC->Gdopt("shad","on");
788 gMC->Gsatt("*", "fill", 5);
789 gMC->SetClipBox(".");
790 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
791 gMC->DefaultRange();
792 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
793 gMC->Gdhead(1111,"TOF detector V1");
794 gMC->Gdman(18, 4, "MAN");
795 gMC->Gdopt("hide","off");
796}
797
798//_____________________________________________________________________________
799void AliTOFv3::DrawDetectorStrips()
800{
801//
802// Draw a shaded view of the TOF strips for version 3
803//
804
517b7f8f 805//Set ALIC mother transparent
4c475d27 806 gMC->Gsatt("ALIC","SEEN",0);
517b7f8f 807
808//
809//Set volumes visible
810//=====> Level 1
811 // Level 1 for TOF volumes
812 gMC->Gsatt("B077","seen",0);
813
814//==========> Level 2
815 // Level 2
816 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
817 gMC->Gsatt("B071","seen",0);
818 gMC->Gsatt("B074","seen",0);
819 gMC->Gsatt("B075","seen",0);
820 gMC->Gsatt("B080","seen",0); // B080 does not has sub-level
821
822 // Level 2 of B071
823 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
824 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
825 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
826 gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped -
827 gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels -
828 gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped -
829 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
830 gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels -
831 gMC->Gsatt("BTO1","seen",0);
832
833// ==================> Level 3
834 // Level 3 of B071 / Level 2 of BTO1
835 gMC->Gsatt("FTOC","seen",0);
836 gMC->Gsatt("FTOB","seen",0);
837 gMC->Gsatt("FTOA","seen",0);
838
839 // Level 3 of B074 / Level 2 of BTO2
840 // -> cfr previous settings
841
842 // Level 3 of B075 / Level 2 of BTO3
843 // -> cfr previous settings
844
845
846// ==========================> Level 4
847 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC
848 gMC->Gsatt("FLTC","seen",0);
849 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB
850 gMC->Gsatt("FLTB","seen",0);
851 // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA
852 gMC->Gsatt("FLTA","seen",0);
853
854 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC
855 // -> cfr previous settings
856 // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB
857 // -> cfr previous settings
858
859 // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC
860 // -> cfr previous settings
861
862//======================================> Level 5
863 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC
864 gMC->Gsatt("FALC","seen",0); // no children for FALC
865 gMC->Gsatt("FSTR","seen",-2);
866 gMC->Gsatt("FPEC","seen",0); // no children for FPEC
867 gMC->Gsatt("FECC","seen",0); // no children for FECC
868 gMC->Gsatt("FWAC","seen",0); // no children for FWAC
869 gMC->Gsatt("FAIC","seen",0); // no children for FAIC
870
871 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB
872 gMC->Gsatt("FALB","seen",0); // no children for FALB
873//--> gMC->Gsatt("FSTR","seen",-2);
874
875
876 // -> cfr previous settings
877 gMC->Gsatt("FPEB","seen",0); // no children for FPEB
878 gMC->Gsatt("FECB","seen",0); // no children for FECB
879 gMC->Gsatt("FWAB","seen",0); // no children for FWAB
880 gMC->Gsatt("FAIB","seen",0); // no children for FAIB
881
882 // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA
883 gMC->Gsatt("FALA","seen",0); // no children for FALB
884//--> gMC->Gsatt("FSTR","seen",-2);
885 // -> cfr previous settings
886 gMC->Gsatt("FPEA","seen",0); // no children for FPEA
887 gMC->Gsatt("FECA","seen",0); // no children for FECA
888 gMC->Gsatt("FWAA","seen",0); // no children for FWAA
889 gMC->Gsatt("FAIA","seen",0); // no children for FAIA
890
891 // Level 2 of B074
892 gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels -
893 gMC->Gsatt("BTO2","seen",0);
894
895 // Level 2 of B075
896 gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels -
897 gMC->Gsatt("BTO3","seen",0);
898
899// for others Level 5, cfr. previous settings
900
901 gMC->Gdopt("hide","on");
902 gMC->Gdopt("shad","on");
903 gMC->Gsatt("*", "fill", 5);
904 gMC->SetClipBox(".");
905 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
906 gMC->DefaultRange();
907 gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015);
908 gMC->Gdhead(1111,"TOF Strips V1");
909 gMC->Gdman(18, 4, "MAN");
910 gMC->Gdopt("hide","off");
911}
fe4da5cc 912
913//_____________________________________________________________________________
914void AliTOFv3::CreateMaterials()
915{
916 //
917 // Define materials for the Time Of Flight
918 //
3fe3a833 919 AliTOF::CreateMaterials();
fe4da5cc 920}
921
922//_____________________________________________________________________________
923void AliTOFv3::Init()
924{
925 //
926 // Initialise the detector after the geometry has been defined
927 //
9e1a0ddb 928 if(fDebug) {
929 printf("%s: **************************************"
68861244 930 " TOF "
931 "**************************************\n",ClassName());
9e1a0ddb 932 printf("\n%s Version 3 of TOF initialing, "
f4b3bbb7 933 "TOF with holes for HMPID detector\n",ClassName());
9e1a0ddb 934 }
ab76897d 935
fe4da5cc 936 AliTOF::Init();
ab76897d 937
2cef3cb2 938 fIdFTOA = gMC->VolId("FTOA");
939 fIdFTOB = gMC->VolId("FTOB");
940 fIdFTOC = gMC->VolId("FTOC");
941 fIdFLTA = gMC->VolId("FLTA");
942 fIdFLTB = gMC->VolId("FLTB");
943 fIdFLTC = gMC->VolId("FLTC");
ab76897d 944
9e1a0ddb 945 if(fDebug) {
946 printf("%s: **************************************"
68861244 947 " TOF "
948 "**************************************\n",ClassName());
949 }
fe4da5cc 950}
951
952//_____________________________________________________________________________
953void AliTOFv3::StepManager()
954{
955 //
956 // Procedure called at each step in the Time Of Flight
957 //
0a6d8768 958 TLorentzVector mom, pos;
2cef3cb2 959 Float_t xm[3],pm[3],xpad[3],ppad[3];
960 Float_t hits[13],phi,phid,z;
961 Int_t vol[5];
b94fa26c 962 Int_t sector, plate, padx, padz, strip;
963 Int_t copy, padzid, padxid, stripid, i;
2cef3cb2 964 Int_t *idtmed = fIdtmed->GetArray()-499;
b94fa26c 965 Float_t incidenceAngle;
826b71ec 966
fa914fe6 967 if(gMC->CurrentMedium()==idtmed[513] &&
0a6d8768 968 gMC->IsTrackEntering() && gMC->TrackCharge()
826b71ec 969 && gMC->CurrentVolID(copy)==fIdSens)
2cef3cb2 970 {
971 // getting information about hit volumes
826b71ec 972
b94fa26c 973 padzid=gMC->CurrentVolOffID(2,copy);
da3d3acd 974 padz=copy;
826b71ec 975
b94fa26c 976 padxid=gMC->CurrentVolOffID(1,copy);
da3d3acd 977 padx=copy;
826b71ec 978
b94fa26c 979 stripid=gMC->CurrentVolOffID(4,copy);
826b71ec 980 strip=copy;
981
0a6d8768 982 gMC->TrackPosition(pos);
983 gMC->TrackMomentum(mom);
826b71ec 984
2cef3cb2 985// Double_t NormPos=1./pos.Rho();
b94fa26c 986 Double_t normMom=1./mom.Rho();
2cef3cb2 987
988// getting the cohordinates in pad ref system
989 xm[0] = (Float_t)pos.X();
990 xm[1] = (Float_t)pos.Y();
991 xm[2] = (Float_t)pos.Z();
992
b94fa26c 993 pm[0] = (Float_t)mom.X()*normMom;
994 pm[1] = (Float_t)mom.Y()*normMom;
995 pm[2] = (Float_t)mom.Z()*normMom;
2cef3cb2 996
997 gMC->Gmtod(xm,xpad,1);
998 gMC->Gmtod(pm,ppad,2);
5919c40c 999
b94fa26c 1000 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
826b71ec 1001
1002 z = pos[2];
2cef3cb2 1003
da3d3acd 1004 plate = 0;
1005 if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC
2cef3cb2 1006 if (z < (fZlenA*0.5+fZlenB) &&
da3d3acd 1007 z > fZlenA*0.5) plate = 1; //4; // AdC
2cef3cb2 1008 if (z >-(fZlenA*0.5+fZlenB) &&
da3d3acd 1009 z < -fZlenA*0.5) plate = 3; //2; // AdC
1010 if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC
1011 if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC
1012
1013 if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC
1014 else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC
1015 else strip--; // AdC
1016
1017 if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC
1018 else padx--; // AdC
1019
1020 if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC
1021 else padz--; // AdC
2cef3cb2 1022
1023 phi = pos.Phi();
da3d3acd 1024 if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC
1025 else phid = phi*kRaddeg + 360.; // AdC
826b71ec 1026 sector = Int_t (phid/20.);
da3d3acd 1027 //sector++; // AdC
826b71ec 1028
0a6d8768 1029 for(i=0;i<3;++i) {
2cef3cb2 1030 hits[i] = pos[i];
1031 hits[i+3] = pm[i];
0a6d8768 1032 }
2cef3cb2 1033
1034 hits[6] = mom.Rho();
1035 hits[7] = pos[3];
1036 hits[8] = xpad[0];
1037 hits[9] = xpad[1];
1038 hits[10]= xpad[2];
b94fa26c 1039 hits[11]= incidenceAngle;
2cef3cb2 1040 hits[12]= gMC->Edep();
1041
1042 vol[0]= sector;
1043 vol[1]= plate;
1044 vol[2]= strip;
b94fa26c 1045 vol[3]= padx;
1046 vol[4]= padz;
2cef3cb2 1047
5d12ce38 1048 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
fe4da5cc 1049 }
1050}