1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 3 of the Time Of Flight //
9 <img src="picts/AliTOFv3Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
23 //_____________________________________________________________________________
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="picts/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
68 Float_t xcor, zcor, ytop;
70 Float_t xcor1, xcor2, ycoor;
71 Float_t stepx, stepz, dx, dy, dz, xp, yp, zp, shiftx, shiftz, ywidth;
72 Float_t shiftx1, shiftx2, xad, zad;
78 Float_t xsz, ysz, zsz;
79 Int_t nzp0, nzp1, nzp2;
81 Int_t *idtmed = fIdtmed->GetArray()-499;
83 // X size of PPC plate
85 // Y size of PPC plate
87 // Z size of PPC plate
89 // First return additional shift along X
91 // Second return additional shift along X
93 // Return additional shift along Z
97 // X size of PPC chamber
99 // Y size of PPC chamber
101 // Z size of PPC chamber
103 // Frame width along X,Y and Z axis of PPC chambers
107 // No sensitive volumes with DME
109 par[1] = ywidth / 2.;
111 ycoor = ym / 3. - ywidth / 2.;
112 gMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
113 gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
115 gMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
116 gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
118 gMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
119 gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
123 ycoor = ywidth / 2. - ysz / 2.;
124 gMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
125 gMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
126 gMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
128 gMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
129 gMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
130 gMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
132 gMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
133 gMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
134 gMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
135 // Electronic insensitive volumes
138 ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
139 gMC->Gsvolu("FST1", "BOX ", idtmed[505], par, 3);
140 gMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
141 gMC->Gspos("FST1", 0, "FBT1", 0., ytop, 0., 0, "ONLY");
142 gMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
144 gMC->Gsvolu("FST2", "BOX ", idtmed[505], par, 3);
145 gMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
146 gMC->Gspos("FST2", 0, "FBT2", 0., ytop, 0., 0, "ONLY");
147 gMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
149 gMC->Gsvolu("FST3", "BOX ", idtmed[505], par, 3);
150 gMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
151 gMC->Gspos("FST3", 0, "FBT3", 0., ytop, 0., 0, "ONLY");
152 gMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
153 // PPC-plate number along X axis
154 nxp = Int_t (xm / xsz);
155 // PPC-plate number along Z axis
156 nzp0 = Int_t (zm0 / zsz);
157 nzp1 = Int_t (zm1 / zsz);
158 nzp2 = Int_t (zm2 / zsz);
159 // Position of big PPC-plate
160 par[0] = xm * .5 / nxp;
161 par[2] = zm0 * .5 / nzp0;
162 gMC->Gsvolu("FSK1", "BOX ", idtmed[505], par, 3);
163 gMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
165 for (ink = 1; ink <= nxp; ++ink) {
166 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp - 1.);
167 for (inz = 1; inz <= nzp0; ++inz) {
168 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
170 gMC->Gspos("FSK1", inum, "FST1", xcor, 0., zcor, 0, "ONLY");
171 gMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
173 for (inz = 1; inz <= nzp1; ++inz) {
174 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
176 gMC->Gspos("FSK1", inum, "FST2", xcor, 0., zcor, 0, "ONLY");
177 gMC->Gspos("FLK1", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
179 for (inz = 1; inz <= nzp2; ++inz) {
180 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
182 gMC->Gspos("FSK1", inum, "FST3", xcor, 0., zcor, 0, "ONLY");
183 gMC->Gspos("FLK1", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
189 gMC->Gsvolu("FSL1", "BOX ", idtmed[505], par, 3);
190 gMC->Gsvolu("FLL1", "BOX ", idtmed[505], par, 3);
191 shiftx = (xp / 2. + xad / 2.) / 2.;
192 shiftz = (zm0 / nzp0 - zsz) / 2.;
193 gMC->Gspos("FSL1", 0, "FSK1", -shiftx, 0., -shiftz, 0, "ONLY");
194 gMC->Gspos("FLL1", 0, "FLK1", shiftx, 0., shiftz, 0, "ONLY");
195 // PPC position on PPC-plate
201 stepx = (xad + xzd + xp * 2) / 2.;
202 stepz = (zp + zad) / 2.;
203 shiftz = npz * (zad + zp) / 2.;
204 shiftx = npx * (xp * 2 + xad + xzd) / 2.;
205 shiftx1 = (xp * 2 + xzd + xad) / 2. - xp / 2.;
206 shiftx2 = (xp * 2 + xzd + xad) / 2. - xp / 2. - xzd;
207 gMC->Gsvolu("FPG1", "BOX ", idtmed[507], par, 3);
208 for (ink = 1; ink <= npx; ++ink) {
209 xcor1 = -shiftx + stepx * (ink * 2 - 1) - shiftx1;
210 xcor2 = -shiftx + stepx * (ink * 2 - 1) + shiftx2;
211 for (inz = 1; inz <= npz; ++inz) {
212 zcor = -shiftz + stepz * (inz * 2 - 1);
214 inum1 = npx * npz + inum;
215 gMC->Gspos("FPG1", inum, "FSL1", xcor1, 0., zcor, 0, "ONLY");
216 gMC->Gspos("FPG1", inum1, "FSL1", xcor2, 0., zcor, 0, "ONLY");
217 gMC->Gspos("FPG1", inum, "FLL1", xcor1, 0., zcor, 0, "ONLY");
218 gMC->Gspos("FPG1", inum1, "FLL1", xcor2, 0., zcor, 0, "ONLY");
221 par[0] = xp / 2. - dx;
222 par[1] = yp / 2. - dy;
223 par[2] = zp / 2. - dz;
224 gMC->Gsvolu("FPG2", "BOX ", idtmed[509], par, 3);
225 gMC->Gspos("FPG2", 0, "FPG1", 0., 0., 0., 0, "ONLY");
228 //_____________________________________________________________________________
229 void AliTOFv3::DrawModule()
232 // Draw a shaded view of the Time Of Flight version 3
235 // Set everything unseen
236 gMC->Gsatt("*", "seen", -1);
238 // Set ALIC mother transparent
239 gMC->Gsatt("ALIC","SEEN",0);
241 // Set the volumes visible
242 gMC->Gsatt("ALIC","SEEN",0);
243 gMC->Gsatt("FBAR","SEEN",0);
244 gMC->Gsatt("FTO1","SEEN",0);
245 gMC->Gsatt("FTO2","SEEN",0);
246 gMC->Gsatt("FTO3","SEEN",0);
247 gMC->Gsatt("FBT1","SEEN",0);
248 gMC->Gsatt("FBT2","SEEN",0);
249 gMC->Gsatt("FBT3","SEEN",0);
250 gMC->Gsatt("FST1","SEEN",0);
251 gMC->Gsatt("FLT1","SEEN",0);
252 gMC->Gsatt("FST2","SEEN",0);
253 gMC->Gsatt("FLT2","SEEN",0);
254 gMC->Gsatt("FST3","SEEN",0);
255 gMC->Gsatt("FLT3","SEEN",0);
256 gMC->Gsatt("FSK1","SEEN",0);
257 gMC->Gsatt("FLK1","SEEN",0);
258 gMC->Gsatt("FSL1","SEEN",1);
259 gMC->Gsatt("FLL1","SEEN",1);
261 gMC->Gdopt("hide", "on");
262 gMC->Gdopt("shad", "on");
263 gMC->Gsatt("*", "fill", 7);
264 gMC->SetClipBox(".");
265 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
267 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
268 gMC->Gdhead(1111, "Time Of Flight");
269 gMC->Gdman(18, 4, "MAN");
270 gMC->Gdopt("hide","off");
273 //_____________________________________________________________________________
274 void AliTOFv3::CreateMaterials()
277 // Define materials for the Time Of Flight
279 AliTOF::CreateMaterials();
282 //_____________________________________________________________________________
283 void AliTOFv3::Init()
286 // Initialise the detector after the geometry has been defined
290 fIdFTO2=gMC->VolId("FTO2");
291 fIdFTO3=gMC->VolId("FTO3");
292 fIdFLT1=gMC->VolId("FLT1");
293 fIdFLT2=gMC->VolId("FLT2");
294 fIdFLT3=gMC->VolId("FLT3");
297 //_____________________________________________________________________________
298 void AliTOFv3::StepManager()
301 // Procedure called at each step in the Time Of Flight
306 Int_t *idtmed = fIdtmed->GetArray()-499;
307 if(gMC->GetMedium()==idtmed[510-1] &&
308 gMC->TrackEntering() && gMC->TrackCharge()
309 && gMC->CurrentVol(0,copy)==fIdSens) {
310 TClonesArray &lhits = *fHits;
312 // Record only charged tracks at entrance
313 gMC->CurrentVolOff(1,0,copy);
315 gMC->CurrentVolOff(3,0,copy);
317 id=gMC->CurrentVolOff(6,0,copy);
321 id=gMC->CurrentVolOff(4,0,copy);
322 if(id==fIdFLT3) vol[1]+=6;
323 } else if (id==fIdFTO2) {
325 id=gMC->CurrentVolOff(4,0,copy);
326 if(id==fIdFLT2) vol[1]+=8;
328 id=gMC->CurrentVolOff(4,0,copy);
329 if(id==fIdFLT1) vol[1]+=14;
331 gMC->TrackPosition(hits);
332 gMC->TrackMomentum(&hits[3]);
333 hits[7]=gMC->TrackTime();
334 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);