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