1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 2 of the Time Of Flight //
9 <img src="gif/AliTOFv3Class.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 2
46 <img src="gif/AliTOFv3.gif">
52 // Create common geometry between version 2 and 3
54 AliTOF::CreateGeometry();
57 //_____________________________________________________________________________
58 void AliTOFv2::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
59 Float_t zm1, Float_t zm2)
62 // Definition of the Time Of Fligh Resistive Plate Chambers
65 AliMC* pMC = AliMC::GetMC();
68 Float_t xcor, zcor, ytop, ycoor;
69 Float_t zazor, dx, dy, dz, xp, yp, zp, ywidth;
72 Int_t inz, nxp, npx, npz;
73 Float_t xsz, ysz, zsz;
74 Int_t nzp0, nzp1, nzp2;
76 Int_t *idtmed = gAlice->Idtmed();
78 // X size of PPC plate
80 // Y size of PPC plate
82 // Z size of PPC plate
86 // Frame width along X,Y and Z axis of RPC chambers
93 // X size of RPC chamber
94 // XP=3.06 ! + 0.06cm (Zagreev)
96 // Y size of RPC chamber
99 // Z size of RPC chamber
100 // ZP=3.06 ! + 0.06cm (Zagreev)
103 // No sensitive volumes with DME
105 par[1] = ywidth / 2.;
107 ycoor = ym / 3. - ywidth / 2.;
108 pMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
109 pMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
111 pMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
112 pMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
114 pMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
115 pMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
119 ycoor = ywidth / 2. - ysz / 2.;
120 pMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
121 pMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
122 pMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
124 pMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
125 pMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
126 pMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
128 pMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
129 pMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
130 pMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
131 // Electronic insensitive volumes
134 ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
135 pMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
136 pMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
138 pMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
139 pMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
141 pMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
142 pMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
143 // PPC-plate number along X axis
144 nxp = Int_t (xm / xsz);
145 // PPC-plate number along Z axis
146 nzp0 = Int_t (zm0 / zsz);
147 nzp1 = Int_t (zm1 / zsz);
148 nzp2 = Int_t (zm2 / zsz);
149 // Position of PPC-plates
150 par[0] = xm * .5 / nxp;
151 par[2] = zm0 * .5 / nzp0;
152 pMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
154 for (ink = 1; ink <= nxp; ++ink) {
155 xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp -
157 for (inz = 1; inz <= nzp0; ++inz) {
158 zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
160 pMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
162 for (inz = 1; inz <= nzp1; ++inz) {
163 zcor = zm1 * .5 * ((inz * 2 - 1) / (Float_t) nzp1 - 1.);
165 pMC->Gspos("FLK1", inum, "FLT2", xcor, 0., zcor, 0, "ONLY");
167 for (inz = 1; inz <= nzp2; ++inz) {
168 zcor = zm2 * .5 * ((inz * 2 - 1) / (Float_t) nzp2 - 1.);
170 pMC->Gspos("FLK1", inum, "FLT3", xcor, 0., zcor, 0, "ONLY");
173 // RPC position on RPC-plate
178 par[0] = xsz * .5 / npx;
179 par[2] = zsz * .5 / npz;
180 pMC->Gsvolu("FLL1", "BOX ", idtmed[505], par, 3);
182 for (ink = 1; ink <= npx; ++ink) {
183 xcor = xsz * .5 * ((ink * 2 - 1) / (Float_t) npx - 1.);
184 for (inz = 1; inz <= npz; ++inz) {
185 zcor = zsz * .5 * ((inz * 2 - 1) / (Float_t) npz - 1.);
187 pMC->Gspos("FLL1", inum, "FLK1", xcor, 0., zcor, 0, "ONLY");
194 pMC->Gsvolu("FPG1", "BOX ", idtmed[507], par, 3);
195 pMC->Gspos("FPG1", inum, "FLL1", 0., 0., 0., 0, "ONLY");
196 par[0] = xp / 2. - dx;
197 par[1] = yp / 2. - dy;
198 par[2] = zp / 2. - dz;
199 pMC->Gsvolu("FPG2", "BOX ", idtmed[509], par, 3);
200 pMC->Gspos("FPG2", 0, "FPG1", 0., 0., 0., 0, "ONLY");
203 //_____________________________________________________________________________
204 void AliTOFv2::DrawModule()
207 // Draw a shaded view of the Time Of Flight version 2
210 AliMC* pMC = AliMC::GetMC();
212 // Set everything unseen
213 pMC->Gsatt("*", "seen", -1);
215 // Set ALIC mother transparent
216 pMC->Gsatt("ALIC","SEEN",0);
218 // Set the volumes visible
219 pMC->Gsatt("ALIC","SEEN",0);
220 pMC->Gsatt("FBAR","SEEN",0);
221 pMC->Gsatt("FTO1","SEEN",0);
222 pMC->Gsatt("FTO2","SEEN",0);
223 pMC->Gsatt("FTO3","SEEN",0);
224 pMC->Gsatt("FBT1","SEEN",0);
225 pMC->Gsatt("FBT2","SEEN",0);
226 pMC->Gsatt("FBT3","SEEN",0);
227 pMC->Gsatt("FLT1","SEEN",0);
228 pMC->Gsatt("FLT2","SEEN",0);
229 pMC->Gsatt("FLT3","SEEN",0);
230 pMC->Gsatt("FLK1","SEEN",1);
232 pMC->Gdopt("hide", "on");
233 pMC->Gdopt("shad", "on");
234 pMC->Gsatt("*", "fill", 7);
235 pMC->SetClipBox(".");
236 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
238 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
239 pMC->Gdhead(1111, "Time Of Flight");
240 pMC->Gdman(18, 4, "MAN");
241 pMC->Gdopt("hide","off");
244 //_____________________________________________________________________________
245 void AliTOFv2::CreateMaterials()
248 // Define materials for the Time Of Flight
250 AliTOF::CreateMaterials();
253 //_____________________________________________________________________________
254 void AliTOFv2::Init()
257 // Initialise the detector after the geometry has been defined
260 AliMC* pMC = AliMC::GetMC();
263 fIdFTO2=pMC->VolId("FTO2");
264 fIdFTO3=pMC->VolId("FTO3");
265 fIdFLT1=pMC->VolId("FLT1");
266 fIdFLT2=pMC->VolId("FLT2");
267 fIdFLT3=pMC->VolId("FLT3");
270 //_____________________________________________________________________________
271 void AliTOFv2::StepManager()
274 // Procedure called at each step in the Time Of Flight
279 AliMC *pMC= AliMC::GetMC();
280 Int_t *idtmed = gAlice->Idtmed();
281 if(pMC->GetMedium()==idtmed[510-1] &&
282 pMC->TrackEntering() && pMC->TrackCharge()
283 && pMC->CurrentVol(0,copy)==fIdSens) {
284 TClonesArray &lhits = *fHits;
286 // Record only charged tracks at entrance
287 pMC->CurrentVolOff(1,0,copy);
289 pMC->CurrentVolOff(3,0,copy);
291 id=pMC->CurrentVolOff(6,0,copy);
295 id=pMC->CurrentVolOff(4,0,copy);
296 if(id==fIdFLT3) vol[1]+=6;
297 } else if (id==fIdFTO2) {
299 id=pMC->CurrentVolOff(4,0,copy);
300 if(id==fIdFLT2) vol[1]+=8;
302 id=pMC->CurrentVolOff(4,0,copy);
303 if(id==fIdFLT1) vol[1]+=14;
305 pMC->TrackPosition(hits);
306 pMC->TrackMomentum(&hits[3]);
307 hits[7]=pMC->TrackTime();
308 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);