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.12 1999/10/22 08:04:14 fca
19 Correct improper use of negative parameters
21 Revision 1.11 1999/10/16 19:30:05 fca
22 Corrected Rotation Matrix and CVS log
24 Revision 1.10 1999/10/15 15:35:20 fca
25 New version for frame1099 with and without holes
27 Revision 1.9 1999/09/29 09:24:33 fca
28 Introduction of the Copyright and cvs Log
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 TILTED STRIPS
40 // WITH HOLES FOR PHOS AND HMPID inside the
41 // SPACE FRAME WITH HOLES
49 // University of Salerno - Italy
54 <img src="picts/AliTOFv1Class.gif">
58 ///////////////////////////////////////////////////////////////////////////////
68 //_____________________________________________________________________________
72 // Default constructor
76 //_____________________________________________________________________________
77 AliTOFv1::AliTOFv1(const char *name, const char *title)
81 // Standard constructor
85 //_____________________________________________________________________________
86 void AliTOFv1::CreateGeometry()
89 // Create geometry for Time Of Flight version 0
93 <img src="picts/AliTOFv1.gif">
97 // Creates common geometry
99 AliTOF::CreateGeometry();
102 //_____________________________________________________________________________
103 void AliTOFv1::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
104 Float_t zlen2, Float_t zlen3, Float_t ztof0)
107 // Definition of the Time Of Fligh Resistive Plate Chambers
108 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
115 Int_t *idtmed = fIdtmed->GetArray()-499;
121 gMC->Gsvolu("FTO1", "BOX ", idtmed[506], par, 3);
123 gMC->Gsvolu("FTO2", "BOX ", idtmed[506], par, 3);
125 gMC->Gsvolu("FTO3", "BOX ", idtmed[506], par, 3);
128 // Positioning of modules
132 Float_t zcor1 = ztof0 - zlen1/2;
133 Float_t zcor2 = ztof0 - zlen1 - zlen2/2.;
136 AliMatrix(idrotm[0], 90., 0., 0., 0., 90, -90.);
137 AliMatrix(idrotm[1], 90., 180., 0., 0., 90, 90.);
138 gMC->Gspos("FTO1", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY");
139 gMC->Gspos("FTO1", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY");
141 gMC->Gspos("FTO1", 1, "BTO2", 0, zcoor, 0, idrotm[0], "ONLY");
143 gMC->Gspos("FTO1", 1, "BTO3", 0, zcoor, 0, idrotm[0], "ONLY");
145 gMC->Gspos("FTO2", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY");
146 gMC->Gspos("FTO2", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY");
148 gMC->Gspos("FTO2", 0, "BTO2", 0, zcoor, 0, idrotm[0], "ONLY");
150 gMC->Gspos("FTO3", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY");
152 // Subtraction the distance to TOF module boundaries
155 Float_t xFLT, yFLT, zFLT1, zFLT2, zFLT3;
157 xFLT = xtof -(.5 +.5)*2;
163 // Sizes of MRPC pads
165 Float_t yPad = 0.505;
167 // Large not sensitive volumes with CO2
171 cout <<"************************* TOF geometry **************************"<<endl;
173 par[2] = (zFLT1 / 2.);
174 gMC->Gsvolu("FLT1", "BOX ", idtmed[506], par, 3); // CO2
175 gMC->Gspos("FLT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
177 par[2] = (zFLT2 / 2.);
178 gMC->Gsvolu("FLT2", "BOX ", idtmed[506], par, 3); // CO2
179 gMC->Gspos("FLT2", 0, "FTO2", 0., 0., 0., 0, "ONLY");
181 par[2] = (zFLT3 / 2.);
182 gMC->Gsvolu("FLT3", "BOX ", idtmed[506], par, 3); // CO2
183 gMC->Gspos("FLT3", 0, "FTO3", 0., 0., 0., 0, "ONLY");
185 ////////// Layers before detector ////////////////////
187 // Alluminium layer in front 1.0 mm thick at the beginning
191 ycoor = -yFLT/2 + par[1];
192 gMC->Gsvolu("FMY1", "BOX ", idtmed[508], par, 3); // Alluminium
193 gMC->Gspos("FMY1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
194 gMC->Gsvolu("FMY2", "BOX ", idtmed[508], par, 3); // Alluminium
195 gMC->Gspos("FMY2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
196 gMC->Gsvolu("FMY3", "BOX ", idtmed[508], par, 3); // Alluminium
197 gMC->Gspos("FMY3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
199 // Honeycomb layer (1cm of special polyethilene)
200 ycoor = ycoor + par[1];
204 ycoor = ycoor + par[1];
205 gMC->Gsvolu("FPL1", "BOX ", idtmed[503], par, 3); // Hony
206 gMC->Gspos("FPL1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
207 gMC->Gsvolu("FPL2", "BOX ", idtmed[503], par, 3); // Hony
208 gMC->Gspos("FPL2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
209 gMC->Gsvolu("FPL3", "BOX ", idtmed[503], par, 3); // Hony
210 gMC->Gspos("FPL3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
212 ///////////////// Detector itself //////////////////////
214 const Float_t StripWidth = 7.81;//cm
215 const Float_t DeadBound = 1.;//cm non-sensitive between the pad edge and the boundary of the strip
216 const Int_t nx = 40; // number of pads along x
217 const Int_t nz = 2; // number of pads along z
218 const Float_t Gap=4.; //cm distance between the strip axis
219 const Float_t Space = 5.5; //cm distance from the front plate of the box
222 zSenStrip = StripWidth-2*DeadBound;//cm
226 par[2] = StripWidth/2.;
228 // Glass Layer of detector
229 gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
231 // Freon for non-sesitive boundaries
235 gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
236 gMC->Gspos("FNSF",0,"FSTR",0.,0.,0.,0,"ONLY");
237 // Mylar for non-sesitive boundaries
239 gMC->Gsvolu("FMYI","BOX",idtmed[510],par,3);
240 gMC->Gspos("FMYI",0,"FNSF",0.,0.,0.,0,"ONLY");
242 // Mylar for outer layers
244 ycoor = -yPad/2.+par[1];
245 gMC->Gsvolu("FMYX","BOX",idtmed[510],par,3);
246 gMC->Gspos("FMYX",1,"FSTR",0.,ycoor,0.,0,"ONLY");
247 gMC->Gspos("FMYX",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
253 gMC->Gsvolu("FGRL","BOX",idtmed[502],par,3);
254 gMC->Gspos("FGRL",1,"FSTR",0.,ycoor,0.,0,"ONLY");
255 gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
257 // Freon sensitive layer
260 par[2] = zSenStrip/2.;
261 gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
262 gMC->Gspos("FCFC",0,"FNSF",0.,0.,0.,0,"ONLY");
264 // Pad definition x & z
265 gMC->Gsdvn("FLZ","FCFC", nz, 3);
266 gMC->Gsdvn("FLX","FLZ" , nx, 1);
272 gMC->Gsvolu("FPAD", "BOX ", idtmed[513], par, 3);
273 gMC->Gspos("FPAD", 0, "FLX", 0., 0., 0., 0, "ONLY");
276 //// Positioning the Strips (FSTR) in the FLT volumes /////
280 Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
288 Int_t UpDown=-1; // UpDown=-1 -> Upper strip, UpDown=+1 -> Lower strip
293 AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
294 AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90.,ang, 90.);
295 ycoor = -14.5+ Space; //2 cm over front plate
296 ycoor += (1-(UpDown+1)/2)*Gap;
297 gMC->Gspos("FSTR",j ,"FLT3",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
298 gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
301 zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
302 UpDown*= -1; // Alternate strips
305 } while (zcoor-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+zFLT2+7*2.5);
307 ycoor = -29./2.+ Space; //2 cm over front plate
311 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
312 Offset = StripWidth*TMath::Cos(ang)/2;
316 // UpDown has not to be reinitialized, so that the arrangement of the strips can continue coherently
319 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
321 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
322 ycoor = -29./2.+ Space ; //2 cm over front plate
323 ycoor += (1-(UpDown+1)/2)*Gap;
324 zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
325 gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
327 zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
328 last = StripWidth*TMath::Cos(ang)/2;
331 } while (zpos-(StripWidth/2)*TMath::Cos(ang)>-t+zFLT1+7);
335 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
336 Offset = StripWidth*TMath::Cos(ang)/2.;
340 ycoor= -29./2.+Space+Gap/2;
343 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
345 AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
347 zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
348 gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
350 zpos = zpos - zSenStrip/TMath::Cos(ang);
351 last = StripWidth*TMath::Cos(ang)/2.;
352 } while (zpos>-t+7.+last);
354 printf("#######################################################\n");
355 printf(" Distance from the bound of the FLT3: %f cm \n", t+zpos-(zSenStrip/2)/TMath::Cos(ang));
356 ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
357 zpos = zpos - zSenStrip/TMath::Cos(ang);
358 printf("NEXT Distance from the bound of the FLT3: %f cm \n", t+zpos-(zSenStrip/2)/TMath::Cos(ang));
359 printf("#######################################################\n");
361 ////////// Layers after detector /////////////////
363 // Honeycomb layer after (3cm)
365 Float_t OverSpace = Space + 7.3;
366 /// StripWidth*TMath::Sin(ang) + 1.3;
371 ycoor = -yFLT/2 + OverSpace + par[1];
372 gMC->Gsvolu("FPE1", "BOX ", idtmed[503], par, 3); // Hony
373 gMC->Gspos("FPE1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
374 gMC->Gsvolu("FPE2", "BOX ", idtmed[503], par, 3); // Hony
375 gMC->Gspos("FPE2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
376 gMC->Gsvolu("FPE3", "BOX ", idtmed[503], par, 3); // Hony
377 gMC->Gspos("FPE3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
379 // Electronics (Cu) after
382 par[1] = 1.43*0.05 / 2.; // 5% of X0
385 gMC->Gsvolu("FEC1", "BOX ", idtmed[501], par, 3); // Cu
386 gMC->Gspos("FEC1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
387 gMC->Gsvolu("FEC2", "BOX ", idtmed[501], par, 3); // Cu
388 gMC->Gspos("FEC2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
389 gMC->Gsvolu("FEC3", "BOX ", idtmed[501], par, 3); // Cu
390 gMC->Gspos("FEC3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
392 // Cooling water after
395 par[1] = 36.1*0.02 / 2.; // 2% of X0
398 gMC->Gsvolu("FWA1", "BOX ", idtmed[515], par, 3); // Water
399 gMC->Gspos("FWA1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
400 gMC->Gsvolu("FWA2", "BOX ", idtmed[515], par, 3); // Water
401 gMC->Gspos("FWA2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
402 gMC->Gsvolu("FWA3", "BOX ", idtmed[515], par, 3); // Water
403 gMC->Gspos("FWA3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
405 //back plate honycomb (2cm)
409 ycoor = yFLT/2 - par[1];
410 gMC->Gsvolu("FEG1", "BOX ", idtmed[503], par, 3); // Hony
411 gMC->Gspos("FEG1", 0, "FLT1", 0., ycoor, 0., 0, "ONLY");
412 gMC->Gsvolu("FEG2", "BOX ", idtmed[503], par, 3); // Hony
413 gMC->Gspos("FEG2", 0, "FLT2", 0., ycoor, 0., 0, "ONLY");
414 gMC->Gsvolu("FEG3", "BOX ", idtmed[503], par, 3); // Hony
415 gMC->Gspos("FEG3", 0, "FLT3", 0., ycoor, 0., 0, "ONLY");
418 //_____________________________________________________________________________
419 void AliTOFv1::DrawModule()
422 // Draw a shaded view of the Time Of Flight version 1
424 // Set everything unseen
425 gMC->Gsatt("*", "seen", -1);
427 // Set ALIC mother transparent
428 gMC->Gsatt("ALIC","SEEN",0);
430 // Set the volumes visible
431 gMC->Gsatt("ALIC","SEEN",0);
432 gMC->Gsatt("FBAR","SEEN",1);
433 gMC->Gsatt("FTO1","SEEN",1);
434 gMC->Gsatt("FTO2","SEEN",1);
435 gMC->Gsatt("FTO3","SEEN",1);
436 gMC->Gsatt("FBT1","SEEN",1);
437 gMC->Gsatt("FBT2","SEEN",1);
438 gMC->Gsatt("FBT3","SEEN",1);
439 gMC->Gsatt("FDT1","SEEN",1);
440 gMC->Gsatt("FDT2","SEEN",1);
441 gMC->Gsatt("FDT3","SEEN",1);
442 gMC->Gsatt("FLT1","SEEN",1);
443 gMC->Gsatt("FLT2","SEEN",1);
444 gMC->Gsatt("FLT3","SEEN",1);
445 gMC->Gsatt("FPL1","SEEN",1);
446 gMC->Gsatt("FPL2","SEEN",1);
447 gMC->Gsatt("FPL3","SEEN",1);
448 gMC->Gsatt("FLD1","SEEN",1);
449 gMC->Gsatt("FLD2","SEEN",1);
450 gMC->Gsatt("FLD3","SEEN",1);
451 gMC->Gsatt("FLZ1","SEEN",1);
452 gMC->Gsatt("FLZ2","SEEN",1);
453 gMC->Gsatt("FLZ3","SEEN",1);
454 gMC->Gsatt("FLX1","SEEN",1);
455 gMC->Gsatt("FLX2","SEEN",1);
456 gMC->Gsatt("FLX3","SEEN",1);
457 gMC->Gsatt("FPA0","SEEN",1);
459 gMC->Gdopt("hide", "on");
460 gMC->Gdopt("shad", "on");
461 gMC->Gsatt("*", "fill", 7);
462 gMC->SetClipBox(".");
463 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
465 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
466 gMC->Gdhead(1111, "Time Of Flight");
467 gMC->Gdman(18, 4, "MAN");
468 gMC->Gdopt("hide","off");
471 //_____________________________________________________________________________
472 void AliTOFv1::CreateMaterials()
475 // Define materials for the Time Of Flight
477 AliTOF::CreateMaterials();
480 //_____________________________________________________________________________
481 void AliTOFv1::Init()
484 // Initialise the detector after the geometry has been defined
486 printf("**************************************"
488 "**************************************\n");
489 printf("\n Version 1 of TOF initialing, "
490 "with openings for PHOS and RICH\n\n");
495 // Check that FRAME is there otherwise we have no place where to
497 AliModule* FRAME=gAlice->GetModule("FRAME");
499 Error("Ctor","TOF needs FRAME to be present\n");
502 if(FRAME->IsVersion()!=0) {
503 Error("Ctor","FRAME version 0 needed with this version of TOF\n");
507 fIdFTO2=gMC->VolId("FTO2");
508 fIdFTO3=gMC->VolId("FTO3");
509 fIdFLT1=gMC->VolId("FLT1");
510 fIdFLT2=gMC->VolId("FLT2");
511 fIdFLT3=gMC->VolId("FLT3");
513 printf("**************************************"
515 "**************************************\n");
518 //_____________________________________________________________________________
519 void AliTOFv1::StepManager()
522 // Procedure called at each step in the Time Of Flight
524 TLorentzVector mom, pos;
528 Int_t *idtmed = fIdtmed->GetArray()-499;
529 if(gMC->GetMedium()==idtmed[514-1] &&
530 gMC->IsTrackEntering() && gMC->TrackCharge()
531 && gMC->CurrentVolID(copy)==fIdSens) {
532 TClonesArray &lhits = *fHits;
534 // Record only charged tracks at entrance
535 gMC->CurrentVolOffID(1,copy);
537 gMC->CurrentVolOffID(3,copy);
539 id=gMC->CurrentVolOffID(8,copy);
543 id=gMC->CurrentVolOffID(5,copy);
544 if(id==fIdFLT3) vol[1]+=6;
545 } else if (id==fIdFTO2) {
547 id=gMC->CurrentVolOffID(5,copy);
548 if(id==fIdFLT2) vol[1]+=8;
550 id=gMC->CurrentVolOffID(5,copy);
551 if(id==fIdFLT1) vol[1]+=14;
553 gMC->TrackPosition(pos);
554 gMC->TrackMomentum(mom);
556 Double_t ptot=mom.Rho();
557 Double_t norm=1/ptot;
560 hits[i+3]=mom[i]*norm;
564 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);