1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 3 of the Time Of Flight //
9 <img src="picts/AliTOFv3Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
20 //_____________________________________________________________________________
24 // Default constructor
28 //_____________________________________________________________________________
29 AliTOFv3::AliTOFv3(const char *name, const char *title)
33 // Standard constructor
37 //_____________________________________________________________________________
38 void AliTOFv3::CreateGeometry()
41 // Create geometry for Time Of Flight version 2
45 <img src="picts/AliTOFv3.gif">
51 // Create common geometry between version 2 and 3
53 AliTOF::CreateGeometry();
56 //_____________________________________________________________________________
57 void AliTOFv3::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
58 Float_t zm1, Float_t zm2)
61 // Definition of the Time Of Fligh Parallel Plate Chambers
65 Float_t xcor, zcor, ytop;
67 Float_t xcor1, xcor2, ycoor;
68 Float_t stepx, stepz, dx, dy, dz, xp, yp, zp, shiftx, shiftz, ywidth;
69 Float_t shiftx1, shiftx2, xad, zad;
75 Float_t xsz, ysz, zsz;
76 Int_t nzp0, nzp1, nzp2;
78 Int_t *idtmed = fIdtmed->GetArray()-499;
80 // X size of PPC plate
82 // Y size of PPC plate
84 // Z size of PPC plate
86 // First return additional shift along X
88 // Second return additional shift along X
90 // Return additional shift along Z
94 // X size of PPC chamber
96 // Y size of PPC chamber
98 // Z size of PPC chamber
100 // Frame width along X,Y and Z axis of PPC chambers
104 // No sensitive volumes with DME
106 par[1] = ywidth / 2.;
108 ycoor = ym / 3. - ywidth / 2.;
109 gMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
110 gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
112 gMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
113 gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
115 gMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
116 gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
120 ycoor = ywidth / 2. - ysz / 2.;
121 gMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
122 gMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
123 gMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
125 gMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
126 gMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
127 gMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
129 gMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
130 gMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
131 gMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
132 // Electronic insensitive volumes
135 ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
136 gMC->Gsvolu("FST1", "BOX ", idtmed[505], par, 3);
137 gMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
138 gMC->Gspos("FST1", 0, "FBT1", 0., ytop, 0., 0, "ONLY");
139 gMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
141 gMC->Gsvolu("FST2", "BOX ", idtmed[505], par, 3);
142 gMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
143 gMC->Gspos("FST2", 0, "FBT2", 0., ytop, 0., 0, "ONLY");
144 gMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
146 gMC->Gsvolu("FST3", "BOX ", idtmed[505], par, 3);
147 gMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
148 gMC->Gspos("FST3", 0, "FBT3", 0., ytop, 0., 0, "ONLY");
149 gMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
150 // PPC-plate number along X axis
151 nxp = Int_t (xm / xsz);
152 // PPC-plate number along Z axis
153 nzp0 = Int_t (zm0 / zsz);
154 nzp1 = Int_t (zm1 / zsz);
155 nzp2 = Int_t (zm2 / zsz);
156 // Position of big PPC-plate
157 par[0] = xm * .5 / nxp;
158 par[2] = zm0 * .5 / nzp0;
159 gMC->Gsvolu("FSK1", "BOX ", idtmed[505], par, 3);
160 gMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
162 for (ink = 1; ink <= nxp; ++ink) {
163 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp - 1.);
164 for (inz = 1; inz <= nzp0; ++inz) {
165 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
167 gMC->Gspos("FSK1", inum, "FST1", xcor, 0., zcor, 0, "ONLY");
168 gMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
170 for (inz = 1; inz <= nzp1; ++inz) {
171 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
173 gMC->Gspos("FSK1", inum, "FST2", xcor, 0., zcor, 0, "ONLY");
174 gMC->Gspos("FLK1", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
176 for (inz = 1; inz <= nzp2; ++inz) {
177 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
179 gMC->Gspos("FSK1", inum, "FST3", xcor, 0., zcor, 0, "ONLY");
180 gMC->Gspos("FLK1", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
186 gMC->Gsvolu("FSL1", "BOX ", idtmed[505], par, 3);
187 gMC->Gsvolu("FLL1", "BOX ", idtmed[505], par, 3);
188 shiftx = (xp / 2. + xad / 2.) / 2.;
189 shiftz = (zm0 / nzp0 - zsz) / 2.;
190 gMC->Gspos("FSL1", 0, "FSK1", -shiftx, 0., -shiftz, 0, "ONLY");
191 gMC->Gspos("FLL1", 0, "FLK1", shiftx, 0., shiftz, 0, "ONLY");
192 // PPC position on PPC-plate
198 stepx = (xad + xzd + xp * 2) / 2.;
199 stepz = (zp + zad) / 2.;
200 shiftz = npz * (zad + zp) / 2.;
201 shiftx = npx * (xp * 2 + xad + xzd) / 2.;
202 shiftx1 = (xp * 2 + xzd + xad) / 2. - xp / 2.;
203 shiftx2 = (xp * 2 + xzd + xad) / 2. - xp / 2. - xzd;
204 gMC->Gsvolu("FPG1", "BOX ", idtmed[507], par, 3);
205 for (ink = 1; ink <= npx; ++ink) {
206 xcor1 = -shiftx + stepx * (ink * 2 - 1) - shiftx1;
207 xcor2 = -shiftx + stepx * (ink * 2 - 1) + shiftx2;
208 for (inz = 1; inz <= npz; ++inz) {
209 zcor = -shiftz + stepz * (inz * 2 - 1);
211 inum1 = npx * npz + inum;
212 gMC->Gspos("FPG1", inum, "FSL1", xcor1, 0., zcor, 0, "ONLY");
213 gMC->Gspos("FPG1", inum1, "FSL1", xcor2, 0., zcor, 0, "ONLY");
214 gMC->Gspos("FPG1", inum, "FLL1", xcor1, 0., zcor, 0, "ONLY");
215 gMC->Gspos("FPG1", inum1, "FLL1", xcor2, 0., zcor, 0, "ONLY");
218 par[0] = xp / 2. - dx;
219 par[1] = yp / 2. - dy;
220 par[2] = zp / 2. - dz;
221 gMC->Gsvolu("FPG2", "BOX ", idtmed[509], par, 3);
222 gMC->Gspos("FPG2", 0, "FPG1", 0., 0., 0., 0, "ONLY");
225 //_____________________________________________________________________________
226 void AliTOFv3::DrawModule()
229 // Draw a shaded view of the Time Of Flight version 3
232 // Set everything unseen
233 gMC->Gsatt("*", "seen", -1);
235 // Set ALIC mother transparent
236 gMC->Gsatt("ALIC","SEEN",0);
238 // Set the volumes visible
239 gMC->Gsatt("ALIC","SEEN",0);
240 gMC->Gsatt("FBAR","SEEN",0);
241 gMC->Gsatt("FTO1","SEEN",0);
242 gMC->Gsatt("FTO2","SEEN",0);
243 gMC->Gsatt("FTO3","SEEN",0);
244 gMC->Gsatt("FBT1","SEEN",0);
245 gMC->Gsatt("FBT2","SEEN",0);
246 gMC->Gsatt("FBT3","SEEN",0);
247 gMC->Gsatt("FST1","SEEN",0);
248 gMC->Gsatt("FLT1","SEEN",0);
249 gMC->Gsatt("FST2","SEEN",0);
250 gMC->Gsatt("FLT2","SEEN",0);
251 gMC->Gsatt("FST3","SEEN",0);
252 gMC->Gsatt("FLT3","SEEN",0);
253 gMC->Gsatt("FSK1","SEEN",0);
254 gMC->Gsatt("FLK1","SEEN",0);
255 gMC->Gsatt("FSL1","SEEN",1);
256 gMC->Gsatt("FLL1","SEEN",1);
258 gMC->Gdopt("hide", "on");
259 gMC->Gdopt("shad", "on");
260 gMC->Gsatt("*", "fill", 7);
261 gMC->SetClipBox(".");
262 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
264 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
265 gMC->Gdhead(1111, "Time Of Flight");
266 gMC->Gdman(18, 4, "MAN");
267 gMC->Gdopt("hide","off");
270 //_____________________________________________________________________________
271 void AliTOFv3::CreateMaterials()
274 // Define materials for the Time Of Flight
276 AliTOF::CreateMaterials();
279 //_____________________________________________________________________________
280 void AliTOFv3::Init()
283 // Initialise the detector after the geometry has been defined
287 fIdFTO2=gMC->VolId("FTO2");
288 fIdFTO3=gMC->VolId("FTO3");
289 fIdFLT1=gMC->VolId("FLT1");
290 fIdFLT2=gMC->VolId("FLT2");
291 fIdFLT3=gMC->VolId("FLT3");
294 //_____________________________________________________________________________
295 void AliTOFv3::StepManager()
298 // Procedure called at each step in the Time Of Flight
300 TLorentzVector mom, pos;
304 Int_t *idtmed = fIdtmed->GetArray()-499;
305 if(gMC->GetMedium()==idtmed[510-1] &&
306 gMC->IsTrackEntering() && gMC->TrackCharge()
307 && gMC->CurrentVolID(copy)==fIdSens) {
308 TClonesArray &lhits = *fHits;
310 // Record only charged tracks at entrance
311 gMC->CurrentVolOffID(1,copy);
313 gMC->CurrentVolOffID(3,copy);
315 id=gMC->CurrentVolOffID(6,copy);
319 id=gMC->CurrentVolOffID(4,copy);
320 if(id==fIdFLT3) vol[1]+=6;
321 } else if (id==fIdFTO2) {
323 id=gMC->CurrentVolOffID(4,copy);
324 if(id==fIdFLT2) vol[1]+=8;
326 id=gMC->CurrentVolOffID(4,copy);
327 if(id==fIdFLT1) vol[1]+=14;
329 gMC->TrackPosition(pos);
330 gMC->TrackMomentum(mom);
331 Double_t ptot=mom.Rho();
332 Double_t norm=1/ptot;
335 hits[i+3]=mom[i]*norm;
339 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);