#include "AliKFParticle.h"
#include "AliESDVZERO.h"
#include "AliFlowCommonConstants.h"
+#include "AliAnalysisManager.h"
+#include "AliPIDResponse.h"
ClassImp(AliFlowTrackCuts)
fCurrCentr(0.0),
fVZEROgainEqualization(NULL),
fApplyRecentering(kFALSE),
- fVZEROgainEqualizationPerRing(kFALSE)
+ fVZEROgainEqualizationPerRing(kFALSE),
+ fPIDResponse(NULL),
+ fNsigmaCut2(9)
{
//io constructor
SetPriors(); //init arrays
fCurrCentr(0.0),
fVZEROgainEqualization(NULL),
fApplyRecentering(kFALSE),
- fVZEROgainEqualizationPerRing(kFALSE)
+ fVZEROgainEqualizationPerRing(kFALSE),
+ fPIDResponse(NULL),
+ fNsigmaCut2(9)
{
//constructor
SetTitle("AliFlowTrackCuts");
fCurrCentr(0.0),
fVZEROgainEqualization(NULL),
fApplyRecentering(that.fApplyRecentering),
- fVZEROgainEqualizationPerRing(that.fVZEROgainEqualizationPerRing)
+ fVZEROgainEqualizationPerRing(that.fVZEROgainEqualizationPerRing),
+ fPIDResponse(that.fPIDResponse),
+ fNsigmaCut2(that.fNsigmaCut2)
{
//copy constructor
printf(" \n\n claling copy ctor \n\n" );
}
for(Int_t i(0); i < 8; i++) fUseVZERORing[i] = that.fUseVZERORing[i];
+ fPIDResponse = that.fPIDResponse;
+ fNsigmaCut2 = that.fNsigmaCut2;
+
return *this;
}
fEvent=event;
fMCevent=mcEvent;
+ // Get PID response
+ AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+ if(man){
+ AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
+ if(inputHandler) fPIDResponse=inputHandler->GetPIDResponse();
+ }
+
//do the magic for ESD
AliESDEvent* myESD = dynamic_cast<AliESDEvent*>(event);
AliAODEvent* myAOD = dynamic_cast<AliAODEvent*>(event);
case kTPCbayesian:
if (!PassesTPCbayesianCut(track)) pass=kFALSE;
break;
+ case kTPCTOFNsigma:
+ if (!PassesTPCTOFNsigmaCut(track)) pass = kFALSE;
+ break;
default:
return kTRUE;
break;
// do a simple combined cut on the n sigma from tpc and tof
// with information of the pid response object (needs pid response task)
// stub, not implemented yet
+ if(!fPIDResponse) return kFALSE;
if(!track) return kFALSE;
- return kFALSE;
+
+ // check TOF status
+ if ((track->GetStatus()&AliVTrack::kTOFout)==0) return kFALSE;
+ if ((track->GetStatus()&AliVTrack::kTIME)==0) return kFALSE;
+
+ // check TPC status
+ if(track->GetTPCsignal() < 10) return kFALSE;
+
+ Float_t nsigmaTPC = fPIDResponse->NumberOfSigmas(AliPIDResponse::kTPC,track,fParticleID);
+ Float_t nsigmaTOF = fPIDResponse->NumberOfSigmas(AliPIDResponse::kTOF,track,fParticleID);
+
+ Float_t nsigma2 = nsigmaTPC*nsigmaTPC + nsigmaTOF*nsigmaTOF;
+
+ return (nsigma2 < fNsigmaCut2);
}
//-----------------------------------------------------------------------------
// do a simple combined cut on the n sigma from tpc and tof
// with information of the pid response object (needs pid response task)
// stub, not implemented yet
+ if(!fPIDResponse) return kFALSE;
if(!track) return kFALSE;
- return kFALSE;
+
+ // check TOF status
+ if ((track->GetStatus()&AliVTrack::kTOFout)==0) return kFALSE;
+ if ((track->GetStatus()&AliVTrack::kTIME)==0) return kFALSE;
+
+ // check TPC status
+ if(track->GetTPCsignal() < 10) return kFALSE;
+
+ Float_t nsigmaTPC = fPIDResponse->NumberOfSigmas(AliPIDResponse::kTPC,track,fParticleID);
+ Float_t nsigmaTOF = fPIDResponse->NumberOfSigmas(AliPIDResponse::kTOF,track,fParticleID);
+
+ Float_t nsigma2 = nsigmaTPC*nsigmaTPC + nsigmaTOF*nsigmaTOF;
+
+ return (nsigma2 < fNsigmaCut2);
}
class AliESDkink;
class AliESDv0;
class AliESDVZERO;
+class AliPIDResponse;
class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
}
Bool_t GetUseVZERORing(Int_t i) const {return fUseVZERORing[i];}
+ void SetNumberOfSigmas(Float_t val) {fNsigmaCut2 = val*val;};
+ Float_t GetNumberOfSigmas() const {return TMath::Sqrt(fNsigmaCut2);};
+
protected:
//AliFlowTrack* MakeFlowTrackSPDtracklet() const;
//AliFlowTrack* MakeFlowTrackPMDtrack() const;
Bool_t fUseVZERORing[8]; // kTRUE means the ring is included
static const Int_t fgkNumberOfVZEROtracks=64; //number of VZERO channels
- ClassDef(AliFlowTrackCuts,13)
+ AliPIDResponse *fPIDResponse; //! Pid reponse to manage Nsigma cuts
+ Float_t fNsigmaCut2; // Number of sigma^2 (cut value) for TPC+TOF nsigma cut
+
+ ClassDef(AliFlowTrackCuts,14)
};
#endif