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 **************************************************************************/
18 Revision 1.9 1999/09/29 09:24:33 fca
19 Introduction of the Copyright and cvs Log
23 ///////////////////////////////////////////////////////////////////////////////
25 // Time Of Flight: design of C.Williams FCA //
26 // This class contains the functions for version 1 of the Time Of Flight //
29 // VERSION WITH 5 MODULES AND FLAT PLATES
31 // WITH HOLES FOR PHOS AND HMPID inside the
32 // SPACE FRAME WITH HOLES
39 // University of Salerno - Italy
44 <img src="picts/AliTOFv4Class.gif">
48 ///////////////////////////////////////////////////////////////////////////////
56 //_____________________________________________________________________________
60 // Default constructor
64 //_____________________________________________________________________________
65 AliTOFv4::AliTOFv4(const char *name, const char *title)
69 // Standard constructor
73 //_____________________________________________________________________________
74 void AliTOFv4::CreateGeometry()
77 // Create geometry for Time Of Flight version 0
81 <img src="picts/AliTOFv4.gif">
85 // Creates common geometry
87 AliTOF::CreateGeometry();
90 //_____________________________________________________________________________
91 void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
92 Float_t zlen2, Float_t zlen3, Float_t ztof0)
95 // Definition of the Time Of Fligh Resistive Plate Chambers
96 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
101 Float_t yFREON, xp, yp, zp;
103 Int_t *idtmed = fIdtmed->GetArray()-499;
108 gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
110 gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
112 gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
115 // Positioning of modules
117 Float_t zcor1 = ztof0 - zlen1/2;
118 Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
121 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
122 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
123 gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
124 gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
126 gMC->Gspos("FTO1", 1, "BTO2", 0, zcoor, 0, idrotm[0], "ONLY");
128 gMC->Gspos("FTO1", 1, "BTO3", 0, zcoor, 0, idrotm[0], "ONLY");
130 gMC->Gspos("FTO2", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
131 gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
133 gMC->Gspos("FTO2", 0, "BTO2", 0, zcoor, 0, idrotm[0], "ONLY");
135 gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
137 // Subtraction the distance to TOF module boundaries
140 Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
142 xFLT = xtof -(.5 +.5)*2;
150 // freon gaps in MRPC chamber
153 // Sizes of MRPC pads
156 yp = 12.3*0.05; // 5% X0 of glass
159 // Subtraction of dead boundaries in X=2 cm and Z=7/2 cm
161 cout <<"************************* TOF geometry **************************"<<endl;
163 Int_t nz1, nz2, nz3, nx; //- numbers of pixels
164 nx = Int_t (xFLT/xp);
166 printf("Number of pixel along x axis = %i",nx);
170 par[2] = (zFLT1 / 2.);
171 nz1 = Int_t (par[2]*2/zp);
172 gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
173 gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
174 printf("Number of pixel along z axis (module 1) = %i",nz1);
176 par[2] = (zFLT2 / 2.);
177 nz2 = Int_t (par[2]*2/zp);
178 gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
179 gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
180 printf("Number of pixel along z axis (module 2) = %i",nz2);
182 par[2] = (zFLT3 / 2.);
183 nz3 = Int_t (par[2]*2/zp);
184 gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
185 gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
186 printf("Number of pixel along z axis (module 3) = %i",nz3);
188 ////////// Layers before detector ////////////////////
190 // Alluminium layer in front 1.0 mm thick at the beginning
194 ycoor = -yFLT/2 + par[1];
195 gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
196 gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
197 gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
198 gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
199 gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium
200 gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
202 // Honeycomb layer (1cm of special polyethilene)
203 ycoor = ycoor + par[1];
207 ycoor = ycoor + par[1];
208 gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
209 gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
210 gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
211 gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
212 gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
213 gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
215 ///////////////// Detector itself //////////////////////
217 const Float_t SpaceBefore=2.; // Space Beetween detector & Front Panel
220 par[1] = yp/2; // 5 %X0 thick of glass
222 ycoor = -yFLT/2 + SpaceBefore;
223 gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
224 gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
225 gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
226 gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
227 gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
228 gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
230 gMC->Gsdvn("FLZ1", "FLD1", nz1, 3); //pixel size xp=zp=3
231 gMC->Gsdvn("FLZ2", "FLD2", nz2, 3);
232 gMC->Gsdvn("FLZ3", "FLD3", nz3, 3);
233 gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
234 gMC->Gsdvn("FLX2", "FLZ2", nx, 1);
235 gMC->Gsdvn("FLX3", "FLZ3", nx, 1);
239 par[1] = -1;//yp/2; // 5 %X0 thick of glass
241 gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
242 gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
243 gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
244 gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
246 // Freon gas sencitive vol.ume
250 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);// Freon
251 gMC->Gspos("FPAD", 0, "FPA0", 0., 0., 0., 0, "ONLY");
253 ////////// Layers after detector ////////////////////
255 const Float_t SpaceAfter = 6.; //Space beetween detector & Back Panel
257 // Honeycomb layer after (3cm)
261 ycoor = -yFLT/2 + SpaceAfter - par[1];
262 gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
263 gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
264 gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
265 gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
266 gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
267 gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
269 // Electronics (Cu) after
271 par[1] = 1.43*0.05 / 2.; // 5% of X0
273 ycoor = -yFLT/2 + SpaceAfter +par[1];
274 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
275 gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
276 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
277 gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
278 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
279 gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
281 // Cooling water after
282 ycoor = ycoor+par[1];
284 par[1] = 36.1*0.02 / 2.; // 2% of X0
286 ycoor = ycoor+par[1];
287 gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
288 gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
289 gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
290 gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
291 gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
292 gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
294 //back plate honycomb (2cm)
298 ycoor = yFLT/2 - par[1];
299 gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
300 gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
301 gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
302 gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
303 gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
304 gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
307 //_____________________________________________________________________________
308 void AliTOFv4::DrawModule()
311 // Draw a shaded view of the Time Of Flight version 1
313 // Set everything unseen
314 gMC->Gsatt("*", "seen", -1);
316 // Set ALIC mother transparent
317 gMC->Gsatt("ALIC","SEEN",0);
319 // Set the volumes visible
320 gMC->Gsatt("ALIC","SEEN",0);
321 gMC->Gsatt("FBAR","SEEN",1);
322 gMC->Gsatt("FTO1","SEEN",1);
323 gMC->Gsatt("FTO2","SEEN",1);
324 gMC->Gsatt("FTO3","SEEN",1);
325 gMC->Gsatt("FBT1","SEEN",1);
326 gMC->Gsatt("FBT2","SEEN",1);
327 gMC->Gsatt("FBT3","SEEN",1);
328 gMC->Gsatt("FDT1","SEEN",1);
329 gMC->Gsatt("FDT2","SEEN",1);
330 gMC->Gsatt("FDT3","SEEN",1);
331 gMC->Gsatt("FLT1","SEEN",1);
332 gMC->Gsatt("FLT2","SEEN",1);
333 gMC->Gsatt("FLT3","SEEN",1);
334 gMC->Gsatt("FPL1","SEEN",1);
335 gMC->Gsatt("FPL2","SEEN",1);
336 gMC->Gsatt("FPL3","SEEN",1);
337 gMC->Gsatt("FLD1","SEEN",1);
338 gMC->Gsatt("FLD2","SEEN",1);
339 gMC->Gsatt("FLD3","SEEN",1);
340 gMC->Gsatt("FLZ1","SEEN",1);
341 gMC->Gsatt("FLZ2","SEEN",1);
342 gMC->Gsatt("FLZ3","SEEN",1);
343 gMC->Gsatt("FLX1","SEEN",1);
344 gMC->Gsatt("FLX2","SEEN",1);
345 gMC->Gsatt("FLX3","SEEN",1);
346 gMC->Gsatt("FPA0","SEEN",1);
348 gMC->Gdopt("hide", "on");
349 gMC->Gdopt("shad", "on");
350 gMC->Gsatt("*", "fill", 7);
351 gMC->SetClipBox(".");
352 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
354 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
355 gMC->Gdhead(1111, "Time Of Flight");
356 gMC->Gdman(18, 4, "MAN");
357 gMC->Gdopt("hide","off");
360 //_____________________________________________________________________________
361 void AliTOFv4::CreateMaterials()
364 // Define materials for the Time Of Flight
366 AliTOF::CreateMaterials();
369 //_____________________________________________________________________________
370 void AliTOFv4::Init()
373 // Initialise the detector after the geometry has been defined
376 fIdFTO2=gMC->VolId("FTO2");
377 fIdFTO3=gMC->VolId("FTO3");
378 fIdFLT1=gMC->VolId("FLT1");
379 fIdFLT2=gMC->VolId("FLT2");
380 fIdFLT3=gMC->VolId("FLT3");
383 //_____________________________________________________________________________
384 void AliTOFv4::StepManager()
387 // Procedure called at each step in the Time Of Flight
389 TLorentzVector mom, pos;
393 Int_t *idtmed = fIdtmed->GetArray()-499;
394 if(gMC->GetMedium()==idtmed[514-1] &&
395 gMC->IsTrackEntering() && gMC->TrackCharge()
396 && gMC->CurrentVolID(copy)==fIdSens) {
397 TClonesArray &lhits = *fHits;
399 // Record only charged tracks at entrance
400 gMC->CurrentVolOffID(1,copy);
402 gMC->CurrentVolOffID(3,copy);
404 id=gMC->CurrentVolOffID(8,copy);
408 id=gMC->CurrentVolOffID(5,copy);
409 if(id==fIdFLT3) vol[1]+=6;
410 } else if (id==fIdFTO2) {
412 id=gMC->CurrentVolOffID(5,copy);
413 if(id==fIdFLT2) vol[1]+=8;
415 id=gMC->CurrentVolOffID(5,copy);
416 if(id==fIdFLT1) vol[1]+=14;
418 gMC->TrackPosition(pos);
419 gMC->TrackMomentum(mom);
421 Double_t ptot=mom.Rho();
422 Double_t norm=1/ptot;
425 hits[i+3]=mom[i]*norm;
429 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);