1 ///////////////////////////////////////////////////////////////////////////////
3 // Time Of Flight: design of P.Fonte //
4 // This class contains the functions for version 2 of the Time Of Flight //
9 <img src="picts/AliTOFv2Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
21 //_____________________________________________________________________________
25 // Default constructor
29 //_____________________________________________________________________________
30 AliTOFv2::AliTOFv2(const char *name, const char *title)
34 // Standard constructor
38 //_____________________________________________________________________________
39 void AliTOFv2::CreateGeometry()
42 // Create geometry for Time Of Flight version 0
46 <img src="picts/AliTOFv2.gif">
51 // Create common geometry
53 AliTOF::CreateGeometry();
56 //_____________________________________________________________________________
57 void AliTOFv2::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
58 Float_t zm1, Float_t zm2)
61 // Definition of the Time Of Fligh Resistive Plate Chambers
62 // xm, ym, zm - sizes of TOF modules (large)
65 Float_t xcor, ycor, zcor, ycoor;
66 Float_t zazor, dx, dy, dz, xp, yp, zp, ywidth;
69 Int_t inz, nxp, npx, npz;
70 Float_t xsz, ysz, zsz;
71 Int_t nzp0, nzp1, nzp2;
73 Int_t *idtmed = fIdtmed->GetArray()-499;
75 // X size of small RPC plate G10
77 // Y size (thickness) of large && small RPC plate G10
79 // Z size of small RPC plate G10
81 // Width of CO2 box with RPC
83 // Frame width along X,Y and Z axis of RPC chambers
85 dy = .3; //this is 1mm(ceramic) + 1mm(Al) + 1mm(polyethelene)
89 // Sizes of RPC chamber
90 xp = 3.06; //small pixel
91 //xp = 3.9; //large pixel
92 yp = zazor + dy * 2; //=0.83cm total thickness of RPC
93 zp = 3.06; //small pixel
94 //zp = 4.1; //large pixel
95 // Large not sensitive volumes with CO2
99 gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
100 gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
102 gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
103 gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
105 gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
106 gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
107 // Large electronic plate (G10) after
112 gMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3); // G10
113 gMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
115 gMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3); // G10
116 gMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
118 gMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3); // G10
119 gMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
120 // Electronics (5cm thick) after
121 //first - Cu (0.02574cm thick - 1.8% X0)
123 par[1] = 0.02574 / 2.;
125 ycoor = yp + ysz + 5/2 - par[1];
126 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
127 gMC->Gspos("FEC1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
129 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
130 gMC->Gspos("FEC2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
132 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
133 gMC->Gspos("FEC3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
134 //second - G10 (0.2328cm thick - 1.2% X0)
136 par[1] = 0.2328 / 2.;
138 ycoor = yp + ysz + 5/2 + par[1];
139 gMC->Gsvolu("FEG1", "BOX ", idtmed[504], par, 3); // G10
140 gMC->Gspos("FEG1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
142 gMC->Gsvolu("FEG2", "BOX ", idtmed[504], par, 3); // G10
143 gMC->Gspos("FEG2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
145 gMC->Gsvolu("FEG3", "BOX ", idtmed[504], par, 3); // G10
146 gMC->Gspos("FEG3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
147 // Al support (5mm thick) after
151 ycoor = yp + ysz + par[1];
152 gMC->Gsvolu("FSP1", "BOX ", idtmed[508], par, 3); // Al
153 gMC->Gspos("FSP1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
155 gMC->Gsvolu("FSP2", "BOX ", idtmed[508], par, 3); // Al
156 gMC->Gspos("FSP2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
158 gMC->Gsvolu("FSP3", "BOX ", idtmed[508], par, 3); // Al
159 gMC->Gspos("FSP3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
160 // Mylar layer in front 0.5mm thick at 5mm from detector
164 ycoor = -yp - 0.5 - par[1];
165 gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // G10
166 gMC->Gspos("FMY1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
168 gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // G10
169 gMC->Gspos("FMY2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
171 gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // G10
172 gMC->Gspos("FMY3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
173 // insensitive volumes - large box for RPCs
174 par[1] = yp; // two times thicker than RPC
176 gMC->Gsvolu("FLT1", "BOX ", idtmed[512], par, 3); //Freon not senc.
177 gMC->Gspos("FLT1", 0, "FBT1", 0., 0., 0., 0, "ONLY");
179 gMC->Gsvolu("FLT2", "BOX ", idtmed[512], par, 3); //Freon not senc.
180 gMC->Gspos("FLT2", 0, "FBT2", 0., 0., 0., 0, "ONLY");
182 gMC->Gsvolu("FLT3", "BOX ", idtmed[512], par, 3); //Freon not senc.
183 gMC->Gspos("FLT3", 0, "FBT3", 0., 0., 0., 0, "ONLY");
184 // RPC box (small plate) number along X axis
185 nxp = Int_t (xm / xsz);
186 // RPC box (small plate) number along Z axis
187 nzp0 = Int_t (zm0 / zsz);
188 nzp1 = Int_t (zm1 / zsz);
189 nzp2 = Int_t (zm2 / zsz);
190 // (small) box (plate) for RPC size with insencitive Freon
191 par[0] = xm * .5 / nxp;
192 par[1] = yp; // two times thicker than RPC
193 par[2] = zm0 * .5 / nzp0;
194 gMC->Gsvolu("FLK0", "BOX ", idtmed[512], par, 3); //Freon not sencitive
195 // Position of (small) RPC boxes
197 for (ink = 1; ink <= nxp; ++ink) {
198 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp - 1.);
199 for (inz = 1; inz <= nzp0; ++inz) {
200 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
202 gMC->Gspos("FLK0", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
204 for (inz = 1; inz <= nzp1; ++inz) {
205 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
207 gMC->Gspos("FLK0", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
209 for (inz = 1; inz <= nzp2; ++inz) {
210 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
212 gMC->Gspos("FLK0", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
215 // Polyethilene boxes for RPC cell
216 npx = 19; //number of small pixels along X
217 npz = 16; //number of small pixels along Z
218 // npx = 15; //large pixel
219 // npz = 12; //large pixel
220 par[0] = xsz * .5 / npx;
222 par[2] = zsz * .5 / npz;
223 gMC->Gsvolu("FPP0", "BOX ", idtmed[503], par, 3); // Polyethilene
225 for (ink = 1; ink <= npx; ++ink) {
226 xcor = xsz * .5 * ((ink * 2 - 1) / (Float_t) npx - 1.);
227 if (ink%2 != 0) ycor=yp/2; else ycor=-yp/2;
228 for (inz = 1; inz <= npz; ++inz) {
229 zcor = zsz * .5 * ((inz * 2 - 1) / (Float_t) npz - 1.);
231 gMC->Gspos("FPP0", inum, "FLK0", xcor, ycor, zcor, 0, "ONLY");
237 par[1] = yp / 2. - 0.1; //minus 1mm of poliethelene
239 gMC->Gsvolu("FPA0", "BOX ", idtmed[508], par, 3);// Al
240 gMC->Gspos("FPA0", inum, "FPP0", 0., 0., 0., 0, "ONLY");
241 //Ceramic RPC geometry
243 par[1] = par[1] - 0.1; //minus 1mm of Al
245 gMC->Gsvolu("FPC0", "BOX ", idtmed[507], par, 3);// Ceramic
246 gMC->Gspos("FPC0", inum, "FPA0", 0., 0., 0., 0, "ONLY");
247 // Freon gas sencitive volume
248 par[0] = xp / 2. - dx;
249 par[1] = yp / 2. - dy;
250 par[2] = zp / 2. - dz;
251 gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon
252 gMC->Gspos("FPG0", 0, "FPC0", 0., 0., 0., 0, "ONLY");
255 //_____________________________________________________________________________
256 void AliTOFv2::DrawModule()
259 // Draw a shaded view of the Time Of Flight version 2
261 // Set everything unseen
262 gMC->Gsatt("*", "seen", -1);
264 // Set ALIC mother transparent
265 gMC->Gsatt("ALIC","SEEN",0);
267 // Set the volumes visible
268 gMC->Gsatt("ALIC","SEEN",0);
269 gMC->Gsatt("FBAR","SEEN",0);
270 gMC->Gsatt("FTO1","SEEN",0);
271 gMC->Gsatt("FTO2","SEEN",0);
272 gMC->Gsatt("FTO3","SEEN",0);
273 gMC->Gsatt("FBT1","SEEN",0);
274 gMC->Gsatt("FBT2","SEEN",0);
275 gMC->Gsatt("FBT3","SEEN",0);
276 gMC->Gsatt("FLT1","SEEN",0);
277 gMC->Gsatt("FLT2","SEEN",0);
278 gMC->Gsatt("FLT3","SEEN",0);
279 gMC->Gsatt("FLK0","SEEN",1);
281 gMC->Gdopt("hide", "on");
282 gMC->Gdopt("shad", "on");
283 gMC->Gsatt("*", "fill", 7);
284 gMC->SetClipBox(".");
285 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
287 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
288 gMC->Gdhead(1111, "Time Of Flight");
289 gMC->Gdman(18, 4, "MAN");
290 gMC->Gdopt("hide","off");
293 //_____________________________________________________________________________
294 void AliTOFv2::CreateMaterials()
297 // Define materials for the Time Of Flight
299 AliTOF::CreateMaterials();
302 //_____________________________________________________________________________
303 void AliTOFv2::Init()
306 // Initialise the detector after the geometry has been defined
309 fIdFTO2=gMC->VolId("FTO2");
310 fIdFTO3=gMC->VolId("FTO3");
311 fIdFLT1=gMC->VolId("FLT1");
312 fIdFLT2=gMC->VolId("FLT2");
313 fIdFLT3=gMC->VolId("FLT3");
316 //_____________________________________________________________________________
317 void AliTOFv2::StepManager()
320 // Procedure called at each step in the Time Of Flight
322 TLorentzVector mom, pos;
326 Int_t *idtmed = fIdtmed->GetArray()-499;
327 if(gMC->GetMedium()==idtmed[514-1] &&
328 gMC->IsTrackEntering() && gMC->TrackCharge()
329 && gMC->CurrentVolID(copy)==fIdSens) {
330 TClonesArray &lhits = *fHits;
332 // Record only charged tracks at entrance
333 gMC->CurrentVolOffID(1,copy);
335 gMC->CurrentVolOffID(3,copy);
337 id=gMC->CurrentVolOffID(6,copy);
341 id=gMC->CurrentVolOffID(4,copy);
342 if(id==fIdFLT3) vol[1]+=4;
343 } else if (id==fIdFTO2) {
345 id=gMC->CurrentVolOffID(4,copy);
346 if(id==fIdFLT2) vol[1]+=8;
348 id=gMC->CurrentVolOffID(4,copy);
349 if(id==fIdFLT1) vol[1]+=14;
351 gMC->TrackPosition(pos);
352 gMC->TrackMomentum(mom);
354 Double_t ptot=mom.Rho();
355 Double_t norm=1/ptot;
358 hits[i+3]=mom[i]*norm;
362 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);