#include <vector>
#include "AliCFManager.h"
#include "AliGammaConversionBGHandler.h"
+#include "AliESDpid.h"
class TClonesArray;
class TFormula;
class TChain;
class AliCFManager; // for CF
class AliCFContainer; // for CF
-class AliESDpid; // for dEdx cut based on nSigma to particle lines
+//class AliESDpid; // for dEdx cut based on nSigma to particle lines
class AliESDtrackCuts;
class AliV0Reader : public TObject {
kStepR = 10,
kStepLine = 11,
kStepZ = 12,
- kStepNDF = 13,
- kStepChi2 = 14,
- kStepEta = 15,
- kStepPt = 16,
- kStepTrueGamma = 17
+ kStepMinClsTPC = 13,
+ kStepSinglePt= 14,
+ kStepNDF = 15,
+ kStepChi2 = 16,
+ kStepEta = 17,
+ kStepPt = 18,
+ kStepTrueGamma = 19
};
AliV0Reader(); //constructor
*Initialize the reader
*/
void Initialize();
-
+ void SetInputAndMCEvent(AliVEvent* esd, AliMCEvent* mc) ;
+
+
+ virtual void SetInputEvent(AliVEvent* const input) {fESDEvent = dynamic_cast<AliESDEvent*>(input);}
+ virtual void SetMC(AliMCEvent* const mc) {fMCEvent = mc;}
+
// for CF
void SetCFManager(AliCFManager * const io){fCFManager = io;};
/*
*Returns the number of contributors to the vertex
*/
- Int_t GetNumberOfContributorsVtx() const{return fESDEvent->GetPrimaryVertex()->GetNContributors();}
+ // Int_t GetNumberOfContributorsVtx() const{return fESDEvent->GetPrimaryVertex()->GetNContributors();}
+ Int_t GetNumberOfContributorsVtx();
/*
* Check if there are any more good v0s left in the v0 stack
/*
* Returns the negative ESD track which belongs to fCurrentV0
*/
- AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
+ // AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
+ AliESDtrack* GetNegativeESDTrack(){return fCurrentNegativeESDTrack;}
/*
* Returns the positive ESD track which belongs to fCurrentV0
*/
- AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
+ // AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
+ AliESDtrack* GetPositiveESDTrack(){return fCurrentPositiveESDTrack;}
/*
* Returns the negative KF particle which belongs to fCurrentV0
* Checks if the PID of the two particles are within our cuts.
*/
void GetPIDProbability(Double_t &negPIDProb, Double_t &posPIDProb);
+
+ /*
+ * Checks if the PID of the two particles are within our cuts.
+ */
+ void GetPIDProbabilityMuonPion(Double_t &negPIDProb, Double_t &posPIDProb);
/*
*Get the negative MC TParticle from the stack
/*
* Setup AliMCEventHandler
*/
- AliMCEventHandler* GetMCTruth() const{return fMCTruth;} // for CF
+ // AliMCEventHandler* GetMCTruth() const{return fMCTruth;} // for CF
/*
/*
* Gets the Number of the TPC clusters of the negative track.
*/
- Double_t GetNegativeTracknTPCClusters() const{return fCurrentNegativeESDTrack->GetNcls(1);}
+ Int_t GetNegativeTracknTPCClusters() const{return fCurrentNegativeESDTrack->GetNcls(1);}
/*
* Gets the Number of the TPC clusters of the positive track.
*/
- Double_t GetPositiveTracknTPCClusters() const{return fCurrentPositiveESDTrack->GetNcls(1);}
+ Int_t GetPositiveTracknTPCClusters() const{return fCurrentPositiveESDTrack->GetNcls(1);}
+
+ /*
+ * Gets the Number of the TPC findable clusters of the negative track.
+ */
+ Int_t GetNegativeTracknTPCFClusters() const{return fCurrentNegativeESDTrack->GetTPCNclsF();}
+
+ /*
+ * Gets the Number of the TPC findable clusters of the positive track.
+ */
+ Int_t GetPositiveTracknTPCFClusters() const{return fCurrentPositiveESDTrack->GetTPCNclsF();}
+
/*
* Gets the Number of the ITS clusters of the negative track.
*/
- Double_t GetNegativeTracknITSClusters() const{return fCurrentNegativeESDTrack->GetNcls(0);}
+ Int_t GetNegativeTracknITSClusters() const{return fCurrentNegativeESDTrack->GetNcls(0);}
/*
* Gets the Number of the ITS clusters of the positive track.
*/
- Double_t GetPositiveTracknITSClusters() const{return fCurrentPositiveESDTrack->GetNcls(0);}
+ Int_t GetPositiveTracknITSClusters() const{return fCurrentPositiveESDTrack->GetNcls(0);}
+
+ /*
+ * Gets the chi2 of the TPC negative track.
+ */
+ Double_t GetNegativeTrackTPCchi2() const{return fCurrentNegativeESDTrack->GetTPCchi2();}
+
+ /*
+ * Gets the chi2 of the TPC the positive track.
+ */
+ Double_t GetPositiveTrackTPCchi2() const{return fCurrentPositiveESDTrack->GetTPCchi2();}
/*
* Update data which need to be updated every event.
*/
void UpdateEventByEventData();
+
+ /*
+ * Gets the MaxRCut value.
+ */
+ Double_t GetMaxVertexZ() const{return fMaxVertexZ;}
/*
* Gets the MaxRCut value.
*/
Double_t GetMaxRCut() const{return fMaxR;}
+
+ /*
+ * Gets the MinRCut value.
+ */
+ Double_t GetMinRCut() const{return fMinR;}
/*
* Gets the Eta cut value.
*/
Double_t GetEtaCut() const{return fEtaCut;}
+
+ /*
+ * Gets the Rapidity Meson cut value.
+ */
+ Double_t GetRapidityMesonCut() const{return fRapidityMesonCut;}
/*
* Gets the Pt cut value.
Double_t GetMaxZCut() const{return fMaxZ;}
+ /*
+ * Gets the MinClsTPC value.
+ */
+ Double_t GetMinClsTPCCut() const{return fMinClsTPC;}
+
+ /*
+ * Gets the MinClsTPC value.
+ */
+ Double_t GetMinClsTPCCutToF() const{return fMinClsTPCToF;}
+
+
+
/*
* Gets the line cut values.
*/
*/
Double_t GetChi2CutMeson() const{return fChi2CutMeson;}
+ /*
+ * Gets the alpha cut value for the mesons.
+ */
+ Double_t GetAlphaCutMeson() const{return fAlphaCutMeson;}
+
+ /*
+ * Gets the Minimum alpha cut value for the mesons.
+ */
+ Double_t GetAlphaMinCutMeson() const{return fAlphaMinCutMeson;}
+
Double_t GetPositiveTrackLength() const{return fCurrentPositiveESDTrack->GetIntegratedLength();}
Double_t GetNegativeTrackLength() const{return fCurrentNegativeESDTrack->GetIntegratedLength();}
Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();}
Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();}
+ /*
+ * Sets the MaxVertexZ value.
+ */
+ void SetMaxVertexZ(Double_t maxVertexZ){fMaxVertexZ=maxVertexZ;}
+
/*
* Sets the MaxRCut value.
*/
void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
-
+ /*
+ * Sets the MinRCut value.
+ */
+ void SetMinRCut(Double_t minR){fMinR=minR;}
+
/*
* Sets the EtaCut value.
*/
void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
+
+ /*
+ * Sets the Rapidity Meson Cut value.
+ */
+ void SetRapidityMesonCut(Double_t RapidityMesonCut){fRapidityMesonCut=RapidityMesonCut;}
/*
* Sets the PtCut value.
*/
void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
+ /*
+ * Sets the PtCut value.
+ */
+ void SetSinglePtCut(Double_t singleptCut){fSinglePtCut=singleptCut;}
+
/*
* Sets the MaxZCut value.
*/
void SetMaxZCut(Double_t maxZ){fMaxZ=maxZ;}
+ /*
+ * Sets the MinClsTPC value.
+ */
+ void SetMinClsTPCCut(Double_t minClsTPC){fMinClsTPC=minClsTPC;}
+
+ /*
+ * Sets the MinClsTPC value.
+ */
+ void SetMinClsTPCCutToF(Double_t minClsTPCToF){fMinClsTPCToF=minClsTPCToF;}
+
/*
* Sets the LineCut values.
*/
*/
void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;}
+ /*
+ * Sets the AlphaCut for the mesons.
+ */
+ void SetAlphaCutMeson(Double_t alpha){fAlphaCutMeson=alpha;}
+
+
+ /*
+ * Sets the AlphaCut for the mesons.
+ */
+ void SetAlphaMinCutMeson(Double_t alpha){fAlphaMinCutMeson=alpha;}
+
+
/*
* Sets the XVertexCut value.
*/
*/
void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;}
+ /*
+ * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+ */
+ void SetPIDMaxPnSigmaAbovePionLine(Double_t MaxPnSigmaAbovePion){fPIDMaxPnSigmaAbovePionLine=MaxPnSigmaAbovePion;}
+
/*
* Sets the SigmaMassCut value.
*/
void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
+ /*
+ * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p
+ */
+ void SetDoKaonRejectionLowP( Bool_t doKaonRejectionLowP){fDoKaonRejectionLowP=doKaonRejectionLowP;}
+ /*
+ * Sets the flag to enable/disable the cut dedx N sigma for Proton Rejection at low p
+ */
+ void SetDoProtonRejectionLowP( Bool_t doProtonRejectionLowP){fDoProtonRejectionLowP=doProtonRejectionLowP;}
+
+ /*
+ * Sets the flag to enable/disable the cut dedx N sigma for Pion Rejection at low p
+ */
+ void SetDoPionRejectionLowP( Bool_t doPionRejectionLowP){fDoPionRejectionLowP=doPionRejectionLowP;}
+
+ /*
+ * Sets the PIDMinPnSigmaAroundKaon cut value for the tracks.
+ */
+ void SetPIDnSigmaAtLowPAroundKaonLine(Double_t nSigmaAtLowPAroundKaon){fPIDnSigmaAtLowPAroundKaonLine =nSigmaAtLowPAroundKaon;}
+
+ /*
+ * Sets the PIDMinPnSigmaAroundProton cut value for the tracks.
+ */
+ void SetPIDnSigmaAtLowPAroundProtonLine(Double_t nSigmaAtLowPAroundProton){fPIDnSigmaAtLowPAroundProtonLine =nSigmaAtLowPAroundProton;}
+
+ /*
+ * Sets the PIDMinPnSigmaAroundPion cut value for the tracks.
+ */
+ void SetPIDnSigmaAtLowPAroundPionLine(Double_t nSigmaAtLowPAroundPion){fPIDnSigmaAtLowPAroundPionLine =nSigmaAtLowPAroundPion;}
+
+ /*
+ * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+ */
+ void SetPIDMinPKaonRejectionLowP(Double_t PIDMinPKaonRejectionLowP ){fPIDMinPKaonRejectionLowP=PIDMinPKaonRejectionLowP;}
+
+ /*
+ * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+ */
+ void SetPIDMinPProtonRejectionLowP(Double_t PIDMinPProtonRejectionLowP ){fPIDMinPProtonRejectionLowP=PIDMinPProtonRejectionLowP;}
+ /*
+ * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
+ */
+ void SetPIDMinPPionRejectionLowP(Double_t PIDMinPPionRejectionLowP ){fPIDMinPPionRejectionLowP=PIDMinPPionRejectionLowP;}
+
+ /*
+ *Set if we want to use Gamma Selection based on Qt from Armenteros
+ */
+ void SetDoQtGammaSelection(Bool_t doQtGammaSelection){fDoQtGammaSelection=doQtGammaSelection;}
+ /*
+ * Sets the MaxQtCut value.
+ */
+ void SetQtMax(Double_t qtMax){fQtMax=qtMax;}
/*
* Updates the V0 information of the current V0.
* Resets the V0 index.
*/
void ResetV0IndexNumber(){fCurrentV0IndexNumber=0;}
-
+
+
+ /*
+ * Returns number of good v0s in the event
+ */
+ Int_t GetNGoodV0s() const {return fNumberOfGoodV0s;}
+
/*
* Sets the histograms.
*/
*/
Bool_t CheckForPrimaryVertex();
+ /*
+ * Check for primary vertex Z.
+ */
+ Bool_t CheckForPrimaryVertexZ();
+
/*
* Gets a vector of good v0s.
*/
void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
+ void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
+
Bool_t GetHelixCenter(AliESDtrack* track, Double_t b,Int_t charge, Double_t center[2]);
Bool_t GetConvPosXY(AliESDtrack* ptrack,AliESDtrack* ntrack, Double_t b, Double_t convpos[2]);
Double_t GetConvPosZ(AliESDtrack* ptrack,AliESDtrack* ntrack, Double_t b);
+ Bool_t GetArmenterosQtAlfa(AliKFParticle * posKFparticle,AliKFParticle * negKFparticle,AliKFParticle * gamKFparticle,Double_t armenterosQtAlfa[2]);
+
void SetDoCF(Bool_t flag){fDoCF = flag;}
Bool_t CheckV0FinderStatus(Int_t index);
void SetESDtrackCuts(AliESDtrackCuts * const trackCuts){fEsdTrackCuts = trackCuts;}
+ void SetNEventsForBG(Int_t nev){nEventsForBGCalculation = nev;}
+
Int_t CountESDTracks();
Int_t GetCurrentV0IndexNumber() const {return fCurrentV0IndexNumber;}
Bool_t CheckIfPi0IsMother(Int_t label);
+ Bool_t CheckIfEtaIsMother(Int_t label);
+
+ static void InitESDpid(Int_t type=0);
+ static void SetESDpid(AliESDpid * const pid) {fgESDpid=pid;}
+ static AliESDpid* GetESDpid() {return fgESDpid;}
+
+ void SetUseChargedTracksMultiplicityForBG(Bool_t flag){fUseChargedTrackMultiplicityForBG = flag;}
+
+ Int_t GetPindex(Int_t i) {return fV0Pindex.at(i);}
+ Int_t GetNindex(Int_t i) {return fV0Nindex.at(i);}
+
+ void ResetNGoodV0s(){fNumberOfGoodV0s=0;}
+
private:
AliStack * fMCStack; // pointer to MonteCarlo particle stack
- AliMCEventHandler* fMCTruth; // for CF pointer to the MC object
+ // AliMCEventHandler* fMCTruth; // for CF pointer to the MC object
AliMCEvent *fMCEvent; // for CF pointer to MC event
TChain * fChain; // pointer to the TChain
- AliESDInputHandler* fESDHandler; //! pointer to esd object
+ // AliESDInputHandler* fESDHandler; //! pointer to esd object
AliESDEvent *fESDEvent; //! pointer to esd object
// AliCFContainer *container;
// for dEdx cut based on nSigma to a particle line
- AliESDpid * fESDpid; // esd pid
+ //AliESDpid * fESDpid; // esd pid
AliGammaConversionHistograms *fHistograms; // pointer to histogram handling class
Bool_t fUseKFParticle; // flag
Bool_t fUseESDTrack; // flag
Bool_t fDoMC; // flag
-
+
+ //Event Cuts
+ Double_t fMaxVertexZ;
//cuts
Double_t fMaxR; //r cut
+ Double_t fMinR; //r cut
Double_t fEtaCut; //eta cut
+ Double_t fRapidityMesonCut; //rapidity for meson cut
Double_t fPtCut; // pt cut
- Double_t fMaxZ; //z cut
+ Double_t fSinglePtCut; // pt cut for electron/positron
+ Double_t fMaxZ; //z cut
+ Double_t fMinClsTPC;
+ Double_t fMinClsTPCToF;
Double_t fLineCutZRSlope; //linecut
Double_t fLineCutZValue; //linecut
Double_t fChi2CutConversion; //chi2cut
Double_t fChi2CutMeson; //chi2cut
+ Double_t fAlphaCutMeson; //alphacut
+ Double_t fAlphaMinCutMeson; //alphacut
Double_t fPIDProbabilityCutNegativeParticle; //pid cut
Double_t fPIDProbabilityCutPositiveParticle; //pid cut
Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
Double_t fPIDnSigmaBelowElectronLine; // sigma cut
Double_t fPIDnSigmaAbovePionLine; // sigma cut
Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
+ Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
+ Double_t fDoKaonRejectionLowP; // Kaon rejection at low p
+ Double_t fDoProtonRejectionLowP; // Proton rejection at low p
+ Double_t fDoPionRejectionLowP; // Pion rejection at low p
+ Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
+ Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
+ Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
+ Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
+ Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
+ Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
+ Bool_t fDoQtGammaSelection; // Select gammas using qtMax
+ Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas
Double_t fXVertexCut; //vertex cut
Double_t fYVertexCut; //vertex cut
Double_t fZVertexCut; // vertexcut
Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
+ Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
+
Bool_t fDoCF; //flag
Bool_t fUseOnFlyV0Finder; //flag
Bool_t fUpdateV0AlreadyCalled; //flag
TClonesArray* fCurrentEventGoodV0s; //vector of good v0s
+
+ vector<Int_t> fV0Pindex;
+ vector<Int_t> fV0Nindex;
// vector<AliKFParticle> fPreviousEventGoodV0s; // vector of good v0s from prevous events
Bool_t fCalculateBackground; //flag
AliESDtrackCuts *fEsdTrackCuts; // track cuts
Int_t fNumberOfESDTracks; //track counter
- ClassDef(AliV0Reader,10)
+ static AliESDpid* fgESDpid; // ESD pid object
+
+ Int_t nEventsForBGCalculation;
+
+ Bool_t fUseChargedTrackMultiplicityForBG;
+ Int_t fNumberOfGoodV0s;
+
+ ClassDef(AliV0Reader,16)
};
+
+inline void AliV0Reader::InitESDpid(Int_t type)
+{
+ //
+ // initialize PID parameters
+ // type=0 is simulation
+ // type=1 is data
+
+ if (!fgESDpid) fgESDpid=new AliESDpid;
+ Double_t alephParameters[5];
+ // simulation
+ alephParameters[0] = 2.15898e+00/50.;
+ alephParameters[1] = 1.75295e+01;
+ alephParameters[2] = 3.40030e-09;
+ alephParameters[3] = 1.96178e+00;
+ alephParameters[4] = 3.91720e+00;
+ fgESDpid->GetTOFResponse().SetTimeResolution(80.);
+
+ // data
+ if (type==1){
+ alephParameters[0] = 0.0283086/0.97;
+ alephParameters[1] = 2.63394e+01;
+ alephParameters[2] = 5.04114e-11;
+ alephParameters[3] = 2.12543e+00;
+ alephParameters[4] = 4.88663e+00;
+ fgESDpid->GetTOFResponse().SetTimeResolution(130.);
+ fgESDpid->GetTPCResponse().SetMip(50.);
+ }
+
+ fgESDpid->GetTPCResponse().SetBetheBlochParameters(
+ alephParameters[0],alephParameters[1],alephParameters[2],
+ alephParameters[3],alephParameters[4]);
+
+ fgESDpid->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04);
+
+}
+
#endif
+
+