1 ///////////////////////////////////////////////////////////////////////////////
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 //
10 <img src="gif/AliTRDClass.gif">
15 ///////////////////////////////////////////////////////////////////////////////
20 #include <TGeometry.h>
33 //_____________________________________________________________________________
37 // Default constructor
47 //_____________________________________________________________________________
48 AliTRD::AliTRD(const char *name, const char *title)
49 : AliDetector(name,title)
52 // Standard constructor for the TRD
56 // Allocate the hit array
58 fHits = new TClonesArray("AliTRDhit", 405);
67 SetMarkerColor(kWhite);
70 //_____________________________________________________________________________
71 void AliTRD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
74 // Add a hit for the TRD
76 TClonesArray &lhits = *fHits;
77 new(lhits[fNhits++]) AliTRDhit(fIshunt,track,vol,hits);
80 //_____________________________________________________________________________
81 void AliTRD::BuildGeometry()
84 // Create the ROOT TNode geometry for the TRD
88 const Int_t kColorTRD = 46;
90 // Find the top node alice
91 Top=gAlice->GetGeometry()->GetNode("alice");
93 pgon = new TPGON("S_TRD","TRD","void",0,360,nsect,4);
94 Float_t ff = TMath::Cos(kDegrad * 180 / nsect);
95 Float_t rrmin = rmin / ff;
96 Float_t rrmax = rmax / ff;
97 pgon->DefineSection(0,-zmax1,rrmax,rrmax);
98 pgon->DefineSection(1,-zmax2,rrmin,rrmax);
99 pgon->DefineSection(2, zmax2,rrmin,rrmax);
100 pgon->DefineSection(3, zmax1,rrmax,rrmax);
102 Node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
103 Node->SetLineColor(kColorTRD);
108 //_____________________________________________________________________________
109 void AliTRD::CreateMaterials()
113 // Create the materials for the TRD
117 AliMC* pMC = AliMC::GetMC();
119 Int_t ISXFLD = gAlice->Field()->Integ();
120 Float_t SXMGMX = gAlice->Field()->Max();
122 // For polyethilene (CH2)
123 Float_t ape[2] = { 12., 1. };
124 Float_t zpe[2] = { 6., 1. };
125 Float_t wpe[2] = { 1., 2. };
128 // For mylar (C5H4O2)
129 Float_t amy[3] = { 12., 1., 16. };
130 Float_t zmy[3] = { 6., 1., 8. };
131 Float_t wmy[3] = { 5., 4., 2. };
135 Float_t aco[2] = { 12., 16. };
136 Float_t zco[2] = { 6., 8. };
137 Float_t wco[2] = { 1., 2. };
138 Float_t dco = 0.001977;
141 Float_t awa[2] = { 1., 16. };
142 Float_t zwa[2] = { 1., 8. };
143 Float_t wwa[2] = { 2., 1. };
146 // For isobutane (C4H10)
147 Float_t ais[2] = { 12., 1. };
148 Float_t zis[2] = { 6., 1. };
149 Float_t wis[2] = { 4., 10. };
150 Float_t dis = 0.00267;
152 // For Xe/CO2-gas-mixture
153 // Xe-content of the Xe/CO2-mixture (90% / 10%)
155 // Xe-content of the Xe/Isobutane-mixture (97% / 3%)
157 Float_t dxe = .005858;
159 // General tracking parameter
160 Float_t tmaxfd = -10.;
161 Float_t stemax = -1e10;
162 Float_t deemax = -0.1;
163 Float_t epsil = 1e-4;
164 Float_t stmin = -0.001;
166 Float_t absl, radl, d, buf[1];
167 Float_t agm[2], dgm, zgm[2], wgm[2];
170 //////////////////////////////////////////////////////////////////////////
172 //////////////////////////////////////////////////////////////////////////
174 AliMaterial( 1, "Al $", 26.98, 13.0, 2.7 , 8.9 , 37.2);
175 AliMaterial( 2, "Air$", 14.61, 7.3, 0.001205, 30420.0 , 67500.0);
176 AliMaterial( 4, "Xe $", 131.29, 54.0, dxe , 1447.59, 0.0);
177 AliMaterial( 5, "Cu $", 63.54, 29.0, 8.96 , 1.43, 14.8);
178 AliMaterial( 6, "C $", 12.01, 6.0, 2.265 , 18.8 , 74.4);
179 AliMaterial(12, "G10$", 20.00, 10.0, 1.7 , 19.4 , 999.0);
182 AliMixture(3, "Polyethilene$", ape, zpe, dpe, -2, wpe);
183 AliMixture(7, "Mylar$", amy, zmy, dmy, -3, wmy);
184 AliMixture(8, "CO2$", aco, zco, dco, -2, wco);
185 AliMixture(9, "Isobutane$", ais, zis, dis, -2, wis);
186 AliMixture(13, "Water$" , awa, zwa, dwa, -2, wwa);
191 // Get properties of Xe
192 pMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
193 // Get properties of CO2
194 pMC->Gfmate((*fIdmate)[8], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
195 // Create gas mixture
198 dgm = wgm[0] * dxe + wgm[1] * dco;
199 AliMixture(10, "Gas mixture 1$", agm, zgm, dgm, 2, wgm);
200 // Xe/Isobutane-mixture
201 // Get properties of Xe
202 pMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
203 // Get properties of Isobutane
204 pMC->Gfmate((*fIdmate)[9], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
205 // Create gas mixture
208 dgm = wgm[0] * dxe + wgm[1] * dis;
209 AliMixture(11, "Gas mixture 2$", agm, zgm, dgm, 2, wgm);
211 //////////////////////////////////////////////////////////////////////////
212 // Tracking Media Parameters
213 //////////////////////////////////////////////////////////////////////////
216 AliMedium(1301, "Al Frame$", 1, 0, ISXFLD, SXMGMX
217 , tmaxfd, stemax, deemax, epsil, stmin);
219 AliMedium(1302, "Air$", 2, 0, ISXFLD, SXMGMX
220 , tmaxfd, stemax, deemax, epsil, stmin);
222 AliMedium(1303, "Radiator$", 3, 0, ISXFLD, SXMGMX
223 , tmaxfd, stemax, deemax, epsil, stmin);
225 AliMedium(1304, "Xe$", 4, 1, ISXFLD, SXMGMX
226 , tmaxfd, stemax, deemax, epsil, stmin);
228 AliMedium(1305, "Padplane$", 5, 1, ISXFLD, SXMGMX
229 , tmaxfd, stemax, deemax, epsil, stmin);
231 AliMedium(1306, "Readout$", 1, 0, ISXFLD, SXMGMX
232 , tmaxfd, stemax, deemax, epsil, stmin);
234 AliMedium(1307, "C Frame$", 6, 0, ISXFLD, SXMGMX
235 , tmaxfd, stemax, deemax, epsil, stmin);
237 AliMedium(1308, "Mylar$", 7, 0, ISXFLD, SXMGMX
238 , tmaxfd, stemax, deemax, epsil, stmin);
240 // Gas-mixture (Xe/CO2)
241 AliMedium(1309, "Gas-mix$", 10, 1, ISXFLD, SXMGMX
242 , tmaxfd, stemax, deemax, epsil, stmin);
245 // Gas-mixture (Xe/Isobutane)
246 AliMedium(1309, "Gas-mix$", 11, 1, ISXFLD, SXMGMX
247 , tmaxfd, stemax, deemax, epsil, stmin);
249 // Nomex-honeycomb (use carbon for the time being)
250 AliMedium(1310, "Nomex$", 6, 0, ISXFLD, SXMGMX
251 , tmaxfd, stemax, deemax, epsil, stmin);
252 // Kapton foils (use Mylar for the time being)
253 AliMedium(1311, "Kapton$", 7, 0, ISXFLD, SXMGMX
254 , tmaxfd, stemax, deemax, epsil, stmin);
255 // Gas-filling of the radiator
256 AliMedium(1312, "CO2$", 8, 0, ISXFLD, SXMGMX
257 , tmaxfd, stemax, deemax, epsil, stmin);
259 AliMedium(1313, "G10-plates$",12, 0, ISXFLD, SXMGMX
260 , tmaxfd, stemax, deemax, epsil, stmin);
262 AliMedium(1314, "Water$", 13, 0, ISXFLD, SXMGMX
263 , tmaxfd, stemax, deemax, epsil, stmin);
267 //_____________________________________________________________________________
268 Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
271 // Distance between the mouse and the TRD detector on the screen
277 //_____________________________________________________________________________
281 // Initialise the TRD detector after the geometry has been created
286 for(i=0;i<35;i++) printf("*");
287 printf(" TRD_INIT ");
288 for(i=0;i<35;i++) printf("*");
291 // Here the TRD initialisation code (if any!)
293 printf(" Gas Mixture: 90%% Xe + 10%% CO2\n");
295 printf(" Gas Mixture: 97%% Xe + 3%% Isobutane\n");
297 printf(" Only plane %d is sensitive\n",fSensPlane);
299 printf(" Only chamber %d is sensitive\n",fSensChamber);
301 printf(" Only sector %d is sensitive\n",fSensSector);
303 for(i=0;i<80;i++) printf("*");
307 //_____________________________________________________________________________
308 void AliTRD::SetGasMix(Int_t imix)
311 if ((imix < 0) || (imix > 1)) {
312 printf("Wrong input value: %d\n",imix);
313 printf("Use standard setting\n");
322 //_____________________________________________________________________________
323 void AliTRD::SetSensPlane(Int_t iplane)
326 if ((iplane < 0) || (iplane > 6)) {
327 printf("Wrong input value: %d\n",iplane);
328 printf("Use standard setting\n");
339 //_____________________________________________________________________________
340 void AliTRD::SetSensChamber(Int_t ichamber)
343 if ((ichamber < 0) || (ichamber > 5)) {
344 printf("Wrong input value: %d\n",ichamber);
345 printf("Use standard setting\n");
352 fSensChamber = ichamber;
356 //_____________________________________________________________________________
357 void AliTRD::SetSensSector(Int_t isector)
360 if ((isector < 0) || (isector > 18)) {
361 printf("Wrong input value: %d\n",isector);
362 printf("Use standard setting\n");
369 fSensSector = isector;
375 //_____________________________________________________________________________
376 AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
384 // Store volume hierarchy
389 // Store position and charge