]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrackingSector.cxx
Coding conventions
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackingSector.cxx
index aecfbc53bb13eb0ffbeced0a1990cfd9c65e2086..22521eaeeddde41056c0b4602f8f2c31de288194 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  2001/11/19 08:44:08  cblume
+Fix bugs reported by Rene
+
 Revision 1.6  2001/05/28 17:07:58  hristov
 Last minute changes; ExB correction in AliTRDclusterizerV1; taking into account of material in G10 TEC frames and material between TEC planes (C.Blume,S.Sedykh)
 
@@ -36,7 +39,13 @@ Replace include files by forward declarations
 Revision 1.1.2.1  2000/09/22 14:47:52  cblume
 Add the tracking code
 
-*/                        
+*/ 
+
+/////////////////////////////////////////////////////////////////////////
+//                                                                     //
+//  Tracking sector                                                    //
+//                                                                     //
+/////////////////////////////////////////////////////////////////////////                       
                                 
 #include <TObject.h>
 
@@ -51,7 +60,6 @@ Add the tracking code
 ClassImp(AliTRDtrackingSector) 
 
 //_______________________________________________________
-
 AliTRDtrackingSector::~AliTRDtrackingSector()
 {
   //
@@ -74,11 +82,14 @@ AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
 }
 
 //_______________________________________________________
-
 void AliTRDtrackingSector::SetUp()
 { 
-  AliTRD *TRD = (AliTRD*) gAlice->GetDetector("TRD");
-  fGeom = TRD->GetGeometry();
+  //
+  // Initialization
+  //
+
+  AliTRD *trd = (AliTRD*) gAlice->GetDetector("TRD");
+  fGeom = trd->GetGeometry();
 
   fTimeBinSize = fGeom->GetTimeBinSize();
 
@@ -90,68 +101,80 @@ void AliTRDtrackingSector::SetUp()
 }
 
 //______________________________________________________
-
 Double_t AliTRDtrackingSector::GetX(Int_t tb) const
 {
+  //
+  // Get global x coordinate
+  //
+
   if( (tb<0) || (tb>fN-1)) {
     fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
     return -99999.;
   }
   else { 
     
-    Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
-    Int_t local_tb = tb_per_plane - tb%tb_per_plane - 1;
+    Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
+    Int_t localTb = tbPerPlane - tb%tbPerPlane - 1;
 
-    Int_t plane = tb/tb_per_plane;
+    Int_t plane = tb/tbPerPlane;
     Float_t t0 = fGeom->GetTime0(plane);
-    Double_t x = t0 - (local_tb + 0.5) * fTimeBinSize;
+    Double_t x = t0 - (localTb + 0.5) * fTimeBinSize;
 
     return x;
+
   }
+
 }
 
 //______________________________________________________
-
 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
 {
-  Float_t r_out = fGeom->GetTime0(AliTRDgeometry::Nplan()-1); 
-  Float_t r_in = fGeom->GetTime0(0) - AliTRDgeometry::DrThick();
+  //
+  // Returns the time bin number
+  //
+
+  Float_t rOut = fGeom->GetTime0(AliTRDgeometry::Nplan()-1); 
+  Float_t rIn  = fGeom->GetTime0(0) - AliTRDgeometry::DrThick();
 
 
-  if(x >= r_out) return fN-1;
-  if(x <= r_in) return 0;
+  if(x >= rOut) return fN-1;
+  if(x <= rIn)  return 0;
 
   Int_t plane;
   for (plane = AliTRDgeometry::Nplan()-1; plane >= 0; plane--) {
     if(x > (fGeom->GetTime0(plane) - AliTRDgeometry::DrThick())) break;
   }  
  
-  Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
-  Int_t local_tb = Int_t((fGeom->GetTime0(plane)-x)/fTimeBinSize);
+  Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
+  Int_t localTb = Int_t((fGeom->GetTime0(plane)-x)/fTimeBinSize);
 
-  if((local_tb < 0) || (local_tb >= tb_per_plane)) {
+  if((localTb < 0) || (localTb >= tbPerPlane)) {
     printf("AliTRDtrackingSector::GetTimeBinNumber: \n");
     printf("local time bin %d is out of bounds [0..%d]: x = %f \n",
-          local_tb,tb_per_plane-1,x);
+          localTb,tbPerPlane-1,x);
     return -1;
   }
       
-  Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
+  Int_t timeBin = (plane + 1) * tbPerPlane - 1 - localTb;
 
-  return time_bin;
+  return timeBin;
 }
 
 //______________________________________________________
-
-Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const 
+Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t localTb) const 
 {
+  //
+  // Time bin
+  //
+
   Int_t plane = fGeom->GetPlane(det);
 
-  Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
+  Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
 
-  Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
+  Int_t timeBin = (plane + 1) * tbPerPlane - 1 - localTb;
+
+  return timeBin;
 
-  return time_bin;
 }
 
 
@@ -159,15 +182,15 @@ Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
 
 Bool_t AliTRDtrackingSector::TECframe(Int_t tb, Double_t y, Double_t z) const
 {
-// 
-// Returns <true> if point defined by <x(tb),y,z> is within 
-// the TEC G10 frame, otherwise returns <false>  
-//  
+  //  
+  // Returns <true> if point defined by <x(tb),y,z> is within 
+  // the TEC G10 frame, otherwise returns <false>  
+  //  
 
   if((tb > (fN-1)) || (tb < 0)) return kFALSE; 
 
-  Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
-  Int_t plane = tb/tb_per_plane;
+  Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
+  Int_t plane = tb/tbPerPlane;
   
   Double_t x = GetX(tb);
   y = TMath::Abs(y);
@@ -194,4 +217,5 @@ Bool_t AliTRDtrackingSector::TECframe(Int_t tb, Double_t y, Double_t z) const
   }
 
   return kFALSE;
+
 }