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 2006/04/16 22:29:05 hristov
19 Coding conventions (Annalisa)
21 Revision 1.3 2006/03/12 14:38:13 arcelli
22 Changes for TOF Reconstruction using TGeo
24 Revision 1.2 2006/02/28 10:38:00 decaro
25 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
27 Revision 1.1 2005/12/15 08:55:33 decaro
28 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
30 Revision 0.1 2005/07/19 A. De Caro
31 Modify Global methods IsInsideThePad & DistanceToPad
32 according to the PPR TOF geometry
33 Implement Global methods GetPadDx & GetPadDy & GetPadDz
34 Modify Global methods GetDetID & GetPlate & GetSector &
35 GetStrip & GetPadX & GetPadZ
36 according to the PPR TOF geometry
37 Modify Global methods GetPos & GetX & GetY & GetZ
38 according to the PPR TOF geometry
41 ///////////////////////////////////////////////////////////////////////////////
43 // TOF Geometry class (PPR version) //
45 ///////////////////////////////////////////////////////////////////////////////
47 #include "TGeoManager.h"
52 #include "AliTOFGeometryV4.h"
54 extern TGeoManager *gGeoManager;
56 ClassImp(AliTOFGeometryV4)
59 const Float_t AliTOFGeometryV4::fgkZlenA = 106.0; // length (cm) of the A module
60 const Float_t AliTOFGeometryV4::fgkZlenB = 141.0; // length (cm) of the B module
61 const Float_t AliTOFGeometryV4::fgkZlenC = 177.5; // length (cm) of the C module
62 const Float_t AliTOFGeometryV4::fgkMaxhZtof = 371.5; // Max half z-size of TOF (cm)
64 const Float_t AliTOFGeometryV4::fgkDeadBndX = 1.0; // Dead Boundaries of a Strip along X direction (length) (cm)
65 const Float_t AliTOFGeometryV4::fgkDeadBndZ = 1.5; // Dead Boundaries of a Strip along Z direction (width) (cm)
66 const Float_t AliTOFGeometryV4::fgkOverSpc = 15.3; // Space available for sensitive layers in radial direction (cm)
68 const Float_t AliTOFGeometryV4::fgkDprecMin = 0.0000075;//num.prec.tolerance on Thmin
69 const Float_t AliTOFGeometryV4::fgkDprecMax = 0.0000100;//num.prec.tolerance on Thma
70 const Float_t AliTOFGeometryV4::fgkDprecCen = 0.0000005;//num.prec.tolerance on <Theta>
72 const Float_t AliTOFGeometryV4::fgkxTOF = 371.; // Inner radius of the TOF for Reconstruction (cm)
73 const Float_t AliTOFGeometryV4::fgkRmin = 370.; // Inner radius of the TOF (cm)
74 const Float_t AliTOFGeometryV4::fgkRmax = 399.; // Outer radius of the TOF (cm)
76 //_____________________________________________________________________________
77 AliTOFGeometryV4::AliTOFGeometryV4()
81 // AliTOFGeometryV4 default constructor
84 AliTOFGeometry::fNStripC = kNStripC; // number of strips in C type module
86 AliTOFGeometry::fZlenA = fgkZlenA; // length (cm) of the A module
87 AliTOFGeometry::fZlenB = fgkZlenB; // length (cm) of the B module
88 AliTOFGeometry::fZlenC = fgkZlenC; // length (cm) of the C module
89 AliTOFGeometry::fMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF (cm)
91 AliTOFGeometry::fxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm)
92 AliTOFGeometry::fRmin = fgkRmin; // Inner radius of the TOF (cm)
93 AliTOFGeometry::fRmax = fgkRmax; // Outer radius of the TOF (cm)
99 //_____________________________________________________________________________
100 AliTOFGeometryV4::~AliTOFGeometryV4()
103 // AliTOFGeometryV4 destructor
107 //_____________________________________________________________________________
108 void AliTOFGeometryV4::ImportGeometry(){
109 TGeoManager::Import("geometry.root");
111 //_____________________________________________________________________________
112 void AliTOFGeometryV4::Init()
115 // Initialize strip Tilt Angles and Heights
117 // Strips Tilt Angles
119 fPhiSec = 360./kNSectors;
121 Float_t const kangles[kNPlates][kMaxNstrip] ={
123 {44.494, 43.725, 42.946, 42.156, 41.357, 40.548, 39.729, 38.899,
124 38.060, 37.211, 36.353, 35.484, 34.606, 33.719, 32.822, 31.916,
125 31.001, 30.077, 29.144, 28.202 },
127 {26.884, 25.922, 24.952, 23.975, 22.989, 22.320, 21.016, 20.309,
128 19.015, 18.270, 16.989, 16.205, 14.941, 14.117, 12.871, 12.008,
129 10.784, 9.8807, 8.681, 0.0 },
131 { 7.5835, 6.4124, 5.4058, 4.2809, 3.2448, 2.1424, 1.078, -0., -1.078,
132 -2.1424, -3.2448, -4.2809, -5.4058, -6.4124, -7.5835, 0.0, 0.0, 0.0,
135 {-8.681, -9.8807, -10.784, -12.008, -12.871, -14.117, -14.941, -16.205,
136 -16.989, -18.27, -19.015, -20.309, -21.016, -22.32, -22.989,
137 -23.975, -24.952, -25.922, -26.884, 0. },
139 {-28.202, -29.144, -30.077, -31.001, -31.916, -32.822, -33.719, -34.606,
140 -35.484, -36.353, -37.211, -38.06, -38.899, -39.729, -40.548,
141 -41.357, -42.156, -42.946, -43.725, -44.494 }};
146 Float_t const kheights[kNPlates][kMaxNstrip]= {
148 {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5,
149 -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 },
151 {-6.3, -7.1, -7.9, -8.7, -9.5, -3, -9.5, -3, -9.5, -3,
152 -9.5, -3.0, -9.5, -3.0, -9.5, -3, -9.5, -3, -9 , 0.},
154 { -3, -9, -4.5, -9, -4.5, -9, -4.5, -9, -4.5, -9,
155 -4.5, -9, -4.5, -9, -3, 0.0, 0.0, 0.0, 0.0, 0.0 },
157 { -9, -3, -9.5, -3, -9.5, -3, -9.5, -3, -9.5, -3, -9.5,
158 -3, -9.5, -3, -9.5, -8.7, -7.9, -7.1, -6.3, 0. },
160 {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5,
161 -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 }};
163 // Deposit in fAngles, fHeights
165 for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
166 for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
167 AliTOFGeometry::fAngles[iplate][istrip] = kangles[iplate][istrip];
168 AliTOFGeometry::fHeights[iplate][istrip] = kheights[iplate][istrip];
174 //_____________________________________________________________________________
175 Float_t AliTOFGeometryV4::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const
178 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
179 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
182 //Transform pos into Sector Frame
188 Float_t radius = TMath::Sqrt(x*x+y*y);
189 Float_t phi=TMath::ATan2(y,x);
190 if(phi<0) phi=2.*TMath::Pi()+phi;
191 // Get the local angle in the sector philoc
192 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5)*fPhiSec;
193 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
194 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
197 // Do the same for the selected pad
202 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
203 Float_t padPhi=TMath::ATan2(g[1],g[0]);
204 if(padPhi<0) padPhi=2.*TMath::Pi()+padPhi;
205 // Get the local angle in the sector philoc
206 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
207 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
208 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
209 Float_t padzs = g[2];
211 //Now move to local pad coordinate frame. Translate:
213 Float_t xt = xs-padxs;
214 Float_t yt = ys-padys;
215 Float_t zt = zs-padzs;
218 Float_t alpha = GetAngles(det[1],det[2]);
219 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
221 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
223 Float_t dist = TMath::Sqrt(xr*xr+yr*yr+zr*zr);
234 //_____________________________________________________________________________
235 Bool_t AliTOFGeometryV4::IsInsideThePadPar(Int_t *det, Float_t *pos) const
238 // Returns true if space point with coor pos (x,y,z) (cm) falls
239 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
242 Bool_t isInside=false;
244 //Transform pos into Sector Frame
250 Float_t radius = TMath::Sqrt(x*x+y*y);
251 Float_t phi=TMath::ATan2(y,x);
252 if(phi<0) phi=2.*TMath::Pi()+phi;
253 // Get the local angle in the sector philoc
254 Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/fPhiSec) + 0.5) *fPhiSec;
255 Float_t xs = radius*TMath::Cos(angle/kRaddeg);
256 Float_t ys = radius*TMath::Sin(angle/kRaddeg);
259 // Do the same for the selected pad
264 Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
265 Float_t padPhi=TMath::ATan2(g[1],g[0]);
266 if(padPhi<0) padPhi=2.*TMath::Pi()+padPhi;
267 // Get the local angle in the sector philoc
268 Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/fPhiSec)+ 0.5) * fPhiSec;
269 Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
270 Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
271 Float_t padzs = g[2];
273 //Now move to local pad coordinate frame. Translate:
275 Float_t xt = xs-padxs;
276 Float_t yt = ys-padys;
277 Float_t zt = zs-padzs;
281 Float_t alpha = GetAngles(det[1],det[2]);
282 Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
284 Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
286 if(TMath::Abs(xr)<=0.75 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
293 //_____________________________________________________________________________
294 Float_t AliTOFGeometryV4::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const
297 // Returns distance of space point with coor pos (x,y,z) (cm) wrt
298 // pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
301 printf("ERROR: no TGeo\n");
308 Double_t veclr[3]={-1.,-1.,-1.};
309 Double_t vecl[3]={-1.,-1.,-1.};
310 mat.MasterToLocal(vecg,veclr);
314 //Take into account reflections
320 Float_t dist = TMath::Sqrt(vecl[0]*vecl[0]+vecl[1]*vecl[1]+vecl[2]*vecl[2]);
334 //_____________________________________________________________________________
335 Bool_t AliTOFGeometryV4::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const
338 // Returns true if space point with coor pos (x,y,z) (cm) falls
339 // inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
342 const Float_t khsensmy = 0.5; // heigth of Sensitive Layer
348 Double_t veclr[3]={-1.,-1.,-1.};
349 Double_t vecl[3]={-1.,-1.,-1.};
350 mat.MasterToLocal(vecg,veclr);
354 //Take into account reflections
360 Float_t xr = vecl[0];
361 Float_t yr = vecl[1];
362 Float_t zr = vecl[2];
364 Bool_t isInside=false;
365 if(TMath::Abs(xr)<= khsensmy*0.5 && TMath::Abs(yr)<= (fgkXPad*0.5) && TMath::Abs(zr)<= (fgkZPad*0.5))
370 //_____________________________________________________________________________
371 Float_t AliTOFGeometryV4::GetX(Int_t *det) const
374 // Returns X coordinate (cm)
377 Int_t isector = det[0];
378 Int_t iplate = det[1];
379 Int_t istrip = det[2];
380 Int_t ipadz = det[3];
381 Int_t ipadx = det[4];
383 // Find out distance d on the plane wrt median phi:
384 Float_t d = (ipadx+0.5)*fgkXPad-(kNpadX*fgkXPad)*0.5;
386 // The radius r in xy plane:
387 Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+
388 (ipadz-0.5)*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25;
390 // local azimuthal angle in the sector philoc
391 Float_t philoc = TMath:: ATan(d/r);
393 // azimuthal angle in the global frame phi
394 Float_t phi = philoc*kRaddeg+(isector+0.5 )*fPhiSec;
396 Float_t xCoor = r/TMath::Cos(philoc)*TMath::Cos(phi/kRaddeg);
401 //_____________________________________________________________________________
402 Float_t AliTOFGeometryV4::GetY(Int_t *det) const
405 // Returns Y coordinate (cm)
408 Int_t isector = det[0];
409 Int_t iplate = det[1];
410 Int_t istrip = det[2];
411 Int_t ipadz = det[3];
412 Int_t ipadx = det[4];
414 // Find out distance d on the plane wrt median phi:
415 Float_t d = (ipadx+0.5)*fgkXPad-(kNpadX*fgkXPad)*0.5;
417 // The radius r in xy plane:
418 Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+
419 (ipadz-0.5)*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25;
421 // local azimuthal angle in the sector philoc
422 Float_t philoc = TMath:: ATan(d/r);
424 // azimuthal angle in the global frame phi
425 Float_t phi = philoc*kRaddeg+(isector+0.5 )*fPhiSec;
427 Float_t yCoor = r/TMath::Cos(philoc)*TMath::Sin(phi/kRaddeg);
433 //_____________________________________________________________________________
434 Float_t AliTOFGeometryV4::GetZ(Int_t *det) const
437 // Returns Z coordinate (cm)
440 Int_t iplate = det[1];
441 Int_t istrip = det[2];
442 Int_t ipadz = det[3];
444 // The radius r in xy plane:
445 Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip];
447 Float_t zCoor = r*TMath::Tan(0.5*TMath::Pi()-GetStripTheta(iplate,istrip))-
448 (ipadz-0.5)*fgkZPad*TMath::Cos(fAngles[iplate][istrip]/kRaddeg);
453 //_____________________________________________________________________________
454 Int_t AliTOFGeometryV4::GetSector(Float_t *pos) const
457 // Returns the Sector index
465 Float_t phi = TMath::ATan2(y,x);
466 if(phi<0.) phi=2.*TMath::Pi()+phi;
467 iSect = (Int_t) (phi*kRaddeg/fPhiSec);
473 //_____________________________________________________________________________
474 Int_t AliTOFGeometryV4::GetPadX(Float_t *pos) const
477 // Returns the Pad index along X
486 Int_t isector = GetSector(pos);
488 AliError("Detector Index could not be determined");
490 Int_t iplate = GetPlate(pos);
492 AliError("Detector Index could not be determined");
494 Int_t istrip = GetStrip(pos);
496 AliError("Detector Index could not be determined");
500 Float_t rho=TMath::Sqrt(x*x+y*y);
501 Float_t phi = TMath::ATan2(y,x);
502 if(phi<0.) phi=2.*TMath::Pi()+phi;
504 // Get the local angle in the sector philoc
505 Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec;
506 philoc*=TMath::Pi()/180.;
507 // theta projected on the median of the sector
508 Float_t theta = TMath::ATan2(rho*TMath::Cos(philoc),z);
509 // The radius r in xy plane:
510 Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+
511 (theta-GetStripTheta(iplate, istrip))/
512 (GetMaxStripTheta(iplate, istrip)-GetMinStripTheta(iplate, istrip))
513 * 2.*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25;
515 // Find out distance projected onto the strip plane
516 Float_t d = (r*TMath::Tan(philoc)+(kNpadX*fgkXPad)*0.5);
518 iPadX = (Int_t) ( d/fgkXPad);
522 //_____________________________________________________________________________
523 Int_t AliTOFGeometryV4::GetPlate(Float_t *pos) const
526 // Returns the Plate index
530 Int_t isector = GetSector(pos);
532 AliError("Detector Index could not be determined");
539 Float_t rho=TMath::Sqrt(x*x+y*y);
540 Float_t phi=TMath::ATan2(y,x);
541 if(phi<0) phi=2.*TMath::Pi()+phi;
542 // Get the local angle in the sector philoc
543 Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec;
544 philoc*=TMath::Pi()/180.;
545 // theta projected on the median of the sector
546 Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z);
548 for (Int_t i=0; i<kNPlates; i++){
549 if ( GetMaxPlateTheta(i) >= theta &&
550 GetMinPlateTheta(i) <= theta)iPlate=i;
557 //_____________________________________________________________________________
558 Int_t AliTOFGeometryV4::GetStrip(Float_t *pos) const
561 // Returns the Strip index
567 Int_t isector = GetSector(pos);
569 AliError("Detector Index could not be determined");
571 Int_t iplate = GetPlate(pos);
573 AliError("Detector Index could not be determined");
582 if(iplate==0 || iplate == 4)nstrips=kNStripC;
583 if(iplate==1 || iplate == 3)nstrips=kNStripB;
584 if(iplate==2) nstrips=kNStripA;
586 Float_t rho=TMath::Sqrt(x*x+y*y);
587 Float_t phi=TMath::ATan2(y,x);
588 if(phi<0) phi=2.*TMath::Pi()+phi;
589 // Get the local angle in the sector philoc
590 Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec;
591 philoc*=TMath::Pi()/180.;
592 // theta projected on the median of the sector
593 Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z);
595 for (Int_t istrip=0; istrip<nstrips; istrip++){
598 GetMaxStripTheta(iplate,istrip) >= theta
600 GetMinStripTheta(iplate,istrip) <= theta ) iStrip = istrip;
607 //_____________________________________________________________________________
608 Int_t AliTOFGeometryV4::GetPadZ(Float_t *pos) const
611 // Returns the Pad index along Z
615 Int_t isector = GetSector(pos);
617 AliError("Detector Index could not be determined");
619 Int_t iplate = GetPlate(pos);
621 AliError("Detector Index could not be determined");
623 Int_t istrip = GetStrip(pos);
625 AliError("Detector Index could not be determined");
633 Float_t rho=TMath::Sqrt(x*x+y*y);
634 Float_t phi=TMath::ATan2(y,x);
635 if(phi<0) phi=2.*TMath::Pi()+phi;
636 Float_t philoc = phi*kRaddeg-(isector+0.5)*fPhiSec;
637 philoc*=TMath::Pi()/180.;
638 Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z);
640 if (theta >= GetStripTheta(iplate, istrip))iPadZ=1;
646 //_____________________________________________________________________________
647 Float_t AliTOFGeometryV4::GetMinPlateTheta(Int_t iPlate) const
650 // Returns the minimum theta angle of a given plate iPlate (rad)
657 if(iPlate==0)delta = -1. ;
658 if(iPlate==1)delta = -0.5;
659 if(iPlate==3)delta = +0.5;
660 if(iPlate==4)delta = +1. ;
662 Float_t z=(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][index]/kRaddeg)+delta;
663 Float_t r=(fgkRmin+fgkRmax)/2.+fHeights[iPlate][index];
664 z =z+fgkZPad*TMath::Cos(fAngles[iPlate][index]/kRaddeg);
665 r =r-fgkZPad*TMath::Sin(fAngles[iPlate][index]/kRaddeg);
667 Float_t thmin = 0.5*TMath::Pi()-TMath::ATan(z/r)-fgkDprecMin;
671 //_____________________________________________________________________________
672 Float_t AliTOFGeometryV4::GetMaxPlateTheta(Int_t iPlate) const
675 // Returns the maximum theta angle of a given plate iPlate (rad)
678 if(iPlate==0 ||iPlate == 4)index=kNStripC-1;
679 if(iPlate==1 ||iPlate == 3)index=kNStripB-1;
680 if(iPlate==2) index=kNStripA-1;
683 if(iPlate==0)delta = -1. ;
684 if(iPlate==1)delta = -0.5;
685 if(iPlate==3)delta = +0.5;
686 if(iPlate==4)delta = +1. ;
688 Float_t z=(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][index]/kRaddeg)+delta;
689 Float_t r=(fgkRmin+fgkRmax)/2.+fHeights[iPlate][index];
690 z =z-fgkZPad*TMath::Cos(fAngles[iPlate][index]/kRaddeg);
691 r= r+fgkZPad*TMath::Sin(fAngles[iPlate][index]/kRaddeg);
693 Float_t thmax = 0.5*TMath::Pi()-TMath::ATan(z/r)+fgkDprecMax;
698 //_____________________________________________________________________________
699 Float_t AliTOFGeometryV4::GetMaxStripTheta(Int_t iPlate, Int_t iStrip) const
702 // Returns the maximum theta angle of a given strip iStrip (rad)
707 if(iPlate==0)delta = -1. ;
708 if(iPlate==1)delta = -0.5;
709 if(iPlate==3)delta = +0.5;
710 if(iPlate==4)delta = +1. ;
712 Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip];
713 Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta;
714 z = z-fgkZPad*TMath::Cos(fAngles[iPlate][iStrip]/kRaddeg);
715 r = r+fgkZPad*TMath::Sin(fAngles[iPlate][iStrip]/kRaddeg);
716 Float_t thmax =0.5*TMath::Pi()-TMath::ATan(z/r)+fgkDprecMax;
720 //_____________________________________________________________________________
721 Float_t AliTOFGeometryV4::GetMinStripTheta(Int_t iPlate, Int_t iStrip) const
724 // Returns the minimum theta angle of a given Strip iStrip (rad)
729 if(iPlate==0)delta = -1. ;
730 if(iPlate==1)delta = -0.5;
731 if(iPlate==3)delta = +0.5;
732 if(iPlate==4)delta = +1. ;
735 Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip];
736 Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta;
737 z =z+fgkZPad*TMath::Cos(fAngles[iPlate][iStrip]/kRaddeg);
738 r =r-fgkZPad*TMath::Sin(fAngles[iPlate][iStrip]/kRaddeg);
739 Float_t thmin =0.5*TMath::Pi()-TMath::ATan(z/r)-fgkDprecMin;
744 //_____________________________________________________________________________
745 Float_t AliTOFGeometryV4::GetStripTheta(Int_t iPlate, Int_t iStrip) const
748 // returns the median theta angle of a given strip iStrip (rad)
753 if(iPlate==0)delta = -1. ;
754 if(iPlate==1)delta = -0.5;
755 if(iPlate==3)delta = +0.5;
756 if(iPlate==4)delta = +1. ;
758 Float_t r =(fgkRmin+fgkRmax)/2.+fHeights[iPlate][iStrip];
759 Float_t z =(fgkRmin+2.)*TMath::Tan(fAngles[iPlate][iStrip]/kRaddeg)+delta;
760 Float_t theta =0.5*TMath::Pi()-TMath::ATan(z/r);
762 if(theta > 0.5*TMath::Pi() )theta+=fgkDprecCen;
763 if(theta < 0.5*TMath::Pi() )theta-=fgkDprecCen;
768 //_____________________________________________________________________________
769 void AliTOFGeometryV4::GetVolumePath(Int_t *ind, Char_t *path ) {
770 //--------------------------------------------------------------------
771 // This function returns the colume path of a given pad
772 //--------------------------------------------------------------------
773 Int_t sector = ind[0];
778 Int_t nstrB = NStripB();
779 Int_t nstrC = NStripC();
785 sprintf(string1,"/ALIC_1/B077_1/B075_%i/BTO3_1",icopy);
790 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1",icopy);
792 else if(sector==11 || sector==12){
794 sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1",icopy);
799 sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1",icopy);
806 sprintf(string2,"FTOC_1/FLTC_0");
807 icopy= nstrC - istrip;
808 sprintf(string3,"FSTR_%i",icopy);
810 else if( modnum ==1){
811 sprintf(string2,"FTOB_1/FLTB_0");
812 icopy= nstrB - istrip;
813 sprintf(string3,"FSTR_%i",icopy);
815 else if( modnum ==2){
816 sprintf(string2,"FTOA_0/FLTA_0");
818 sprintf(string3,"FSTR_%i",icopy);
820 else if( modnum ==3){
821 sprintf(string2,"FTOB_2/FLTB_0");
823 sprintf(string3,"FSTR_%i",icopy);
825 else if( modnum ==4){
826 sprintf(string2,"FTOC_2/FLTC_0");
828 sprintf(string3,"FSTR_%i",icopy);
832 Int_t padz = ind[3]+1;
833 Int_t padx = ind[4]+1;
834 if(modnum==3 || modnum==4){
835 padz = NpadZ() -ind[3];
836 padx = NpadX() -ind[4];
838 sprintf(string4,"FSEN_0/FSEZ_%i/FSEX_%i",padz,padx);
839 sprintf(path,"%s/%s/%s/%s",string1,string2,string3,string4);
843 //_____________________________________________________________________________
844 void AliTOFGeometryV4::GetPos(Int_t *det, Float_t *pos)
847 // Returns space point coor (x,y,z) (cm) for Detector
848 // Indices (iSect,iPlate,iStrip,iPadX,iPadZ)
851 GetVolumePath(det,path );
853 printf("ERROR: no TGeo\n");
855 gGeoManager->cd(path);
857 global = *gGeoManager->GetCurrentMatrix();
858 const Double_t *tr = global.GetTranslation();
864 //_____________________________________________________________________________