1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Time Of Flight: as for version 1 but not sensitive //
23 // This class contains the functions for version 0 of the Time Of Flight //
28 <img src="picts/AliTOFv0Class.gif">
32 ///////////////////////////////////////////////////////////////////////////////
40 //_____________________________________________________________________________
44 // Default constructor
48 //_____________________________________________________________________________
49 AliTOFv0::AliTOFv0(const char *name, const char *title)
53 // Standard constructor
57 //_____________________________________________________________________________
58 void AliTOFv0::CreateGeometry()
61 // Create geometry for Time Of Flight version 0
65 <img src="picts/AliTOFv0.gif">
70 // Create common geometry
72 AliTOF::CreateGeometry();
75 //_____________________________________________________________________________
76 void AliTOFv0::TOFpc(Float_t xm, Float_t ym, Float_t zm0,
77 Float_t zm1, Float_t zm2)
80 // Definition of the Time Of Fligh Resistive Plate Chambers
81 // xm, ym, zm - sizes of TOF modules (large)
84 Float_t zazor, xp, yp, zp;
87 Int_t *idtmed = fIdtmed->GetArray()-499;
91 // Sizes of RPC chamber
92 xp = 3.0; //small pixel
93 //xp = 3.9; //large pixel
94 yp = 12.3*0.05; // 5% X0 of glass
95 zp = 3.0; //small pixel
96 //zp = 4.1; //large pixel
97 // Large not sensitive volumes with CO2
101 gMC->Gsvolu("FBT1", "BOX ", idtmed[506], par, 3); // CO2
102 gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
103 gMC->Gsdvn("FDT1", "FBT1", 2, 3); // 2 large modules along Z
105 gMC->Gsvolu("FBT2", "BOX ", idtmed[506], par, 3); // CO2
106 gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
107 gMC->Gsdvn("FDT2", "FBT2", 2, 3); // 2 (PHOS) modules along Z
109 gMC->Gsvolu("FBT3", "BOX ", idtmed[506], par, 3); // CO2
110 gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
111 gMC->Gsdvn("FDT3", "FBT3", 1, 3); // 1 (RICH) module along Z
113 // subtraction of dead boundaries in X=2 cm and Z=7/2 cm
115 Int_t nz0, nz1, nz2, nx; //- numbers of pixels
116 nx = Int_t (par[0]*2/xp);
117 cout <<"************************* TOF geometry **************************"<<endl;
118 cout<< "nx = "<< nx << " x size = "<< par[0]*2/nx << endl;
120 par[2] = (zm0 / 2.)/2.; //this is half size of module after division by 2
122 nz0 = Int_t (par[2]*2/zp);
123 cout<< "nz0 = "<< nz0 << " z0 size = "<< par[2]*2/nz0 << endl;
124 gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
125 gMC->Gspos("FLT1", 0, "FDT1", 0., 0., 0., 0, "ONLY");
126 par[2] = (zm1 / 2.)/2.; //this is half size of module after division by 2
128 nz1 = Int_t (par[2]*2/zp);
129 cout<< "nz1 = "<< nz1 << " z1 size = "<< par[2]*2/nz1 << endl;
130 gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
131 gMC->Gspos("FLT2", 0, "FDT2", 0., 0., 0., 0, "ONLY");
132 par[2] = (zm2 / 2.); //this is half size of module after division by 1
134 nz2 = Int_t (par[2]*2/zp);
135 cout<< "nz2 = "<< nz2 << " z2 size = "<< par[2]*2/nz2 << endl;
136 gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
137 gMC->Gspos("FLT3", 0, "FDT3", 0., 0., 0., 0, "ONLY");
139 ////////// Layers before detector ////////////////////
140 // Mylar layer in front 0.5mm thick at the beginning
144 ycoor = -ym/2 + par[1];
145 gMC->Gsvolu("FMY1", "BOX ", idtmed[511], par, 3); // Mylar
146 gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
147 gMC->Gsvolu("FMY2", "BOX ", idtmed[511], par, 3); // Mylar
148 gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
149 gMC->Gsvolu("FMY3", "BOX ", idtmed[511], par, 3); // Mylar
150 gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
151 // Honeycomb layer (1cm of special!!! polyethilene)
152 ycoor = ycoor + par[1];
156 ycoor = ycoor + par[1];
157 gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
158 gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
159 gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
160 gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
161 gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
162 gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
164 ///////////////// Detector itself //////////////////////
166 par[1] = yp/2; // 5 %X0 thick of glass
169 gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
170 gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
171 gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
172 gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
173 gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
174 gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
176 gMC->Gsdvn("FLZ1", "FLD1", nz0, 3); //pixel size xp=zp=3
177 gMC->Gsdvn("FLZ2", "FLD2", nz1, 3);
178 gMC->Gsdvn("FLZ3", "FLD3", nz2, 3);
179 gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
180 gMC->Gsdvn("FLX2", "FLZ2", nx, 1);
181 gMC->Gsdvn("FLX3", "FLZ3", nx, 1);
184 par[1] = -1;//yp/2; // 5 %X0 thick of glass
186 gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
187 gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
188 gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
189 gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
190 // Freon gas sencitive volume
194 gMC->Gsvolu("FPG0", "BOX ", idtmed[513], par, 3);// Freon
195 gMC->Gspos("FPG0", 0, "FPA0", 0., 0., 0., 0, "ONLY");
197 ////////// Layers after detector ////////////////////
198 // Honeycomb layer after (3cm)
202 ycoor = -ym/2 + 6. - par[1];
203 gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
204 gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
205 gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
206 gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
207 gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
208 gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
209 // Electronics (Cu) after
211 par[1] = 1.43*0.05 / 2.; // 5% of X0
213 ycoor = -ym/2 + 6.+par[1];
214 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
215 gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
216 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
217 gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
218 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
219 gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
220 // Cooling water after
221 ycoor = ycoor+par[1];
223 par[1] = 36.1*0.02 / 2.; // 2% of X0
225 ycoor = ycoor+par[1];
226 gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
227 gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
228 gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
229 gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
230 gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
231 gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
232 //back plate honycomb (2cm)
236 ycoor = ym/2 - par[1];
237 gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
238 gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
239 gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
240 gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
241 gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
242 gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
245 //_____________________________________________________________________________
246 void AliTOFv0::DrawModule()
249 // Draw a shaded view of the Time Of Flight version 0
251 // Set everything unseen
252 gMC->Gsatt("*", "seen", -1);
254 // Set ALIC mother transparent
255 gMC->Gsatt("ALIC","SEEN",0);
257 // Set the volumes visible
258 gMC->Gsatt("ALIC","SEEN",0);
259 gMC->Gsatt("FBAR","SEEN",1);
260 gMC->Gsatt("FTO1","SEEN",1);
261 gMC->Gsatt("FTO2","SEEN",1);
262 gMC->Gsatt("FTO3","SEEN",1);
263 gMC->Gsatt("FBT1","SEEN",1);
264 gMC->Gsatt("FBT2","SEEN",1);
265 gMC->Gsatt("FBT3","SEEN",1);
266 gMC->Gsatt("FDT1","SEEN",1);
267 gMC->Gsatt("FDT2","SEEN",1);
268 gMC->Gsatt("FDT3","SEEN",1);
269 gMC->Gsatt("FLT1","SEEN",1);
270 gMC->Gsatt("FLT2","SEEN",1);
271 gMC->Gsatt("FLT3","SEEN",1);
273 gMC->Gdopt("hide", "on");
274 gMC->Gdopt("shad", "on");
275 gMC->Gsatt("*", "fill", 7);
276 gMC->SetClipBox(".");
277 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
279 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
280 gMC->Gdhead(1111, "Time Of Flight");
281 gMC->Gdman(18, 4, "MAN");
282 gMC->Gdopt("hide","off");
285 //_____________________________________________________________________________
286 void AliTOFv0::CreateMaterials()
289 // Define materials for the Time Of Flight
291 AliTOF::CreateMaterials();
294 //_____________________________________________________________________________
295 void AliTOFv0::Init()
298 // Initialise the detector after the geometry has been defined
301 fIdFTO2=gMC->VolId("FTO2");
302 fIdFTO3=gMC->VolId("FTO3");
303 fIdFLT1=gMC->VolId("FLT1");
304 fIdFLT2=gMC->VolId("FLT2");
305 fIdFLT3=gMC->VolId("FLT3");
308 //_____________________________________________________________________________
309 void AliTOFv0::StepManager()
312 // Procedure called at each step in the Time Of Flight
314 TLorentzVector mom, pos;
318 Int_t *idtmed = fIdtmed->GetArray()-499;
319 if(gMC->GetMedium()==idtmed[514-1] &&
320 gMC->IsTrackEntering() && gMC->TrackCharge()
321 && gMC->CurrentVolID(copy)==fIdSens) {
322 TClonesArray &lhits = *fHits;
324 // Record only charged tracks at entrance
325 gMC->CurrentVolOffID(1,copy);
327 gMC->CurrentVolOffID(3,copy);
329 id=gMC->CurrentVolOffID(8,copy);
333 id=gMC->CurrentVolOffID(5,copy);
334 if(id==fIdFLT3) vol[1]+=6;
335 } else if (id==fIdFTO2) {
337 id=gMC->CurrentVolOffID(5,copy);
338 if(id==fIdFLT2) vol[1]+=8;
340 id=gMC->CurrentVolOffID(5,copy);
341 if(id==fIdFLT1) vol[1]+=14;
343 gMC->TrackPosition(pos);
344 gMC->TrackMomentum(mom);
346 Double_t ptot=mom.Rho();
347 Double_t norm=1/ptot;
350 hits[i+3]=mom[i]*norm;
354 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);