]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrack.cxx
SDD QA updated in order to deal with acquisition through HLT (M. Siciliano)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrack.cxx
index 1188fbe3139aef7c31c833e23e61aa107d9e8750..cd4dd0d398ed3810959bed4530e2ec72b1937245 100644 (file)
@@ -18,7 +18,6 @@
 #include <TVector2.h>
 
 #include "AliTracker.h"
-#include "AliESDtrack.h"
 
 #include "AliTRDgeometry.h" 
 #include "AliTRDcluster.h" 
@@ -68,6 +67,10 @@ AliTRDtrack::AliTRDtrack()
     fMom[i]         = -1.;
     fSnp[i]         = 0.;
     fTgl[i]         = 0.;
+    fTrackletIndex[i] = -1;
+  }
+  for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
+    fPID[ispec] = 1.0 / AliPID::kSPECIES;      
   }
 
   for (UInt_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
@@ -143,6 +146,10 @@ AliTRDtrack::AliTRDtrack(AliTRDcluster *c, Int_t index
     fMom[i]         = -1.;
     fSnp[i]         =  0.;
     fTgl[i]         =  0.;
+    fTrackletIndex[i] = -1;
+  }
+  for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
+    fPID[ispec] = 1.0 / AliPID::kSPECIES;      
   }
 
   Double_t q = TMath::Abs(c->GetQ());
@@ -200,6 +207,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner*/)
     fMom[i]         = t.fMom[i];
     fSnp[i]         = t.fSnp[i];
     fTgl[i]         = t.fTgl[i];
+    fTrackletIndex[i] = t.fTrackletIndex[i];
   }
 
   Int_t n = t.GetNumberOfClusters(); 
@@ -269,6 +277,10 @@ AliTRDtrack::AliTRDtrack(const AliKalmanTrack &t, Double_t /*alpha*/)
     fMom[i]         = -1.;
     fSnp[i]         =  0.;
     fTgl[i]         =  0.;
+    fTrackletIndex[i] = -1;
+  }
+  for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
+    fPID[ispec] = 1.0 / AliPID::kSPECIES;      
   }
 
   for (UInt_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
@@ -322,12 +334,13 @@ AliTRDtrack::AliTRDtrack(const AliESDtrack &t)
 
   for (Int_t i = 0; i < kNplane; i++) {
     for (Int_t j = 0; j < kNslice; j++) {
-      fdEdxPlane[i][j] = t.GetTRDsignals(i,j);
+      fdEdxPlane[i][j] = t.GetTRDslice(i,j);
     }
     fTimBinPlane[i] = t.GetTRDTimBin(i);
     fMom[i]         = -1.;
     fSnp[i]         =  0.;
     fTgl[i]         =  0.;
+    fTrackletIndex[i] = -1;
   }
 
   const AliExternalTrackParam *par = &t;
@@ -351,6 +364,9 @@ AliTRDtrack::AliTRDtrack(const AliESDtrack &t)
   for (Int_t i = 0; i < 3; i++) {
     fBudget[i] = 0;
   }
+  for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
+    fPID[ispec] = t.GetTRDpid(ispec);  
+  }
 
   if ((t.GetStatus() & AliESDtrack::kTIME) == 0) {
     return;
@@ -474,9 +490,9 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/)
   //
 
   // Max charge in chamber
-  Double_t  maxcharge[AliESDtrack::kNPlane]; 
+  Double_t  maxcharge[kNplane]; 
   // Number of clusters attached to track per chamber and slice
-  Int_t     nCluster[AliESDtrack::kNPlane][AliESDtrack::kNSlice];
+  Int_t     nCluster[kNplane][kNslice];
   // Number of time bins in chamber
   Int_t ntb = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
   Int_t plane;                  // Plane of current cluster
@@ -485,10 +501,10 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/)
   AliTRDcluster *cluster = 0x0; // Pointer to current cluster
 
   // Reset class and local counters/variables
-  for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) {
+  for (Int_t iPlane = 0; iPlane < kNplane; iPlane++) {
     fTimBinPlane[iPlane] = -1;
     maxcharge[iPlane]    =  0.0;
-    for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) {
+    for (Int_t iSlice = 0; iSlice < kNslice; iSlice++) {
       fdEdxPlane[iPlane][iSlice] = 0.0;
       nCluster[iPlane][iSlice]   = 0;
     }
@@ -501,8 +517,8 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/)
     if (!cluster) continue;
 
     // Read info from current cluster
-    plane  = AliTRDgeometry::GetPlane(cluster->GetDetector());
-    if (plane < 0 || plane >= AliESDtrack::kNPlane) {
+    plane  = AliTRDgeometry::GetLayer(cluster->GetDetector());
+    if (plane < 0 || plane >= kNplane) {
       AliError(Form("Wrong plane %d", plane));
       continue;
     }
@@ -514,7 +530,7 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/)
       continue;
     }
        
-    slice = tb * AliESDtrack::kNSlice / ntb;
+    slice = tb * kNslice / ntb;
 
     fdEdxPlane[plane][slice] += fdQdl[iClus];
     if (fdQdl[iClus] > maxcharge[plane]) {
@@ -527,8 +543,8 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/)
   } // End of loop over cluster
        
   // Normalize fdEdxPlane to number of clusters and set track segments
-  for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) {
-    for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) {
+  for (Int_t iPlane = 0; iPlane < kNplane; iPlane++) {
+    for (Int_t iSlice = 0; iSlice < kNslice; iSlice++) {
       if (nCluster[iPlane][iSlice]) {
         fdEdxPlane[iPlane][iSlice] /= nCluster[iPlane][iSlice];
       }
@@ -555,7 +571,7 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx)
   const Int_t kMLPscale  = 16000; // scaling of the MLP input to be smaller than 1
 
   // Reset class and local contors/variables
-  for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++){
+  for (Int_t iPlane = 0; iPlane < kNplane; iPlane++){
     for (Int_t iSlice = 0; iSlice < kNMLPslice; iSlice++) {
       *(dedx + (kNMLPslice * iPlane) + iSlice) = 0.0;
     }
@@ -570,8 +586,8 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx)
     }
          
     // Read info from current cluster
-    plane   = AliTRDgeometry::GetPlane(cluster->GetDetector());
-    if (plane < 0 || plane >= AliESDtrack::kNPlane) {
+    plane   = AliTRDgeometry::GetLayer(cluster->GetDetector());
+    if (plane < 0 || plane >= kNplane) {
       AliError(Form("Wrong plane %d",plane));
       continue;
     }
@@ -653,7 +669,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality)
   }
        
   // Retrieve the CDB container class with the probability distributions
-  const AliTRDCalPID *pd = calibration->GetPIDObject(fPIDmethod == kNN ? 0 : 1);
+  const AliTRDCalPID *pd = calibration->GetPIDObject(AliTRDReconstructor::kLQPID);
   if (!pd) {
     AliError("No access to AliTRDCalPID");
     return kFALSE;
@@ -681,7 +697,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality)
   // Skip tracks which have no TRD signal at all
   if (fdEdx == 0.) return kFALSE;
        
-  for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNplan; iPlane++) {
+  for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNlayer; iPlane++) {
 
     length = (AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick())
            / TMath::Sqrt((1.0 - fSnp[iPlane]*fSnp[iPlane]) 
@@ -1116,7 +1132,7 @@ Int_t AliTRDtrack::GetSector() const
   //
 
   return Int_t(TVector2::Phi_0_2pi(GetAlpha()) / AliTRDgeometry::GetAlpha())
-             % AliTRDgeometry::kNsect;
+             % AliTRDgeometry::kNsector;
 
 }