]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In order to use at tracking time the TPC pid only converted the method
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Mar 2012 15:42:12 +0000 (15:42 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Mar 2012 15:42:12 +0000 (15:42 +0000)
AliESDtrack::GetPID() and GetMass() to GetPID(Bool_t tpcOnly=kFALSE) and
GetMass(Bool_t tpcOnly=kFALSE). The default behaviour is unchanged.
The virtual method GetTOFBunchCrossing also modified to accept this option
(dummy for its AODtrack implementation), but its default behaviour is set
to tpcOnly

STEER/AOD/AliAODTrack.cxx
STEER/AOD/AliAODTrack.h
STEER/ESD/AliESDtrack.cxx
STEER/ESD/AliESDtrack.h
STEER/STEERBase/AliVTrack.h

index 4ebed0f882181f89a8ff8cd7ca1e2d3f89b37025..facd38185b641051fd965ef526d7a19b4eb6d5cb 100644 (file)
@@ -711,7 +711,7 @@ Double_t AliAODTrack::GetTRDmomentum(Int_t plane, Double_t */*sp*/) const
 }
 
 //_______________________________________________________________________
-Int_t AliAODTrack::GetTOFBunchCrossing(Double_t b) const 
+Int_t AliAODTrack::GetTOFBunchCrossing(Double_t b, Bool_t) const 
 {
   // Returns the number of bunch crossings after trigger (assuming 25ns spacing)
   const double kSpacing = 25e3; // min interbanch spacing
index 53605085e29ba813827027175314ef6577b4031f..13e31334f54e39e3373825908d05aba138eae26b 100644 (file)
@@ -176,7 +176,7 @@ class AliAODTrack : public AliVTrack {
   Bool_t  IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
   Bool_t  IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
   //
-  Int_t   GetTOFBunchCrossing(Double_t b=0) const;
+  Int_t   GetTOFBunchCrossing(Double_t b=0, Bool_t tpcPIDonly=kFALSE) const;
   //
   template <class T> void GetP(T *p) const {
     p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
index aa32089f609412721cf6919be29d9cb2434eac25..915997dadac1196520cad8b7c70957ad0276a001 100644 (file)
@@ -1198,24 +1198,32 @@ void AliESDtrack::MakeMiniESDtrack(){
 } 
 
 //_______________________________________________________________________
-Int_t AliESDtrack::GetPID() const 
+Int_t AliESDtrack::GetPID(Bool_t tpcOnly) const 
 {
   // Returns the particle most probable id
   Int_t i;
-  for (i=0; i<AliPID::kSPECIES-1; i++) if (fR[i] != fR[i+1]) break;
-  //
-  if (i == AliPID::kSPECIES-1) return AliPID::kPion;  // If all the probabilities are equal, return the pion mass
+  const Double32_t *prob = 0;
+  if (tpcOnly) { // check if TPCpid is valid
+    prob = fTPCr;
+    for (i=0; i<AliPID::kSPECIES-1; i++) if (prob[i] != prob[i+1]) break;
+    if (i == AliPID::kSPECIES-1) prob = 0; // not valid, try with combined pid
+  }
+  if (!prob) { // either requested TPCpid is not valid or comb.pid is requested 
+    prob = fR;
+    for (i=0; i<AliPID::kSPECIES-1; i++) if (prob[i] != prob[i+1]) break;
+    if (i == AliPID::kSPECIES-1) return AliPID::kPion;  // If all the probabilities are equal, return the pion mass
+  }
   //
   Float_t max=0.;
   Int_t k=-1;
-  for (i=0; i<AliPID::kSPECIES; i++) if (fR[i]>max) {k=i; max=fR[i];}
+  for (i=0; i<AliPID::kSPECIES; i++) if (prob[i]>max) {k=i; max=prob[i];}
   //
   if (k==0) { // dE/dx "crossing points" in the TPC
     Double_t p=GetP();
     if ((p>0.38)&&(p<0.48))
-      if (fR[0]<fR[3]*10.) return AliPID::kKaon;
+      if (prob[0]<prob[3]*10.) return AliPID::kKaon;
     if ((p>0.75)&&(p<0.85))
-      if (fR[0]<fR[4]*10.) return AliPID::kProton;
+      if (prob[0]<prob[4]*10.) return AliPID::kProton;
     return AliPID::kElectron;
   }
   if (k==1) return AliPID::kMuon; 
@@ -1227,7 +1235,7 @@ Int_t AliESDtrack::GetPID() const
 }
 
 //_______________________________________________________________________
-Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b) const 
+Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b, Bool_t pidTPConly) const 
 {
   // Returns the number of bunch crossings after trigger (assuming 25ns spacing)
   const double kSpacing = 25e3; // min interbanch spacing
@@ -1237,7 +1245,7 @@ Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b) const
   //
   double tdif = fTOFsignal;
   if (IsOn(kTIME)) { // integrated time info is there
-    int pid = GetPID();
+    int pid = GetPID(pidTPConly);
     tdif -= fTrackTime[pid];
   }
   else { // assume integrated time info from TOF radius and momentum
@@ -1245,7 +1253,7 @@ Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b) const
     const double kCSpeed = 3.e-2; // cm/ps
     double p = GetP();
     if (p<0.01) return bcid;
-    double m = GetMass();
+    double m = GetMass(pidTPConly);
     double curv = GetC(b);
     double path = TMath::Abs(curv)>kAlmost0 ? // account for curvature
       2./curv*TMath::ASin(kRTOF*curv/2.)*TMath::Sqrt(1.+GetTgl()*GetTgl()) : kRTOF;
index d5831a7835b51ba0e272228ef5779552c36195d6..1319250f790655d6933c6702b9e933b2d6f09c3c 100644 (file)
@@ -84,9 +84,9 @@ public:
 
   Double_t GetIntegratedLength() const {return fTrackLength;}
   void GetIntegratedTimes(Double_t *times) const;
-  Int_t    GetPID()  const;
-  Int_t    GetTOFBunchCrossing(Double_t b=0) const;
-  Double_t GetMass() const {return AliPID::ParticleMass(GetPID());}
+  Int_t    GetPID(Bool_t tpcOnly=kFALSE)  const;
+  Int_t    GetTOFBunchCrossing(Double_t b=0, Bool_t pidTPConly=kTRUE) const;
+  Double_t GetMass(Bool_t tpcOnly=kFALSE) const {return AliPID::ParticleMass(GetPID(tpcOnly));}
   Double_t M() const;
   Double_t E() const;
   Double_t Y() const;
index 64d080c418368c61f11dbf3186e15ad83d106432..53da122d40f9c5d770a341f836f476b4cdb216db 100644 (file)
@@ -93,7 +93,7 @@ public:
   virtual Int_t    GetNcls(Int_t /*idet*/) const { return 0; }\r
   virtual Bool_t   GetPxPyPz(Double_t */*p*/) const { return kFALSE; }\r
   virtual void     SetID(Short_t /*id*/) {;}\r
-  virtual Int_t    GetTOFBunchCrossing(Double_t = 0) const { return kTOFBCNA;}\r
+  virtual Int_t    GetTOFBunchCrossing(Double_t = 0, Bool_t = kFALSE) const { return kTOFBCNA;}\r
 \r
   ClassDef(AliVTrack,1)  // base class for tracks\r
 };\r