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