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