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.11 1999/10/16 19:30:05 fca
19 Corrected Rotation Matrix and CVS log
21 Revision 1.10 1999/10/15 15:35:20 fca
22 New version for frame1099 with and without holes
24 Revision 1.9 1999/09/29 09:24:33 fca
25 Introduction of the Copyright and cvs Log
29 ///////////////////////////////////////////////////////////////////////////////
31 // Time Of Flight: design of C.Williams FCA //
32 // This class contains the functions for version 1 of the Time Of Flight //
35 // VERSION WITH 5 MODULES AND TILTED STRIPS
37 // WITH HOLES FOR PHOS AND HMPID
38 // INSIDE A FULL COVERAGE SPACE FRAME
46 // University of Salerno - Italy
52 <img src="picts/AliTOFv2Class.gif">
56 ///////////////////////////////////////////////////////////////////////////////
64 //_____________________________________________________________________________
68 // Default constructor
72 //_____________________________________________________________________________
73 AliTOFv2::AliTOFv2(const char *name, const char *title)
77 // Standard constructor
81 //_____________________________________________________________________________
82 void AliTOFv2::CreateGeometry()
85 // Create geometry for Time Of Flight version 0
89 <img src="picts/AliTOFv2.gif">
93 // Creates common geometry
95 AliTOF::CreateGeometry();
98 //_____________________________________________________________________________
99 void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
100 Float_t zlen2, Float_t zlen3, Float_t ztof0)
103 // Definition of the Time Of Fligh Resistive Plate Chambers
104 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
108 Float_t ycoor, zcoor;
111 Int_t *idtmed = fIdtmed->GetArray()-499;
117 gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
119 gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
121 gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
124 // Position of modules
125 Float_t zcor1 = ztof0 - zlen1/2;
126 Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
129 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
130 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
131 gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
132 gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
133 gMC->Gspos("FTO1", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY");
134 gMC->Gspos("FTO1", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY");
135 gMC->Gspos("FTO1", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY");
136 gMC->Gspos("FTO1", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY");
138 gMC->Gspos("FTO2", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
139 gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
140 gMC->Gspos("FTO2", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY");
141 gMC->Gspos("FTO2", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY");
143 gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
145 // Subtraction the distance to TOF module boundaries
148 Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
150 xFLT = xtof -(.5 +.5)*2;
157 // Sizes of MRPC pads
159 Float_t yPad = 0.505;
161 // Large not sensitive volumes with CO2
165 cout <<"************************* TOF geometry **************************"<<endl;
167 par[2] = (zFLT1 / 2.);
168 gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
169 gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
171 par[2] = (zFLT2 / 2.);
172 gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
173 gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
175 par[2] = (zFLT3 / 2.);
176 gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
177 gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
179 ////////// Layers before detector ////////////////////
181 // Alluminium layer in front 1.0 mm thick at the beginning
185 ycoor = -yFLT/2 + par[1];
186 gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
187 gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
188 gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
189 gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
190 gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium
191 gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
193 // Honeycomb layer (1cm of special polyethilene)
194 ycoor = ycoor + par[1];
198 ycoor = ycoor + par[1];
199 gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
200 gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
201 gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
202 gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
203 gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
204 gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
206 ///////////////// Detector itself //////////////////////
208 const Float_t StripWidth = 7.81;//cm
209 const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
210 const Int_t nx = 40; // number of pads along x
211 const Int_t nz = 2; // number of pads along z
212 const Float_t Gap=4.; //cm distance between the strip axis
213 const Float_t Space = 5.5; //cm distance from the front plate of the box
216 zSenStrip = StripWidth-2*DeadBound;//cm
220 par[2] = StripWidth/2.;
222 // Glass Layer of detector
223 gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
225 // Freon for non-sesitive boundaries
229 gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
230 gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
231 // Mylar for non-sesitive boundaries
233 gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3);
234 gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
236 // Mylar for outer layers
238 ycoor = -yPad/2.+par[1];
239 gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
240 gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
241 gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
247 gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
248 gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
249 gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
251 // Freon sensitive layer
254 par[2] = zSenStrip/2.;
255 gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
256 gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
258 // Pad definition x & z
259 gMC->Gsdvn("FLZ","FCFC", nz, 3);
260 gMC->Gsdvn("FLX","FLZ" , nx, 1);
266 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
267 gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
270 //// Positioning the Strips (FSTR) in the FLT volumes /////
274 Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
282 Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
287 AliMatrix (idrotm[nrot] ,90., 0.,90.-ang,90.,-ang,90.);
288 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90.,ang,90.);
289 ycoor = -29./2.+ Space; //2 cm over front plate
290 ycoor += (1-(UpDown+1)/2)*Gap;
291 gMC->Gspos("FSTR",j,"FLT3",0.,ycoor,zcoor,idrotm[nrot],"ONLY");
292 gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
295 zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
296 UpDown*= -1; // Alternate strips
299 } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
301 ycoor = -29./2.+ Space; //2 cm over front plate
305 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
306 Offset = StripWidth*TMath::Cos(ang)/2;
310 // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
313 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
315 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
316 ycoor = -29./2.+ Space ; //2 cm over front plate
317 ycoor += (1-(UpDown+1)/2)*Gap;
318 zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
319 gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
321 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
322 last = StripWidth*TMath::Cos(ang)/2;
325 } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
329 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
330 Offset = StripWidth*TMath::Cos(ang)/2.;
334 ycoor= -29./2.+Space+Gap/2;
337 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
339 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
341 zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
342 gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
344 zpos = zpos - zSenStrip/TMath::Cos(ang);
345 last = StripWidth*TMath::Cos(ang)/2.;
346 } while (zpos>-t+7.+last);
348 printf("#######################################################\n");
349 printf(" Distance from the bound of the FLT3: zFLT3- %f cm \n", t+zpos-(zSenStrip/2)/TMath::Cos(ang));
350 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
351 zpos = zpos - zSenStrip/TMath::Cos(ang);
352 printf("NEXT Distance from the bound of the FLT3: zFLT3- %f cm \n", t+zpos-(zSenStrip/2)/TMath::Cos(ang));
353 printf("#######################################################\n");
355 ////////// Layers after detector /////////////////
357 // Honeycomb layer after (3cm)
359 Float_t OverSpace = Space + 7.3;
360 /// StripWidth*TMath::Sin(ang) + 1.3;
365 ycoor = -yFLT/2 + OverSpace + par[1];
366 gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
367 gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
368 gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
369 gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
370 gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
371 gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
373 // Electronics (Cu) after
376 par[1] = 1.43*0.05 / 2.; // 5% of X0
379 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
380 gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
381 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
382 gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
383 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
384 gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
386 // Cooling water after
389 par[1] = 36.1*0.02 / 2.; // 2% of X0
392 gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
393 gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
394 gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
395 gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
396 gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
397 gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
399 //back plate honycomb (2cm)
403 ycoor = yFLT/2 - par[1];
404 gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
405 gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
406 gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
407 gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
408 gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
409 gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
412 //_____________________________________________________________________________
413 void AliTOFv2::DrawModule()
416 // Draw a shaded view of the Time Of Flight version 1
418 // Set everything unseen
419 gMC->Gsatt("*", "seen", -1);
421 // Set ALIC mother transparent
422 gMC->Gsatt("ALIC","SEEN",0);
424 // Set the volumes visible
425 gMC->Gsatt("ALIC","SEEN",0);
426 gMC->Gsatt("FBAR","SEEN",1);
427 gMC->Gsatt("FTO1","SEEN",1);
428 gMC->Gsatt("FTO2","SEEN",1);
429 gMC->Gsatt("FTO3","SEEN",1);
430 gMC->Gsatt("FBT1","SEEN",1);
431 gMC->Gsatt("FBT2","SEEN",1);
432 gMC->Gsatt("FBT3","SEEN",1);
433 gMC->Gsatt("FDT1","SEEN",1);
434 gMC->Gsatt("FDT2","SEEN",1);
435 gMC->Gsatt("FDT3","SEEN",1);
436 gMC->Gsatt("FLT1","SEEN",1);
437 gMC->Gsatt("FLT2","SEEN",1);
438 gMC->Gsatt("FLT3","SEEN",1);
439 gMC->Gsatt("FPL1","SEEN",1);
440 gMC->Gsatt("FPL2","SEEN",1);
441 gMC->Gsatt("FPL3","SEEN",1);
442 gMC->Gsatt("FLD1","SEEN",1);
443 gMC->Gsatt("FLD2","SEEN",1);
444 gMC->Gsatt("FLD3","SEEN",1);
445 gMC->Gsatt("FLZ1","SEEN",1);
446 gMC->Gsatt("FLZ2","SEEN",1);
447 gMC->Gsatt("FLZ3","SEEN",1);
448 gMC->Gsatt("FLX1","SEEN",1);
449 gMC->Gsatt("FLX2","SEEN",1);
450 gMC->Gsatt("FLX3","SEEN",1);
451 gMC->Gsatt("FPA0","SEEN",1);
453 gMC->Gdopt("hide", "on");
454 gMC->Gdopt("shad", "on");
455 gMC->Gsatt("*", "fill", 7);
456 gMC->SetClipBox(".");
457 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
459 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
460 gMC->Gdhead(1111, "Time Of Flight");
461 gMC->Gdman(18, 4, "MAN");
462 gMC->Gdopt("hide","off");
465 //_____________________________________________________________________________
466 void AliTOFv2::CreateMaterials()
469 // Define materials for the Time Of Flight
471 AliTOF::CreateMaterials();
474 //_____________________________________________________________________________
475 void AliTOFv2::Init()
478 // Initialise the detector after the geometry has been defined
481 fIdFTO2=gMC->VolId("FTO2");
482 fIdFTO3=gMC->VolId("FTO3");
483 fIdFLT1=gMC->VolId("FLT1");
484 fIdFLT2=gMC->VolId("FLT2");
485 fIdFLT3=gMC->VolId("FLT3");
488 //_____________________________________________________________________________
489 void AliTOFv2::StepManager()
492 // Procedure called at each step in the Time Of Flight
494 TLorentzVector mom, pos;
498 Int_t *idtmed = fIdtmed->GetArray()-499;
499 if(gMC->GetMedium()==idtmed[514-1] &&
500 gMC->IsTrackEntering() && gMC->TrackCharge()
501 && gMC->CurrentVolID(copy)==fIdSens) {
502 TClonesArray &lhits = *fHits;
504 // Record only charged tracks at entrance
505 gMC->CurrentVolOffID(1,copy);
507 gMC->CurrentVolOffID(3,copy);
509 id=gMC->CurrentVolOffID(8,copy);
513 id=gMC->CurrentVolOffID(5,copy);
514 if(id==fIdFLT3) vol[1]+=6;
515 } else if (id==fIdFTO2) {
517 id=gMC->CurrentVolOffID(5,copy);
518 if(id==fIdFLT2) vol[1]+=8;
520 id=gMC->CurrentVolOffID(5,copy);
521 if(id==fIdFLT1) vol[1]+=14;
523 gMC->TrackPosition(pos);
524 gMC->TrackMomentum(mom);
526 Double_t ptot=mom.Rho();
527 Double_t norm=1/ptot;
530 hits[i+3]=mom[i]*norm;
534 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);