1 ///////////////////////////////////////////////////////////////////////////////
3 // Transition Radiation Detector version 0 -- coarse simulation //
7 <img src="gif/AliTRDv0Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
17 #include <TGeometry.h>
22 #include "GParticle.h"
30 //_____________________________________________________________________________
31 AliTRDv0::AliTRDv0(const char *name, const char *title)
35 // Standard constructor for Transition Radiation Detector version 0
37 fIdSens1 = fIdSens2 = 0;
40 //_____________________________________________________________________________
41 void AliTRDv0::CreateGeometry()
44 // Create the GEANT geometry for the Transition Radiation Detector
45 // --- The coarse geometry of the TRD, that can be used for background
46 // studies. This version covers the full azimuth.
47 // -- Author : Nick van Eijndhoven (CERN) 24/09/90
51 <img src="gif/AliTRDv0.gif">
56 <img src="gif/AliTRDv0Tree.gif">
60 Float_t xpos, ypos, zpos, f;
62 Float_t widma, theoc, widmi;
64 Float_t par_ic[4], par_oc[11], par_mo[10], par_fr[4];
66 Int_t *idtmed = gAlice->Idtmed();
68 // --- Name Conventions :
69 // TRD --> Mother TRD volume (Al)
70 // UTRS --> Sectors of the sub-detector (Al)
71 // UTFI(O) --> Inner part of the detector frame (Air)
72 // UTCI(O) --> Frames of the inner and outer chambers (C)
73 // UTII(O) --> Inner part of the chambers (Air)
74 // UTMI(O) --> Modules in the chambers (Air)
75 // UT1I(O) --> Radiator layer (CO2)
76 // UT2I(O) --> Polyethylene layer (PE)
77 // UT3I(O) --> Mylar layer (Mylar)
78 // UT4I(O) --> Xe/C02 layer (Xe/C02)
79 // UT5I(O) --> Cu layer (pads/sensitive) (Cu)
80 // UT6I(O) --> Kapton layer (Kapton)
81 // UT7I(O) --> NOMEX layer (C)
82 // UT8I(O) --> Readout layer (Al)
84 // --- Contains geometry information
86 // --- Number of sectors in the full detector
87 // --- Number of modules in each sector
88 // --- z-Coordinates of the TRD-frame
89 // --- r-Coordinates of the TRD-frame
90 // --- Thickness of the aluminium of the support frame
91 // --- Thickness of the interior of the support frame
92 // --- Thickness of the carbon chamber frame
93 // --- Thickness and z-position of the PE-layer in the radiator
94 // --- Thickness and z-position of the radiator
95 // --- Thickness and z-position of the mylar-layer
96 // --- Thickness and z-position of the Xe/C02-layer
97 // --- Thickness and z-position of the Cu-layer (Pads)
98 // --- Thickness and z-position of the kapton-layer
99 // --- Thickness and z-position of the NOMEX-layer
100 // Simple C-layer for the time being
101 // --- Thickness and z-position of the readout-layer
102 // --- Parameter for the arrays
104 AliMC* pMC = AliMC::GetMC();
106 //************************************************************************
108 // Definition of Volumes
110 //************************************************************************
112 //phisec = 360./nsect; //The phi-angle of the sectors
113 widmi = rmin*TMath::Sin(kPI/nsect);
114 widma = rmax*TMath::Sin(kPI/nsect);
115 // --- Definition of the Mother volume for the TRD (Al)
126 pMC->Gsvolu("TRD ", "PGON", idtmed[1300], par_mo, 10);
127 pMC->Gsdvn("UTRS", "TRD ", 18, 2);
128 // --- Definition of the inner part of the detector frame (Air)
131 par_fr[2] = zmax1/4 - alfram2/2;
132 par_fr[3] = (rmax-rmin)/2;
133 pMC->Gsvolu("UTFI", "TRD1", idtmed[1301], par_fr, 4);
134 pMC->Gsvolu("UTFO", "TRD1", idtmed[1301], par_fr, 4);
135 // --- Calculate the shape-parameter for the outer chambers
136 tanzr = (zmax1-zmax2)/(rmax-rmin);
137 theoc = -kRaddeg*TMath::ATan(tanzr/2);
138 // --- The carbon frame of the outer chambers
139 par_oc[0] = (rmax-rmin)/2;
142 par_oc[3] = zmax2/2 -zmax1/4 -alfram2/2;
143 par_oc[4] = widmi - (inframe+alfram1)/2;
144 par_oc[5] = widmi - (inframe+alfram1)/2;
146 par_oc[7] = zmax1/4 -alfram2/2;
147 par_oc[8] = widma - (inframe+alfram1)/2;
148 par_oc[9] = widma - (inframe+alfram1)/2;
150 pMC->Gsvolu("UTCO", "TRAP", idtmed[1306], par_oc, 11);
151 // --- The inner part of the outer chambers (Air)
152 par_oc[3] -= ccframe;
153 par_oc[4] -= ccframe;
154 par_oc[5] -= ccframe;
155 par_oc[7] -= ccframe;
156 par_oc[8] -= ccframe;
157 par_oc[9] -= ccframe;
158 pMC->Gsvolu("UTIO", "TRAP", idtmed[1301], par_oc, 11);
159 // --- Definition of the six modules within each outer chamber
160 pMC->Gsdvn("UTMO", "UTIO", nmodul, 3);
161 // --- Definition of the layers of each outer chamber
172 // --- Radiator layer
173 par_oc[0] = rathick/2;
174 pMC->Gsvolu("UT1O", "TRAP", idtmed[1311], par_oc, 11);
175 // --- Polyethylene layer
176 par_oc[0] = pethick/2;
177 pMC->Gsvolu("UT2O", "TRAP", idtmed[1302], par_oc, 11);
179 par_oc[0] = mythick/2;
180 pMC->Gsvolu("UT3O", "TRAP", idtmed[1307], par_oc, 11);
182 par_oc[0] = xethick/2;
183 pMC->Gsvolu("UT4O", "TRAP", idtmed[1308], par_oc, 11);
185 par_oc[0] = cuthick/2;
186 pMC->Gsvolu("UT5O", "TRAP", idtmed[1304], par_oc, 11);
188 par_oc[0] = kathick/2;
189 pMC->Gsvolu("UT6O", "TRAP", idtmed[1310], par_oc, 11);
191 par_oc[0] = nothick/2;
192 pMC->Gsvolu("UT7O", "TRAP", idtmed[1309], par_oc, 11);
193 // --- Read out layer
194 par_oc[0] = rothick/2;
195 pMC->Gsvolu("UT8O", "TRAP", idtmed[1305], par_oc, 11);
196 // --- The carbon frame of the inner chambers
197 par_ic[0] = widmi - (inframe+alfram1)/2;
198 par_ic[1] = widma - (inframe+alfram1)/2;
199 par_ic[2] = zmax1/4 - alfram2/2;
200 par_ic[3] = (rmax-rmin)/2;
201 pMC->Gsvolu("UTCI", "TRD1", idtmed[1306], par_ic, 4);
202 // --- The inner part of the inner chambers (Air)
203 par_ic[0] -= ccframe;
204 par_ic[1] -= ccframe;
205 par_ic[2] -= ccframe;
206 pMC->Gsvolu("UTII", "TRD1", idtmed[1301], par_ic, 4);
207 // --- Definition of the six modules within each outer chamber
208 pMC->Gsdvn("UTMI", "UTII", nmodul, 3);
209 // --- Definition of the layers of each inner chamber
213 // --- Radiator layer
214 par_ic[3] = rathick/2;
215 pMC->Gsvolu("UT1I", "TRD1", idtmed[1311], par_ic, 4);
216 // --- Polyethylene layer
217 par_ic[3] = pethick/2;
218 pMC->Gsvolu("UT2I", "TRD1", idtmed[1302], par_ic, 4);
220 par_ic[3] = mythick/2;
221 pMC->Gsvolu("UT3I", "TRD1", idtmed[1307], par_ic, 4);
223 par_ic[3] = xethick/2;
224 pMC->Gsvolu("UT4I", "TRD1", idtmed[1308], par_ic, 4);
226 par_ic[3] = cuthick/2;
227 pMC->Gsvolu("UT5I", "TRD1", idtmed[1304], par_ic, 4);
229 par_ic[3] = kathick/2;
230 pMC->Gsvolu("UT6I", "TRD1", idtmed[1310], par_ic, 4);
232 par_ic[3] = nothick/2;
233 pMC->Gsvolu("UT7I", "TRD1", idtmed[1309], par_ic, 4);
234 // --- Read out layer
235 par_ic[3] = rothick/2;
236 pMC->Gsvolu("UT8I", "TRD1", idtmed[1305], par_ic, 4);
237 //************************************************************************
239 // Positioning of Volumes
241 //************************************************************************
242 // --- The rotation matrices
243 AliMatrix(idmat[0], 90., 90., 180., 0., 90., 0.);
244 AliMatrix(idmat[1], 90., 90., 0., 0., 90., 0.);
245 // --- Position of the layers in a TRD module
246 f = TMath::Tan(theoc * kDegrad);
247 pMC->Gspos("UT8O", 1, "UTMO", 0., f*rozpos, rozpos, 0, "ONLY");
248 pMC->Gspos("UT7O", 1, "UTMO", 0., f*nozpos, nozpos, 0, "ONLY");
249 pMC->Gspos("UT6O", 1, "UTMO", 0., f*kazpos, kazpos, 0, "ONLY");
250 pMC->Gspos("UT5O", 1, "UTMO", 0., f*cuzpos, cuzpos, 0, "ONLY");
251 pMC->Gspos("UT4O", 1, "UTMO", 0., f*xezpos, xezpos, 0, "ONLY");
252 pMC->Gspos("UT3O", 1, "UTMO", 0., f*myzpos, myzpos, 0, "ONLY");
253 pMC->Gspos("UT1O", 1, "UTMO", 0., f*razpos, razpos, 0, "ONLY");
254 pMC->Gspos("UT2O", 1, "UT1O", 0., f*pezpos, pezpos, 0, "ONLY");
255 pMC->Gspos("UT8I", 1, "UTMI", 0., 0., rozpos, 0, "ONLY");
256 pMC->Gspos("UT7I", 1, "UTMI", 0., 0., nozpos, 0, "ONLY");
257 pMC->Gspos("UT6I", 1, "UTMI", 0., 0., kazpos, 0, "ONLY");
258 pMC->Gspos("UT5I", 1, "UTMI", 0., 0., cuzpos, 0, "ONLY");
259 pMC->Gspos("UT4I", 1, "UTMI", 0., 0., xezpos, 0, "ONLY");
260 pMC->Gspos("UT3I", 1, "UTMI", 0., 0., myzpos, 0, "ONLY");
261 pMC->Gspos("UT1I", 1, "UTMI", 0., 0., razpos, 0, "ONLY");
262 pMC->Gspos("UT2I", 1, "UT1I", 0., 0., pezpos, 0, "ONLY");
263 // --- Position of the inner part of the chambers
264 pMC->Gspos("UTII", 1, "UTCI", 0., 0., 0., 0, "ONLY");
265 pMC->Gspos("UTIO", 1, "UTCO", 0., 0., 0., 0, "ONLY");
266 // --- Position of the chambers in the support frame
268 ypos = (zmax1-zmax2)/4;
270 pMC->Gspos("UTCO", 1, "UTFO", xpos, ypos, zpos, 0, "ONLY");
274 pMC->Gspos("UTCI", 1, "UTFI", xpos, ypos, zpos, 0, "ONLY");
275 // --- Position of the frame in the sectors of the mother volume
276 xpos = (rmax+rmin)/2;
279 pMC->Gspos("UTFO", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
280 pMC->Gspos("UTFO", 2, "UTRS", xpos, ypos,-zpos, idmat[1], "ONLY");
281 xpos = (rmax+rmin)/2;
284 pMC->Gspos("UTFI", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
285 pMC->Gspos("UTFI", 2, "UTRS", xpos, ypos,-zpos, idmat[1], "ONLY");
286 // --- Position of TRD mother volume in ALICE experiment
287 pMC->Gspos("TRD ", 1, "ALIC", 0., 0., 0., 0, "ONLY");
290 //_____________________________________________________________________________
291 void AliTRDv0::DrawDetector()
294 // Draw a shaded view of the Transition Radiation Detector version 0
297 AliMC* pMC = AliMC::GetMC();
299 // Set everything unseen
300 pMC->Gsatt("*", "seen", -1);
302 // Set ALIC mother transparent
303 pMC->Gsatt("ALIC","SEEN",0);
305 // Set the volumes visible
306 pMC->Gsatt("TRD","SEEN",0);
307 pMC->Gsatt("UTRS","SEEN",0);
308 pMC->Gsatt("UTFI","SEEN",0);
309 pMC->Gsatt("UTFO","SEEN",0);
310 pMC->Gsatt("UTCO","SEEN",0);
311 pMC->Gsatt("UTIO","SEEN",0);
312 pMC->Gsatt("UTMO","SEEN",0);
313 pMC->Gsatt("UT1O","SEEN",1);
314 pMC->Gsatt("UT4O","SEEN",1);
315 pMC->Gsatt("UTCI","SEEN",0);
316 pMC->Gsatt("UTII","SEEN",0);
317 pMC->Gsatt("UTMI","SEEN",0);
318 pMC->Gsatt("UT1I","SEEN",1);
319 pMC->Gsatt("UT4I","SEEN",1);
321 pMC->Gdopt("hide", "on");
322 pMC->Gdopt("shad", "on");
323 pMC->Gsatt("*", "fill", 7);
324 pMC->SetClipBox(".");
325 pMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
327 pMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
328 pMC->Gdhead(1111, "Transition Radiation Detector Version 0");
329 pMC->Gdman(18, 4, "MAN");
332 //_____________________________________________________________________________
333 void AliTRDv0::CreateMaterials()
336 // Create materials for the Transition Radiation Detector
338 printf("TRD: Fast simulation with coarse geometry\n");
339 AliTRD::CreateMaterials();
342 //_____________________________________________________________________________
343 void AliTRDv0::Init()
346 // Initialise Transition Radiation Detector after geometry is built
349 AliMC* pMC = AliMC::GetMC();
351 // Retrieve the numeric identifier of the sensitive planes
352 fIdSens1 = pMC->VolId("UT5I");
353 fIdSens2 = pMC->VolId("UT5O");
356 //_____________________________________________________________________________
357 void AliTRDv0::StepManager()
360 // Procedure called at every step in the TRD
364 Int_t icopy, idSens, icSens;
368 TClonesArray &lhits = *fHits;
370 AliMC* pMC = AliMC::GetMC();
372 // Use only charged tracks and count them only once per volume
373 if(pMC->TrackCharge() && pMC->TrackEntering()) {
375 // Check on sensitive volume
376 idSens = pMC->CurrentVol(0,icSens);
377 if ((idSens == fIdSens1) || (idSens == fIdSens2)) {
380 pMC->CurrentVolOff(5,0,icopy);
383 // The chamber number
384 pMC->CurrentVolOff(4,0,icopy);
385 if (idSens == fIdSens2)
386 vol[1] = (icopy - 1) * 3 + 1;
391 pMC->CurrentVolOff(1,0,icopy);
394 pMC->TrackPosition(hits);
397 new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);