Added protections against using the wrong version of FRAME
[u/mrichter/AliRoot.git] / TOF / AliTOF.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$
ab76897d 18Revision 1.9 1999/10/15 15:35:19 fca
19New version for frame1099 with and without holes
20
937fe4a4 21Revision 1.9 1999/09/29 09:24:33 fca
22Introduction of the Copyright and cvs Log
4c039060 23
937fe4a4 24*/
fe4da5cc 25///////////////////////////////////////////////////////////////////////////////
26// //
937fe4a4 27// Time Of Flight FCA //
fe4da5cc 28// This class contains the basic functions for the Time Of Flight //
29// detector. Functions specific to one particular geometry are //
30// contained in the derived classes //
937fe4a4 31//
32// VERSIONE WITH 5 SYMMETRIC MODULES ALONG Z AXIS
33// ==============================================
34//
35// VERSION WITH HOLES FOR PHOS AND TRD IN SPACEFRAME WITH HOLES
36//
37// Volume sensibile : FPAD
38//
39//
40//
41// Begin_Html
fe4da5cc 42/*
1439f98e 43<img src="picts/AliTOFClass.gif">
fe4da5cc 44*/
45//End_Html
937fe4a4 46//
47//
fe4da5cc 48// //
49///////////////////////////////////////////////////////////////////////////////
50
51#include "AliTOF.h"
52#include <TNode.h>
53#include <TTUBE.h>
54#include <TBRIK.h>
55#include "AliRun.h"
fe4da5cc 56#include "AliConst.h"
57
58ClassImp(AliTOF)
59
60//_____________________________________________________________________________
61AliTOF::AliTOF()
62{
63 //
64 // Default constructor
65 //
66 fIshunt = 0;
67}
68
69//_____________________________________________________________________________
70AliTOF::AliTOF(const char *name, const char *title)
71 : AliDetector(name,title)
72{
73 //
74 // AliTOF standard constructor
75 //
76 fHits = new TClonesArray("AliTOFhit", 405);
77 //
78 fIshunt = 0;
79 //
80 SetMarkerColor(7);
81 SetMarkerStyle(2);
82 SetMarkerSize(0.4);
83}
84
85//_____________________________________________________________________________
86void AliTOF::AddHit(Int_t track, Int_t *vol, Float_t *hits)
87{
88 //
89 // Add a TOF hit
90 //
91 TClonesArray &lhits = *fHits;
92 new(lhits[fNhits++]) AliTOFhit(fIshunt,track,vol,hits);
93}
94
95//_____________________________________________________________________________
96void AliTOF::BuildGeometry()
97{
98 //
99 // Build TOF ROOT geometry for the ALICE event viewver
100 //
101 TNode *Node, *Top;
102 const int kColorTOF = 27;
103 //
104 // Find top TNODE
105 Top=gAlice->GetGeometry()->GetNode("alice");
106 //
107 // Define rotation matrixes
3fe3a833 108 new TRotMatrix("rot501","rot501",90,-20,90,90-20,0,0);
109 new TRotMatrix("rot502","rot502",90,-40,90,90-40,0,0);
110 new TRotMatrix("rot503","rot503",90,-60,90,90-60,0,0);
111 new TRotMatrix("rot504","rot504",90,-80,90,90-80,0,0);
112 new TRotMatrix("rot505","rot505",90,-100,90,90-100,0,0);
113 new TRotMatrix("rot506","rot506",90,-120,90,90-120,0,0);
114 new TRotMatrix("rot507","rot507",90,-140,90,90-140,0,0);
115 new TRotMatrix("rot508","rot508",90,-160,90,90-160,0,0);
116 new TRotMatrix("rot509","rot509",90,-180,90,90-180,0,0);
117 new TRotMatrix("rot510","rot510",90,-200,90,90-200,0,0);
118 new TRotMatrix("rot511","rot511",90,-220,90,90-220,0,0);
119 new TRotMatrix("rot512","rot512",90,-240,90,90-240,0,0);
120 new TRotMatrix("rot513","rot513",90,-260,90,90-260,0,0);
121 new TRotMatrix("rot514","rot514",90,-280,90,90-280,0,0);
122 new TRotMatrix("rot515","rot515",90,-300,90,90-300,0,0);
123 new TRotMatrix("rot516","rot516",90,-320,90,90-320,0,0);
124 new TRotMatrix("rot517","rot517",90,-340,90,90-340,0,0);
125 new TRotMatrix("rot518","rot518",90,-360,90,90-360,0,0);
fe4da5cc 126 //
151e057e 127 // Position the different copies
3fe3a833 128 const Float_t rtof=(399+370)/2;
129 const Int_t ntof=18;
937fe4a4 130 const Float_t kPi = TMath::Pi();
131 const Float_t angle=2*kPi/ntof;
151e057e 132 Float_t ang;
151e057e 133 //
fe4da5cc 134 // Define TOF basic volume
937fe4a4 135
136 Float_t zlen1 = 152.5;
137 Float_t zlen2 = 147.0;
138 Float_t zlen3 = 117.0;
139
140 new TBRIK("S_TOF1","TOF box","void",130/2,29/2,zlen1/2);
fe4da5cc 141 //
3fe3a833 142 // Position it
937fe4a4 143 //
fe4da5cc 144 Top->cd();
937fe4a4 145 ang=3.5*angle;
146 Node = new TNode("FTO001","FTO001","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot501");
fe4da5cc 147 Node->SetLineColor(kColorTOF);
148 fNodes->Add(Node);
149 //
150 Top->cd();
937fe4a4 151 Node = new TNode("FTO101","FTO101","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot501");
fe4da5cc 152 Node->SetLineColor(kColorTOF);
153 fNodes->Add(Node);
154 //
937fe4a4 155 Top->cd();
156 ang=2.5*angle;
157 Node = new TNode("FTO002","FTO002","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot502");
158 Node->SetLineColor(kColorTOF);
159 fNodes->Add(Node);
fe4da5cc 160 //
161 Top->cd();
937fe4a4 162 Node = new TNode("FTO102","FTO102","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot502");
fe4da5cc 163 Node->SetLineColor(kColorTOF);
164 fNodes->Add(Node);
165 //
166 Top->cd();
937fe4a4 167 ang=1.5*angle;
168 Node = new TNode("FTO003","FTO003","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot503");
fe4da5cc 169 Node->SetLineColor(kColorTOF);
170 fNodes->Add(Node);
171 //
937fe4a4 172 Top->cd();
173 Node = new TNode("FTO103","FTO103","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot503");
174 Node->SetLineColor(kColorTOF);
175 fNodes->Add(Node);
151e057e 176 //
fe4da5cc 177 Top->cd();
3fe3a833 178 ang=0.5*angle;
937fe4a4 179 Node = new TNode("FTO004","FTO004","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot504");
fe4da5cc 180 Node->SetLineColor(kColorTOF);
151e057e 181 fNodes->Add(Node);
fe4da5cc 182 //
183 Top->cd();
937fe4a4 184 Node = new TNode("FTO104","FTO104","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot504");
fe4da5cc 185 Node->SetLineColor(kColorTOF);
186 fNodes->Add(Node);
187 //
188 Top->cd();
3fe3a833 189 ang=-0.5*angle;
937fe4a4 190 Node = new TNode("FTO005","FTO005","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot505");
fe4da5cc 191 Node->SetLineColor(kColorTOF);
192 fNodes->Add(Node);
193 //
194 Top->cd();
937fe4a4 195 Node = new TNode("FTO105","FTO105","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot505");
fe4da5cc 196 Node->SetLineColor(kColorTOF);
197 fNodes->Add(Node);
198 //
199 Top->cd();
3fe3a833 200 ang=-1.5*angle;
937fe4a4 201 Node = new TNode("FTO006","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot506");
fe4da5cc 202 Node->SetLineColor(kColorTOF);
203 fNodes->Add(Node);
204 //
205 Top->cd();
937fe4a4 206 Node = new TNode("FTO106","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot506");
151e057e 207 Node->SetLineColor(kColorTOF);
208 fNodes->Add(Node);
209 //
937fe4a4 210 Top->cd();
211 ang=-2.5*angle;
212 Node = new TNode("FTO007","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot507");
213 Node->SetLineColor(kColorTOF);
214 fNodes->Add(Node);
151e057e 215 //
937fe4a4 216 Top->cd();
217 Node = new TNode("FTO107","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot507");
fe4da5cc 218 Node->SetLineColor(kColorTOF);
219 fNodes->Add(Node);
220 //
221 Top->cd();
937fe4a4 222 ang=-3.5*angle;
223 Node = new TNode("FTO008","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot508");
fe4da5cc 224 Node->SetLineColor(kColorTOF);
225 fNodes->Add(Node);
226 //
937fe4a4 227 Top->cd();
228 Node = new TNode("FTO108","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot508");
229 Node->SetLineColor(kColorTOF);
230 fNodes->Add(Node);
151e057e 231 //
fe4da5cc 232 Top->cd();
937fe4a4 233 ang=-4.5*angle;
234 Node = new TNode("FTO009","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot509");
fe4da5cc 235 Node->SetLineColor(kColorTOF);
236 fNodes->Add(Node);
237 //
238 Top->cd();
937fe4a4 239 Node = new TNode("FTO109","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot509");
fe4da5cc 240 Node->SetLineColor(kColorTOF);
241 fNodes->Add(Node);
242 //
937fe4a4 243 Top->cd();
244 ang=-5.5*angle;
245 Node = new TNode("FTO010","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot510");
246 Node->SetLineColor(kColorTOF);
247 fNodes->Add(Node);
151e057e 248 //
fe4da5cc 249 Top->cd();
937fe4a4 250 Node = new TNode("FTO110","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot510");
fe4da5cc 251 Node->SetLineColor(kColorTOF);
252 fNodes->Add(Node);
253 //
254 Top->cd();
937fe4a4 255 ang=-6.5*angle;
256 Node = new TNode("FTO011","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot511");
fe4da5cc 257 Node->SetLineColor(kColorTOF);
258 fNodes->Add(Node);
259 //
937fe4a4 260 Top->cd();
261 Node = new TNode("FTO111","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot511");
262 Node->SetLineColor(kColorTOF);
263 fNodes->Add(Node);
264 //
265 Top->cd();
266 ang=-7.5*angle;
267 Node = new TNode("FTO012","FTO012","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot512");
268 Node->SetLineColor(kColorTOF);
269 fNodes->Add(Node);
151e057e 270 //
fe4da5cc 271 Top->cd();
937fe4a4 272 Node = new TNode("FTO112","FTO112","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot512");
273 Node->SetLineColor(kColorTOF);
274 fNodes->Add(Node);
275 //
276 Top->cd();
277 ang=-8.5*angle;
278 Node = new TNode("FTO013","FTO013","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot513");
fe4da5cc 279 Node->SetLineColor(kColorTOF);
280 fNodes->Add(Node);
281 //
282 Top->cd();
937fe4a4 283 Node = new TNode("FTO113","FTO113","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot513");
fe4da5cc 284 Node->SetLineColor(kColorTOF);
285 fNodes->Add(Node);
286 //
937fe4a4 287 Top->cd();
288 ang=kPI-0.5*angle;
289 Node = new TNode("FTO014","FTO04","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot514");
290 Node->SetLineColor(kColorTOF);
291 fNodes->Add(Node);
292 //
293 Top->cd();
294 Node = new TNode("FTO114","FTO114","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot514");
295 Node->SetLineColor(kColorTOF);
296 fNodes->Add(Node);
297 //
298 Top->cd();
299 ang=kPI-1.5*angle;
300 Node = new TNode("FTO015","FTO015","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot515");
301 Node->SetLineColor(kColorTOF);
302 fNodes->Add(Node);
303 //
304 Top->cd();
305 Node = new TNode("FTO115","FTO115","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot515");
306 Node->SetLineColor(kColorTOF);
307 fNodes->Add(Node);
151e057e 308 //
fe4da5cc 309 Top->cd();
3fe3a833 310 ang=kPI-2.5*angle;
937fe4a4 311 Node = new TNode("FTO016","FTO016","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot516");
312 Node->SetLineColor(kColorTOF);
313 fNodes->Add(Node);
314 //
315 Top->cd();
316 Node = new TNode("FTO116","FTO116","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot516");
317 Node->SetLineColor(kColorTOF);
318 fNodes->Add(Node);
319 //
320 Top->cd();
321 ang=kPi-3.5*angle;
322 Node = new TNode("FTO017","FTO017","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot517");
323 Node->SetLineColor(kColorTOF);
324 fNodes->Add(Node);
325 //
326 Top->cd();
327 Node = new TNode("FTO117","FTO117","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot517");
328 Node->SetLineColor(kColorTOF);
329 fNodes->Add(Node);
330 //
331 Top->cd();
332 ang=kPi/2;
333 Node = new TNode("FTO018","FTO018","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),299.15,"rot518");
fe4da5cc 334 Node->SetLineColor(kColorTOF);
335 fNodes->Add(Node);
336 //
337 Top->cd();
937fe4a4 338 Node = new TNode("FTO118","FTO118","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-299.15,"rot518");
fe4da5cc 339 Node->SetLineColor(kColorTOF);
3fe3a833 340 fNodes->Add(Node);
341 //
fe4da5cc 342 //
343 // Define second TOF volume
937fe4a4 344 new TBRIK("S_TOF2","TOF box","void",130/2,29/2,zlen2/2);
fe4da5cc 345 //
346 // Position the volume
937fe4a4 347 //
348 Top->cd();
349 ang=2.5*angle;
350 Node = new TNode("FTO202","FTO202","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot502");
351 Node->SetLineColor(kColorTOF);
352 fNodes->Add(Node);
353 //
354 Top->cd();
355 Node = new TNode("FTO402","FTO402","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot502");
356 Node->SetLineColor(kColorTOF);
357 fNodes->Add(Node);
358 //
359 Top->cd();
360 ang=1.5*angle;
361 Node = new TNode("FTO203","FTO203","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot503");
362 Node->SetLineColor(kColorTOF);
363 fNodes->Add(Node);
364 //
365 Top->cd();
366 Node = new TNode("FTO403","FTO403","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot503");
367 Node->SetLineColor(kColorTOF);
368 fNodes->Add(Node);
369 //
370 Top->cd();
371 ang=0.5*angle;
372 Node = new TNode("FTO204","FTO204","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot504");
373 Node->SetLineColor(kColorTOF);
374 fNodes->Add(Node);
375 //
376 Top->cd();
377 Node = new TNode("FTO404","FTO404","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot504");
378 Node->SetLineColor(kColorTOF);
379 fNodes->Add(Node);
380 //
381 Top->cd();
382 ang=-0.5*angle;
383 Node = new TNode("FTO205","FTO205","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot505");
384 Node->SetLineColor(kColorTOF);
385 fNodes->Add(Node);
386 //
387 Top->cd();
388 Node = new TNode("FTO405","FTO405","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot505");
389 Node->SetLineColor(kColorTOF);
390 fNodes->Add(Node);
391 //
392 Top->cd();
393 ang=-1.5*angle;
394 Node = new TNode("FTO206","FTO206","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot506");
395 Node->SetLineColor(kColorTOF);
396 fNodes->Add(Node);
397 //
398 Top->cd();
399 Node = new TNode("FTO406","FTO406","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot506");
400 Node->SetLineColor(kColorTOF);
401 fNodes->Add(Node);
402 //
fe4da5cc 403 Top->cd();
3fe3a833 404 ang=-2.5*angle;
937fe4a4 405 Node = new TNode("FTO207","FTO207","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot507");
fe4da5cc 406 Node->SetLineColor(kColorTOF);
407 fNodes->Add(Node);
408 //
409 Top->cd();
937fe4a4 410 Node = new TNode("FTO407","FTO407","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot507");
fe4da5cc 411 Node->SetLineColor(kColorTOF);
412 fNodes->Add(Node);
413 //
151e057e 414 //
fe4da5cc 415 Top->cd();
3fe3a833 416 ang=-3.5*angle;
937fe4a4 417 Node = new TNode("FTO208","FTO208","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot508");
418 Node->SetLineColor(kColorTOF);
419 fNodes->Add(Node);
420 //
421 Top->cd();
422 Node = new TNode("FTO408","FTO408","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot508");
fe4da5cc 423 Node->SetLineColor(kColorTOF);
424 fNodes->Add(Node);
425 //
426 Top->cd();
937fe4a4 427 ang=-kPi/2;
428 Node = new TNode("FTO209","FTO209","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot509");
fe4da5cc 429 Node->SetLineColor(kColorTOF);
430 fNodes->Add(Node);
431 //
937fe4a4 432 Top->cd();
433 Node = new TNode("FTO409","FTO409","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot509");
434 Node->SetLineColor(kColorTOF);
435 fNodes->Add(Node);
151e057e 436 //
fe4da5cc 437 Top->cd();
937fe4a4 438 ang=-kPi/2-angle;
439 Node = new TNode("FTO210","FTO210","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot510");
fe4da5cc 440 Node->SetLineColor(kColorTOF);
441 fNodes->Add(Node);
442 //
443 Top->cd();
937fe4a4 444 Node = new TNode("FTO410","FTO410","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot510");
fe4da5cc 445 Node->SetLineColor(kColorTOF);
446 fNodes->Add(Node);
447 //
937fe4a4 448 Top->cd();
449 ang=-kPi/2-2*angle;
450 Node = new TNode("FTO211","FTO211","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot511");
451 Node->SetLineColor(kColorTOF);
452 fNodes->Add(Node);
151e057e 453 //
fe4da5cc 454 Top->cd();
937fe4a4 455 Node = new TNode("FTO411","FTO411","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot511");
fe4da5cc 456 Node->SetLineColor(kColorTOF);
457 fNodes->Add(Node);
458 //
459 Top->cd();
937fe4a4 460 ang=-kPi/2-3*angle;
461 Node = new TNode("FTO212","FTO212","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot512");
fe4da5cc 462 Node->SetLineColor(kColorTOF);
463 fNodes->Add(Node);
464 //
937fe4a4 465 Top->cd();
466 Node = new TNode("FTO412","FTO412","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot512");
467 Node->SetLineColor(kColorTOF);
468 fNodes->Add(Node);
469 //
470 //
471 Top->cd();
472 ang=-kPi/2-4*angle;
473 Node = new TNode("FTO213","FTO213","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot513");
474 Node->SetLineColor(kColorTOF);
475 fNodes->Add(Node);
476 //
477 Top->cd();
478 Node = new TNode("FTO413","FTO413","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot513");
479 Node->SetLineColor(kColorTOF);
480 fNodes->Add(Node);
481 //
482 Top->cd();
483 ang=kPi-0.5*angle;
484 Node = new TNode("FTO214","FTO214","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot514");
485 Node->SetLineColor(kColorTOF);
486 fNodes->Add(Node);
487 //
488 Top->cd();
489 Node = new TNode("FTO414","FTO414","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot514");
490 Node->SetLineColor(kColorTOF);
491 fNodes->Add(Node);
151e057e 492 //
fe4da5cc 493 Top->cd();
937fe4a4 494 ang=kPi-1.5*angle;
495 Node = new TNode("FTO215","FTO215","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot515");
fe4da5cc 496 Node->SetLineColor(kColorTOF);
497 fNodes->Add(Node);
498 //
499 Top->cd();
937fe4a4 500 Node = new TNode("FTO415","FTO415","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot515");
fe4da5cc 501 Node->SetLineColor(kColorTOF);
502 fNodes->Add(Node);
503 //
937fe4a4 504 Top->cd();
505 ang=kPi-2.5*angle;
506 Node = new TNode("FTO216","FTO216","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),146.45,"rot516");
507 Node->SetLineColor(kColorTOF);
508 fNodes->Add(Node);
151e057e 509 //
937fe4a4 510 Top->cd();
511 Node = new TNode("FTO416","FTO416","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-146.45,"rot516");
512 Node->SetLineColor(kColorTOF);
513 fNodes->Add(Node);
514
fe4da5cc 515 // Define third TOF volume
937fe4a4 516 new TBRIK("S_TOF3","TOF box","void",130/2.,29/2,zlen3/2.);
fe4da5cc 517 //
518 // Position it
937fe4a4 519 //
fe4da5cc 520 Top->cd();
937fe4a4 521 ang=2.5*angle;
522 Node = new TNode("FTO302","FTO302","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot502");
523 Node->SetLineColor(kColorTOF);
524 fNodes->Add(Node);
525 //
526 Top->cd();
527 ang=1.5*angle;
528 Node = new TNode("FTO303","FTO303","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot503");
529 Node->SetLineColor(kColorTOF);
530 fNodes->Add(Node);
531 //
532 Top->cd();
533 ang=0.5*angle;
534 Node = new TNode("FTO304","FTO304","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot504");
535 Node->SetLineColor(kColorTOF);
536 fNodes->Add(Node);
537 //
538 Top->cd();
539 ang=-0.5*angle;
540 Node = new TNode("FTO305","FTO305","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot505");
fe4da5cc 541 Node->SetLineColor(kColorTOF);
542 fNodes->Add(Node);
543 //
544 Top->cd();
937fe4a4 545 ang=-1.5*angle;
546 Node = new TNode("FTO306","FTO306","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot506");
fe4da5cc 547 Node->SetLineColor(kColorTOF);
548 fNodes->Add(Node);
549 //
151e057e 550 //
fe4da5cc 551 Top->cd();
937fe4a4 552 ang=kPi+1.5*angle;
553 Node = new TNode("FTO312","FTO312","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot512");
fe4da5cc 554 Node->SetLineColor(kColorTOF);
555 fNodes->Add(Node);
556 //
557 Top->cd();
937fe4a4 558 ang=kPi+0.5*angle;
559 Node = new TNode("FTO313","FTO313","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot513");
fe4da5cc 560 Node->SetLineColor(kColorTOF);
561 fNodes->Add(Node);
562 //
937fe4a4 563 Top->cd();
564 ang=kPi-0.5*angle;
565 Node = new TNode("FTO314","FTO314","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot514");
566 Node->SetLineColor(kColorTOF);
567 fNodes->Add(Node);
151e057e 568 //
fe4da5cc 569 Top->cd();
937fe4a4 570 ang=kPi-1.5*angle;
571 Node = new TNode("FTO315","FTO315","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot515");
fe4da5cc 572 Node->SetLineColor(kColorTOF);
573 fNodes->Add(Node);
574 //
575 Top->cd();
937fe4a4 576 ang=kPi-2.5*angle;
577 Node = new TNode("FTO316","FTO316","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),0.,"rot516");
fe4da5cc 578 Node->SetLineColor(kColorTOF);
579 fNodes->Add(Node);
937fe4a4 580
fe4da5cc 581}
582
583//_____________________________________________________________________________
584void AliTOF::CreateGeometry()
585{
586 //
3fe3a833 587 // Common geometry code
fe4da5cc 588 //
589 //Begin_Html
590 /*
1439f98e 591 <img src="picts/AliTOFv23.gif">
fe4da5cc 592 */
593 //End_Html
594 //
595
fe4da5cc 596 const Double_t kPi=TMath::Pi();
597 const Double_t kDegrad=kPi/180;
fe4da5cc 598 //
937fe4a4 599 Float_t xtof, ytof;
600 Float_t ztof0;
601 Float_t rmin, rmax, dwall;
602
3fe3a833 603 // barrel iner radius
937fe4a4 604 rmin = 370.;//cm
3fe3a833 605 // barrel outer radius
606 rmax = rmin+29;
937fe4a4 607
3fe3a833 608 // frame inbetween TOF modules
937fe4a4 609 dwall = 4.;//cm
3fe3a833 610 // Sizes of TOF module with its support etc..
937fe4a4 611 xtof = 2.*(rmin*TMath::Tan(10*kDegrad)-dwall/2-.5);
3fe3a833 612 ytof = rmax-rmin;
937fe4a4 613 ztof0 = 375.5;//cm
3fe3a833 614
937fe4a4 615// TOF size (CO2)
3fe3a833 616
937fe4a4 617 Float_t zlen1 = 159.5;//cm
618 Float_t zlen2 = 154.0;//cm
619 Float_t zlen3 = 124.0;//cm
3fe3a833 620
937fe4a4 621// TOF module internal definitions
622 TOFpc(xtof, ytof, zlen1, zlen2, zlen3, ztof0);
fe4da5cc 623}
624
625//_____________________________________________________________________________
8f72dc0c 626void AliTOF::DrawModule()
fe4da5cc 627{
628 //
629 // Draw a shaded view of the common part of the TOF geometry
fe4da5cc 630 //
631
3fe3a833 632 cout << " Drawing of AliTOF"<< endl;
fe4da5cc 633 // Set everything unseen
cfce8870 634 gMC->Gsatt("*", "seen", -1);
fe4da5cc 635 //
636 // Set ALIC mother transparent
cfce8870 637 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 638 //
639 // Set the volumes visible
cfce8870 640 gMC->Gsatt("FBAR","SEEN",0);
641 gMC->Gsatt("FTO1","SEEN",1);
642 gMC->Gsatt("FTO2","SEEN",1);
643 gMC->Gsatt("FTO3","SEEN",1);
3fe3a833 644 gMC->Gsatt("FBT1","SEEN",1);
645 gMC->Gsatt("FBT2","SEEN",1);
646 gMC->Gsatt("FBT3","SEEN",1);
647 gMC->Gsatt("FLT1","SEEN",1);
648 gMC->Gsatt("FLT2","SEEN",1);
649 gMC->Gsatt("FLT3","SEEN",1);
cfce8870 650 //
651 gMC->Gdopt("hide", "on");
652 gMC->Gdopt("shad", "on");
653 gMC->Gsatt("*", "fill", 7);
654 gMC->SetClipBox(".");
655 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
656 gMC->DefaultRange();
657 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
658 gMC->Gdhead(1111, "Time Of Flight");
659 gMC->Gdman(18, 4, "MAN");
660 gMC->Gdopt("hide","off");
fe4da5cc 661}
662
663//_____________________________________________________________________________
664void AliTOF::CreateMaterials()
665{
666 //
667 // Defines TOF materials for all versions
668 // Authors : Maxim Martemianov, Boris Zagreev (ITEP) 18/09/98
669 //
670 Int_t ISXFLD = gAlice->Field()->Integ();
671 Float_t SXMGMX = gAlice->Field()->Max();
672 //
3fe3a833 673 //--- Quartz (SiO2)
674 Float_t aq[2] = { 28.0855,15.9994 };
675 Float_t zq[2] = { 14.,8. };
676 Float_t wq[2] = { 1.,2. };
677 Float_t dq = 2.20;
678 Int_t nq = -2;
679 // --- Freon
680 Float_t afre[2] = { 12.011,18.9984032 };
681 Float_t zfre[2] = { 6.,9. };
682 Float_t wfre[2] = { 5.,12. };
683 Float_t densfre = 1.5;
684 Int_t nfre = -2;
685 // --- CO2
fe4da5cc 686 Float_t ac[2] = { 12.,16. };
687 Float_t zc[2] = { 6.,8. };
688 Float_t wc[2] = { 1.,2. };
3fe3a833 689 Float_t dc = .001977;
690 Int_t nc = -2;
691 // For mylar (C5H4O2)
692 Float_t amy[3] = { 12., 1., 16. };
693 Float_t zmy[3] = { 6., 1., 8. };
694 Float_t wmy[3] = { 5., 4., 2. };
695 Float_t dmy = 1.39;
696 Int_t nmy = -3;
697 // For polyethilene (CH2) for honeycomb!!!!
698 Float_t ape[2] = { 12., 1. };
699 Float_t zpe[2] = { 6., 1. };
700 Float_t wpe[2] = { 1., 2. };
701 Float_t dpe = 0.935*0.479; //To have 1%X0 for 1cm as for honeycomb
702 Int_t npe = -2;
703 // --- G10
fe4da5cc 704 Float_t ag10[4] = { 12.,1.,16.,28. };
705 Float_t zg10[4] = { 6.,1.,8.,14. };
706 Float_t wmatg10[4] = { .259,.288,.248,.205 };
3fe3a833 707 Float_t densg10 = 1.7;
708 Int_t nlmatg10 = -4;
709 // --- DME
fe4da5cc 710 Float_t adme[5] = { 12.,1.,16.,19.,79. };
711 Float_t zdme[5] = { 6.,1.,8.,9.,35. };
712 Float_t wmatdme[5] = { .4056,.0961,.2562,.1014,.1407 };
3fe3a833 713 Float_t densdme = .00205;
714 Int_t nlmatdme = 5;
715 // ---- ALUMINA (AL203)
fe4da5cc 716 Float_t aal[2] = { 27.,16. };
717 Float_t zal[2] = { 13.,8. };
718 Float_t wmatal[2] = { 2.,3. };
3fe3a833 719 Float_t densal = 2.3;
720 Int_t nlmatal = -2;
721 // -- Water
722 Float_t awa[2] = { 1., 16. };
723 Float_t zwa[2] = { 1., 8. };
724 Float_t wwa[2] = { 2., 1. };
725 Float_t dwa = 1.0;
726 Int_t nwa = -2;
fe4da5cc 727 //
3fe3a833 728 //AliMaterial(0, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
fe4da5cc 729 AliMaterial(1, "Air$",14.61,7.3,0.001205,30423.24,67500.);
3fe3a833 730 AliMaterial(2, "Cu $", 63.54, 29.0, 8.96, 1.43, 14.8);
731 AliMaterial(3, "C $", 12.01, 6.0, 2.265,18.8, 74.4);
732 AliMixture(4, "Polyethilene$", ape, zpe, dpe, npe, wpe);
fe4da5cc 733 AliMixture(5, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
fe4da5cc 734 AliMixture(6, "DME ", adme, zdme, densdme, nlmatdme, wmatdme);
3fe3a833 735 AliMixture(7, "CO2$", ac, zc, dc, nc, wc);
fe4da5cc 736 AliMixture(8, "ALUMINA$", aal, zal, densal, nlmatal, wmatal);
3fe3a833 737 AliMaterial(9, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
3fe3a833 738 AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*15./100, 18.8, 74.4); // for 15%
3fe3a833 739 AliMixture(11, "Mylar$", amy, zmy, dmy, nmy, wmy);
740 AliMixture(12, "Freon$", afre, zfre, densfre, nfre, wfre);
741 AliMixture(13, "Quartz$", aq, zq, dq, nq, wq);
742 AliMixture(14, "Water$", awa, zwa, dwa, nwa, wwa);
743
744 Float_t epsil, stmin, deemax, stemax;
fe4da5cc 745 // Previous data
746 // EPSIL = 0.1 ! Tracking precision,
747 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
748 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
749 // STMIN = 0.1
750 // New data from
751 epsil = .001;
752 stemax = -1.;
753 deemax = -.3;
754 stmin = -.8;
937fe4a4 755
3fe3a833 756 AliMedium(1, "Air$", 1, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
757 AliMedium(2, "Cu $", 2, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
758 AliMedium(3, "C $", 3, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
759 AliMedium(4, "Pol$", 4, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
ad51aeb0 760 AliMedium(5, "G10$", 5, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
761 AliMedium(6, "DME$", 6, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
762 AliMedium(7, "CO2$", 7, 0, ISXFLD, SXMGMX, 10., -.01, -.1, .01, -.01);
763 AliMedium(8, "ALUMINA$", 8, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
3fe3a833 764 AliMedium(9, "Al Frame$", 9, 0, ISXFLD, SXMGMX, 10, stemax, deemax, epsil, stmin);
765 AliMedium(10, "DME-S$", 6, 1, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
766 AliMedium(11, "C-TRD$", 10, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
767 AliMedium(12, "Myl$", 11, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
768 AliMedium(13, "Fre$", 12, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
769 AliMedium(14, "Fre-S$", 12, 1, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
770 AliMedium(15, "Glass$", 13, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
771 AliMedium(16, "Water$", 14, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin);
fe4da5cc 772}
773
774//_____________________________________________________________________________
775Int_t AliTOF::DistancetoPrimitive(Int_t , Int_t )
776{
777 //
778 // Returns distance from mouse pointer to detector, default version
779 //
780 return 9999;
781}
782
783//_____________________________________________________________________________
784void AliTOF::Init()
785{
786 //
787 // Initialise TOF detector after it has been built
788 //
fe4da5cc 789 //
790 // Set id of TOF sensitive volume
937fe4a4 791 if (IsVersion() !=0) fIdSens=gMC->VolId("FPAD");
fe4da5cc 792 //
fe4da5cc 793}
794
795
796ClassImp(AliTOFhit)
797
798//___________________________________________
799AliTOFhit::AliTOFhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
800 AliHit(shunt, track)
801{
802 //
803 // Store a TOF hit
804 //
805 Int_t i;
806 for (i=0;i<3;i++) fVolume[i] = vol[i];
807 //
808 // Position
809 fX=hits[0];
810 fY=hits[1];
811 fZ=hits[2];
812 //
813 // Momentum
814 fPx=hits[3];
815 fPy=hits[4];
816 fPz=hits[5];
817 fPmom=hits[6];
818 //
819 // Time Of Flight
820 fTof=hits[7];
821}
937fe4a4 822