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