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