]>
Commit | Line | Data |
---|---|---|
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$ | |
18 | */ | |
19 | ||
fe4da5cc | 20 | /////////////////////////////////////////////////////////////////////////////// |
21 | // // | |
22 | // Time Of Flight // | |
23 | // This class contains the basic functions for the Time Of Flight // | |
24 | // detector. Functions specific to one particular geometry are // | |
25 | // contained in the derived classes // | |
26 | // // | |
27 | //Begin_Html | |
28 | /* | |
1439f98e | 29 | <img src="picts/AliTOFClass.gif"> |
fe4da5cc | 30 | */ |
31 | //End_Html | |
32 | // // | |
33 | // // | |
34 | /////////////////////////////////////////////////////////////////////////////// | |
35 | ||
36 | #include "AliTOF.h" | |
37 | #include <TNode.h> | |
38 | #include <TTUBE.h> | |
39 | #include <TBRIK.h> | |
40 | #include "AliRun.h" | |
fe4da5cc | 41 | #include "AliConst.h" |
3fe3a833 | 42 | #include <stdlib.h> |
fe4da5cc | 43 | |
44 | ClassImp(AliTOF) | |
45 | ||
46 | //_____________________________________________________________________________ | |
47 | AliTOF::AliTOF() | |
48 | { | |
49 | // | |
50 | // Default constructor | |
51 | // | |
52 | fIshunt = 0; | |
53 | } | |
54 | ||
55 | //_____________________________________________________________________________ | |
56 | AliTOF::AliTOF(const char *name, const char *title) | |
57 | : AliDetector(name,title) | |
58 | { | |
59 | // | |
60 | // AliTOF standard constructor | |
61 | // | |
62 | fHits = new TClonesArray("AliTOFhit", 405); | |
63 | // | |
64 | fIshunt = 0; | |
65 | // | |
66 | SetMarkerColor(7); | |
67 | SetMarkerStyle(2); | |
68 | SetMarkerSize(0.4); | |
3fe3a833 | 69 | // |
70 | // Check that FRAME is there otherwise we have no place where to | |
71 | // put TOF | |
72 | AliModule* FRAME=gAlice->GetModule("FRAME"); | |
73 | if(!FRAME) { | |
74 | Error("Ctor","TOF needs FRAME to be present\n"); | |
75 | exit(1); | |
76 | } | |
fe4da5cc | 77 | } |
78 | ||
79 | //_____________________________________________________________________________ | |
80 | void AliTOF::AddHit(Int_t track, Int_t *vol, Float_t *hits) | |
81 | { | |
82 | // | |
83 | // Add a TOF hit | |
84 | // | |
85 | TClonesArray &lhits = *fHits; | |
86 | new(lhits[fNhits++]) AliTOFhit(fIshunt,track,vol,hits); | |
87 | } | |
88 | ||
89 | //_____________________________________________________________________________ | |
90 | void AliTOF::BuildGeometry() | |
91 | { | |
92 | // | |
93 | // Build TOF ROOT geometry for the ALICE event viewver | |
94 | // | |
95 | TNode *Node, *Top; | |
96 | const int kColorTOF = 27; | |
97 | // | |
98 | // Find top TNODE | |
99 | Top=gAlice->GetGeometry()->GetNode("alice"); | |
100 | // | |
101 | // Define rotation matrixes | |
3fe3a833 | 102 | new TRotMatrix("rot501","rot501",90,-20,90,90-20,0,0); |
103 | new TRotMatrix("rot502","rot502",90,-40,90,90-40,0,0); | |
104 | new TRotMatrix("rot503","rot503",90,-60,90,90-60,0,0); | |
105 | new TRotMatrix("rot504","rot504",90,-80,90,90-80,0,0); | |
106 | new TRotMatrix("rot505","rot505",90,-100,90,90-100,0,0); | |
107 | new TRotMatrix("rot506","rot506",90,-120,90,90-120,0,0); | |
108 | new TRotMatrix("rot507","rot507",90,-140,90,90-140,0,0); | |
109 | new TRotMatrix("rot508","rot508",90,-160,90,90-160,0,0); | |
110 | new TRotMatrix("rot509","rot509",90,-180,90,90-180,0,0); | |
111 | new TRotMatrix("rot510","rot510",90,-200,90,90-200,0,0); | |
112 | new TRotMatrix("rot511","rot511",90,-220,90,90-220,0,0); | |
113 | new TRotMatrix("rot512","rot512",90,-240,90,90-240,0,0); | |
114 | new TRotMatrix("rot513","rot513",90,-260,90,90-260,0,0); | |
115 | new TRotMatrix("rot514","rot514",90,-280,90,90-280,0,0); | |
116 | new TRotMatrix("rot515","rot515",90,-300,90,90-300,0,0); | |
117 | new TRotMatrix("rot516","rot516",90,-320,90,90-320,0,0); | |
118 | new TRotMatrix("rot517","rot517",90,-340,90,90-340,0,0); | |
119 | new TRotMatrix("rot518","rot518",90,-360,90,90-360,0,0); | |
fe4da5cc | 120 | // |
151e057e | 121 | // Position the different copies |
3fe3a833 | 122 | const Float_t rtof=(399+370)/2; |
123 | const Int_t ntof=18; | |
151e057e | 124 | const Float_t angle=2*kPI/ntof; |
125 | Float_t ang; | |
151e057e | 126 | // |
fe4da5cc | 127 | // Define TOF basic volume |
3fe3a833 | 128 | new TBRIK("S_TOF1","TOF box","void",130/2,29/2,190.); |
fe4da5cc | 129 | // |
3fe3a833 | 130 | // Position it |
fe4da5cc | 131 | Top->cd(); |
3fe3a833 | 132 | ang=2.5*angle; |
133 | Node = new TNode("FTO002","FTO02","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot502"); | |
fe4da5cc | 134 | Node->SetLineColor(kColorTOF); |
135 | fNodes->Add(Node); | |
136 | // | |
137 | Top->cd(); | |
3fe3a833 | 138 | Node = new TNode("FTO102","FTO102","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot502"); |
fe4da5cc | 139 | Node->SetLineColor(kColorTOF); |
140 | fNodes->Add(Node); | |
141 | // | |
fe4da5cc | 142 | // |
143 | Top->cd(); | |
3fe3a833 | 144 | ang=1.5*angle; |
145 | Node = new TNode("FTO003","FTO003","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot503"); | |
fe4da5cc | 146 | Node->SetLineColor(kColorTOF); |
147 | fNodes->Add(Node); | |
148 | // | |
149 | Top->cd(); | |
3fe3a833 | 150 | Node = new TNode("FTO103","FTO103","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot503"); |
fe4da5cc | 151 | Node->SetLineColor(kColorTOF); |
152 | fNodes->Add(Node); | |
153 | // | |
151e057e | 154 | // |
fe4da5cc | 155 | Top->cd(); |
3fe3a833 | 156 | ang=0.5*angle; |
157 | Node = new TNode("FTO004","FTO004","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot504"); | |
fe4da5cc | 158 | Node->SetLineColor(kColorTOF); |
151e057e | 159 | fNodes->Add(Node); |
fe4da5cc | 160 | // |
161 | Top->cd(); | |
3fe3a833 | 162 | Node = new TNode("FTO104","FTO104","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot504"); |
fe4da5cc | 163 | Node->SetLineColor(kColorTOF); |
164 | fNodes->Add(Node); | |
165 | // | |
151e057e | 166 | // |
fe4da5cc | 167 | Top->cd(); |
3fe3a833 | 168 | ang=-0.5*angle; |
169 | Node = new TNode("FTO005","FTO005","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot505"); | |
fe4da5cc | 170 | Node->SetLineColor(kColorTOF); |
171 | fNodes->Add(Node); | |
172 | // | |
173 | Top->cd(); | |
3fe3a833 | 174 | Node = new TNode("FTO105","FTO105","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot505"); |
fe4da5cc | 175 | Node->SetLineColor(kColorTOF); |
176 | fNodes->Add(Node); | |
177 | // | |
151e057e | 178 | // |
fe4da5cc | 179 | Top->cd(); |
3fe3a833 | 180 | ang=-1.5*angle; |
181 | Node = new TNode("FTO006","FTO006","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot506"); | |
fe4da5cc | 182 | Node->SetLineColor(kColorTOF); |
183 | fNodes->Add(Node); | |
184 | // | |
185 | Top->cd(); | |
3fe3a833 | 186 | Node = new TNode("FTO106","FTO106","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot506"); |
151e057e | 187 | Node->SetLineColor(kColorTOF); |
188 | fNodes->Add(Node); | |
189 | // | |
190 | // | |
191 | Top->cd(); | |
3fe3a833 | 192 | ang=kPI+1.5*angle; |
193 | Node = new TNode("FTO012","FTO012","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot512"); | |
fe4da5cc | 194 | Node->SetLineColor(kColorTOF); |
195 | fNodes->Add(Node); | |
196 | // | |
197 | Top->cd(); | |
3fe3a833 | 198 | Node = new TNode("FTO112","FTO112","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot512"); |
fe4da5cc | 199 | Node->SetLineColor(kColorTOF); |
200 | fNodes->Add(Node); | |
201 | // | |
151e057e | 202 | // |
fe4da5cc | 203 | Top->cd(); |
3fe3a833 | 204 | ang=kPI+0.5*angle; |
205 | Node = new TNode("FTO013","FTO013","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot513"); | |
fe4da5cc | 206 | Node->SetLineColor(kColorTOF); |
207 | fNodes->Add(Node); | |
208 | // | |
209 | Top->cd(); | |
3fe3a833 | 210 | Node = new TNode("FTO113","FTO113","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot513"); |
fe4da5cc | 211 | Node->SetLineColor(kColorTOF); |
212 | fNodes->Add(Node); | |
213 | // | |
151e057e | 214 | // |
fe4da5cc | 215 | Top->cd(); |
3fe3a833 | 216 | ang=kPI-0.5*angle; |
217 | Node = new TNode("FTO014","FTO04","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot514"); | |
fe4da5cc | 218 | Node->SetLineColor(kColorTOF); |
219 | fNodes->Add(Node); | |
220 | // | |
221 | Top->cd(); | |
3fe3a833 | 222 | Node = new TNode("FTO114","FTO114","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot514"); |
fe4da5cc | 223 | Node->SetLineColor(kColorTOF); |
224 | fNodes->Add(Node); | |
225 | // | |
151e057e | 226 | // |
fe4da5cc | 227 | Top->cd(); |
3fe3a833 | 228 | ang=kPI-1.5*angle; |
229 | Node = new TNode("FTO015","FTO015","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot515"); | |
fe4da5cc | 230 | Node->SetLineColor(kColorTOF); |
231 | fNodes->Add(Node); | |
232 | // | |
233 | Top->cd(); | |
3fe3a833 | 234 | Node = new TNode("FTO115","FTO115","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot515"); |
fe4da5cc | 235 | Node->SetLineColor(kColorTOF); |
236 | fNodes->Add(Node); | |
237 | // | |
151e057e | 238 | // |
fe4da5cc | 239 | Top->cd(); |
3fe3a833 | 240 | ang=kPI-2.5*angle; |
241 | Node = new TNode("FTO016","FTO016","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),190,"rot516"); | |
fe4da5cc | 242 | Node->SetLineColor(kColorTOF); |
243 | fNodes->Add(Node); | |
244 | // | |
245 | Top->cd(); | |
3fe3a833 | 246 | Node = new TNode("FTO116","FTO116","S_TOF1",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-190,"rot516"); |
fe4da5cc | 247 | Node->SetLineColor(kColorTOF); |
3fe3a833 | 248 | fNodes->Add(Node); |
249 | // | |
fe4da5cc | 250 | // |
251 | // Define second TOF volume | |
3fe3a833 | 252 | new TBRIK("S_TOF2","TOF box","void",130/2,29/2,170.); |
fe4da5cc | 253 | // |
254 | // Position the volume | |
255 | Top->cd(); | |
3fe3a833 | 256 | ang=-2.5*angle; |
257 | Node = new TNode("FTO007","FTO007","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot507"); | |
fe4da5cc | 258 | Node->SetLineColor(kColorTOF); |
259 | fNodes->Add(Node); | |
260 | // | |
261 | Top->cd(); | |
3fe3a833 | 262 | Node = new TNode("FTO107","FTO107","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot507"); |
fe4da5cc | 263 | Node->SetLineColor(kColorTOF); |
264 | fNodes->Add(Node); | |
265 | // | |
151e057e | 266 | // |
fe4da5cc | 267 | Top->cd(); |
3fe3a833 | 268 | ang=-3.5*angle; |
269 | Node = new TNode("FTO008","FTO008","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot508"); | |
fe4da5cc | 270 | Node->SetLineColor(kColorTOF); |
271 | fNodes->Add(Node); | |
272 | // | |
273 | Top->cd(); | |
3fe3a833 | 274 | Node = new TNode("FTO108","FTO108","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot508"); |
fe4da5cc | 275 | Node->SetLineColor(kColorTOF); |
276 | fNodes->Add(Node); | |
277 | // | |
151e057e | 278 | // |
fe4da5cc | 279 | Top->cd(); |
3fe3a833 | 280 | ang=-kPI/2; |
281 | Node = new TNode("FTO009","FTO009","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot509"); | |
fe4da5cc | 282 | Node->SetLineColor(kColorTOF); |
283 | fNodes->Add(Node); | |
284 | // | |
285 | Top->cd(); | |
3fe3a833 | 286 | Node = new TNode("FTO109","FTO109","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot509"); |
fe4da5cc | 287 | Node->SetLineColor(kColorTOF); |
288 | fNodes->Add(Node); | |
289 | // | |
151e057e | 290 | // |
fe4da5cc | 291 | Top->cd(); |
3fe3a833 | 292 | ang=kPI+3.5*angle; |
293 | Node = new TNode("FTO010","FTO010","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot510"); | |
fe4da5cc | 294 | Node->SetLineColor(kColorTOF); |
295 | fNodes->Add(Node); | |
296 | // | |
297 | Top->cd(); | |
3fe3a833 | 298 | Node = new TNode("FTO110","FTO110","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot510"); |
fe4da5cc | 299 | Node->SetLineColor(kColorTOF); |
300 | fNodes->Add(Node); | |
301 | // | |
151e057e | 302 | // |
fe4da5cc | 303 | Top->cd(); |
3fe3a833 | 304 | ang=kPI+2.5*angle; |
305 | Node = new TNode("FTO011","FTO011","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-170),"rot511"); | |
fe4da5cc | 306 | Node->SetLineColor(kColorTOF); |
307 | fNodes->Add(Node); | |
308 | // | |
309 | Top->cd(); | |
3fe3a833 | 310 | Node = new TNode("FTO111","FTO111","S_TOF2",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-170),"rot511"); |
fe4da5cc | 311 | Node->SetLineColor(kColorTOF); |
312 | fNodes->Add(Node); | |
313 | // | |
151e057e | 314 | // |
fe4da5cc | 315 | // Define third TOF volume |
3fe3a833 | 316 | new TBRIK("S_TOF3","TOF box","void",130/2.,29/2,75.); |
fe4da5cc | 317 | // |
318 | // Position it | |
319 | Top->cd(); | |
3fe3a833 | 320 | ang=3.5*angle; |
321 | Node = new TNode("FTO001","FTO001","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot501"); | |
fe4da5cc | 322 | Node->SetLineColor(kColorTOF); |
323 | fNodes->Add(Node); | |
324 | // | |
325 | Top->cd(); | |
3fe3a833 | 326 | Node = new TNode("FTO101","FTO101","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot501"); |
fe4da5cc | 327 | Node->SetLineColor(kColorTOF); |
328 | fNodes->Add(Node); | |
329 | // | |
151e057e | 330 | // |
fe4da5cc | 331 | Top->cd(); |
3fe3a833 | 332 | ang=kPI-3.5*angle; |
333 | Node = new TNode("FTO017","FTO017","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot517"); | |
fe4da5cc | 334 | Node->SetLineColor(kColorTOF); |
335 | fNodes->Add(Node); | |
336 | // | |
337 | Top->cd(); | |
3fe3a833 | 338 | Node = new TNode("FTO117","FTO117","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot517"); |
fe4da5cc | 339 | Node->SetLineColor(kColorTOF); |
340 | fNodes->Add(Node); | |
341 | // | |
151e057e | 342 | // |
fe4da5cc | 343 | Top->cd(); |
151e057e | 344 | ang=kPI/2; |
3fe3a833 | 345 | Node = new TNode("FTO018","FTO018","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),(2*190-75),"rot518"); |
fe4da5cc | 346 | Node->SetLineColor(kColorTOF); |
347 | fNodes->Add(Node); | |
348 | // | |
349 | Top->cd(); | |
3fe3a833 | 350 | Node = new TNode("FTO118","FTO118","S_TOF3",rtof*TMath::Cos(ang),rtof*TMath::Sin(ang),-(2*190-75),"rot518"); |
fe4da5cc | 351 | Node->SetLineColor(kColorTOF); |
352 | fNodes->Add(Node); | |
353 | } | |
354 | ||
355 | //_____________________________________________________________________________ | |
356 | void AliTOF::CreateGeometry() | |
357 | { | |
358 | // | |
3fe3a833 | 359 | // Common geometry code |
fe4da5cc | 360 | // |
361 | //Begin_Html | |
362 | /* | |
1439f98e | 363 | <img src="picts/AliTOFv23.gif"> |
fe4da5cc | 364 | */ |
365 | //End_Html | |
366 | // | |
367 | ||
fe4da5cc | 368 | const Double_t kPi=TMath::Pi(); |
369 | const Double_t kDegrad=kPi/180; | |
fe4da5cc | 370 | // |
fe4da5cc | 371 | Int_t lmax; |
3fe3a833 | 372 | Float_t xtof, ytof, fil_step; |
fe4da5cc | 373 | Float_t zcor1, zcor2, zcor3; |
3fe3a833 | 374 | Float_t ztof0, ztof1, ztof2; |
375 | Float_t zl, rmin, rmax, xm, ym, dwall; | |
376 | Int_t idrotm[18]; | |
377 | Float_t zm0, zm1, zm2; | |
378 | Float_t par[10]; | |
fe4da5cc | 379 | // |
ad51aeb0 | 380 | Int_t *idtmed = fIdtmed->GetArray()-499; |
fe4da5cc | 381 | // |
3fe3a833 | 382 | // barrel iner radius |
383 | rmin = 370.; | |
384 | // barrel outer radius | |
385 | rmax = rmin+29; | |
fe4da5cc | 386 | // barrel length along Z axis |
3fe3a833 | 387 | zl = (rmin+2/*distance to sencetive layer*/+7/2)*2; |
388 | // | |
389 | // frame inbetween TOF modules | |
390 | dwall = 4.; | |
391 | // Sizes of TOF module with its support etc.. | |
392 | xtof = 2 * (rmin*TMath::Tan(10*kDegrad)-dwall/2-.5); | |
393 | ytof = rmax-rmin; | |
394 | ztof0 = zl/2; | |
395 | // Is it full coverage version (3) or not | |
396 | if (IsVersion() != 3) { | |
397 | ztof1 = ztof0-rmax*TMath::Tan(7.8*kDegrad); // minus Z size of PHOS | |
398 | ztof2 = ztof0-rmax*TMath::Tan(54.34/2*kDegrad); // minus Z size of HMPID; | |
399 | } else { | |
400 | ztof1 = ztof0; | |
401 | ztof2 = ztof0; | |
402 | } | |
403 | // Number of TOF-modules | |
404 | lmax = 18; | |
fe4da5cc | 405 | // |
3fe3a833 | 406 | /* |
407 | //Some imitation of TRD | |
408 | par[0] = 281; | |
409 | par[1] = 350.282; | |
410 | par[2] = zl/2; | |
411 | gMC->Gsvolu("FTRD", "TUBE", idtmed[510], par, 3); | |
412 | gMC->Gspos("FTRD", 1, "ALIC", 0., 0., 0., 0, "ONLY"); | |
413 | ||
414 | par[0] = 0.; | |
415 | par[1] = 360.; | |
416 | par[2] = lmax; | |
417 | par[3] = 2.; | |
418 | par[4] = -zl/2; | |
419 | par[5] = rmin; | |
420 | par[6] = rmax; | |
421 | par[7] = zl/2; | |
422 | par[8] = rmin; | |
423 | par[9] = rmax; | |
424 | gMC->Gsvolu("FBAR", "PGON", idtmed[500], par, 10); | |
cfce8870 | 425 | gMC->Gspos("FBAR", 1, "ALIC", 0., 0., 0., 0, "ONLY"); |
3fe3a833 | 426 | */ |
fe4da5cc | 427 | // |
3fe3a833 | 428 | // TOF size (CO2) |
fe4da5cc | 429 | par[0] = xtof / 2.; |
430 | par[1] = ytof / 2.; | |
431 | par[2] = ztof0 / 2.; | |
cfce8870 | 432 | gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3); |
fe4da5cc | 433 | par[2] = ztof1 / 2.; |
cfce8870 | 434 | gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3); |
fe4da5cc | 435 | par[2] = ztof2 / 2.; |
cfce8870 | 436 | gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3); |
3fe3a833 | 437 | /* |
438 | // Frame wall | |
439 | par[0]=dwall/2.; | |
440 | par[1]=(rmax-rmin)/2.; | |
441 | par[2]=ztof0/2.; | |
442 | gMC->Gsvolu("FFR1", "BOX ", idtmed[508], par, 3); | |
443 | gMC->Gsatt("FFR1", "SEEN", -2); | |
444 | par[2]=ztof1/2.; | |
445 | gMC->Gsvolu("FFR2", "BOX ", idtmed[508], par, 3); | |
446 | gMC->Gsatt("FFR2", "SEEN", -2); | |
447 | par[2]=ztof2/2.; | |
448 | gMC->Gsvolu("FFR2", "BOX ", idtmed[508], par, 3); | |
449 | gMC->Gsatt("FFR2", "SEEN", -2); | |
450 | */ | |
451 | // | |
452 | // Subtraction the distanse to TOF module boundaries | |
453 | xm = xtof -(.5 +.5)*2; | |
fe4da5cc | 454 | ym = ytof; |
3fe3a833 | 455 | zm0 = ztof0; |
456 | zm1 = ztof1; | |
457 | zm2 = ztof2; | |
fe4da5cc | 458 | // |
3fe3a833 | 459 | /////////////// TOF module internal definitions ////////////// |
fe4da5cc | 460 | TOFpc(xm, ym, zm0, zm1, zm2); |
3fe3a833 | 461 | ///////////////////////////////////////////////////////////// |
fe4da5cc | 462 | // |
3fe3a833 | 463 | // Position of modules |
464 | fil_step = 360./lmax; | |
465 | zcor1 = ztof0/2; | |
fe4da5cc | 466 | zcor2 = ztof0 - ztof1 / 2.; |
467 | zcor3 = ztof0 - ztof2 / 2.; | |
3fe3a833 | 468 | /* |
fe4da5cc | 469 | for (i = 1; i <= lmax; ++i) { |
470 | fil1 = fil_step * i; | |
3fe3a833 | 471 | xcor2 = (rmin+rmax)/2 * TMath::Sin(fil1 * kDegrad); |
472 | ycor2 = (rmin+rmax)/2 * TMath::Cos(fil1 * kDegrad); | |
fe4da5cc | 473 | lmax1 = i + lmax; |
3fe3a833 | 474 | AliMatrix(idrotm[i], 90., -fil1, 90., 90. -fil1, 0., 0.); |
475 | if (i>=7 && i<=11) { // free space for PHOS | |
476 | // if (fil1 >= 180-50 && fil1 <= 180+50) { | |
cfce8870 | 477 | gMC->Gspos("FTO2", i, "FBAR", xcor2, ycor2, zcor2, idrotm[i], "ONLY"); |
478 | gMC->Gspos("FTO2", lmax1, "FBAR", xcor2, ycor2, -zcor2, idrotm[i], "ONLY"); | |
3fe3a833 | 479 | } else if (i>=17 || i==1) { // free space for RICH |
480 | // } else if (fil1 <= 30 || fil1 >= 360. - 30) { | |
cfce8870 | 481 | gMC->Gspos("FTO3", i, "FBAR", xcor2, ycor2, zcor3, idrotm[i], "ONLY"); |
482 | gMC->Gspos("FTO3", lmax1, "FBAR", xcor2, ycor2, -zcor3, idrotm[i], "ONLY"); | |
fe4da5cc | 483 | } else { |
cfce8870 | 484 | gMC->Gspos("FTO1", i, "FBAR", xcor2, ycor2, zcor1, idrotm[i], "ONLY"); |
485 | gMC->Gspos("FTO1", lmax1, "FBAR", xcor2, ycor2, -zcor1, idrotm[i], "ONLY"); | |
fe4da5cc | 486 | } |
487 | } | |
3fe3a833 | 488 | */ |
489 | AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.); | |
490 | gMC->Gspos("FTO2", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY"); | |
491 | gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[0], "ONLY"); | |
492 | ||
493 | gMC->Gspos("FTO3", 1, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY"); | |
494 | gMC->Gspos("FTO3", 2, "BTO3", 0, -zcor3, 0, idrotm[0], "ONLY"); | |
495 | ||
496 | gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY"); | |
497 | gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[0], "ONLY"); | |
fe4da5cc | 498 | } |
499 | ||
500 | //_____________________________________________________________________________ | |
8f72dc0c | 501 | void AliTOF::DrawModule() |
fe4da5cc | 502 | { |
503 | // | |
504 | // Draw a shaded view of the common part of the TOF geometry | |
fe4da5cc | 505 | // |
506 | ||
3fe3a833 | 507 | cout << " Drawing of AliTOF"<< endl; |
fe4da5cc | 508 | // Set everything unseen |
cfce8870 | 509 | gMC->Gsatt("*", "seen", -1); |
fe4da5cc | 510 | // |
511 | // Set ALIC mother transparent | |
cfce8870 | 512 | gMC->Gsatt("ALIC","SEEN",0); |
fe4da5cc | 513 | // |
514 | // Set the volumes visible | |
cfce8870 | 515 | gMC->Gsatt("FBAR","SEEN",0); |
516 | gMC->Gsatt("FTO1","SEEN",1); | |
517 | gMC->Gsatt("FTO2","SEEN",1); | |
518 | gMC->Gsatt("FTO3","SEEN",1); | |
3fe3a833 | 519 | gMC->Gsatt("FBT1","SEEN",1); |
520 | gMC->Gsatt("FBT2","SEEN",1); | |
521 | gMC->Gsatt("FBT3","SEEN",1); | |
522 | gMC->Gsatt("FLT1","SEEN",1); | |
523 | gMC->Gsatt("FLT2","SEEN",1); | |
524 | gMC->Gsatt("FLT3","SEEN",1); | |
cfce8870 | 525 | // |
526 | gMC->Gdopt("hide", "on"); | |
527 | gMC->Gdopt("shad", "on"); | |
528 | gMC->Gsatt("*", "fill", 7); | |
529 | gMC->SetClipBox("."); | |
530 | gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000); | |
531 | gMC->DefaultRange(); | |
532 | gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02); | |
533 | gMC->Gdhead(1111, "Time Of Flight"); | |
534 | gMC->Gdman(18, 4, "MAN"); | |
535 | gMC->Gdopt("hide","off"); | |
fe4da5cc | 536 | } |
537 | ||
538 | //_____________________________________________________________________________ | |
539 | void AliTOF::CreateMaterials() | |
540 | { | |
541 | // | |
542 | // Defines TOF materials for all versions | |
543 | // Authors : Maxim Martemianov, Boris Zagreev (ITEP) 18/09/98 | |
544 | // | |
545 | Int_t ISXFLD = gAlice->Field()->Integ(); | |
546 | Float_t SXMGMX = gAlice->Field()->Max(); | |
547 | // | |
3fe3a833 | 548 | //--- Quartz (SiO2) |
549 | Float_t aq[2] = { 28.0855,15.9994 }; | |
550 | Float_t zq[2] = { 14.,8. }; | |
551 | Float_t wq[2] = { 1.,2. }; | |
552 | Float_t dq = 2.20; | |
553 | Int_t nq = -2; | |
554 | // --- Freon | |
555 | Float_t afre[2] = { 12.011,18.9984032 }; | |
556 | Float_t zfre[2] = { 6.,9. }; | |
557 | Float_t wfre[2] = { 5.,12. }; | |
558 | Float_t densfre = 1.5; | |
559 | Int_t nfre = -2; | |
560 | // --- CO2 | |
fe4da5cc | 561 | Float_t ac[2] = { 12.,16. }; |
562 | Float_t zc[2] = { 6.,8. }; | |
563 | Float_t wc[2] = { 1.,2. }; | |
3fe3a833 | 564 | Float_t dc = .001977; |
565 | Int_t nc = -2; | |
566 | // For mylar (C5H4O2) | |
567 | Float_t amy[3] = { 12., 1., 16. }; | |
568 | Float_t zmy[3] = { 6., 1., 8. }; | |
569 | Float_t wmy[3] = { 5., 4., 2. }; | |
570 | Float_t dmy = 1.39; | |
571 | Int_t nmy = -3; | |
572 | // For polyethilene (CH2) for honeycomb!!!! | |
573 | Float_t ape[2] = { 12., 1. }; | |
574 | Float_t zpe[2] = { 6., 1. }; | |
575 | Float_t wpe[2] = { 1., 2. }; | |
576 | Float_t dpe = 0.935*0.479; //To have 1%X0 for 1cm as for honeycomb | |
577 | Int_t npe = -2; | |
578 | // --- G10 | |
fe4da5cc | 579 | Float_t ag10[4] = { 12.,1.,16.,28. }; |
580 | Float_t zg10[4] = { 6.,1.,8.,14. }; | |
581 | Float_t wmatg10[4] = { .259,.288,.248,.205 }; | |
3fe3a833 | 582 | Float_t densg10 = 1.7; |
583 | Int_t nlmatg10 = -4; | |
584 | // --- DME | |
fe4da5cc | 585 | Float_t adme[5] = { 12.,1.,16.,19.,79. }; |
586 | Float_t zdme[5] = { 6.,1.,8.,9.,35. }; | |
587 | Float_t wmatdme[5] = { .4056,.0961,.2562,.1014,.1407 }; | |
3fe3a833 | 588 | Float_t densdme = .00205; |
589 | Int_t nlmatdme = 5; | |
590 | // ---- ALUMINA (AL203) | |
fe4da5cc | 591 | Float_t aal[2] = { 27.,16. }; |
592 | Float_t zal[2] = { 13.,8. }; | |
593 | Float_t wmatal[2] = { 2.,3. }; | |
3fe3a833 | 594 | Float_t densal = 2.3; |
595 | Int_t nlmatal = -2; | |
596 | // -- Water | |
597 | Float_t awa[2] = { 1., 16. }; | |
598 | Float_t zwa[2] = { 1., 8. }; | |
599 | Float_t wwa[2] = { 2., 1. }; | |
600 | Float_t dwa = 1.0; | |
601 | Int_t nwa = -2; | |
fe4da5cc | 602 | // |
fe4da5cc | 603 | // |
3fe3a833 | 604 | //AliMaterial(0, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16); |
fe4da5cc | 605 | AliMaterial(1, "Air$",14.61,7.3,0.001205,30423.24,67500.); |
3fe3a833 | 606 | AliMaterial(2, "Cu $", 63.54, 29.0, 8.96, 1.43, 14.8); |
607 | AliMaterial(3, "C $", 12.01, 6.0, 2.265,18.8, 74.4); | |
608 | AliMixture(4, "Polyethilene$", ape, zpe, dpe, npe, wpe); | |
fe4da5cc | 609 | AliMixture(5, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10); |
fe4da5cc | 610 | AliMixture(6, "DME ", adme, zdme, densdme, nlmatdme, wmatdme); |
3fe3a833 | 611 | AliMixture(7, "CO2$", ac, zc, dc, nc, wc); |
fe4da5cc | 612 | AliMixture(8, "ALUMINA$", aal, zal, densal, nlmatal, wmatal); |
3fe3a833 | 613 | AliMaterial(9, "Al $", 26.98, 13., 2.7, 8.9, 37.2); |
614 | // (TRD simulation) thickness = 69.282cm/18.8cm = 3.685 X/X0 | |
615 | // AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*10.2/100, 18.8, 74.4); // for 10.2% | |
616 | AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*15./100, 18.8, 74.4); // for 15% | |
617 | // AliMaterial(10, "C-TRD$", 12.01, 6., 2.265*18.8/69.282*20./100, 18.8, 74.4); // for 20% | |
618 | AliMixture(11, "Mylar$", amy, zmy, dmy, nmy, wmy); | |
619 | AliMixture(12, "Freon$", afre, zfre, densfre, nfre, wfre); | |
620 | AliMixture(13, "Quartz$", aq, zq, dq, nq, wq); | |
621 | AliMixture(14, "Water$", awa, zwa, dwa, nwa, wwa); | |
622 | ||
623 | Float_t epsil, stmin, deemax, stemax; | |
fe4da5cc | 624 | // Previous data |
625 | // EPSIL = 0.1 ! Tracking precision, | |
626 | // STEMAX = 0.1 ! Maximum displacement for multiple scattering | |
627 | // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS | |
628 | // STMIN = 0.1 | |
629 | // New data from | |
630 | epsil = .001; | |
631 | stemax = -1.; | |
632 | deemax = -.3; | |
633 | stmin = -.8; | |
3fe3a833 | 634 | // AliMedium(0, "Vacuum $", 0, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); |
635 | AliMedium(1, "Air$", 1, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
636 | AliMedium(2, "Cu $", 2, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
637 | AliMedium(3, "C $", 3, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
638 | AliMedium(4, "Pol$", 4, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
ad51aeb0 | 639 | AliMedium(5, "G10$", 5, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); |
640 | AliMedium(6, "DME$", 6, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
641 | AliMedium(7, "CO2$", 7, 0, ISXFLD, SXMGMX, 10., -.01, -.1, .01, -.01); | |
642 | AliMedium(8, "ALUMINA$", 8, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
3fe3a833 | 643 | AliMedium(9, "Al Frame$", 9, 0, ISXFLD, SXMGMX, 10, stemax, deemax, epsil, stmin); |
644 | AliMedium(10, "DME-S$", 6, 1, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
645 | AliMedium(11, "C-TRD$", 10, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
646 | AliMedium(12, "Myl$", 11, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
647 | AliMedium(13, "Fre$", 12, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
648 | AliMedium(14, "Fre-S$", 12, 1, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
649 | AliMedium(15, "Glass$", 13, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
650 | AliMedium(16, "Water$", 14, 0, ISXFLD, SXMGMX, 10., stemax, deemax, epsil, stmin); | |
fe4da5cc | 651 | } |
652 | ||
653 | //_____________________________________________________________________________ | |
654 | Int_t AliTOF::DistancetoPrimitive(Int_t , Int_t ) | |
655 | { | |
656 | // | |
657 | // Returns distance from mouse pointer to detector, default version | |
658 | // | |
659 | return 9999; | |
660 | } | |
661 | ||
662 | //_____________________________________________________________________________ | |
663 | void AliTOF::Init() | |
664 | { | |
665 | // | |
666 | // Initialise TOF detector after it has been built | |
667 | // | |
668 | Int_t i; | |
fe4da5cc | 669 | // |
670 | printf("\n"); | |
671 | for(i=0;i<35;i++) printf("*"); | |
672 | printf(" TOF_INIT "); | |
673 | for(i=0;i<35;i++) printf("*"); | |
674 | printf("\n"); | |
3fe3a833 | 675 | cout << "TOF version " << IsVersion() <<" initialized" << endl; |
fe4da5cc | 676 | // |
677 | // Set id of TOF sensitive volume | |
3fe3a833 | 678 | if (IsVersion() !=0) fIdSens=gMC->VolId("FPG0"); |
fe4da5cc | 679 | // |
680 | for(i=0;i<80;i++) printf("*"); | |
681 | printf("\n"); | |
682 | } | |
683 | ||
684 | ||
685 | ClassImp(AliTOFhit) | |
686 | ||
687 | //___________________________________________ | |
688 | AliTOFhit::AliTOFhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits): | |
689 | AliHit(shunt, track) | |
690 | { | |
691 | // | |
692 | // Store a TOF hit | |
693 | // | |
694 | Int_t i; | |
695 | for (i=0;i<3;i++) fVolume[i] = vol[i]; | |
696 | // | |
697 | // Position | |
698 | fX=hits[0]; | |
699 | fY=hits[1]; | |
700 | fZ=hits[2]; | |
701 | // | |
702 | // Momentum | |
703 | fPx=hits[3]; | |
704 | fPy=hits[4]; | |
705 | fPz=hits[5]; | |
706 | fPmom=hits[6]; | |
707 | // | |
708 | // Time Of Flight | |
709 | fTof=hits[7]; | |
710 | } | |
711 | ||
712 |