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