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