]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - TRD/AliTRD.cxx
Correct improper use of negative parameters
[u/mrichter/AliRoot.git] / TRD / AliTRD.cxx
... / ...
CommitLineData
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
20///////////////////////////////////////////////////////////////////////////////
21// //
22// Transition Radiation Detector //
23// This class contains the basic functions for the Transition Radiation //
24// detector. Functions specific to one particular geometry are //
25// contained in the derived classes //
26// //
27//Begin_Html
28/*
29<img src="picts/AliTRDClass.gif">
30*/
31//End_Html
32// //
33// //
34///////////////////////////////////////////////////////////////////////////////
35
36#include <stdlib.h>
37
38#include <TMath.h>
39#include <TNode.h>
40#include <TPGON.h>
41
42#include "AliTRD.h"
43#include "AliRun.h"
44
45#include "AliConst.h"
46
47ClassImp(AliTRD)
48
49//_____________________________________________________________________________
50AliTRD::AliTRD()
51{
52 //
53 // Default constructor
54 //
55
56 fIshunt = 0;
57 fGasMix = 0;
58 fHits = 0;
59 fDigits = 0;
60
61 // The chamber dimensions
62 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
63 fClengthI[iplan] = 0.;
64 fClengthM[iplan] = 0.;
65 fClengthO[iplan] = 0.;
66 }
67
68}
69
70//_____________________________________________________________________________
71AliTRD::AliTRD(const char *name, const char *title)
72 : AliDetector(name,title)
73{
74 //
75 // Standard constructor for the TRD
76 //
77
78
79 // Check that FRAME is there otherwise we have no place where to put the TRD
80 AliModule* FRAME = gAlice->GetModule("FRAME");
81 if (!FRAME) {
82 Error("AliTRD","TRD needs FRAME to be present\n");
83 exit(1);
84 }
85
86 // Allocate the hit array
87 fHits = new TClonesArray("AliTRDhit", 405);
88
89 // Allocate the digits array
90 fDigits = new TClonesArray("AliTRDdigit",10000);
91
92 fIshunt = 0;
93 fGasMix = 0;
94
95 // The chamber dimensions
96 for (Int_t iplan = 0; iplan < kNplan; iplan++) {
97 fClengthI[iplan] = 0.;
98 fClengthM[iplan] = 0.;
99 fClengthO[iplan] = 0.;
100 fCwidth[iplan] = 0.;
101 }
102
103 SetMarkerColor(kWhite);
104
105}
106
107//_____________________________________________________________________________
108AliTRD::~AliTRD()
109{
110 //
111 // TRD destructor
112 //
113
114 fIshunt = 0;
115
116 delete fHits;
117 delete fDigits;
118
119}
120
121//_____________________________________________________________________________
122void AliTRD::AddDigit(Int_t *tracks, Int_t *digits)
123{
124 //
125 // Add a digit for the TRD
126 //
127
128 TClonesArray &ldigits = *fDigits;
129 new(ldigits[fNdigits++]) AliTRDdigit(tracks,digits);
130
131}
132
133//_____________________________________________________________________________
134void AliTRD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
135{
136 //
137 // Add a hit for the TRD
138 //
139
140 TClonesArray &lhits = *fHits;
141 new(lhits[fNhits++]) AliTRDhit(fIshunt,track,vol,hits);
142
143}
144
145//_____________________________________________________________________________
146void AliTRD::BuildGeometry()
147{
148 //
149 // Create the ROOT TNode geometry for the TRD
150 //
151
152 TNode *Node, *Top;
153 TPGON *pgon;
154 const Int_t kColorTRD = 46;
155
156 // Find the top node alice
157 Top = gAlice->GetGeometry()->GetNode("alice");
158
159 pgon = new TPGON("S_TRD","TRD","void",0,360,kNsect,4);
160 Float_t ff = TMath::Cos(kDegrad * 180 / kNsect);
161 Float_t rrmin = kRmin / ff;
162 Float_t rrmax = kRmax / ff;
163 pgon->DefineSection(0,-kZmax1,rrmax,rrmax);
164 pgon->DefineSection(1,-kZmax2,rrmin,rrmax);
165 pgon->DefineSection(2, kZmax2,rrmin,rrmax);
166 pgon->DefineSection(3, kZmax1,rrmax,rrmax);
167 Top->cd();
168 Node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
169 Node->SetLineColor(kColorTRD);
170 fNodes->Add(Node);
171
172}
173
174//_____________________________________________________________________________
175void AliTRD::CreateGeometry()
176{
177 //
178 // Creates the volumes for the TRD chambers
179 //
180 // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99
181 //
182 // The volumes:
183 // TRD (Air) --- The TRD mother volume for one sector.
184 // To be placed into the spaceframe.
185 //
186 // UAFI(/M/O) (Al) --- The aluminum frame of the inner(/middle/outer) chambers (readout)
187 // UCFI(/M/O) (C) --- The carbon frame of the inner(/middle/outer) chambers
188 // (driftchamber + radiator)
189 // UAII(/M/O) (Air) --- The inner part of the readout of the inner(/middle/outer) chambers
190 // UFII(/M/O) (Air) --- The inner part of the chamner and radiator of the
191 // inner(/middle/outer) chambers
192 //
193 // The material layers in one chamber:
194 // UL01 (G10) --- The gas seal of the radiator
195 // UL02 (CO2) --- The gas in the radiator
196 // UL03 (PE) --- The foil stack
197 // UL04 (Mylar) --- Entrance window to the driftvolume and HV-cathode
198 // UL05 (Xe) --- The driftvolume
199 // UL06 (Xe) --- The amplification region
200 //
201 // UL07 (Cu) --- The pad plane
202 // UL08 (G10) --- The Nomex honeycomb support structure
203 // UL09 (Cu) --- FEE and signal lines
204 // UL10 (PE) --- The cooling devices
205 // UL11 (Water) --- The cooling water
206
207 // Check that FRAME is there otherwise we have no place where to put the TRD
208 AliModule* FRAME = gAlice->GetModule("FRAME");
209 if (!FRAME) return;
210
211 const Int_t npar_trd = 4;
212 const Int_t npar_cha = 3;
213
214 Float_t par_dum[3];
215 Float_t par_trd[npar_trd];
216 Float_t par_cha[npar_cha];
217 Int_t iplan;
218
219 Float_t xpos, ypos, zpos;
220
221 Int_t *idtmed = fIdtmed->GetArray()-1299;
222
223 // The length of the inner chambers
224 for (iplan = 0; iplan < kNplan; iplan++) fClengthI[iplan] = 110.0;
225 // The length of the middle chambers
226 fClengthM[0] = 123.5;
227 fClengthM[1] = 131.0;
228 fClengthM[2] = 138.5;
229 fClengthM[3] = 146.0;
230 fClengthM[4] = 153.0;
231 fClengthM[5] = 160.5;
232 // The length of the outer chambers
233 fClengthO[0] = 123.5;
234 fClengthO[1] = 131.0;
235 fClengthO[2] = 134.5;
236 fClengthO[3] = 142.0;
237 fClengthO[4] = 142.0;
238 fClengthO[5] = 134.5;
239
240 // The width of the chambers
241 fCwidth[0] = 99.6;
242 fCwidth[1] = 104.1;
243 fCwidth[2] = 108.5;
244 fCwidth[3] = 112.9;
245 fCwidth[4] = 117.4;
246 fCwidth[5] = 121.8;
247
248 // The TRD mother volume for one sector (Air) (dimensions identical to BTR1-3)
249 par_trd[0] = kSwidth1/2.;
250 par_trd[1] = kSwidth2/2.;
251 par_trd[2] = kSlength/2.;
252 par_trd[3] = kSheight/2.;
253 gMC->Gsvolu("TRD ","TRD1",idtmed[1302-1],par_trd,npar_trd);
254
255 // The aluminum frames - readout + electronics (Al)
256 // The inner chambers
257 gMC->Gsvolu("UAFI","BOX ",idtmed[1301-1],par_dum,0);
258 // The middle chambers
259 gMC->Gsvolu("UAFM","BOX ",idtmed[1301-1],par_dum,0);
260 // The outer chambers
261 gMC->Gsvolu("UAFO","BOX ",idtmed[1301-1],par_dum,0);
262
263 // The inner part of the aluminum frames (Air)
264 // The inner chambers
265 gMC->Gsvolu("UAII","BOX ",idtmed[1302-1],par_dum,0);
266 // The middle chambers
267 gMC->Gsvolu("UAIM","BOX ",idtmed[1302-1],par_dum,0);
268 // The outer chambers
269 gMC->Gsvolu("UAIO","BOX ",idtmed[1302-1],par_dum,0);
270
271 // The carbon frames - radiator + driftchamber (C)
272 // The inner chambers
273 gMC->Gsvolu("UCFI","BOX ",idtmed[1307-1],par_dum,0);
274 // The middle chambers
275 gMC->Gsvolu("UCFM","BOX ",idtmed[1307-1],par_dum,0);
276 // The outer chambers
277 gMC->Gsvolu("UCFO","BOX ",idtmed[1307-1],par_dum,0);
278
279 // The inner part of the carbon frames (Air)
280 // The inner chambers
281 gMC->Gsvolu("UCII","BOX ",idtmed[1302-1],par_dum,0);
282 // The middle chambers
283 gMC->Gsvolu("UCIM","BOX ",idtmed[1302-1],par_dum,0);
284 // The outer chambers
285 gMC->Gsvolu("UCIO","BOX ",idtmed[1302-1],par_dum,0);
286
287 // The material layers inside the chambers
288 par_cha[0] = -1.;
289 par_cha[1] = -1.;
290 // G10 layer (radiator seal)
291 par_cha[2] = kSeThick/2;
292 gMC->Gsvolu("UL01","BOX ",idtmed[1313-1],par_cha,npar_cha);
293 // CO2 layer (radiator)
294 par_cha[2] = kRaThick/2;
295 gMC->Gsvolu("UL02","BOX ",idtmed[1312-1],par_cha,npar_cha);
296 // PE layer (radiator)
297 par_cha[2] = kPeThick/2;
298 gMC->Gsvolu("UL03","BOX ",idtmed[1303-1],par_cha,npar_cha);
299 // Mylar layer (entrance window + HV cathode)
300 par_cha[2] = kMyThick/2;
301 gMC->Gsvolu("UL04","BOX ",idtmed[1308-1],par_cha,npar_cha);
302 // Xe/Isobutane layer (drift volume, sensitive)
303 par_cha[2] = kDrThick/2.;
304 gMC->Gsvolu("UL05","BOX ",idtmed[1309-1],par_cha,npar_cha);
305 // Xe/Isobutane layer (amplification volume, not sensitive)
306 par_cha[2] = kAmThick/2.;
307 gMC->Gsvolu("UL06","BOX ",idtmed[1309-1],par_cha,npar_cha);
308
309 // Cu layer (pad plane)
310 par_cha[2] = kCuThick/2;
311 gMC->Gsvolu("UL07","BOX ",idtmed[1305-1],par_cha,npar_cha);
312 // G10 layer (support structure)
313 par_cha[2] = kSuThick/2;
314 gMC->Gsvolu("UL08","BOX ",idtmed[1313-1],par_cha,npar_cha);
315 // Cu layer (FEE + signal lines)
316 par_cha[2] = kFeThick/2;
317 gMC->Gsvolu("UL09","BOX ",idtmed[1305-1],par_cha,npar_cha);
318 // PE layer (cooling devices)
319 par_cha[2] = kCoThick/2;
320 gMC->Gsvolu("UL10","BOX ",idtmed[1303-1],par_cha,npar_cha);
321 // Water layer (cooling)
322 par_cha[2] = kWaThick/2;
323 gMC->Gsvolu("UL11","BOX ",idtmed[1314-1],par_cha,npar_cha);
324
325 // Position the layers in the chambers
326 xpos = 0;
327 ypos = 0;
328
329 // G10 layer (radiator seal)
330 zpos = kSeZpos;
331 gMC->Gspos("UL01",1,"UCII",xpos,ypos,zpos,0,"ONLY");
332 gMC->Gspos("UL01",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
333 gMC->Gspos("UL01",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
334 // CO2 layer (radiator)
335 zpos = kRaZpos;
336 gMC->Gspos("UL02",1,"UCII",xpos,ypos,zpos,0,"ONLY");
337 gMC->Gspos("UL02",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
338 gMC->Gspos("UL02",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
339 // PE layer (radiator)
340 zpos = 0;
341 gMC->Gspos("UL03",1,"UL02",xpos,ypos,zpos,0,"ONLY");
342 // Mylar layer (entrance window + HV cathode)
343 zpos = kMyZpos;
344 gMC->Gspos("UL04",1,"UCII",xpos,ypos,zpos,0,"ONLY");
345 gMC->Gspos("UL04",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
346 gMC->Gspos("UL04",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
347 // Xe/Isobutane layer (drift volume)
348 zpos = kDrZpos;
349 gMC->Gspos("UL05",1,"UCII",xpos,ypos,zpos,0,"ONLY");
350 gMC->Gspos("UL05",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
351 gMC->Gspos("UL05",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
352 // Xe/Isobutane layer (amplification volume)
353 zpos = kAmZpos;
354 gMC->Gspos("UL06",1,"UCII",xpos,ypos,zpos,0,"ONLY");
355 gMC->Gspos("UL06",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
356 gMC->Gspos("UL06",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
357
358 // Cu layer (pad plane)
359 zpos = kCuZpos;
360 gMC->Gspos("UL07",1,"UAII",xpos,ypos,zpos,0,"ONLY");
361 gMC->Gspos("UL07",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
362 gMC->Gspos("UL07",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
363 // G10 layer (support structure)
364 zpos = kSuZpos;
365 gMC->Gspos("UL08",1,"UAII",xpos,ypos,zpos,0,"ONLY");
366 gMC->Gspos("UL08",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
367 gMC->Gspos("UL08",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
368 // Cu layer (FEE + signal lines)
369 zpos = kFeZpos;
370 gMC->Gspos("UL09",1,"UAII",xpos,ypos,zpos,0,"ONLY");
371 gMC->Gspos("UL09",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
372 gMC->Gspos("UL09",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
373 // PE layer (cooling devices)
374 zpos = kCoZpos;
375 gMC->Gspos("UL10",1,"UAII",xpos,ypos,zpos,0,"ONLY");
376 gMC->Gspos("UL10",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
377 gMC->Gspos("UL10",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
378 // Water layer (cooling)
379 zpos = kWaZpos;
380 gMC->Gspos("UL11",1,"UAII",xpos,ypos,zpos,0,"ONLY");
381 gMC->Gspos("UL11",1,"UAIM",xpos,ypos,zpos,0,"ONLY");
382 gMC->Gspos("UL11",1,"UAIO",xpos,ypos,zpos,0,"ONLY");
383
384 // Position the chambers in the TRD mother volume
385 for (iplan = 1; iplan <= kNplan; iplan++) {
386
387 // The inner chambers ---------------------------------------------------------------
388
389 // the aluminum frame
390 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
391 par_cha[0] = fCwidth[iplan-1]/2.;
392 par_cha[1] = fClengthI[iplan-1]/2.;
393 par_cha[2] = kCaframe/2.;
394 xpos = 0.;
395 ypos = 0.;
396 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
397 gMC->Gsposp("UAFI",iplan ,"TRD ",xpos,ypos,zpos,0,"MANY",par_cha,npar_cha);
398
399 // the inner part of the aluminum frame
400 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
401 par_cha[0] = fCwidth[iplan-1]/2. - kCathick;
402 par_cha[1] = fClengthI[iplan-1]/2. - kCathick;
403 par_cha[2] = kCaframe/2.;
404 xpos = 0.;
405 ypos = 0.;
406 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
407 gMC->Gsposp("UAII",iplan ,"TRD ",xpos,ypos,zpos,0,"ONLY",par_cha,npar_cha);
408
409 // the carbon frame
410 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
411 par_cha[0] = fCwidth[iplan-1]/2.;
412 par_cha[1] = fClengthI[iplan-1]/2.;
413 par_cha[2] = kCcframe/2.;
414 xpos = 0.;
415 ypos = 0.;
416 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
417 gMC->Gsposp("UCFI",iplan ,"TRD ",xpos,ypos,zpos,0,"MANY",par_cha,npar_cha);
418
419 // the inner part of the carbon frame
420 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
421 par_cha[0] = fCwidth[iplan-1]/2. - kCcthick;
422 par_cha[1] = fClengthI[iplan-1]/2. - kCcthick;
423 par_cha[2] = kCcframe/2.;
424 xpos = 0.;
425 ypos = 0.;
426 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
427 gMC->Gsposp("UCII",iplan ,"TRD ",xpos,ypos,zpos,0,"ONLY",par_cha,npar_cha);
428
429 // The middle chambers --------------------------------------------------------------
430
431 // the aluminum frame
432 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
433 par_cha[0] = fCwidth[iplan-1]/2.;
434 par_cha[1] = fClengthM[iplan-1]/2.;
435 par_cha[2] = kCaframe/2.;
436 xpos = 0.;
437 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
438 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
439 gMC->Gsposp("UAFM",iplan ,"TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
440 gMC->Gsposp("UAFM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
441
442 // the inner part of the aluminum frame
443 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
444 par_cha[0] = fCwidth[iplan-1]/2. - kCathick;
445 par_cha[1] = fClengthM[iplan-1]/2. - kCathick;
446 par_cha[2] = kCaframe/2.;
447 xpos = 0.;
448 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
449 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
450 gMC->Gsposp("UAIM",iplan ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
451 gMC->Gsposp("UAIM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
452
453 // the carbon frame
454 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
455 par_cha[0] = fCwidth[iplan-1]/2.;
456 par_cha[1] = fClengthM[iplan-1]/2.;
457 par_cha[2] = kCcframe/2.;
458 xpos = 0.;
459 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
460 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
461 gMC->Gsposp("UCFM",iplan, "TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
462 gMC->Gsposp("UCFM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
463
464 // the inner part of the carbon frame
465 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
466 par_cha[0] = fCwidth[iplan-1]/2. - kCcthick;
467 par_cha[1] = fClengthM[iplan-1]/2. - kCcthick;
468 par_cha[2] = kCcframe/2.;
469 xpos = 0.;
470 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1]/2.;
471 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
472 gMC->Gsposp("UCIM",iplan ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
473 gMC->Gsposp("UCIM",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
474
475 // The outer chambers ---------------------------------------------------------------
476
477 // the aluminum frame
478 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
479 par_cha[0] = fCwidth[iplan-1]/2.;
480 par_cha[1] = fClengthO[iplan-1]/2.;
481 par_cha[2] = kCaframe/2.;
482 xpos = 0.;
483 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1] + fClengthO[iplan-1]/2.;
484 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
485 gMC->Gsposp("UAFO",iplan ,"TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
486 gMC->Gsposp("UAFO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
487
488 // the inner part of the aluminum frame
489 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCathick;
490 par_cha[0] = fCwidth[iplan-1]/2. - kCathick;
491 par_cha[1] = fClengthO[iplan-1]/2. - kCathick;
492 par_cha[2] = kCaframe/2.;
493 xpos = 0.;
494 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1] + fClengthO[iplan-1]/2.;
495 zpos = kCheight - kCaframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
496 gMC->Gsposp("UAIO",iplan ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
497 gMC->Gsposp("UAIO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
498
499 // the carbon frame
500 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2.;
501 par_cha[0] = fCwidth[iplan-1]/2.;
502 par_cha[1] = fClengthO[iplan-1]/2.;
503 par_cha[2] = kCcframe/2.;
504 xpos = 0.;
505 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1] + fClengthO[iplan-1]/2.;
506 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
507 gMC->Gsposp("UCFO",iplan, "TRD ",xpos, ypos,zpos,0,"MANY",par_cha,npar_cha);
508 gMC->Gsposp("UCFO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"MANY",par_cha,npar_cha);
509
510 // the inner part of the carbon frame
511 //par_cha[0] = kSwidth1/2. + (iplan-1) * kCwidcha/2. - kCcthick;
512 par_cha[0] = fCwidth[iplan-1]/2. - kCcthick;
513 par_cha[1] = fClengthO[iplan-1]/2. - kCcthick;
514 par_cha[2] = kCcframe/2.;
515 xpos = 0.;
516 ypos = fClengthI[iplan-1]/2. + fClengthM[iplan-1] + fClengthO[iplan-1]/2.;
517 zpos = kCcframe/2. - kSheight/2. + (iplan-1) * (kCheight + kCspace);
518 gMC->Gsposp("UCIO",iplan ,"TRD ",xpos, ypos,zpos,0,"ONLY",par_cha,npar_cha);
519 gMC->Gsposp("UCIO",iplan+kNplan,"TRD ",xpos,-ypos,zpos,0,"ONLY",par_cha,npar_cha);
520
521 }
522
523}
524
525//_____________________________________________________________________________
526void AliTRD::CreateMaterials()
527{
528 //
529 // Create the materials for the TRD
530 // Origin Y.Foka
531 //
532
533 Int_t ISXFLD = gAlice->Field()->Integ();
534 Float_t SXMGMX = gAlice->Field()->Max();
535
536 // For polyethilene (CH2)
537 Float_t ape[2] = { 12., 1. };
538 Float_t zpe[2] = { 6., 1. };
539 Float_t wpe[2] = { 1., 2. };
540 Float_t dpe = 0.95;
541
542 // For mylar (C5H4O2)
543 Float_t amy[3] = { 12., 1., 16. };
544 Float_t zmy[3] = { 6., 1., 8. };
545 Float_t wmy[3] = { 5., 4., 2. };
546 Float_t dmy = 1.39;
547
548 // For CO2
549 Float_t aco[2] = { 12., 16. };
550 Float_t zco[2] = { 6., 8. };
551 Float_t wco[2] = { 1., 2. };
552 Float_t dco = 0.001977;
553
554 // For water
555 Float_t awa[2] = { 1., 16. };
556 Float_t zwa[2] = { 1., 8. };
557 Float_t wwa[2] = { 2., 1. };
558 Float_t dwa = 1.0;
559
560 // For isobutane (C4H10)
561 Float_t ais[2] = { 12., 1. };
562 Float_t zis[2] = { 6., 1. };
563 Float_t wis[2] = { 4., 10. };
564 Float_t dis = 0.00267;
565
566 // For Xe/CO2-gas-mixture
567 // Xe-content of the Xe/CO2-mixture (90% / 10%)
568 Float_t fxc = .90;
569 // Xe-content of the Xe/Isobutane-mixture (97% / 3%)
570 Float_t fxi = .97;
571 Float_t dxe = .005858;
572
573 // General tracking parameter
574 Float_t tmaxfd = -10.;
575 Float_t stemax = -1e10;
576 Float_t deemax = -0.1;
577 Float_t epsil = 1e-4;
578 Float_t stmin = -0.001;
579
580 Float_t absl, radl, d, buf[1];
581 Float_t agm[2], dgm, zgm[2], wgm[2];
582 Int_t nbuf;
583
584 //////////////////////////////////////////////////////////////////////////
585 // Define Materials
586 //////////////////////////////////////////////////////////////////////////
587
588 AliMaterial( 1, "Al $", 26.98, 13.0, 2.7 , 8.9 , 37.2);
589 AliMaterial( 2, "Air$", 14.61, 7.3, 0.001205, 30420.0 , 67500.0);
590 AliMaterial( 4, "Xe $", 131.29, 54.0, dxe , 1447.59, 0.0);
591 AliMaterial( 5, "Cu $", 63.54, 29.0, 8.96 , 1.43, 14.8);
592 AliMaterial( 6, "C $", 12.01, 6.0, 2.265 , 18.8 , 74.4);
593 AliMaterial(12, "G10$", 20.00, 10.0, 1.7 , 19.4 , 999.0);
594
595 // Mixtures
596 AliMixture(3, "Polyethilene$", ape, zpe, dpe, -2, wpe);
597 AliMixture(7, "Mylar$", amy, zmy, dmy, -3, wmy);
598 AliMixture(8, "CO2$", aco, zco, dco, -2, wco);
599 AliMixture(9, "Isobutane$", ais, zis, dis, -2, wis);
600 AliMixture(13,"Water$", awa, zwa, dwa, -2, wwa);
601
602 // Gas mixtures
603 Char_t namate[21];
604 // Xe/CO2-mixture
605 // Get properties of Xe
606 gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
607 // Get properties of CO2
608 gMC->Gfmate((*fIdmate)[8], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
609 // Create gas mixture
610 wgm[0] = fxc;
611 wgm[1] = 1. - fxc;
612 dgm = wgm[0] * dxe + wgm[1] * dco;
613 AliMixture(10, "Gas mixture 1$", agm, zgm, dgm, 2, wgm);
614 // Xe/Isobutane-mixture
615 // Get properties of Xe
616 gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
617 // Get properties of Isobutane
618 gMC->Gfmate((*fIdmate)[9], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
619 // Create gas mixture
620 wgm[0] = fxi;
621 wgm[1] = 1. - fxi;
622 dgm = wgm[0] * dxe + wgm[1] * dis;
623 AliMixture(11, "Gas mixture 2$", agm, zgm, dgm, 2, wgm);
624
625 //////////////////////////////////////////////////////////////////////////
626 // Tracking Media Parameters
627 //////////////////////////////////////////////////////////////////////////
628
629 // Al Frame
630 AliMedium(1, "Al Frame$", 1, 0, ISXFLD, SXMGMX
631 , tmaxfd, stemax, deemax, epsil, stmin);
632 // Air
633 AliMedium(2, "Air$", 2, 0, ISXFLD, SXMGMX
634 , tmaxfd, stemax, deemax, epsil, stmin);
635 // Polyethilene
636 AliMedium(3, "Radiator$", 3, 0, ISXFLD, SXMGMX
637 , tmaxfd, stemax, deemax, epsil, stmin);
638 // Xe
639 AliMedium(4, "Xe$", 4, 1, ISXFLD, SXMGMX
640 , tmaxfd, stemax, deemax, epsil, stmin);
641 // Cu pads
642 AliMedium(5, "Padplane$", 5, 1, ISXFLD, SXMGMX
643 , tmaxfd, stemax, deemax, epsil, stmin);
644 // Fee + cables
645 AliMedium(6, "Readout$", 1, 0, ISXFLD, SXMGMX
646 , tmaxfd, stemax, deemax, epsil, stmin);
647 // C frame
648 AliMedium(7, "C Frame$", 6, 0, ISXFLD, SXMGMX
649 , tmaxfd, stemax, deemax, epsil, stmin);
650 // Mylar foils
651 AliMedium(8, "Mylar$", 7, 0, ISXFLD, SXMGMX
652 , tmaxfd, stemax, deemax, epsil, stmin);
653 if (fGasMix == 1) {
654 // Gas-mixture (Xe/CO2)
655 AliMedium(9, "Gas-mix$", 10, 1, ISXFLD, SXMGMX
656 , tmaxfd, stemax, deemax, epsil, stmin);
657 }
658 else {
659 // Gas-mixture (Xe/Isobutane)
660 AliMedium(9, "Gas-mix$", 11, 1, ISXFLD, SXMGMX
661 , tmaxfd, stemax, deemax, epsil, stmin);
662 }
663 // Nomex-honeycomb (use carbon for the time being)
664 AliMedium(10, "Nomex$", 6, 0, ISXFLD, SXMGMX
665 , tmaxfd, stemax, deemax, epsil, stmin);
666 // Kapton foils (use Mylar for the time being)
667 AliMedium(11, "Kapton$", 7, 0, ISXFLD, SXMGMX
668 , tmaxfd, stemax, deemax, epsil, stmin);
669 // Gas-filling of the radiator
670 AliMedium(12, "CO2$", 8, 0, ISXFLD, SXMGMX
671 , tmaxfd, stemax, deemax, epsil, stmin);
672 // G10-plates
673 AliMedium(13, "G10-plates$",12, 0, ISXFLD, SXMGMX
674 , tmaxfd, stemax, deemax, epsil, stmin);
675 // Cooling water
676 AliMedium(14, "Water$", 13, 0, ISXFLD, SXMGMX
677 , tmaxfd, stemax, deemax, epsil, stmin);
678
679}
680
681//_____________________________________________________________________________
682void AliTRD::DrawModule()
683{
684 //
685 // Draw a shaded view of the Transition Radiation Detector version 0
686 //
687
688 // Set everything unseen
689 gMC->Gsatt("*" ,"SEEN",-1);
690
691 // Set ALIC mother transparent
692 gMC->Gsatt("ALIC","SEEN", 0);
693
694 // Set the volumes visible
695 gMC->Gsatt("B032","SEEN", 0);
696 gMC->Gsatt("B028","SEEN", 0);
697 gMC->Gsatt("B029","SEEN", 0);
698 gMC->Gsatt("B030","SEEN", 0);
699 gMC->Gsatt("BTR1","SEEN", 0);
700 gMC->Gsatt("BTR2","SEEN", 0);
701 gMC->Gsatt("BTR3","SEEN", 0);
702 gMC->Gsatt("TRD" ,"SEEN", 0);
703 gMC->Gsatt("UCII","SEEN", 0);
704 gMC->Gsatt("UCIM","SEEN", 0);
705 gMC->Gsatt("UCIO","SEEN", 0);
706 gMC->Gsatt("UL02","SEEN", 1);
707 gMC->Gsatt("UL05","SEEN", 1);
708 gMC->Gsatt("UL06","SEEN", 1);
709
710 gMC->Gdopt("hide", "on");
711 gMC->Gdopt("shad", "on");
712 gMC->Gsatt("*", "fill", 7);
713 gMC->SetClipBox(".");
714 gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
715 gMC->DefaultRange();
716 gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
717 gMC->Gdhead(1111, "Transition Radiation Detector");
718 gMC->Gdman(18, 4, "MAN");
719
720}
721
722//_____________________________________________________________________________
723Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
724{
725 //
726 // Distance between the mouse and the TRD detector on the screen
727 // Dummy routine
728
729 return 9999;
730
731}
732
733//_____________________________________________________________________________
734void AliTRD::Init()
735{
736 //
737 // Initialise the TRD detector after the geometry has been created
738 //
739
740 Int_t i;
741
742 printf("\n");
743 for(i=0;i<35;i++) printf("*");
744 printf(" TRD_INIT ");
745 for(i=0;i<35;i++) printf("*");
746 printf("\n");
747
748 // Here the TRD initialisation code (if any!)
749 if (fGasMix == 1)
750 printf(" Gas Mixture: 90%% Xe + 10%% CO2\n");
751 else
752 printf(" Gas Mixture: 97%% Xe + 3%% Isobutane\n");
753
754}
755
756//_____________________________________________________________________________
757void AliTRD::SetGasMix(Int_t imix)
758{
759 //
760 // Defines the gas mixture (imix=0: Xe/Isobutane imix=1: Xe/CO2)
761 //
762
763 if ((imix < 0) || (imix > 1)) {
764 printf("Wrong input value: %d\n",imix);
765 printf("Use standard setting\n");
766 fGasMix = 0;
767 return;
768 }
769
770 fGasMix = imix;
771
772}
773
774ClassImp(AliTRDhit)
775
776//_____________________________________________________________________________
777AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
778 AliHit(shunt, track)
779{
780 //
781 // Create a TRD hit
782 //
783
784 // Store volume hierarchy
785 fSector = vol[0];
786 fChamber = vol[1];
787 fPlane = vol[2];
788
789 // Store position and charge
790 fX = hits[0];
791 fY = hits[1];
792 fZ = hits[2];
793 fQ = hits[3];
794
795}
796
797ClassImp(AliTRDdigit)
798
799//_____________________________________________________________________________
800AliTRDdigit::AliTRDdigit(Int_t *tracks, Int_t *digits)
801 :AliDigit(tracks)
802{
803 //
804 // Create a TRD digit
805 //
806
807 // Store the volume hierarchy
808 fSector = digits[0];
809 fChamber = digits[1];
810 fPlane = digits[2];
811
812 // Store the row, pad, and time bucket number
813 fRow = digits[3];
814 fCol = digits[4];
815 fTime = digits[5];
816
817 // Store the signal amplitude
818 fSignal = digits[6];
819
820}