Avoid warnings on SunOS
[u/mrichter/AliRoot.git] / TRD / AliTRDv0.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Transition Radiation Detector version 0 -- coarse simulation //
4// //
5//Begin_Html
6/*
1439f98e 7<img src="picts/AliTRDv0Class.gif">
fe4da5cc 8*/
9//End_Html
10// //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
14#include <TMath.h>
15#include <TRandom.h>
16#include <TVector.h>
fe4da5cc 17
fe4da5cc 18#include "AliTRDv0.h"
19#include "AliRun.h"
20#include "AliMC.h"
21#include "AliConst.h"
22
23ClassImp(AliTRDv0)
24
25//_____________________________________________________________________________
26AliTRDv0::AliTRDv0(const char *name, const char *title)
27 :AliTRD(name, title)
28{
29 //
30 // Standard constructor for Transition Radiation Detector version 0
31 //
d3f347ff 32 fIdSens1 = fIdSens2 = fIdSens3 = 0;
fe4da5cc 33}
34
35//_____________________________________________________________________________
36void AliTRDv0::CreateGeometry()
37{
38 //
39 // Create the GEANT geometry for the Transition Radiation Detector
40 // --- The coarse geometry of the TRD, that can be used for background
41 // studies. This version covers the full azimuth.
d3f347ff 42 // --- Author : Christoph Blume (GSI) 17/5/99
43 //
44 // --- Volume names :
45 // TRD --> Mother TRD volume (Al)
46 // UTRS --> Sectors of the sub-detector (Al)
47 // UTRI --> Inner part of the detector frame (Air)
48 // UTCI(N,O) --> Frames of the inner, neighbouring and outer chambers (C)
49 // UTII(N,O) --> Inner part of the chambers (Air)
50 // UTMI(N,O) --> Modules in the chambers (Air)
51 // UT0I(N,O) --> Radiator seal (G10)
52 // UT1I(N,O) --> Radiator (CO2)
53 // UT2I(N,O) --> Polyethylene of radiator (PE)
54 // UT3I(N,O) --> Entrance window (Mylar)
55 // UT4I(N,O) --> Gas volume (sensitive) (Xe/Isobutane)
56 // UT5I(N,O) --> Pad plane (Cu)
57 // UT6I(N,O) --> Support structure (G10)
58 // UT7I(N,O) --> FEE + signal lines (Cu)
59 // UT8I(N,O) --> Polyethylene of cooling device (PE)
60 // UT9I(N,O) --> Cooling water (Water)
fe4da5cc 61 //
62 //Begin_Html
63 /*
1439f98e 64 <img src="picts/AliTRDv0.gif">
fe4da5cc 65 */
66 //End_Html
67 //Begin_Html
68 /*
1439f98e 69 <img src="picts/AliTRDv0Tree.gif">
fe4da5cc 70 */
71 //End_Html
72
73 Float_t xpos, ypos, zpos, f;
d3f347ff 74 Int_t idmat[2];
75
76 const Int_t nparmo = 10;
77 const Int_t nparfr = 4;
78 const Int_t nparic = 4;
79 const Int_t nparnc = 4;
80 const Int_t nparoc = 11;
81
82 Float_t par_mo[nparmo];
83 Float_t par_fr[nparfr];
84 Float_t par_ic[nparic];
85 Float_t par_nc[nparnc];
86 Float_t par_oc[nparoc];
87
ad51aeb0 88 Int_t *idtmed =fIdtmed->GetArray()-1299;
fe4da5cc 89
d3f347ff 90 //////////////////////////////////////////////////////////////////////////
fe4da5cc 91 // Definition of Volumes
d3f347ff 92 //////////////////////////////////////////////////////////////////////////
fe4da5cc 93
d3f347ff 94 // Definition of the mother volume for the TRD (Al)
95 par_mo[0] = 0.;
fe4da5cc 96 par_mo[1] = 360.;
97 par_mo[2] = nsect;
98 par_mo[3] = 2.;
99 par_mo[4] = -zmax1;
100 par_mo[5] = rmin;
101 par_mo[6] = rmax;
d3f347ff 102 par_mo[7] = zmax1;
fe4da5cc 103 par_mo[8] = rmin;
104 par_mo[9] = rmax;
cfce8870 105 gMC->Gsvolu("TRD ", "PGON", idtmed[1301-1], par_mo, nparmo);
106 gMC->Gsdvn("UTRS", "TRD ", nsect, 2);
d3f347ff 107
108 // The minimal width of a sector in rphi-direction
c2ba0804 109 Float_t widmi = rmin * TMath::Tan(kPI/nsect);
d3f347ff 110 // The maximal width of a sector in rphi-direction
c2ba0804 111 Float_t widma = rmax * TMath::Tan(kPI/nsect);
d3f347ff 112 // The total thickness of the spaceframe (Al + Air)
113 Float_t frame = widmi - (widpl1 / 2);
114
115 // Definition of the inner part of the detector frame (Air)
116 par_fr[0] = widmi - alframe / 2.;
117 par_fr[1] = widma - alframe / 2.;
118 par_fr[2] = zmax1;
119 par_fr[3] = (rmax - rmin) / 2;
cfce8870 120 gMC->Gsvolu("UTRI", "TRD1", idtmed[1302-1], par_fr, nparfr);
d3f347ff 121
122 //
123 // The outer chambers
124 //
125
126 // Calculate some shape-parameter
127 Float_t tanzr = (zmax1 - zmax2) / (rmax - rmin);
128 Float_t theoc = -kRaddeg * TMath::ATan(tanzr / 2);
129
130 // The carbon frame (C)
131 par_oc[0] = (rmax - rmin) / 2;
132 par_oc[1] = theoc;
133 par_oc[2] = 90.;
134 par_oc[3] = (zmax2 - zlenn - zleni/2) / 2;
135 par_oc[4] = widmi - frame;
136 par_oc[5] = widmi - frame;
137 par_oc[6] = 0.;
138 par_oc[7] = (zmax1 - zlenn - zleni/2) / 2;
139 par_oc[8] = widma - frame;
140 par_oc[9] = widma - frame;
fe4da5cc 141 par_oc[10] = 0.;
cfce8870 142 gMC->Gsvolu("UTCO", "TRAP", idtmed[1307-1], par_oc, nparoc);
d3f347ff 143
144 // The inner part (Air)
fe4da5cc 145 par_oc[3] -= ccframe;
146 par_oc[4] -= ccframe;
d3f347ff 147 par_oc[5] -= ccframe;
fe4da5cc 148 par_oc[7] -= ccframe;
149 par_oc[8] -= ccframe;
150 par_oc[9] -= ccframe;
cfce8870 151 gMC->Gsvolu("UTIO", "TRAP", idtmed[1302-1], par_oc, nparoc);
d3f347ff 152
153 // Definition of the six modules within each chamber
cfce8870 154 gMC->Gsdvn("UTMO", "UTIO", nmodul, 3);
d3f347ff 155
156 // Definition of the layers of each chamber
157 par_oc[1] = theoc;
158 par_oc[2] = 90.;
159 par_oc[3] = -1.;
160 par_oc[4] = -1.;
161 par_oc[5] = -1.;
162 par_oc[6] = 0.;
163 par_oc[7] = -1.;
164 par_oc[8] = -1.;
165 par_oc[9] = -1.;
166 par_oc[10] = 0.;
167 // G10 layer (radiator layer)
168 par_oc[0] = sethick / 2;
cfce8870 169 gMC->Gsvolu("UT0O", "TRAP", idtmed[1313-1], par_oc, nparoc);
d3f347ff 170 // CO2 layer (radiator)
171 par_oc[0] = rathick / 2;
cfce8870 172 gMC->Gsvolu("UT1O", "TRAP", idtmed[1312-1], par_oc, nparoc);
d3f347ff 173 // PE layer (radiator)
174 par_oc[0] = pethick / 2;
cfce8870 175 gMC->Gsvolu("UT2O", "TRAP", idtmed[1303-1], par_oc, nparoc);
d3f347ff 176 // Mylar layer (entrance window + HV cathode)
177 par_oc[0] = mythick / 2;
cfce8870 178 gMC->Gsvolu("UT3O", "TRAP", idtmed[1308-1], par_oc, nparoc);
d3f347ff 179 // Xe/Isobutane layer (gasvolume)
180 par_oc[0] = xethick / 2;
cfce8870 181 gMC->Gsvolu("UT4O", "TRAP", idtmed[1309-1], par_oc, nparoc);
d3f347ff 182 // Cu layer (pad plane)
183 par_oc[0] = cuthick / 2;
cfce8870 184 gMC->Gsvolu("UT5O", "TRAP", idtmed[1305-1], par_oc, nparoc);
d3f347ff 185 // G10 layer (support structure)
186 par_oc[0] = suthick / 2;
cfce8870 187 gMC->Gsvolu("UT6O", "TRAP", idtmed[1313-1], par_oc, nparoc);
d3f347ff 188 // Cu layer (FEE + signal lines)
189 par_oc[0] = fethick / 2;
cfce8870 190 gMC->Gsvolu("UT7O", "TRAP", idtmed[1305-1], par_oc, nparoc);
d3f347ff 191 // PE layer (cooling devices)
192 par_oc[0] = cothick / 2;
cfce8870 193 gMC->Gsvolu("UT8O", "TRAP", idtmed[1303-1], par_oc, nparoc);
d3f347ff 194 // Water layer (cooling)
195 par_oc[0] = wathick / 2;
cfce8870 196 gMC->Gsvolu("UT9O", "TRAP", idtmed[1314-1], par_oc, nparoc);
d3f347ff 197
198 //
199 // The neighbouring chambers
200 //
201
202 // The carbon frame (C)
203 par_nc[0] = widmi - frame;
204 par_nc[1] = widma - frame;
205 par_nc[2] = zlenn / 2;
206 par_nc[3] = (rmax - rmin) / 2;
cfce8870 207 gMC->Gsvolu("UTCN", "TRD1", idtmed[1307-1], par_nc, nparnc);
d3f347ff 208
209 // The inner part (Air)
210 par_nc[0] -= ccframe;
211 par_nc[1] -= ccframe;
212 par_nc[2] -= ccframe;
cfce8870 213 gMC->Gsvolu("UTIN", "TRD1", idtmed[1302-1], par_nc, nparnc);
d3f347ff 214
215 // Definition of the six modules within each outer chamber
cfce8870 216 gMC->Gsdvn("UTMN", "UTIN", nmodul, 3);
d3f347ff 217
218 // Definition of the layers of each chamber
219 par_nc[0] = -1.;
220 par_nc[1] = -1.;
221 par_nc[2] = -1.;
222 // G10 layer (radiator layer)
223 par_nc[3] = sethick / 2;
cfce8870 224 gMC->Gsvolu("UT0N", "TRD1", idtmed[1313-1], par_nc, nparnc);
d3f347ff 225 // CO2 layer (radiator)
226 par_nc[3] = rathick / 2;
cfce8870 227 gMC->Gsvolu("UT1N", "TRD1", idtmed[1312-1], par_nc, nparnc);
d3f347ff 228 // PE layer (radiator)
229 par_nc[3] = pethick / 2;
cfce8870 230 gMC->Gsvolu("UT2N", "TRD1", idtmed[1303-1], par_nc, nparnc);
d3f347ff 231 // Mylar layer (entrance window + HV cathode)
232 par_nc[3] = mythick / 2;
cfce8870 233 gMC->Gsvolu("UT3N", "TRD1", idtmed[1308-1], par_nc, nparnc);
d3f347ff 234 // Xe/Isobutane layer (gasvolume)
235 par_nc[3] = xethick / 2;
cfce8870 236 gMC->Gsvolu("UT4N", "TRD1", idtmed[1309-1], par_nc, nparnc);
d3f347ff 237 // Cu layer (pad plane)
238 par_nc[3] = cuthick / 2;
cfce8870 239 gMC->Gsvolu("UT5N", "TRD1", idtmed[1305-1], par_nc, nparnc);
d3f347ff 240 // G10 layer (support structure)
241 par_nc[3] = suthick / 2;
cfce8870 242 gMC->Gsvolu("UT6N", "TRD1", idtmed[1313-1], par_nc, nparnc);
d3f347ff 243 // Cu layer (FEE + signal lines)
244 par_nc[3] = fethick / 2;
cfce8870 245 gMC->Gsvolu("UT7N", "TRD1", idtmed[1305-1], par_nc, nparnc);
d3f347ff 246 // PE layer (cooling devices)
247 par_nc[3] = cothick / 2;
cfce8870 248 gMC->Gsvolu("UT8N", "TRD1", idtmed[1303-1], par_nc, nparnc);
d3f347ff 249 // Water layer (cooling)
250 par_nc[3] = wathick / 2;
cfce8870 251 gMC->Gsvolu("UT9N", "TRD1", idtmed[1314-1], par_nc, nparnc);
d3f347ff 252
253 //
254 // The inner chamber
255 //
256
257 // The carbon frame (C)
258 par_ic[0] = widmi - frame;
259 par_ic[1] = widma - frame;
260 par_ic[2] = zleni / 2;
261 par_ic[3] = (rmax - rmin) / 2;
cfce8870 262 gMC->Gsvolu("UTCI", "TRD1", idtmed[1307-1], par_ic, nparic);
d3f347ff 263
264 // The inner part (Air)
fe4da5cc 265 par_ic[0] -= ccframe;
266 par_ic[1] -= ccframe;
267 par_ic[2] -= ccframe;
cfce8870 268 gMC->Gsvolu("UTII", "TRD1", idtmed[1302-1], par_ic, nparic);
d3f347ff 269
270 // Definition of the six modules within each outer chamber
cfce8870 271 gMC->Gsdvn("UTMI", "UTII", nmodul, 3);
d3f347ff 272
273 // Definition of the layers of each inner chamber
fe4da5cc 274 par_ic[0] = -1.;
275 par_ic[1] = -1.;
276 par_ic[2] = -1.;
d3f347ff 277 // G10 layer (radiator layer)
278 par_ic[3] = sethick / 2;
cfce8870 279 gMC->Gsvolu("UT0I", "TRD1", idtmed[1313-1], par_ic, nparic);
d3f347ff 280 // CO2 layer (radiator)
281 par_ic[3] = rathick / 2;
cfce8870 282 gMC->Gsvolu("UT1I", "TRD1", idtmed[1312-1], par_ic, nparic);
d3f347ff 283 // PE layer (radiator)
284 par_ic[3] = pethick / 2;
cfce8870 285 gMC->Gsvolu("UT2I", "TRD1", idtmed[1303-1], par_ic, nparic);
d3f347ff 286 // Mylar layer (entrance window + HV cathode)
287 par_ic[3] = mythick / 2;
cfce8870 288 gMC->Gsvolu("UT3I", "TRD1", idtmed[1308-1], par_ic, nparic);
d3f347ff 289 // Xe/Isobutane layer (gasvolume)
290 par_ic[3] = xethick / 2;
cfce8870 291 gMC->Gsvolu("UT4I", "TRD1", idtmed[1309-1], par_ic, nparic);
d3f347ff 292 // Cu layer (pad plane)
293 par_ic[3] = cuthick / 2;
cfce8870 294 gMC->Gsvolu("UT5I", "TRD1", idtmed[1305-1], par_ic, nparic);
d3f347ff 295 // G10 layer (support structure)
296 par_ic[3] = suthick / 2;
cfce8870 297 gMC->Gsvolu("UT6I", "TRD1", idtmed[1313-1], par_ic, nparic);
d3f347ff 298 // Cu layer (FEE + signal lines)
299 par_ic[3] = fethick / 2;
cfce8870 300 gMC->Gsvolu("UT7I", "TRD1", idtmed[1305-1], par_ic, nparic);
d3f347ff 301 // PE layer (cooling devices)
302 par_ic[3] = cothick / 2;
cfce8870 303 gMC->Gsvolu("UT8I", "TRD1", idtmed[1303-1], par_ic, nparic);
d3f347ff 304 // Water layer (cooling)
305 par_ic[3] = wathick / 2;
cfce8870 306 gMC->Gsvolu("UT9I", "TRD1", idtmed[1314-1], par_ic, nparic);
d3f347ff 307
308 //////////////////////////////////////////////////////////////////////////
309 // Positioning of Volumes
310 //////////////////////////////////////////////////////////////////////////
311
312 // The rotation matrices
313 AliMatrix(idmat[0], 90., 90., 180., 0., 90., 0.);
314 AliMatrix(idmat[1], 90., 180., 90., 270., 0., 0.);
315
316 // Position of the layers in a TRD module
fe4da5cc 317 f = TMath::Tan(theoc * kDegrad);
cfce8870 318 gMC->Gspos("UT9O", 1, "UTMO", 0., f*wazpos, wazpos, 0, "ONLY");
319 gMC->Gspos("UT8O", 1, "UTMO", 0., f*cozpos, cozpos, 0, "ONLY");
320 gMC->Gspos("UT7O", 1, "UTMO", 0., f*fezpos, fezpos, 0, "ONLY");
321 gMC->Gspos("UT6O", 1, "UTMO", 0., f*suzpos, suzpos, 0, "ONLY");
322 gMC->Gspos("UT5O", 1, "UTMO", 0., f*cuzpos, cuzpos, 0, "ONLY");
323 gMC->Gspos("UT4O", 1, "UTMO", 0., f*xezpos, xezpos, 0, "ONLY");
324 gMC->Gspos("UT3O", 1, "UTMO", 0., f*myzpos, myzpos, 0, "ONLY");
325 gMC->Gspos("UT1O", 1, "UTMO", 0., f*razpos, razpos, 0, "ONLY");
326 gMC->Gspos("UT0O", 1, "UTMO", 0., f*sezpos, sezpos, 0, "ONLY");
327 gMC->Gspos("UT2O", 1, "UT1O", 0., f*pezpos, pezpos, 0, "ONLY");
328
329 gMC->Gspos("UT9N", 1, "UTMN", 0., 0., wazpos, 0, "ONLY");
330 gMC->Gspos("UT8N", 1, "UTMN", 0., 0., cozpos, 0, "ONLY");
331 gMC->Gspos("UT7N", 1, "UTMN", 0., 0., fezpos, 0, "ONLY");
332 gMC->Gspos("UT6N", 1, "UTMN", 0., 0., suzpos, 0, "ONLY");
333 gMC->Gspos("UT5N", 1, "UTMN", 0., 0., cuzpos, 0, "ONLY");
334 gMC->Gspos("UT4N", 1, "UTMN", 0., 0., xezpos, 0, "ONLY");
335 gMC->Gspos("UT3N", 1, "UTMN", 0., 0., myzpos, 0, "ONLY");
336 gMC->Gspos("UT1N", 1, "UTMN", 0., 0., razpos, 0, "ONLY");
337 gMC->Gspos("UT0N", 1, "UTMN", 0., 0., sezpos, 0, "ONLY");
338 gMC->Gspos("UT2N", 1, "UT1N", 0., 0., pezpos, 0, "ONLY");
339
340 gMC->Gspos("UT9I", 1, "UTMI", 0., 0., wazpos, 0, "ONLY");
341 gMC->Gspos("UT8I", 1, "UTMI", 0., 0., cozpos, 0, "ONLY");
342 gMC->Gspos("UT7I", 1, "UTMI", 0., 0., fezpos, 0, "ONLY");
343 gMC->Gspos("UT6I", 1, "UTMI", 0., 0., suzpos, 0, "ONLY");
344 gMC->Gspos("UT5I", 1, "UTMI", 0., 0., cuzpos, 0, "ONLY");
345 gMC->Gspos("UT4I", 1, "UTMI", 0., 0., xezpos, 0, "ONLY");
346 gMC->Gspos("UT3I", 1, "UTMI", 0., 0., myzpos, 0, "ONLY");
347 gMC->Gspos("UT1I", 1, "UTMI", 0., 0., razpos, 0, "ONLY");
348 gMC->Gspos("UT0I", 1, "UTMI", 0., 0., sezpos, 0, "ONLY");
349 gMC->Gspos("UT2I", 1, "UT1I", 0., 0., pezpos, 0, "ONLY");
d3f347ff 350
351 // Position of the inner part of the chambers
352 xpos = 0.;
353 ypos = 0.;
354 zpos = 0.;
cfce8870 355 gMC->Gspos("UTII", 1, "UTCI", xpos, ypos, zpos, 0, "ONLY");
356 gMC->Gspos("UTIN", 1, "UTCN", xpos, ypos, zpos, 0, "ONLY");
357 gMC->Gspos("UTIO", 1, "UTCO", xpos, ypos, zpos, 0, "ONLY");
d3f347ff 358
359 // Position of the chambers in the support frame
360 xpos = 0.;
361 ypos = ((zmax1 + zmax2) / 2 + zlenn + zleni / 2) / 2;
362 zpos = 0.;
cfce8870 363 gMC->Gspos("UTCO", 1, "UTRI", xpos, ypos, zpos, idmat[1], "ONLY");
364 gMC->Gspos("UTCO", 2, "UTRI", xpos,-ypos, zpos, 0 , "ONLY");
fe4da5cc 365 xpos = 0.;
d3f347ff 366 ypos = (zlenn + zleni) / 2;
fe4da5cc 367 zpos = 0.;
cfce8870 368 gMC->Gspos("UTCN", 1, "UTRI", xpos, ypos, zpos, 0 , "ONLY");
369 gMC->Gspos("UTCN", 2, "UTRI", xpos,-ypos, zpos, 0 , "ONLY");
fe4da5cc 370 xpos = 0.;
371 ypos = 0.;
372 zpos = 0.;
cfce8870 373 gMC->Gspos("UTCI", 1, "UTRI", xpos, ypos, zpos, 0 , "ONLY");
d3f347ff 374
375 // Position of the inner part of the detector frame
376 xpos = (rmax + rmin) / 2;
fe4da5cc 377 ypos = 0.;
d3f347ff 378 zpos = 0.;
cfce8870 379 gMC->Gspos("UTRI", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
d3f347ff 380
381 // Position of the TRD mother volume in the ALICE experiment
382 xpos = 0.;
fe4da5cc 383 ypos = 0.;
d3f347ff 384 zpos = 0.;
cfce8870 385 gMC->Gspos("TRD ", 1, "ALIC", xpos, ypos, zpos, 0, "ONLY");
d3f347ff 386
fe4da5cc 387}
388
389//_____________________________________________________________________________
05e51f55 390void AliTRDv0::DrawModule()
fe4da5cc 391{
d3f347ff 392
fe4da5cc 393 //
394 // Draw a shaded view of the Transition Radiation Detector version 0
395 //
396
fe4da5cc 397 // Set everything unseen
cfce8870 398 gMC->Gsatt("*", "seen", -1);
fe4da5cc 399 //
400 // Set ALIC mother transparent
cfce8870 401 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 402 //
403 // Set the volumes visible
cfce8870 404 gMC->Gsatt("TRD" ,"SEEN",0);
405 gMC->Gsatt("UTRS","SEEN",0);
406 gMC->Gsatt("UTRI","SEEN",0);
407 gMC->Gsatt("UTCO","SEEN",0);
408 gMC->Gsatt("UTIO","SEEN",0);
409 gMC->Gsatt("UTMO","SEEN",0);
410 gMC->Gsatt("UTCN","SEEN",0);
411 gMC->Gsatt("UTIN","SEEN",0);
412 gMC->Gsatt("UTMN","SEEN",0);
413 gMC->Gsatt("UTCI","SEEN",0);
414 gMC->Gsatt("UTII","SEEN",0);
415 gMC->Gsatt("UTMI","SEEN",0);
416 gMC->Gsatt("UT1O","SEEN",1);
417 gMC->Gsatt("UT4O","SEEN",1);
418 gMC->Gsatt("UT1N","SEEN",1);
419 gMC->Gsatt("UT4N","SEEN",1);
420 gMC->Gsatt("UT1I","SEEN",1);
421 gMC->Gsatt("UT4I","SEEN",1);
fe4da5cc 422 //
cfce8870 423 gMC->Gdopt("hide", "on");
424 gMC->Gdopt("shad", "on");
425 gMC->Gsatt("*", "fill", 7);
426 gMC->SetClipBox(".");
427 gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
428 gMC->DefaultRange();
429 gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
430 gMC->Gdhead(1111, "Transition Radiation Detector Version 0");
431 gMC->Gdman(18, 4, "MAN");
d3f347ff 432
fe4da5cc 433}
434
435//_____________________________________________________________________________
436void AliTRDv0::CreateMaterials()
437{
438 //
439 // Create materials for the Transition Radiation Detector
440 //
fe4da5cc 441 AliTRD::CreateMaterials();
442}
443
444//_____________________________________________________________________________
445void AliTRDv0::Init()
446{
447 //
448 // Initialise Transition Radiation Detector after geometry is built
449 //
450 AliTRD::Init();
fe4da5cc 451 //
d3f347ff 452 // Retrieve the numeric identifier of the sensitive volumes (gas volume)
cfce8870 453 fIdSens1 = gMC->VolId("UT4I");
454 fIdSens2 = gMC->VolId("UT4N");
455 fIdSens3 = gMC->VolId("UT4O");
fe4da5cc 456}
457
458//_____________________________________________________________________________
459void AliTRDv0::StepManager()
460{
461 //
462 // Procedure called at every step in the TRD
463 //
464
465 Int_t vol[3];
0a6d8768 466 Int_t icopy, idSens, icSens, i;
fe4da5cc 467
468 Float_t hits[4];
0a6d8768 469 TLorentzVector p;
fe4da5cc 470
471 TClonesArray &lhits = *fHits;
472
fe4da5cc 473 // Use only charged tracks and count them only once per volume
0a6d8768 474 if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
fe4da5cc 475
476 // Check on sensitive volume
0a6d8768 477 idSens = gMC->CurrentVolID(icSens);
d3f347ff 478 if ((idSens == fIdSens1) ||
479 (idSens == fIdSens2) ||
480 (idSens == fIdSens3)) {
fe4da5cc 481
482 // The sector number
0a6d8768 483 gMC->CurrentVolOffID(5,icopy);
fe4da5cc 484 vol[0] = icopy;
485
d3f347ff 486 // The chamber number
487 // 1: outer left
488 // 2: neighbouring left
489 // 3: inner
490 // 4: neighbouring right
491 // 5: outer right
0a6d8768 492 gMC->CurrentVolOffID(3,icopy);
d3f347ff 493 if (idSens == fIdSens3)
494 vol[1] = 4 * icopy - 3;
495 else if (idSens == fIdSens2)
496 vol[1] = 2 * icopy;
497 else
498 vol[1] = 3;
fe4da5cc 499
500 // The plane number
0a6d8768 501 gMC->CurrentVolOffID(1,icopy);
fe4da5cc 502 vol[2] = icopy;
d3f347ff 503
504 if (fSensSelect) {
505 Int_t addthishit = 1;
506 if ((fSensPlane) && (vol[2] != fSensPlane )) addthishit = 0;
507 if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
508 if ((fSensSector) && (vol[0] != fSensSector )) addthishit = 0;
509 if (addthishit) {
0a6d8768 510 gMC->TrackPosition(p);
511 for(i=0;i<3;++i) hits[i]=p[i];
d3f347ff 512 hits[3] = 0;
513 new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
514 }
515 }
516 else {
0a6d8768 517 gMC->TrackPosition(p);
518 for(i=0;i<3;++i) hits[i]=p[i];
d3f347ff 519 hits[3] = 0;
520 new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
521 }
522
fe4da5cc 523 }
d3f347ff 524
fe4da5cc 525 }
d3f347ff 526
fe4da5cc 527}