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