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