For backward compatibility changed the method AliVTrack::GetIntegratedTimes(double...
authorshahoian <ruben.shahoyan@cern.ch>
Thu, 6 Feb 2014 01:39:56 +0000 (02:39 +0100)
committershahoian <ruben.shahoyan@cern.ch>
Thu, 6 Feb 2014 01:43:32 +0000 (02:43 +0100)
All framework calls of this method go with GetIntegratedTimes(v,kSPECIESC).
See https://savannah.cern.ch/bugs/?103666#comment19 for details

34 files changed:
ANALYSIS/ESDfilter/AliAnalysisTaskESDfilter.cxx
ANALYSIS/TenderSupplies/AliTOFTenderSupply.cxx
HMPID/AliHMPIDtrack.cxx
ITS/AliITStrackV2.cxx
ITS/AliITStrackerMI.cxx
ITS/UPGRADE/AliITSUTrackHyp.cxx
ITS/UPGRADE/AliITSUTrackerGlo.cxx
PWGLF/RESONANCES/AliRsnCutPIDTOF.cxx
PWGPP/TPC/AliESDRecInfo.cxx
PWGPP/comparison/AliAnalysisTaskCheckESD.cxx
PWGPP/global/AliAnalysisTaskGlobalQA.cxx
PWGPP/pid/AliAnalysisTaskK0sBayes.cxx
PWGPP/pid/AliAnalysisTaskLambdaBayes.cxx
PWGPP/pid/AliAnalysisTaskPhiBayes.cxx
STEER/AOD/AliAODPid.cxx
STEER/AOD/AliAODPid.h
STEER/AOD/AliAODTrack.cxx
STEER/AOD/AliAODTrack.h
STEER/ESD/AliESDtrack.cxx
STEER/ESD/AliESDtrack.h
STEER/ESD/AliKalmanTrack.cxx
STEER/ESD/AliKalmanTrack.h
STEER/STEER/AliGlobalQADataMaker.cxx
STEER/STEERBase/AliTOFPIDResponse.cxx
STEER/STEERBase/AliVTrack.cxx
STEER/STEERBase/AliVTrack.h
TOF/AliTOFCalibTask.cxx
TOF/AliTOFT0v1.cxx
TOF/AliTOFcalib.cxx
TOF/AliTOFtracker.cxx
TOF/AliTOFtrackerV1.cxx
TOF/AliTOFtrackerV2.cxx
TPC/Rec/AliTPCtrack.cxx
TRD/AliTRDtrackV1.cxx

index fca0f55..b5ff284 100644 (file)
@@ -2398,7 +2398,7 @@ void AliAnalysisTaskESDfilter::SetDetectorRawSignals(AliAODPid *aodpid, AliESDtr
   aodpid->SetTRDChi2(track->GetTRDchi2());
 
   //TOF PID  
-  Double_t times[AliPID::kSPECIESC]; track->GetIntegratedTimes(times);
+  Double_t times[AliPID::kSPECIESC]; track->GetIntegratedTimes(times,AliPID::kSPECIESC);
   aodpid->SetIntegratedTimes(times);
 
   //  Float_t tzeroTrack = fESDpid->GetTOFResponse().GetStartTime(track->P());
index dd13110..9fd8447 100644 (file)
@@ -617,7 +617,7 @@ void AliTOFTenderSupply::FixTRDBug(AliESDtrack *track)
     Double_t correctionTimes[AliPID::kSPECIES] = {0.,0.,0.,0.,0.}; // to be added to the expected times
     FindTRDFix(track, correctionTimes);
     Double_t expectedTimes[AliPID::kSPECIESC] = {0.,0.,0.,0.,0.,0.,0.,0.,0.}; 
-    track->GetIntegratedTimes(expectedTimes);
+    track->GetIntegratedTimes(expectedTimes,AliPID::kSPECIESC);
     //    Printf("Exp. times: %f %f %f %f %f",
     //    expectedTimes[0],expectedTimes[1],expectedTimes[2],expectedTimes[3],expectedTimes[4]);
     //    Printf("Corr. times: %f %f %f %f %f",
index 1f74210..8a9b936 100644 (file)
@@ -16,6 +16,7 @@
 #include "AliESDtrack.h" 
 #include "AliTracker.h" 
 #include "AliHMPIDtrack.h" 
+#include "AliPID.h" 
 
 ClassImp(AliHMPIDtrack)
 
@@ -47,7 +48,8 @@ AliHMPIDtrack::AliHMPIDtrack(const AliESDtrack& t):AliKalmanTrack()
 
   if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
   StartTimeIntegral();
-  Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
+  Double_t times[AliPID::kSPECIESC]; 
+  t.GetIntegratedTimes(times,AliPID::kSPECIESC); SetIntegratedTimes(times);
   SetIntegratedLength(t.GetIntegratedLength());
 }              
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 86a2fe5..ee4380d 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliITStrackV2.h"
 #include "AliTracker.h"
 #include "AliLog.h"
+#include "AliPID.h"
 
 const Int_t AliITStrackV2::fgkWARN = 5;
 
@@ -71,7 +72,9 @@ AliITStrackV2::AliITStrackV2(AliESDtrack& t,Bool_t c):
 
   if (t.GetStatus()&AliESDtrack::kTIME) {
     StartTimeIntegral();
-    Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
+    Double_t times[AliPID::kSPECIESC]; 
+    t.GetIntegratedTimes(times,AliPID::kSPECIESC); 
+    SetIntegratedTimes(times);
     SetIntegratedLength(t.GetIntegratedLength());
   }
 
index 15cc909..4b0953d 100644 (file)
@@ -58,6 +58,7 @@
 #include "AliITSV0Finder.h"
 #include "AliITStrackerMI.h"
 #include "AliMathBase.h"
+#include "AliPID.h"
 
 
 ClassImp(AliITStrackerMI)
@@ -737,7 +738,9 @@ Int_t AliITStrackerMI::PropagateBack(AliESDEvent *event) {
      //
      // transfer the time integral to ESD track
      esd->SetStatus(AliESDtrack::kTIME);
-     Double_t times[10];t.GetIntegratedTimes(times); esd->SetIntegratedTimes(times);
+     Double_t times[AliPID::kSPECIESC];
+     t.GetIntegratedTimes(times,AliPID::kSPECIESC); 
+     esd->SetIntegratedTimes(times);
      esd->SetIntegratedLength(t.GetIntegratedLength());
      //
      if ((esd->GetStatus()&AliESDtrack::kITSin)==0) continue;
index 18bc4ed..394ac47 100644 (file)
@@ -86,7 +86,7 @@ AliITSUTrackHyp::AliITSUTrackHyp(const AliESDtrack &src)
     StartTimeIntegral();
     SetIntegratedLength(src.GetIntegratedLength());
     double times[AliPID::kSPECIESC];
-    src.GetIntegratedTimes(times);
+    src.GetIntegratedTimes(times,AliPID::kSPECIESC);
     SetIntegratedTimes(times);
   }
   //
@@ -135,7 +135,7 @@ AliITSUTrackHyp &AliITSUTrackHyp::operator=(const AliESDtrack &src)
     StartTimeIntegral();
     SetIntegratedLength(src.GetIntegratedLength());
     double times[AliPID::kSPECIESC];
-    src.GetIntegratedTimes(times);
+    src.GetIntegratedTimes(times,AliPID::kSPECIESC);
     SetIntegratedTimes(times);
   }
   //
index b3cef92..59796e4 100644 (file)
@@ -341,7 +341,7 @@ Int_t AliITSUTrackerGlo::PropagateBack(AliESDEvent *esdEv)
       dummyTr.AliExternalTrackParam::operator=(*fCurrESDtrack);
       dummyTr.StartTimeIntegral();
       dummyTr.AddTimeStep(dst);
-      dummyTr.GetIntegratedTimes(times); 
+      dummyTr.GetIntegratedTimes(times,AliPID::kSPECIESC); 
       fCurrESDtrack->SetIntegratedTimes(times);
       fCurrESDtrack->SetIntegratedLength(dummyTr.GetIntegratedLength());
       continue;
index a91acd7..eace6a5 100644 (file)
@@ -108,7 +108,7 @@ Bool_t AliRsnCutPIDTOF::IsSelected(TObject *object)
 
    // retrieve real object type and
    // prepare some useful variables
-   Double_t     tof, sigma, times[5];
+   Double_t     tof, sigma, times[AliPID::kSPECIESC];
    Double_t    &ref = times[(Int_t)fRefType];
    AliESDtrack *esdTrack = fDaughter->Ref2ESDtrack();
    AliAODTrack *aodTrack = fDaughter->Ref2AODtrack();
@@ -126,7 +126,7 @@ Bool_t AliRsnCutPIDTOF::IsSelected(TObject *object)
       fESDpid->SetTOFResponse(esd, AliESDpid::kTOF_T0);
 
       // get time of flight, reference times and sigma
-      esdTrack->GetIntegratedTimes(times);
+      esdTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
       tof   = (Double_t)(esdTrack->GetTOFsignal() - fESDpid->GetTOFResponse().GetStartTime(esdTrack->P()));
       sigma = (Double_t)fESDpid->GetTOFResponse().GetExpectedSigma(esdTrack->P(), ref, fRefMass);
 
index 24bf4b1..0bf7f70 100644 (file)
@@ -432,9 +432,9 @@ void AliESDRecInfo::UpdateTOF(AliMCInfo* info){
   if (((fESDtrack->GetStatus()&AliESDtrack::kTOFout)>0)){
     //
     // best tof match
-    Double_t times[5];
-    fESDtrack->GetIntegratedTimes(times);    
-    for (Int_t i=0;i<5;i++){
+    Double_t times[AliPID::kSPECIESC];
+    fESDtrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
+    for (Int_t i=0;i<AliPID::kSPECIESC;i++){
       if ( TMath::Abs(fESDtrack->GetTOFsignal()-times[i]) <TMath::Abs(fBestTOFmatch) ){
        fBestTOFmatch = fESDtrack->GetTOFsignal()-times[i];
       }
index 894218e..fb0a4db 100644 (file)
@@ -377,8 +377,8 @@ void AliAnalysisTaskCheckESD::UserExec(Option_t */*option*/)
     }
 
     // dE/dx and TOF
-    Double_t time[AliPID::kSPECIES];
-    track->GetIntegratedTimes(time);
+    Double_t time[AliPID::kSPECIESC];
+    track->GetIntegratedTimes(time,AliPID::kSPECIESC);
     if (iGen == iRec) {
       fDEdxRight->Fill(particle->P(), track->GetTPCsignal());
       if ((track->GetStatus() & AliESDtrack::kTOFpid) != 0) {
index f312481..ab0b645 100644 (file)
@@ -33,6 +33,7 @@
 #include "AliESDInputHandler.h"
 #include "AliESDVZERO.h"
 #include "AliMultiplicity.h" 
+#include "AliPID.h" 
 
 
 #include "AliAnalysisTaskGlobalQA.h"
@@ -304,10 +305,10 @@ void AliAnalysisTaskGlobalQA::UserExec(Option_t *)
          Float_t dz[2];
          track->GetDZ(xv,yv,zv,esd->GetMagneticField(),dz);
          if (dz[1]<3.) {
-            Double_t times[10];
-            track->GetIntegratedTimes(times);
-            Double_t tof=track->GetTOFsignal()/*-847055 -1771207*/;
-            GetESDsData(kPid2)->Fill(times[2]-tof);
+          Double_t times[AliPID::kSPECIESC];
+          track->GetIntegratedTimes(times,AliPID::kSPECIESC);
+          Double_t tof=track->GetTOFsignal()/*-847055 -1771207*/;
+          GetESDsData(kPid2)->Fill(times[2]-tof);
         }
       }
     }
index a699a62..38dac6e 100644 (file)
@@ -712,8 +712,8 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
            
            // generate random time
            Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+01;
-           Double_t times[10];
-           KpTrack->GetIntegratedTimes(times);
+           Double_t times[AliPID::kSPECIESC];
+           KpTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
            nSigmaTOF = TMath::Abs(timeRandom - times[2])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[2], AliPID::kPion);
            nSigmaTOFRef = TMath::Abs(timeRandom - times[fSpeciesRef])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[fSpeciesRef], fSpeciesRef);
          }
@@ -829,8 +829,8 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
              
              // generate random time
              Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+00;
-             Double_t times[10];
-             KnTrack->GetIntegratedTimes(times);
+             Double_t times[AliPID::kSPECIESC];
+             KnTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
              nSigmaTOF2 = TMath::Abs(timeRandom - times[2])/PIDResponse->GetTOFResponse().GetExpectedSigma(KnTrack->P(), times[2], AliPID::kPion);
              nSigmaTOF2Ref = TMath::Abs(timeRandom - times[fSpeciesRef])/PIDResponse->GetTOFResponse().GetExpectedSigma(KnTrack->P(), times[fSpeciesRef], fSpeciesRef);
            }
index 57a4428..276a447 100644 (file)
@@ -727,8 +727,8 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
            
            // generate random time
            Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+01;
-           Double_t times[10];
-           KpTrack->GetIntegratedTimes(times);
+           Double_t times[AliPID::kSPECIESC];
+           KpTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
            nSigmaTOF = TMath::Abs(timeRandom - times[4])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[4], AliPID::kProton);
            nSigmaTOFRef = TMath::Abs(timeRandom - times[fSpeciesRef])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[fSpeciesRef], (AliPID::EParticleType) fSpeciesRef);
          }
@@ -829,8 +829,8 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
            
            // generate random time
            Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+01;
-           Double_t times[10];
-           KnTrack->GetIntegratedTimes(times);
+           Double_t times[AliPID::kSPECIESC];
+           KnTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
            nSigmaTOF2 = TMath::Abs(timeRandom - times[4])/PIDResponse->GetTOFResponse().GetExpectedSigma(KnTrack->P(), times[4], AliPID::kProton);
          }
        }
index 37adb35..1b0d37c 100644 (file)
@@ -692,8 +692,8 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
            
            // generate random time
            Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+01;
-           Double_t times[10];
-           KpTrack->GetIntegratedTimes(times);
+           Double_t times[AliPID::kSPECIESC];
+           KpTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
            nSigmaTOF = TMath::Abs(timeRandom - times[3])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[3], AliPID::kKaon);
            nSigmaTOFRef = TMath::Abs(timeRandom - times[fSpeciesRef])/PIDResponse->GetTOFResponse().GetExpectedSigma(KpTrack->P(), times[fSpeciesRef], (AliPID::EParticleType) fSpeciesRef);
          }
@@ -814,8 +814,8 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
              
              // generate random time
              Float_t timeRandom = fHmismTOF->GetRandom() + distIP*3.35655419905265973e+00;
-             Double_t times[10];
-             KnTrack->GetIntegratedTimes(times);
+             Double_t times[AliPID::kSPECIESC];
+             KnTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
              nSigmaTOF2 = TMath::Abs(timeRandom - times[3])/PIDResponse->GetTOFResponse().GetExpectedSigma(KnTrack->P(), times[3], AliPID::kKaon);
              nSigmaTOF2Ref = TMath::Abs(timeRandom - times[fSpeciesRef])/PIDResponse->GetTOFResponse().GetExpectedSigma(KnTrack->P(), times[fSpeciesRef], (AliPID::EParticleType) fSpeciesRef);
            }
index 0b9d8e1..9dd7f10 100644 (file)
@@ -23,7 +23,6 @@
 #include "AliAODPid.h"
 #include "AliESDtrack.h"
 #include "AliLog.h"
-#include "AliPID.h"
 #include "AliTPCdEdxInfo.h"
 
 ClassImp(AliAODPid)
@@ -141,10 +140,14 @@ AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
   return *this;
 }
 //_______________________________________________________________________________
-void AliAODPid::GetIntegratedTimes(Double_t timeint[AliPID::kSPECIES]) const
+void AliAODPid::GetIntegratedTimes(Double_t *timeint, Int_t nspec) const
 {
- // Returns the array with integrated times for each particle hypothesis
- for(Int_t i=0; i<AliPID::kSPECIES; i++) timeint[i]=fIntTime[i];
+  // Returns the array with integrated times for each particle hypothesis
+  //
+  for(Int_t i=0; i<AliPID::kSPECIES; i++) timeint[i]=fIntTime[i];
+  //Note: at the moment only kSPECIES entries are available
+  if (nspec>AliPID::kSPECIES) for (int i=AliPID::kSPECIES;i<AliPID::kSPECIESC;i++) timeint[i]=0;
+  //
 }
 //_______________________________________________________________________________
 void AliAODPid::SetIntegratedTimes(Double_t timeint[AliPID::kSPECIES])
index 9bf4195..2016db5 100644 (file)
@@ -11,6 +11,7 @@
 //-------------------------------------------------------------------------
 
 #include <TObject.h>
+#include "AliPID.h"
 
 class AliTPCdEdxInfo;
 
@@ -64,7 +65,7 @@ class AliAODPid : public TObject {
   UChar_t   GetTRDntrackletsPID() const {return fTRDntls;}
   Double_t  GetTOFsignal()       const {return  fTOFesdsignal;}
 
-  void      GetIntegratedTimes(Double_t timeint[5])  const; 
+  void      GetIntegratedTimes(Double_t *timeint, Int_t nspec=AliPID::kSPECIES)  const; 
   void      GetTOFpidResolution (Double_t tofRes[5]) const;
 
  private :
index f72763b..5acb341 100644 (file)
@@ -807,7 +807,7 @@ Int_t AliAODTrack::GetTOFBunchCrossing(Double_t b, Bool_t) const
   if (IsOn(kTIME)) { // integrated time info is there
     int pid = (int)GetMostProbablePID();
     double ttimes[10]; 
-    GetIntegratedTimes(ttimes);
+    GetIntegratedTimes(ttimes, pid>=AliPID::kSPECIES ? AliPID::kSPECIESC : AliPID::kSPECIES);
     tdif -= ttimes[pid];
   }
   else { // assume integrated time info from TOF radius and momentum
index b2cc6b9..4163dea 100644 (file)
@@ -321,7 +321,7 @@ class AliAODTrack : public AliVTrack {
   
   Bool_t GetOuterHmpPxPyPz(Double_t *p) const;
   
-  void      GetIntegratedTimes(Double_t *times) const {if (fDetPid) fDetPid->GetIntegratedTimes(times); }
+  void      GetIntegratedTimes(Double_t *times, Int_t nspec=AliPID::kSPECIESC) const {if (fDetPid) fDetPid->GetIntegratedTimes(times, nspec);}
   Double_t  GetTRDslice(Int_t plane, Int_t slice) const;
   Double_t  GetTRDsignal()                        const {return fDetPid ? fDetPid->GetTRDsignal() : 0;}
   Double_t  GetTRDmomentum(Int_t plane, Double_t */*sp*/=0x0) const;
index 00df3b2..53b0dff 100644 (file)
@@ -642,7 +642,7 @@ AliESDtrack::AliESDtrack(const AliVTrack *track) :
   //
   SetTOFsignal(track->GetTOFsignal());
   Double_t expt[AliPID::kSPECIESC];
-  track->GetIntegratedTimes(expt);
+  track->GetIntegratedTimes(expt,AliPID::kSPECIESC);
   SetIntegratedTimes(expt);
   //
   SetTrackPhiEtaPtOnEMCal(track->GetTrackPhiOnEMCal(),track->GetTrackEtaOnEMCal(),track->GetTrackPtOnEMCal());
@@ -1426,11 +1426,11 @@ Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b, Bool_t pidTPConly) const
   if (!IsOn(kTOFout) || !IsOn(kESDpid)) return bcid; // no info
   //
   double tdif = fTOFsignal;
-  Double_t times[AliPID::kSPECIESC];
-  GetIntegratedTimes(times);
   if (IsOn(kTIME)) { // integrated time info is there
     int pid = GetPID(pidTPConly);
-
+    Double_t times[AliPID::kSPECIESC];
+    // old esd has only AliPID::kSPECIES times
+    GetIntegratedTimes(times,pid>=AliPID::kSPECIES ? AliPID::kSPECIESC : AliPID::kSPECIES); 
     tdif -= times[pid];
   }
   else { // assume integrated time info from TOF radius and momentum
@@ -1500,7 +1500,9 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
 
   if (t->IsStartedTimeIntegral()) {
     SetStatus(kTIME);
-    Double_t times[AliPID::kSPECIESC];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
+    Double_t times[AliPID::kSPECIESC];
+    t->GetIntegratedTimes(times); 
+    SetIntegratedTimes(times);
     SetIntegratedLength(t->GetIntegratedLength());
   }
 
@@ -1837,19 +1839,19 @@ Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const
 }
 
 //_______________________________________________________________________
-void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
-  Int_t index = -1;
-
+void AliESDtrack::GetIntegratedTimes(Double_t *times, Int_t nspec) const 
+{
+  // get integrated time for requested N species
+  if (nspec<1) return;
   if(fNtofClusters>0 && GetESDEvent()){
     TObjArray *tofclArray = GetESDEvent()->GetTOFcluster();
     AliESDTOFcluster *tofcl = (AliESDTOFcluster *) tofclArray->At(fTOFcluster[0]);
-
-    for(Int_t i=0;i < tofcl->GetNMatchableTracks();i++){
-      if(tofcl->GetTrackIndex(i) == GetID()) index = i;
-    }
-    if(fNtofClusters>0 && index > -1){
-      for (Int_t i=0; i<AliPID::kSPECIESC; i++) times[i]=tofcl->GetIntegratedTime(i,index);
-      return;
+    //
+    for(int i=tofcl->GetNMatchableTracks();i--;){
+      if(tofcl->GetTrackIndex(i) == GetID()) {
+       for (int j=nspec; j--;) times[j]=tofcl->GetIntegratedTime(j,i);
+       return;
+      }
     }
   }
   else if(fNtofClusters>0) 
@@ -1857,9 +1859,10 @@ void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
 
   // Returns the array with integrated times for each particle hypothesis
   if(fTrackTime)
-    for (Int_t i=0; i<AliPID::kSPECIESC; i++) times[i]=fTrackTime[i];
+    for (int i=nspec; i--;) times[i]=fTrackTime[i];
   else
-    for (Int_t i=0; i<AliPID::kSPECIESC; i++) times[i]=0.0;
+    for (int i=AliPID::kSPECIESC; i--;) times[i]=0.0;
+  //
 }
 //_______________________________________________________________________
 Double_t AliESDtrack::GetIntegratedLength() const{
@@ -1881,15 +1884,16 @@ Double_t AliESDtrack::GetIntegratedLength() const{
 }
 
 //_______________________________________________________________________
-void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
+void AliESDtrack::SetIntegratedTimes(const Double_t *times) 
+{
   // Sets the array with integrated times for each particle hypotesis
-  if(!fTrackTime)
-    fTrackTime = new Double32_t[AliPID::kSPECIESC];
-  for (Int_t i=0; i<AliPID::kSPECIESC; i++) fTrackTime[i]=times[i];
+  if(!fTrackTime) fTrackTime = new Double32_t[AliPID::kSPECIESC];
+  for (int i=AliPID::kSPECIESC; i--;) fTrackTime[i]=times[i];
 }
 
 //_______________________________________________________________________
-void AliESDtrack::SetITSpid(const Double_t *p) {
+void AliESDtrack::SetITSpid(const Double_t *p) 
+{
   // Sets values for the probability of each particle type (in ITS)
   if (!fITSr) fITSr = new Double32_t[AliPID::kSPECIESC];
   SetPIDValues(fITSr,p,AliPID::kSPECIES);
index e250a70..3eb3474 100644 (file)
@@ -86,7 +86,7 @@ public:
 
   Double_t GetIntegratedLength() const;
   Double_t GetIntegratedLengthOld() const {return fTrackLength;}
-  void GetIntegratedTimes(Double_t *times) const;
+  void GetIntegratedTimes(Double_t *times, Int_t nspec=AliPID::kSPECIES) const;
   Double_t GetIntegratedTimesOld(Int_t i) const {if(fTrackTime) return fTrackTime[i]; else return 0;};
   Int_t    GetPID(Bool_t tpcOnly=kFALSE)  const;
   Int_t    GetTOFBunchCrossing(Double_t b=0, Bool_t pidTPConly=kTRUE) const;
index 4b47a35..4c1a380 100644 (file)
@@ -168,11 +168,11 @@ Double_t AliKalmanTrack::GetIntegratedTime(Int_t pdg) const
   return 0;
 }
 
-void AliKalmanTrack::GetIntegratedTimes(Double_t *times) const {
-  for (Int_t i=0; i<AliPID::kSPECIESC; i++) times[i]=fIntegratedTime[i];
+void AliKalmanTrack::GetIntegratedTimes(Double_t *times, Int_t nspec) const {
+  for (Int_t i=nspec; i--;) times[i]=fIntegratedTime[i];
 }
 
 void AliKalmanTrack::SetIntegratedTimes(const Double_t *times) {
-  for (Int_t i=0; i<AliPID::kSPECIESC; i++) fIntegratedTime[i]=times[i];
+  for (Int_t i=AliPID::kSPECIESC; i--;) fIntegratedTime[i]=times[i];
 }
 
index 07bd5dd..98a879d 100644 (file)
@@ -69,7 +69,7 @@ public:
 
   virtual Bool_t IsStartedTimeIntegral() const {return fStartTimeIntegral;}
   virtual void AddTimeStep(Double_t length);
-  void GetIntegratedTimes(Double_t *times) const;
+  void GetIntegratedTimes(Double_t *times, Int_t nspec=AliPID::kSPECIESC) const;
   Double_t GetIntegratedTime(Int_t pdg) const;
   Double_t GetIntegratedLength() const {return fIntegratedLength;}
 
index c820d3e..03ed491 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliRawReader.h"
 #include "AliESDVZERO.h"
 #include "AliMultiplicity.h" 
+#include "AliPID.h"
 
 ClassImp(AliGlobalQADataMaker)
  
@@ -439,10 +440,10 @@ void AliGlobalQADataMaker::MakeESDs(AliESDEvent * event) {
          Float_t dz[2];
          track->GetDZ(xv,yv,zv,esd->GetMagneticField(),dz);
          if (dz[1]<3.) {
-            Double_t times[10];
-            track->GetIntegratedTimes(times);
-            Double_t tof=track->GetTOFsignal()/*-847055 -1771207*/;
-            FillESDsData(kPid2,times[2]-tof);
+          Double_t times[AliPID::kSPECIESC];
+          track->GetIntegratedTimes(times);
+          Double_t tof=track->GetTOFsignal()/*-847055 -1771207*/;
+          FillESDsData(kPid2,times[AliPID::kPion]-tof);
         }
       }
     }
index 73f4b07..da46aa7 100644 (file)
@@ -183,7 +183,7 @@ Double_t AliTOFPIDResponse::GetExpectedSignal(const AliVTrack* track,AliPID::EPa
   // If the operation is not possible, return a negative value.
   //
   Double_t expt[AliPID::kSPECIESC];
-  track->GetIntegratedTimes(expt);
+  track->GetIntegratedTimes(expt,AliPID::kSPECIESC);
   if (type<=AliPID::kProton) return expt[type];
   else {
     if (expt[type]<1.E-1) {
index a4a2617..ad5cd14 100644 (file)
@@ -73,3 +73,5 @@ void AliVTrack::GetBxByBz(Double_t b[3]) const
   return;
 }
 
+//________________________________________________________
+void AliVTrack::GetIntegratedTimes(Double_t */*times*/, Int_t /*nspec*/) const { return; }
index 4da6985..b928d06 100644 (file)
@@ -12,6 +12,7 @@
 #include <TBits.h>
 
 #include "AliVParticle.h"
+#include "AliPID.h"
 
 class AliVEvent;
 class AliVVertex;
@@ -19,6 +20,7 @@ class AliExternalTrackParam;
 class AliTPCdEdxInfo;
 class AliDetectorPID;
 class AliTOFHeader;
+
  
 class AliVTrack: public AliVParticle {
 
@@ -129,7 +131,7 @@ public:
   
   virtual Bool_t GetOuterHmpPxPyPz(Double_t */*p*/) const {return kFALSE;}
   
-  virtual void      GetIntegratedTimes(Double_t */*times*/) const { return; }
+  virtual void      GetIntegratedTimes(Double_t */*times*/, Int_t nspec=AliPID::kSPECIESC) const;
   virtual Double_t  GetTRDmomentum(Int_t /*plane*/, Double_t */*sp*/=0x0) const {return 0.;}
   virtual void      GetHMPIDpid(Double_t */*p*/) const {;}
   virtual Double_t  GetIntegratedLength() const { return 0.;}
index cbb45ce..4e66b4c 100644 (file)
@@ -430,7 +430,7 @@ void AliTOFCalibTask::UserExec(Option_t * /*opt*/)
     Float_t time = t->GetTOFsignalRaw();
     AliDebug(2,Form(" track # %i in channel %i, time = %f \n",ntrk,ich,time)); 
     Double_t expTime[AliPID::kSPECIESC]; 
-    t->GetIntegratedTimes(expTime);
+    t->GetIntegratedTimes(expTime,AliPID::kSPECIESC);
     Float_t expTimePi = expTime[2]*1.E-3;
     Float_t expTimeKa = expTime[3]*1.E-3;
     Float_t expTimePr = expTime[4]*1.E-3;
index 8c3c8fa..701e110 100644 (file)
@@ -387,7 +387,8 @@ Double_t * AliTOFT0v1::DefineT0(Option_t *option,Float_t pMinCut,Float_t pMaxCut
          Double_t time=t->GetTOFsignal();
          
          time*=1.E-3; // tof given in nanoseconds         
-         Double_t exptime[AliPID::kSPECIESC]; t->GetIntegratedTimes(exptime);
+         Double_t exptime[AliPID::kSPECIESC]; 
+         t->GetIntegratedTimes(exptime,AliPID::kSPECIESC);
          Double_t toflen=t->GetIntegratedLength();
          toflen=toflen/100.; // toflen given in m 
          
@@ -772,7 +773,7 @@ Bool_t AliTOFT0v1::CheckTPCMatching(AliESDtrack *track,Int_t imass) const{
     Bool_t status = kFALSE;
     
     Double_t exptimes[AliPID::kSPECIESC];
-    track->GetIntegratedTimes(exptimes);
+    track->GetIntegratedTimes(exptimes,AliPID::kSPECIESC);
     
     Float_t dedx = track->GetTPCsignal();
     
index fff1402..6f1cf01 100644 (file)
@@ -2413,7 +2413,7 @@ AliTOFcalib::CalibrateESD(AliESDEvent *event)
     /* correct expected time */
     if (fCorrectTExp) {
       /* get integrated times */
-      track->GetIntegratedTimes(texp);
+      track->GetIntegratedTimes(texp,AliPID::kSPECIESC);
       /* loop over particle types and correct expected time */
       for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
        texp[ipart] += fResponseParams->EvalTExpCorr(ipart, track->P());
@@ -2515,7 +2515,7 @@ AliTOFcalib::CalibrateTExp(AliESDEvent *event) const
     if (!track || !(track->GetStatus() & AliESDtrack::kTOFout)) continue;
 
     /* get integrated times */
-    track->GetIntegratedTimes(texp);
+    track->GetIntegratedTimes(texp,AliPID::kSPECIESC);
     /* loop over particle types and correct expected time */
     for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
       texp[ipart] += fResponseParams->EvalTExpCorr(ipart, track->P());
index 4b853c9..a982ae1 100644 (file)
@@ -294,7 +294,7 @@ Int_t AliTOFtracker::PropagateBack(AliESDEvent * const event) {
          Double_t time[AliPID::kSPECIESC]; t->GetIntegratedTimes(time);
        */
 
-       Double_t time[AliPID::kSPECIESC]; seed->GetIntegratedTimes(time);
+       Double_t time[AliPID::kSPECIESC]; seed->GetIntegratedTimes(time,AliPID::kSPECIESC);
        t->SetIntegratedTimes(time);
 
        Double_t length =  seed->GetIntegratedLength();
index 7e1dc3b..97a7eba 100644 (file)
@@ -245,7 +245,7 @@ Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent * const event) {
          Double_t time[AliPID::kSPECIESC]; t->GetIntegratedTimes(time);
        */
 
-       Double_t time[AliPID::kSPECIESC]; seed->GetIntegratedTimes(time);
+       Double_t time[AliPID::kSPECIESC]; seed->GetIntegratedTimes(time,AliPID::kSPECIESC);
        t->SetIntegratedTimes(time);
 
        Double_t length =  seed->GetIntegratedLength();
@@ -536,7 +536,7 @@ void AliTOFtrackerV1::MatchTracks( ){
     }
 
     fnmatch++;
-    AliDebug(1,Form(" Matched TOF cluster %d for the track number %d: %d",idclus,iseed));
+    AliDebug(1,Form(" Matched TOF cluster %d for the track number %d",idclus,iseed));
 
     AliDebug(3, Form("%7i     %7i     %10i     %10i  %10i  %10i      %7i",
                     iseed,
index 192d063..55594f5 100644 (file)
@@ -1,45 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
@@ -293,7 +251,7 @@ Int_t AliTOFtrackerV2::PropagateBack(AliESDEvent * const event) {
                        covB[14],covA[14]
                        ));
        */
-       Double_t time[AliPID::kSPECIESC]; t->GetIntegratedTimes(time);
+       Double_t time[AliPID::kSPECIESC]; t->GetIntegratedTimes(time,AliPID::kSPECIESC);
        AliDebug(2,Form(" TOF params: %6d  %f %f %f %f %f %6d %3d %f",
                        i,
                        t->GetTOFsignalRaw(),t->GetTOFsignal(),t->GetTOFsignalToT(),
@@ -480,7 +438,7 @@ void AliTOFtrackerV2::MatchTracks() {
     AliESDtrack *t =(AliESDtrack*)fSeeds->At(track->GetSeedIndex());
     AliTOFtrack *trackTOFin = new AliTOFtrack(*track);
 
-    Double_t timesOr[AliPID::kSPECIESC]; t->GetIntegratedTimes(timesOr); // in ps
+    Double_t timesOr[AliPID::kSPECIESC]; t->GetIntegratedTimes(timesOr,AliPID::kSPECIESC); // in ps
 
     // Determine a window around the track
     Double_t x,par[5]; 
index 5398c2b..1401cca 100644 (file)
@@ -202,7 +202,9 @@ AliTPCtrack::AliTPCtrack(const AliESDtrack& t, TTreeSRedirector *pcstream) :
 
   if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
   StartTimeIntegral();
-  Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
+  Double_t times[AliPID::kSPECIESC]; 
+  t.GetIntegratedTimes(times,AliPID::kSPECIESC); 
+  SetIntegratedTimes(times);
   SetIntegratedLength(t.GetIntegratedLength());
 
   if (GetX()>oldX) {
index aceb181..52090dc 100644 (file)
@@ -159,8 +159,8 @@ AliTRDtrackV1::AliTRDtrackV1(const AliESDtrack &t) : AliKalmanTrack()
 
   if(t.GetStatus() & AliESDtrack::kTIME) {
     StartTimeIntegral();
-    Double_t times[10]; 
-    t.GetIntegratedTimes(times); 
+    Double_t times[AliPID::kSPECIESC]; 
+    t.GetIntegratedTimes(times,AliPID::kSPECIESC); 
     SetIntegratedTimes(times);
     SetIntegratedLength(t.GetIntegratedLength());
   }