]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmcTrack.cxx
Avoiding relative path to include files
[u/mrichter/AliRoot.git] / TRD / AliTRDmcTrack.cxx
index 536fee09d4e2d23705f9d07e293a69f02b25fc22..08a1f3f04c17f93e0542fe3db1a7d4f36397d94d 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TRD MC track                                                             //
+//  Used for efficiency estimates and matching of reconstructed tracks       //
+//  to MC particles                                                          //                    
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
 #include "AliTRDmcTrack.h"
 #include "AliTRDgeometry.h"
 
+
 ClassImp(AliTRDmcTrack)
 
 //_____________________________________________________________________________
@@ -32,20 +41,27 @@ AliTRDmcTrack::AliTRDmcTrack()
   fCharge = 0;
   fN = 0; 
   
-  for(Int_t i=0; i<200; i++) fIndex[i]=-1;
-  
+  for(Int_t ltb=0; ltb<kMAX_TB; ltb++) {
+    for(Int_t plane=0; plane < 6; plane++) {
+      fIndex[ltb][plane][0] = -1;
+      fIndex[ltb][plane][1] = -1;
+    }
+  }
+
   for(Int_t i=0; i<6; i++) {
     for(Int_t j=0; j<3; j++) { 
       Pin[i][j]=0.; 
       Pout[i][j] = 0.;
+      XYZin[i][j]=0.; 
+      XYZout[i][j] = 0.;
     }
   }
 
 }
 
 //_____________________________________________________________________________
-AliTRDmcTrack::AliTRDmcTrack(Int_t label, Bool_t primary, Float_t mass
-                           ,Int_t charge, Int_t pdg) 
+AliTRDmcTrack::AliTRDmcTrack(Int_t label, Int_t seedLabel, Bool_t primary, 
+                            Float_t mass, Int_t charge, Int_t pdg) 
 { 
 
   //
@@ -53,30 +69,39 @@ AliTRDmcTrack::AliTRDmcTrack(Int_t label, Bool_t primary, Float_t mass
   //
 
   fLab = label; 
+  fSeedLab = seedLabel; 
   fPrimary = primary; 
   fMass = mass; 
   fCharge = charge;
   fPDG = pdg;
   fN = 0; 
   
-  for(Int_t i=0; i<200; i++) fIndex[i]=-1;
+  for(Int_t ltb=0; ltb<kMAX_TB; ltb++) {
+    for(Int_t plane=0; plane < 6; plane++) {
+      fIndex[ltb][plane][0] = -1;
+      fIndex[ltb][plane][1] = -1;
+    }
+  }
   
   for(Int_t i=0; i<6; i++) {
     for(Int_t j=0; j<3; j++) { 
       Pin[i][j]=0.; 
       Pout[i][j] = 0.;
+      XYZin[i][j]=0.; 
+      XYZout[i][j] = 0.;
     }
   }
 
 }
 
 //_____________________________________________________________________________
-void AliTRDmcTrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz, 
-                              Int_t opt) const 
+void AliTRDmcTrack::GetPxPyPzXYZ(Double_t& px, Double_t& py, Double_t& pz, 
+                                Double_t&  x, Double_t&  y, Double_t&  z, 
+                                Int_t opt) const 
 {
   //
-  // Returns momentum components at the entrance (opt >= 0), or
-  // exit (opt < 0) of TRD. 
+  // Returns track momentum components and coordinates at the entrance 
+  // (opt >= 0), or exit (opt < 0) of TRD. 
   //
 
   Int_t i;
@@ -87,7 +112,8 @@ void AliTRDmcTrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz,
          + Pin[i][1] * Pin[i][1]
          + Pin[i][2] * Pin[i][2] > 0.0005) break;
     }
-    px = Pin[0][0]; py = Pin[0][1]; pz = Pin[0][2];
+    px = Pin[i][0];    py = Pin[i][1];   pz = Pin[i][2];
+     x = XYZin[i][0];   y = XYZin[i][1];  z = XYZin[i][2];
   }
   else {
     for(i = AliTRDgeometry::Nplan() - 1; i >= 0; i--) {
@@ -95,11 +121,10 @@ void AliTRDmcTrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz,
          + Pout[i][1] * Pout[i][1]
          + Pout[i][2] * Pout[i][2] > 0.0005) break;
     }
-    px = Pout[i][0]; py = Pout[i][1]; pz = Pout[i][2];
+    px = Pout[i][0];    py = Pout[i][1];   pz = Pout[i][2];
+     x = XYZout[i][0];   y = XYZout[i][1];  z = XYZout[i][2];
   }
-
   return;
-
 }
 
 //_____________________________________________________________________________
@@ -117,7 +142,5 @@ void AliTRDmcTrack::GetPlanePxPyPz(Double_t& px, Double_t& py, Double_t& pz,
   else {
     px = Pout[plane][0]; py = Pout[plane][1]; pz = Pout[plane][2];
   }
-
   return;
-
 }