1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 3 of the Time Of Flight //
9 <img src="gif/AliTOFv3Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
23 //_____________________________________________________________________________
24 AliTOFv3::AliTOFv3() : AliTOF()
27 // Default constructor
31 //_____________________________________________________________________________
32 AliTOFv3::AliTOFv3(const char *name, const char *title)
36 // Standard constructor
40 //_____________________________________________________________________________
41 void AliTOFv3::CreateGeometry()
44 // Create geometry for Time Of Flight version 2
48 <img src="gif/AliTOFv3.gif">
54 // Create common geometry between version 2 and 3
56 AliTOF::CreateGeometry();
59 //_____________________________________________________________________________
60 void AliTOFv3::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
61 Float_t zm1, Float_t zm2)
64 // Definition of the Time Of Fligh Parallel Plate Chambers
67 AliMC* pMC = AliMC::GetMC();
70 Float_t xcor, zcor, ytop;
72 Float_t xcor1, xcor2, ycoor;
73 Float_t stepx, stepz, dx, dy, dz, xp, yp, zp, shiftx, shiftz, ywidth;
74 Float_t shiftx1, shiftx2, xad, zad;
80 Float_t xsz, ysz, zsz;
81 Int_t nzp0, nzp1, nzp2;
83 Int_t *idtmed = gAlice->Idtmed();
85 // X size of PPC plate
87 // Y size of PPC plate
89 // Z size of PPC plate
91 // First return additional shift along X
93 // Second return additional shift along X
95 // Return additional shift along Z
99 // X size of PPC chamber
101 // Y size of PPC chamber
103 // Z size of PPC chamber
105 // Frame width along X,Y and Z axis of PPC chambers
109 // No sensitive volumes with DME
111 par[1] = ywidth / 2.;
113 ycoor = ym / 3. - ywidth / 2.;
114 pMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
115 pMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
117 pMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
118 pMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
120 pMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
121 pMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
125 ycoor = ywidth / 2. - ysz / 2.;
126 pMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
127 pMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
128 pMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
130 pMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
131 pMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
132 pMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
134 pMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
135 pMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
136 pMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
137 // Electronic insensitive volumes
140 ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
141 pMC->Gsvolu("FST1", "BOX ", idtmed[505], par, 3);
142 pMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
143 pMC->Gspos("FST1", 0, "FBT1", 0., ytop, 0., 0, "ONLY");
144 pMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
146 pMC->Gsvolu("FST2", "BOX ", idtmed[505], par, 3);
147 pMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
148 pMC->Gspos("FST2", 0, "FBT2", 0., ytop, 0., 0, "ONLY");
149 pMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
151 pMC->Gsvolu("FST3", "BOX ", idtmed[505], par, 3);
152 pMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
153 pMC->Gspos("FST3", 0, "FBT3", 0., ytop, 0., 0, "ONLY");
154 pMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
155 // PPC-plate number along X axis
156 nxp = Int_t (xm / xsz);
157 // PPC-plate number along Z axis
158 nzp0 = Int_t (zm0 / zsz);
159 nzp1 = Int_t (zm1 / zsz);
160 nzp2 = Int_t (zm2 / zsz);
161 // Position of big PPC-plate
162 par[0] = xm * .5 / nxp;
163 par[2] = zm0 * .5 / nzp0;
164 pMC->Gsvolu("FSK1", "BOX ", idtmed[505], par, 3);
165 pMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
167 for (ink = 1; ink <= nxp; ++ink) {
168 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp - 1.);
169 for (inz = 1; inz <= nzp0; ++inz) {
170 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
172 pMC->Gspos("FSK1", inum, "FST1", xcor, 0., zcor, 0, "ONLY");
173 pMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
175 for (inz = 1; inz <= nzp1; ++inz) {
176 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
178 pMC->Gspos("FSK1", inum, "FST2", xcor, 0., zcor, 0, "ONLY");
179 pMC->Gspos("FLK1", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
181 for (inz = 1; inz <= nzp2; ++inz) {
182 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
184 pMC->Gspos("FSK1", inum, "FST3", xcor, 0., zcor, 0, "ONLY");
185 pMC->Gspos("FLK1", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
191 pMC->Gsvolu("FSL1", "BOX ", idtmed[505], par, 3);
192 pMC->Gsvolu("FLL1", "BOX ", idtmed[505], par, 3);
193 shiftx = (xp / 2. + xad / 2.) / 2.;
194 shiftz = (zm0 / nzp0 - zsz) / 2.;
195 pMC->Gspos("FSL1", 0, "FSK1", -shiftx, 0., -shiftz, 0, "ONLY");
196 pMC->Gspos("FLL1", 0, "FLK1", shiftx, 0., shiftz, 0, "ONLY");
197 // PPC position on PPC-plate
203 stepx = (xad + xzd + xp * 2) / 2.;
204 stepz = (zp + zad) / 2.;
205 shiftz = npz * (zad + zp) / 2.;
206 shiftx = npx * (xp * 2 + xad + xzd) / 2.;
207 shiftx1 = (xp * 2 + xzd + xad) / 2. - xp / 2.;
208 shiftx2 = (xp * 2 + xzd + xad) / 2. - xp / 2. - xzd;
209 pMC->Gsvolu("FPG1", "BOX ", idtmed[507], par, 3);
210 for (ink = 1; ink <= npx; ++ink) {
211 xcor1 = -shiftx + stepx * (ink * 2 - 1) - shiftx1;
212 xcor2 = -shiftx + stepx * (ink * 2 - 1) + shiftx2;
213 for (inz = 1; inz <= npz; ++inz) {
214 zcor = -shiftz + stepz * (inz * 2 - 1);
216 inum1 = npx * npz + inum;
217 pMC->Gspos("FPG1", inum, "FSL1", xcor1, 0., zcor, 0, "ONLY");
218 pMC->Gspos("FPG1", inum1, "FSL1", xcor2, 0., zcor, 0, "ONLY");
219 pMC->Gspos("FPG1", inum, "FLL1", xcor1, 0., zcor, 0, "ONLY");
220 pMC->Gspos("FPG1", inum1, "FLL1", xcor2, 0., zcor, 0, "ONLY");
223 par[0] = xp / 2. - dx;
224 par[1] = yp / 2. - dy;
225 par[2] = zp / 2. - dz;
226 pMC->Gsvolu("FPG2", "BOX ", idtmed[509], par, 3);
227 pMC->Gspos("FPG2", 0, "FPG1", 0., 0., 0., 0, "ONLY");
230 //_____________________________________________________________________________
231 void AliTOFv3::DrawModule()
234 // Draw a shaded view of the Time Of Flight version 3
237 AliMC* pMC = AliMC::GetMC();
239 // Set everything unseen
240 pMC->Gsatt("*", "seen", -1);
242 // Set ALIC mother transparent
243 pMC->Gsatt("ALIC","SEEN",0);
245 // Set the volumes visible
246 pMC->Gsatt("ALIC","SEEN",0);
247 pMC->Gsatt("FBAR","SEEN",0);
248 pMC->Gsatt("FTO1","SEEN",0);
249 pMC->Gsatt("FTO2","SEEN",0);
250 pMC->Gsatt("FTO3","SEEN",0);
251 pMC->Gsatt("FBT1","SEEN",0);
252 pMC->Gsatt("FBT2","SEEN",0);
253 pMC->Gsatt("FBT3","SEEN",0);
254 pMC->Gsatt("FST1","SEEN",0);
255 pMC->Gsatt("FLT1","SEEN",0);
256 pMC->Gsatt("FST2","SEEN",0);
257 pMC->Gsatt("FLT2","SEEN",0);
258 pMC->Gsatt("FST3","SEEN",0);
259 pMC->Gsatt("FLT3","SEEN",0);
260 pMC->Gsatt("FSK1","SEEN",0);
261 pMC->Gsatt("FLK1","SEEN",0);
262 pMC->Gsatt("FSL1","SEEN",1);
263 pMC->Gsatt("FLL1","SEEN",1);
265 pMC->Gdopt("hide", "on");
266 pMC->Gdopt("shad", "on");
267 pMC->Gsatt("*", "fill", 7);
268 pMC->SetClipBox(".");
269 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
271 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
272 pMC->Gdhead(1111, "Time Of Flight");
273 pMC->Gdman(18, 4, "MAN");
274 pMC->Gdopt("hide","off");
277 //_____________________________________________________________________________
278 void AliTOFv3::CreateMaterials()
281 // Define materials for the Time Of Flight
283 AliTOF::CreateMaterials();
286 //_____________________________________________________________________________
287 void AliTOFv3::Init()
290 // Initialise the detector after the geometry has been defined
293 AliMC* pMC = AliMC::GetMC();
296 fIdFTO2=pMC->VolId("FTO2");
297 fIdFTO3=pMC->VolId("FTO3");
298 fIdFLT1=pMC->VolId("FLT1");
299 fIdFLT2=pMC->VolId("FLT2");
300 fIdFLT3=pMC->VolId("FLT3");
303 //_____________________________________________________________________________
304 void AliTOFv3::StepManager()
307 // Procedure called at each step in the Time Of Flight
312 AliMC *pMC= AliMC::GetMC();
313 Int_t *idtmed = gAlice->Idtmed();
314 if(pMC->GetMedium()==idtmed[510-1] &&
315 pMC->TrackEntering() && pMC->TrackCharge()
316 && pMC->CurrentVol(0,copy)==fIdSens) {
317 TClonesArray &lhits = *fHits;
319 // Record only charged tracks at entrance
320 pMC->CurrentVolOff(1,0,copy);
322 pMC->CurrentVolOff(3,0,copy);
324 id=pMC->CurrentVolOff(6,0,copy);
328 id=pMC->CurrentVolOff(4,0,copy);
329 if(id==fIdFLT3) vol[1]+=6;
330 } else if (id==fIdFTO2) {
332 id=pMC->CurrentVolOff(4,0,copy);
333 if(id==fIdFLT2) vol[1]+=8;
335 id=pMC->CurrentVolOff(4,0,copy);
336 if(id==fIdFLT1) vol[1]+=14;
338 pMC->TrackPosition(hits);
339 pMC->TrackMomentum(&hits[3]);
340 hits[7]=pMC->TrackTime();
341 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);