1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 2 of the Time Of Flight //
9 <img src="gif/AliTOFv3Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
24 //_____________________________________________________________________________
25 AliTOFv2::AliTOFv2() : AliTOF()
28 // Default constructor
32 //_____________________________________________________________________________
33 AliTOFv2::AliTOFv2(const char *name, const char *title)
37 // Standard constructor
41 //_____________________________________________________________________________
42 void AliTOFv2::CreateGeometry()
45 // Create geometry for Time Of Flight version 2
49 <img src="gif/AliTOFv3.gif">
55 // Create common geometry between version 2 and 3
57 AliTOF::CreateGeometry();
60 //_____________________________________________________________________________
61 void AliTOFv2::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
62 Float_t zm1, Float_t zm2)
65 // Definition of the Time Of Fligh Resistive Plate Chambers
68 AliMC* pMC = AliMC::GetMC();
71 Float_t xcor, zcor, ytop, ycoor;
72 Float_t zazor, dx, dy, dz, xp, yp, zp, ywidth;
75 Int_t inz, nxp, npx, npz;
76 Float_t xsz, ysz, zsz;
77 Int_t nzp0, nzp1, nzp2;
79 Int_t *idtmed = gAlice->Idtmed();
81 // X size of PPC plate
83 // Y size of PPC plate
85 // Z size of PPC plate
89 // Frame width along X,Y and Z axis of RPC chambers
96 // X size of RPC chamber
97 // XP=3.06 ! + 0.06cm (Zagreev)
99 // Y size of RPC chamber
102 // Z size of RPC chamber
103 // ZP=3.06 ! + 0.06cm (Zagreev)
106 // No sensitive volumes with DME
108 par[1] = ywidth / 2.;
110 ycoor = ym / 3. - ywidth / 2.;
111 pMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
112 pMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
114 pMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
115 pMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
117 pMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
118 pMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
122 ycoor = ywidth / 2. - ysz / 2.;
123 pMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
124 pMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
125 pMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
127 pMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
128 pMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
129 pMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
131 pMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
132 pMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
133 pMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
134 // Electronic insensitive volumes
137 ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
138 pMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
139 pMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
141 pMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
142 pMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
144 pMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
145 pMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
146 // PPC-plate number along X axis
147 nxp = Int_t (xm / xsz);
148 // PPC-plate number along Z axis
149 nzp0 = Int_t (zm0 / zsz);
150 nzp1 = Int_t (zm1 / zsz);
151 nzp2 = Int_t (zm2 / zsz);
152 // Position of PPC-plates
153 par[0] = xm * .5 / nxp;
154 par[2] = zm0 * .5 / nzp0;
155 pMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
157 for (ink = 1; ink <= nxp; ++ink) {
158 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp -
160 for (inz = 1; inz <= nzp0; ++inz) {
161 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
163 pMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
165 for (inz = 1; inz <= nzp1; ++inz) {
166 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
168 pMC->Gspos("FLK1", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
170 for (inz = 1; inz <= nzp2; ++inz) {
171 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
173 pMC->Gspos("FLK1", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
176 // RPC position on RPC-plate
181 par[0] = xsz * .5 / npx;
182 par[2] = zsz * .5 / npz;
183 pMC->Gsvolu("FLL1", "BOX ", idtmed[505], par, 3);
185 for (ink = 1; ink <= npx; ++ink) {
186 xcor = xsz * .5 * ((ink * 2 - 1) / (Float_t) npx - 1.);
187 for (inz = 1; inz <= npz; ++inz) {
188 zcor = zsz * .5 * ((inz * 2 - 1) / (Float_t) npz - 1.);
190 pMC->Gspos("FLL1", inum, "FLK1", xcor, 0., zcor, 0, "ONLY");
197 pMC->Gsvolu("FPG1", "BOX ", idtmed[507], par, 3);
198 pMC->Gspos("FPG1", inum, "FLL1", 0., 0., 0., 0, "ONLY");
199 par[0] = xp / 2. - dx;
200 par[1] = yp / 2. - dy;
201 par[2] = zp / 2. - dz;
202 pMC->Gsvolu("FPG2", "BOX ", idtmed[509], par, 3);
203 pMC->Gspos("FPG2", 0, "FPG1", 0., 0., 0., 0, "ONLY");
206 //_____________________________________________________________________________
207 void AliTOFv2::DrawDetector()
210 // Draw a shaded view of the Time Of Flight version 2
213 AliMC* pMC = AliMC::GetMC();
215 // Set everything unseen
216 pMC->Gsatt("*", "seen", -1);
218 // Set ALIC mother transparent
219 pMC->Gsatt("ALIC","SEEN",0);
221 // Set the volumes visible
222 pMC->Gsatt("ALIC","SEEN",0);
223 pMC->Gsatt("FBAR","SEEN",0);
224 pMC->Gsatt("FTO1","SEEN",0);
225 pMC->Gsatt("FTO2","SEEN",0);
226 pMC->Gsatt("FTO3","SEEN",0);
227 pMC->Gsatt("FBT1","SEEN",0);
228 pMC->Gsatt("FBT2","SEEN",0);
229 pMC->Gsatt("FBT3","SEEN",0);
230 pMC->Gsatt("FLT1","SEEN",0);
231 pMC->Gsatt("FLT2","SEEN",0);
232 pMC->Gsatt("FLT3","SEEN",0);
233 pMC->Gsatt("FLK1","SEEN",1);
235 pMC->Gdopt("hide", "on");
236 pMC->Gdopt("shad", "on");
237 pMC->Gsatt("*", "fill", 7);
238 pMC->SetClipBox(".");
239 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
241 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
242 pMC->Gdhead(1111, "Time Of Flight");
243 pMC->Gdman(18, 4, "MAN");
244 pMC->Gdopt("hide","off");
247 //_____________________________________________________________________________
248 void AliTOFv2::CreateMaterials()
251 // Define materials for the Time Of Flight
253 AliTOF::CreateMaterials();
256 //_____________________________________________________________________________
257 void AliTOFv2::Init()
260 // Initialise the detector after the geometry has been defined
263 AliMC* pMC = AliMC::GetMC();
266 fIdFTO2=pMC->VolId("FTO2");
267 fIdFTO3=pMC->VolId("FTO3");
268 fIdFLT1=pMC->VolId("FLT1");
269 fIdFLT2=pMC->VolId("FLT2");
270 fIdFLT3=pMC->VolId("FLT3");
273 //_____________________________________________________________________________
274 void AliTOFv2::StepManager()
277 // Procedure called at each step in the Time Of Flight
282 AliMC *pMC= AliMC::GetMC();
283 Int_t *idtmed = gAlice->Idtmed();
284 if(pMC->GetMedium()==idtmed[510-1] &&
285 pMC->TrackEntering() && pMC->TrackCharge()
286 && pMC->CurrentVol(0,copy)==fIdSens) {
287 TClonesArray &lhits = *fHits;
289 // Record only charged tracks at entrance
290 pMC->CurrentVolOff(1,0,copy);
292 pMC->CurrentVolOff(3,0,copy);
294 id=pMC->CurrentVolOff(6,0,copy);
298 id=pMC->CurrentVolOff(4,0,copy);
299 if(id==fIdFLT3) vol[1]+=6;
300 } else if (id==fIdFTO2) {
302 id=pMC->CurrentVolOff(4,0,copy);
303 if(id==fIdFLT2) vol[1]+=8;
305 id=pMC->CurrentVolOff(4,0,copy);
306 if(id==fIdFLT1) vol[1]+=14;
308 pMC->TrackPosition(hits);
309 pMC->TrackMomentum(&hits[3]);
310 hits[7]=pMC->TrackTime();
311 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);