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.4 1999/11/05 22:39:06 fca
21 Revision 1.3 1999/11/01 20:41:58 fca
22 Added protections against using the wrong version of FRAME
24 Revision 1.2 1999/10/16 19:21:57 fca
25 Corrected Rotation Matrix and CVS logAliTOFv4.cxx
27 Revision 1.1 1999/10/15 15:35:20 fca
28 New version for frame1099 with and without holes
32 ///////////////////////////////////////////////////////////////////////////////
34 // Time Of Flight: design of C.Williams FCA //
35 // This class contains the functions for version 1 of the Time Of Flight //
38 // VERSION WITH 5 MODULES AND FLAT PLATES
40 // WITH HOLES FOR PHOS AND HMPID
41 // INSIDE A FULL COVERAGE SPACE FRAME
49 // University of Salerno - Italy
54 <img src="picts/AliTOFv5Class.gif">
58 ///////////////////////////////////////////////////////////////////////////////
69 //_____________________________________________________________________________
73 // Default constructor
77 //_____________________________________________________________________________
78 AliTOFv5::AliTOFv5(const char *name, const char *title)
82 // Standard constructor
85 // Check that FRAME is there otherwise we have no place where to
87 AliModule* FRAME=gAlice->GetModule("FRAME");
89 Error("Ctor","TOF needs FRAME to be present\n");
92 if(FRAME->IsVersion()!=1) {
93 Error("Ctor","FRAME version 1 needed with this version of TOF\n");
99 //_____________________________________________________________________________
100 void AliTOFv5::CreateGeometry()
103 // Create geometry for Time Of Flight version 0
107 <img src="picts/AliTOFv5.gif">
111 // Creates common geometry
113 AliTOF::CreateGeometry();
116 //_____________________________________________________________________________
117 void AliTOFv5::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
118 Float_t zlen2, Float_t zlen3, Float_t ztof0)
121 // Definition of the Time Of Fligh Resistive Plate Chambers
122 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
128 Float_t yFREON, xp, yp, zp;
130 Int_t *idtmed = fIdtmed->GetArray()-499;
136 gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
138 gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
140 gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
143 // Position of modules
144 Float_t zcor1 = ztof0 - zlen1/2;
145 Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
148 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
149 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
150 gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
151 gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
152 gMC->Gspos("FTO1", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
153 gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
154 gMC->Gspos("FTO1", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
155 gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
157 gMC->Gspos("FTO2", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
158 gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
159 gMC->Gspos("FTO2", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
160 gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
162 gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
164 // Subtraction the distance to TOF module boundaries
167 Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
170 xFLT = xtof -(.5 +.5)*2;
177 // fron gaps in MRPC chamber
180 // Sizes of MRPC pads
183 yp = 12.3*0.05; // 5% X0 of glass
186 // Subtraction of dead boundaries in X=2 cm and Z=7/2 cm
188 cout <<"************************* TOF geometry **************************"<<endl;
190 Int_t nz1, nz2, nz3, nx; //- numbers of pixels
191 nx = Int_t (xFLT/xp);
193 printf("Number of pixel along x axis = %i",nx);
197 par[2] = (zFLT1 / 2.);
198 nz1 = Int_t (par[2]*2/zp);
199 gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
200 gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
201 printf("Number of pixel along z axis (module 1) = %i",nz1);
203 par[2] = (zFLT2 / 2.);
204 nz2 = Int_t (par[2]*2/zp);
205 gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
206 gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
207 printf("Number of pixel along z axis (module 2) = %i",nz2);
209 par[2] = (zFLT3 / 2.);
210 nz3 = Int_t (par[2]*2/zp);
211 gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
212 gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
213 printf("Number of pixel along z axis (module 3) = %i",nz3);
215 ////////// Layers before detector ////////////////////
217 // Alluminium layer in front 1.0 mm thick at the beginning
221 ycoor = -yFLT/2 + par[1];
222 gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
223 gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
224 gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
225 gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
226 gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium
227 gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
229 // Honeycomb layer (1cm of special polyethilene)
230 ycoor = ycoor + par[1];
234 ycoor = ycoor + par[1];
235 gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
236 gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
237 gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
238 gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
239 gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
240 gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
242 ///////////////// Detector itself //////////////////////
244 const Float_t SpaceBefore=2.;
247 par[1] = yp/2; // 5 %X0 thick of glass
249 ycoor = -yFLT/2 + SpaceBefore;
250 gMC->Gsvolu("FLD1", "BOX ", idtmed[514], par, 3); // Glass
251 gMC->Gspos("FLD1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
252 gMC->Gsvolu("FLD2", "BOX ", idtmed[514], par, 3); // Glass
253 gMC->Gspos("FLD2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
254 gMC->Gsvolu("FLD3", "BOX ", idtmed[514], par, 3); // Glass
255 gMC->Gspos("FLD3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
257 gMC->Gsdvn("FLZ1", "FLD1", nz1, 3); //pixel size xp=zp=3
258 gMC->Gsdvn("FLZ2", "FLD2", nz2, 3);
259 gMC->Gsdvn("FLZ3", "FLD3", nz3, 3);
260 gMC->Gsdvn("FLX1", "FLZ1", nx, 1);
261 gMC->Gsdvn("FLX2", "FLZ2", nx, 1);
262 gMC->Gsdvn("FLX3", "FLZ3", nx, 1);
266 par[1] = -1;//yp/2; // 5 %X0 thick of glass
268 gMC->Gsvolu("FPA0", "BOX ", idtmed[514], par, 3);// Glass
269 gMC->Gspos("FPA0", 1, "FLX1", 0., 0., 0., 0, "ONLY");
270 gMC->Gspos("FPA0", 2, "FLX2", 0., 0., 0., 0, "ONLY");
271 gMC->Gspos("FPA0", 3, "FLX3", 0., 0., 0., 0, "ONLY");
273 // Freon gas sencitive vol.ume
277 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);// Freon
278 gMC->Gspos("FPAD", 0, "FPA0", 0., 0., 0., 0, "ONLY");
280 ////////// Layers after detector ////////////////////
282 const Float_t SpaceAfter=6.;
284 // Honeycomb layer after (3cm)
288 ycoor = -yFLT/2 + SpaceAfter - par[1];
289 gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
290 gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
291 gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
292 gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
293 gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
294 gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
296 // Electronics (Cu) after
298 par[1] = 1.43*0.05 / 2.; // 5% of X0
300 ycoor = -yFLT/2 + SpaceAfter +par[1];
301 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
302 gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
303 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
304 gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
305 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
306 gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
308 // Cooling water after
309 ycoor = ycoor+par[1];
311 par[1] = 36.1*0.02 / 2.; // 2% of X0
313 ycoor = ycoor+par[1];
314 gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
315 gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
316 gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
317 gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
318 gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
319 gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
321 //back plate honycomb (2cm)
325 ycoor = yFLT/2 - par[1];
326 gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
327 gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
328 gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
329 gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
330 gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
331 gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");}
333 //_____________________________________________________________________________
334 void AliTOFv5::DrawModule()
337 // Draw a shaded view of the Time Of Flight version 1
339 // Set everything unseen
340 gMC->Gsatt("*", "seen", -1);
342 // Set ALIC mother transparent
343 gMC->Gsatt("ALIC","SEEN",0);
345 // Set the volumes visible
346 gMC->Gsatt("ALIC","SEEN",0);
347 gMC->Gsatt("FBAR","SEEN",1);
348 gMC->Gsatt("FTO1","SEEN",1);
349 gMC->Gsatt("FTO2","SEEN",1);
350 gMC->Gsatt("FTO3","SEEN",1);
351 gMC->Gsatt("FBT1","SEEN",1);
352 gMC->Gsatt("FBT2","SEEN",1);
353 gMC->Gsatt("FBT3","SEEN",1);
354 gMC->Gsatt("FDT1","SEEN",1);
355 gMC->Gsatt("FDT2","SEEN",1);
356 gMC->Gsatt("FDT3","SEEN",1);
357 gMC->Gsatt("FLT1","SEEN",1);
358 gMC->Gsatt("FLT2","SEEN",1);
359 gMC->Gsatt("FLT3","SEEN",1);
360 gMC->Gsatt("FPL1","SEEN",1);
361 gMC->Gsatt("FPL2","SEEN",1);
362 gMC->Gsatt("FPL3","SEEN",1);
363 gMC->Gsatt("FLD1","SEEN",1);
364 gMC->Gsatt("FLD2","SEEN",1);
365 gMC->Gsatt("FLD3","SEEN",1);
366 gMC->Gsatt("FLZ1","SEEN",1);
367 gMC->Gsatt("FLZ2","SEEN",1);
368 gMC->Gsatt("FLZ3","SEEN",1);
369 gMC->Gsatt("FLX1","SEEN",1);
370 gMC->Gsatt("FLX2","SEEN",1);
371 gMC->Gsatt("FLX3","SEEN",1);
372 gMC->Gsatt("FPA0","SEEN",1);
374 gMC->Gdopt("hide", "on");
375 gMC->Gdopt("shad", "on");
376 gMC->Gsatt("*", "fill", 7);
377 gMC->SetClipBox(".");
378 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
380 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
381 gMC->Gdhead(1111, "Time Of Flight");
382 gMC->Gdman(18, 4, "MAN");
383 gMC->Gdopt("hide","off");
386 //_____________________________________________________________________________
387 void AliTOFv5::CreateMaterials()
390 // Define materials for the Time Of Flight
392 AliTOF::CreateMaterials();
395 //_____________________________________________________________________________
396 void AliTOFv5::Init()
399 // Initialise the detector after the geometry has been defined
401 printf("**************************************"
403 "**************************************\n");
404 printf("\n Version 5 of TOF initialing, "
405 "with openings for PHOS and RICH in symmetric frame\n\n");
409 fIdFTO2=gMC->VolId("FTO2");
410 fIdFTO3=gMC->VolId("FTO3");
411 fIdFLT1=gMC->VolId("FLT1");
412 fIdFLT2=gMC->VolId("FLT2");
413 fIdFLT3=gMC->VolId("FLT3");
415 printf("**************************************"
417 "**************************************\n");
420 //_____________________________________________________________________________
421 void AliTOFv5::StepManager()
424 // Procedure called at each step in the Time Of Flight
426 TLorentzVector mom, pos;
427 Float_t hits[8],rho,z,phi,phid;
428 Int_t sector, plate, pad_x, pad_z;
429 Int_t copy, pad_x_id, pad_z_id, i;
430 Int_t *idtmed = fIdtmed->GetArray()-499;
431 if(gMC->GetMedium()==idtmed[514-1] &&
432 gMC->IsTrackEntering() && gMC->TrackCharge()
433 && gMC->CurrentVolID(copy)==fIdSens) {
434 TClonesArray &lhits = *fHits;
437 //_________getting information about hit volumes_____________
439 pad_z_id=gMC->CurrentVolOffID(3,copy);
442 pad_x_id=gMC->CurrentVolOffID(2,copy);
445 gMC->TrackPosition(pos);
446 gMC->TrackMomentum(mom);
448 rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
449 phi = TMath::ACos(pos[0]/rho);
450 Float_t as = TMath::ASin(pos[1]/rho);
451 if (as<0) phi = 2*3.141592654-phi;
455 if (z<=62. && z>=-62) plate = 3;
456 if (z<=216. && z>62.) plate = 4;
457 if (z>=-216. && z<-62.) plate = 2;
458 if (z>216.) plate = 5;
459 if (z<-216.) plate = 1;
462 sector = Int_t (phid/20.);
465 Double_t ptot=mom.Rho();
466 Double_t norm=1/ptot;
469 hits[i+3]=mom[i]*norm;
473 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector,plate,pad_x,pad_z,hits);