]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.h
Corrected end-of-line behavior
[u/mrichter/AliRoot.git] / PWGCF / EBYE / BalanceFunctions / AliAnalysisTaskBFPsi.h
index 06e5a2cbfea0a861466a2d788b10882de6be66e1..6e6f6da4c7f148c3b61cf8fa23ea46002db02e3e 100755 (executable)
-#ifndef ALIANALYSISTASKBFPSI_H\r
-#define ALIANALYSISTASKBFPSI_H\r
-\r
-// Analysis task for the BF vs Psi code\r
-// Authors: Panos Cristakoglou@cern.ch\r
-\r
-class TList;\r
-class TH1F;\r
-class TH2F;\r
-class TH3F; \r
-class TF1;\r
-class TH3D;\r
-\r
-class AliBalancePsi;\r
-class AliESDtrackCuts;\r
-class AliEventPoolManager;\r
-\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-#include "AliBalancePsi.h"\r
-\r
-#include "AliPID.h"  \r
-#include "AliPIDResponse.h"\r
-#include "AliPIDCombined.h"\r
\r
-//================================correction\r
-#define kCENTRALITY 101  \r
-//const Double_t centralityArrayForPbPb[kCENTRALITY+1] = {0.,5.,10.,20.,30.,40.,50.,60.,70.,80.};\r
-//const TString centralityArrayForPbPb_string[kCENTRALITY] = {"0-5","5-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80"};\r
-//================================correction\r
-\r
-class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {\r
- public:\r
-  AliAnalysisTaskBFPsi(const char *name = "AliAnalysisTaskBFPsi");\r
-  virtual ~AliAnalysisTaskBFPsi(); \r
-   \r
-  virtual void   UserCreateOutputObjects();\r
-  virtual void   UserExec(Option_t *option);\r
-  virtual void   FinishTaskOutput();\r
-  virtual void   Terminate(Option_t *);\r
-\r
-  //========================correction\r
-  virtual void   SetInputCorrection(TString filename, \r
-                                   Int_t nCentralityBins, \r
-                                   Double_t *centralityArrayForCorrections);\r
-  //========================correction\r
-  // void SetDebugLevel() {fDebugLevel = kTRUE;} //hides overloaded virtual function\r
-\r
-  void SetAnalysisObject(AliBalancePsi *const analysis) {\r
-    fBalance         = analysis;\r
-    }\r
-  void SetShufflingObject(AliBalancePsi *const analysisShuffled) {\r
-    fRunShuffling = kTRUE;\r
-    fShuffledBalance = analysisShuffled;\r
-  }\r
-  void SetMixingObject(AliBalancePsi *const analysisMixed) {\r
-    fRunMixing = kTRUE;\r
-    fMixedBalance = analysisMixed;\r
-  }\r
-  void SetMixingWithEventPlane(Bool_t bMixingWithEventPlane = kTRUE) { fRunMixingEventPlane = bMixingWithEventPlane; }\r
-  void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }\r
-  void SetAnalysisCutObject(AliESDtrackCuts *const trackCuts) {\r
-    fESDtrackCuts = trackCuts;}\r
-  void SetVertexDiamond(Double_t vx, Double_t vy, Double_t vz) {\r
-    fVxMax = vx;\r
-    fVyMax = vy;\r
-    fVzMax = vz;\r
-  }\r
-\r
-  //==============AOD analysis==============//\r
-  void SetAODtrackCutBit(Int_t bit){\r
-    fnAODtrackCutBit = bit;\r
-  }\r
-\r
-  void SetKinematicsCutsAOD(Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax){\r
-    fPtMin  = ptmin;  fPtMax  = ptmax;\r
-    fEtaMin = etamin; fEtaMax = etamax;\r
-  }\r
-\r
-  void SetExtraDCACutsAOD(Double_t DCAxy, Double_t DCAz){\r
-    fDCAxyCut  = DCAxy;\r
-    fDCAzCut = DCAz;\r
-  }\r
-\r
-   void SetExtraTPCCutsAOD(Double_t maxTPCchi2, Int_t minNClustersTPC){\r
-    fTPCchi2Cut      = maxTPCchi2;\r
-    fNClustersTPCCut = minNClustersTPC;\r
-  }\r
-\r
-  //==============MC analysis==============//\r
-  void SetKinematicsCutsMC(Double_t ptmin, Double_t ptmax,\r
-                           Double_t etamin, Double_t etamax){\r
-    fPtMin  = ptmin; fPtMax  = ptmax;\r
-    fEtaMin = etamin; fEtaMax = etamax;\r
-  }\r
-  void UseFlowAfterBurner(TF1 *gDifferentialV2) {\r
-    fDifferentialV2 = gDifferentialV2;\r
-    fUseFlowAfterBurner = kTRUE;\r
-  }\r
-  void ExcludeResonancesInMC() {fExcludeResonancesInMC = kTRUE;}\r
-  void ExcludeElectronsInMC()  {fExcludeElectronsInMC = kTRUE;}\r
-\r
-  void SetPDGCode(Int_t gPdgCode) {\r
-    fUseMCPdgCode = kTRUE;\r
-    fPDGCodeToBeAnalyzed = gPdgCode;\r
-  }\r
-\r
-  //Centrality\r
-  void SetCentralityEstimator(const char* centralityEstimator) {fCentralityEstimator = centralityEstimator;}\r
-  const char* GetCentralityEstimator(void)  const              {return fCentralityEstimator;}\r
-  void SetCentralityPercentileRange(Double_t min, Double_t max) { \r
-    fUseCentrality = kTRUE;\r
-    fCentralityPercentileMin=min;\r
-    fCentralityPercentileMax=max;\r
-  }\r
-  void SetImpactParameterRange(Double_t min, Double_t max) { \r
-    fUseCentrality = kTRUE;\r
-    fImpactParameterMin=min;\r
-    fImpactParameterMax=max;\r
-  }\r
-\r
-  //multiplicity\r
-  void SetMultiplicityEstimator(const char* multiplicityEstimator) {fMultiplicityEstimator = multiplicityEstimator;}\r
-  const char* GetMultiplicityEstimator(void)  const              {return fMultiplicityEstimator;}\r
-  void SetMultiplicityRange(Double_t min, Double_t max) {\r
-    fUseMultiplicity = kTRUE;\r
-    fNumberOfAcceptedTracksMin = min;\r
-    fNumberOfAcceptedTracksMax = max;}\r
-  \r
-  // additional event cuts (default = kFALSE)\r
-  void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}\r
-  void CheckFirstEventInChunk() {fCheckFirstEventInChunk = kTRUE;}\r
-  void CheckPileUp() {fCheckPileUp = kTRUE;}\r
-  void CheckPrimaryFlagAOD() {fCheckPrimaryFlagAOD = kTRUE;}\r
-  void UseMCforKinematics() {fUseMCforKinematics = kTRUE;}\r
-  void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }\r
-  Bool_t AcceptEventCentralityWeight(Double_t centrality);\r
-\r
-  \r
-  //Acceptance filter\r
-  void SetAcceptanceParameterization(TF1 *parameterization) {\r
-    fAcceptanceParameterization = parameterization;}\r
-\r
-  //pid\r
-  enum kDetectorUsedForPID { kTPCpid, kTOFpid, kTPCTOF }; // default TPC & TOF pid (via GetTPCpid & GetTOFpid)  \r
-  enum kParticleOfInterest { kMuon, kElectron, kPion, kKaon, kProton };  \r
-\r
-  void SetUseBayesianPID(Double_t gMinProbabilityValue) {\r
-    fUsePID = kTRUE; fUsePIDnSigma = kFALSE; fUsePIDPropabilities = kTRUE;\r
-    fMinAcceptedPIDProbability = gMinProbabilityValue; }\r
-\r
-  void SetUseNSigmaPID(Double_t gMaxNSigma) {\r
-    fUsePID = kTRUE; fUsePIDPropabilities = kFALSE; fUsePIDnSigma = kTRUE;\r
-    fPIDNSigma = gMaxNSigma; }\r
-\r
-  void SetParticleOfInterest(kParticleOfInterest poi) {\r
-    fParticleOfInterest = poi;}\r
-  void SetDetectorUsedForPID(kDetectorUsedForPID detConfig) {\r
-    fPidDetectorConfig = detConfig;}\r
-    void SetEventClass(TString receivedEventClass){\r
-        fEventClass = receivedEventClass;\r
-    }\r
-    \r
-  void SetCustomBinning(TString receivedCustomBinning) { fCustomBinning = receivedCustomBinning; }\r
-\r
-\r
-    // electron rejection\r
-    void SetElectronRejection(Double_t gMaxNSigma){\r
-      fElectronRejection = kTRUE;\r
-      fElectronRejectionNSigma = gMaxNSigma;\r
-    }\r
-\r
-    void SetElectronOnlyRejection(Double_t gMaxNSigma){\r
-      fElectronRejection       = kTRUE;\r
-      fElectronOnlyRejection   = kTRUE;\r
-      fElectronRejectionNSigma = gMaxNSigma;\r
-    }\r
-\r
-    void SetElectronRejectionPt(Double_t minPt,Double_t maxPt){\r
-      fElectronRejectionMinPt  = minPt;\r
-      fElectronRejectionMaxPt  = maxPt;\r
-    }\r
-\r
-    void SetVZEROCalibrationFile(const char* filename, const char* lhcPeriod);\r
-\r
- private:\r
-  Double_t    IsEventAccepted(AliVEvent* event);\r
-  Double_t    GetRefMultiOrCentrality(AliVEvent* event);\r
-  Double_t    GetReferenceMultiplicityFromAOD(AliVEvent* event);\r
-  Double_t    GetEventPlane(AliVEvent* event);\r
-  //===============================correction\r
-  Double_t    GetTrackbyTrackCorrectionMatrix(Double_t vEta, \r
-                                             Double_t vPhi, \r
-                                             Double_t vPt, \r
-                                             Short_t vCharge, \r
-                                             Double_t gCentrality);\r
-  //===============================correction\r
-  TObjArray* GetAcceptedTracks(AliVEvent* event, Double_t gCentrality, Double_t gReactionPlane);\r
-  TObjArray* GetShuffledTracks(TObjArray* tracks, Double_t gCentrality);\r
-\r
-  Double_t GetChannelEqualizationFactor(Int_t run, Int_t channel);\r
-  Double_t GetEqualizationFactor(Int_t run, const char *side);\r
\r
-  Bool_t fDebugLevel; // debug level\r
-\r
-  TClonesArray* fArrayMC; //! AOD object  //+++++++++++++++++++++\r
-  AliBalancePsi *fBalance; //BF object\r
-  Bool_t fRunShuffling;//run shuffling or not\r
-  AliBalancePsi *fShuffledBalance; //BF object (shuffled)\r
-  Bool_t fRunMixing;//run mixing or not\r
-  Bool_t fRunMixingEventPlane;//run mixing with Event Plane\r
-  Int_t  fMixingTracks;\r
-  AliBalancePsi *fMixedBalance; //TriggeredBF object (mixed)\r
-  AliEventPoolManager*     fPoolMgr;         //! event pool manager\r
-\r
-  TList *fList; //fList object\r
-  TList *fListBF; //fList object\r
-  TList *fListBFS; //fList object\r
-  TList *fListBFM; //fList object\r
-  TList *fHistListPIDQA;  //! list of histograms\r
-\r
-  TH2F *fHistEventStats; //event stats\r
-  TH2F *fHistCentStats; //centrality stats\r
-  TH2F *fHistCentStatsUsed; //centrality stats USED +++++++++++++++++++++++\r
-  TH1F *fHistTriggerStats; //trigger stats\r
-  TH1F *fHistTrackStats; //Track filter bit stats\r
-  TH1F *fHistVx; //x coordinate of the primary vertex\r
-  TH1F *fHistVy; //y coordinate of the primary vertex\r
-  TH2F *fHistVz; //z coordinate of the primary vertex\r
-\r
-  TH2F *fHistTPCvsVZEROMultiplicity; //VZERO vs TPC reference multiplicity\r
-  TH2F *fHistVZEROSignal; //VZERO channel vs signal\r
-\r
-  TH2F *fHistEventPlane; //event plane distribution\r
-\r
-  TH2F *fHistClus;//number of clusters (QA histogram)\r
-  TH2F *fHistDCA;//DCA  (QA histogram)\r
-  TH2F *fHistChi2;//track chi2 (QA histogram)\r
-  TH2F *fHistPt;//transverse momentum (QA histogram)\r
-  TH2F *fHistEta;//pseudorapidity (QA histogram)\r
-  TH2F *fHistRapidity;//rapidity (QA histogram)\r
-  TH2F *fHistPhi;//phi (QA histogram)\r
-  TH3F *fHistEtaPhiPos;//eta-phi pos particles (QA histogram)                   \r
-  TH3F *fHistEtaPhiNeg;//eta-phi neg particles (QA histogram)\r
-  TH2F *fHistPhiBefore;//phi before v2 afterburner (QA histogram)\r
-  TH2F *fHistPhiAfter;//phi after v2 afterburner (QA histogram)\r
-  TH2F *fHistPhiPos;//phi for positive particles (QA histogram)\r
-  TH2F *fHistPhiNeg;//phi for negative particles (QA histogram)\r
-  TH2F *fHistV0M;//V0 multiplicities (QA histogram)\r
-  TH2F *fHistRefTracks;//reference track multiplicities (QA histogram)\r
-\r
-  //============PID============//\r
-  TH2D *fHistdEdxVsPTPCbeforePID;//TPC dEdx vs momentum before PID cuts (QA histogram)\r
-  TH2D *fHistBetavsPTOFbeforePID;//beta vs momentum before PID cuts (QA histogram)\r
-  TH2D *fHistProbTPCvsPtbeforePID; //TPC probability vs pT before PID cuts (QA histogram)\r
-  TH2D *fHistProbTOFvsPtbeforePID;//TOF probability vs pT before PID cuts (QA histogram)\r
-  TH2D *fHistProbTPCTOFvsPtbeforePID;//TOF/TPC probability vs pT before PID cuts (QA histogram)\r
-  TH2D *fHistNSigmaTPCvsPtbeforePID;//TPC nsigma vs pT before PID cuts (QA histogram)\r
-  TH2D *fHistNSigmaTOFvsPtbeforePID;//TOF nsigma vs pT before PID cuts (QA histogram)\r
-  TH2D *fHistBetaVsdEdXbeforePID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++\r
-  TH2D *fHistNSigmaTPCTOFvsPtbeforePID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++\r
-  TH2D *fHistdEdxVsPTPCafterPID;//TPC dEdx vs momentum after PID cuts (QA histogram)\r
-  TH2D *fHistBetavsPTOFafterPID;//beta vs momentum after PID cuts (QA histogram)\r
-  TH2D *fHistProbTPCvsPtafterPID; //TPC probability vs pT after PID cuts (QA histogram)\r
-  TH2D *fHistProbTOFvsPtafterPID;//TOF probability vs pT after PID cuts (QA histogram)\r
-  TH2D *fHistProbTPCTOFvsPtafterPID;//TOF/TPC probability vs pT after PID cuts (QA histogram)\r
-  TH2D *fHistNSigmaTPCvsPtafterPID;//TPC nsigma vs pT after PID cuts (QA histogram)\r
-  TH2D *fHistNSigmaTOFvsPtafterPID;//TOF nsigma vs pT after PID cuts (QA histogram)\r
-  TH2D *fHistBetaVsdEdXafterPID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++\r
-  TH2D *fHistNSigmaTPCTOFvsPtafterPID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++\r
-\r
-  TH2D *fHistdEdxVsPTPCbeforePIDelectron; //+++++++\r
-  TH2D *fHistNSigmaTPCvsPtbeforePIDelectron; //+++++++\r
-  TH2D *fHistdEdxVsPTPCafterPIDelectron; //+++++++\r
-  TH2D *fHistNSigmaTPCvsPtafterPIDelectron; //+++++++\r
-  \r
-  TH3F *fHistCorrectionPlus[kCENTRALITY]; //====correction\r
-  TH3F *fHistCorrectionMinus[kCENTRALITY]; //===correction\r
-  Double_t fCentralityArrayForCorrections[kCENTRALITY];\r
-  Int_t fCentralityArrayBinsForCorrections;\r
-\r
-  TH1* fCentralityWeights;                  // for centrality flattening\r
-\r
-  AliPIDResponse *fPIDResponse;     //! PID response object\r
-  AliPIDCombined       *fPIDCombined;     //! combined PID object\r
-  \r
-  kParticleOfInterest  fParticleOfInterest;//analyzed particle\r
-  kDetectorUsedForPID   fPidDetectorConfig;//used detector for PID\r
-\r
-  Bool_t fUsePID; //flag to use PID \r
-  Bool_t fUsePIDnSigma;//flag to use nsigma method for PID\r
-  Bool_t fUsePIDPropabilities;//flag to use probability method for PID\r
-  Double_t fPIDNSigma;//nsigma cut for PID\r
-  Double_t fMinAcceptedPIDProbability;//probability cut for PID\r
-\r
-  Bool_t   fElectronRejection;//flag to use electron rejection\r
-  Bool_t   fElectronOnlyRejection;//flag to use electron rejection with exclusive electron PID (no other particle in nsigma range)\r
-  Double_t fElectronRejectionNSigma;//nsigma cut for electron rejection\r
-  Double_t fElectronRejectionMinPt;//minimum pt for electron rejection (default = 0.)\r
-  Double_t fElectronRejectionMaxPt;//maximum pt for electron rejection (default = 1000.)\r
-  //============PID============//\r
-\r
-  AliESDtrackCuts *fESDtrackCuts; //ESD track cuts\r
-\r
-  TString fCentralityEstimator;      //"V0M","TRK","TKL","ZDC","FMD"\r
-  Bool_t fUseCentrality;//use the centrality (PbPb) or not (pp)\r
-  Double_t fCentralityPercentileMin;//centrality percentile min\r
-  Double_t fCentralityPercentileMax;//centrality percentile max\r
-  Double_t fImpactParameterMin;//impact parameter min (used for MC)\r
-  Double_t fImpactParameterMax;//impact parameter max (used for MC)\r
-\r
-  TString fMultiplicityEstimator;//"V0M","V0A","V0C","TPC"\r
-  Bool_t fUseMultiplicity;//use the multiplicity cuts\r
-  Double_t fNumberOfAcceptedTracksMin;//min. number of number of accepted tracks (used for the multiplicity dependence study - pp)\r
-  Double_t fNumberOfAcceptedTracksMax;//max. number of number of accepted tracks (used for the multiplicity dependence study - pp)\r
-  TH2F *fHistNumberOfAcceptedTracks;//hisot to store the number of accepted tracks\r
-  TH1F *fHistMultiplicity;//hisot to store the number of accepted tracks //++++++++++++++++++\r
-\r
-  Bool_t fUseOfflineTrigger;//Usage of the offline trigger selection\r
-  Bool_t fCheckFirstEventInChunk;//Usage of the "First Event in Chunk" check (not needed for new productions)\r
-  Bool_t fCheckPileUp;//Usage of the "Pile-Up" event check\r
-  Bool_t fCheckPrimaryFlagAOD;// Usage of check on AliAODtrack::kPrimary (default = OFF)\r
-  Bool_t fUseMCforKinematics;//Usage of MC information for filling the kinematics information of particles (only in MCAODrec mode)\r
-\r
-  Double_t fVxMax;//vxmax\r
-  Double_t fVyMax;//vymax\r
-  Double_t fVzMax;//vzmax\r
-\r
-  Int_t fnAODtrackCutBit;//track cut bit from track selection (only used for AODs)\r
-\r
-  Double_t fPtMin;//only used for AODs\r
-  Double_t fPtMax;//only used for AODs\r
-  Double_t fPtMinForCorrections;//only used for AODs\r
-  Double_t fPtMaxForCorrections;//only used for AODs\r
-  Double_t fPtBinForCorrections; //=================================correction\r
-  Double_t fEtaMin;//only used for AODs\r
-  Double_t fEtaMax;//only used for AODs\r
-  Double_t fEtaMinForCorrections;//only used for AODs\r
-  Double_t fEtaMaxForCorrections;//only used for AODs\r
-  Double_t fEtaBinForCorrections; //=================================correction\r
-  Double_t fPhiMin; //=================================correction \r
-  Double_t fPhiMax; //=================================correction\r
-  Double_t fPhiMinForCorrections;//only used for AODs\r
-  Double_t fPhiMaxForCorrections;//only used for AODs\r
-  Double_t fPhiBinForCorrections; //=================================correction\r
-\r
-  Double_t fDCAxyCut;//only used for AODs\r
-  Double_t fDCAzCut;//only used for AODs\r
-\r
-  Double_t fTPCchi2Cut;//only used for AODs\r
-  Int_t fNClustersTPCCut;//only used for AODs\r
-\r
-  TF1 *fAcceptanceParameterization;//acceptance filter used for MC\r
-\r
-  TF1 *fDifferentialV2;//pt-differential v2 (from real data)\r
-  Bool_t fUseFlowAfterBurner;//Usage of a flow after burner\r
-\r
-  Bool_t fExcludeResonancesInMC;//flag to exclude the resonances' decay products (and conversion) from the MC analysis\r
-  Bool_t fExcludeElectronsInMC;//flag to exclude the electrons from the MC analysis\r
-  Bool_t fUseMCPdgCode; //Boolean to analyze a set of particles in MC\r
-  Int_t fPDGCodeToBeAnalyzed; //Analyze a set of particles in MC\r
-  TString fEventClass; //Can be "EventPlane", "Centrality", "Multiplicity"\r
-  TString fCustomBinning;//for setting customized binning (for output AliTHn of AliBalancePsi)\r
-  \r
-  //VZERO calibration\r
-  TH1F *fHistVZEROAGainEqualizationMap;//VZERO calibration map\r
-  TH1F *fHistVZEROCGainEqualizationMap;//VZERO calibration map\r
-  TH2F *fHistVZEROChannelGainEqualizationMap; //VZERO calibration map\r
-\r
-  AliAnalysisTaskBFPsi(const AliAnalysisTaskBFPsi&); // not implemented\r
-  AliAnalysisTaskBFPsi& operator=(const AliAnalysisTaskBFPsi&); // not implemented\r
-  \r
-  ClassDef(AliAnalysisTaskBFPsi, 6); // example of analysis\r
-};\r
-\r
-\r
-\r
-#endif\r
+#ifndef ALIANALYSISTASKBFPSI_H
+#define ALIANALYSISTASKBFPSI_H
+
+// Analysis task for the BF vs Psi code
+// Authors: Panos Cristakoglou@cern.ch
+
+class TList;
+class TH1F;
+class TH2F;
+class TH3F; 
+class TF1;
+class TH3D;
+
+class AliBalancePsi;
+class AliESDtrackCuts;
+class AliEventPoolManager;
+
+
+#include "AliAnalysisTaskSE.h"
+#include "AliBalancePsi.h"
+
+#include "AliPID.h"  
+#include "AliPIDResponse.h"
+#include "AliPIDCombined.h"
+//================================correction
+#define kCENTRALITY 101  
+//const Double_t centralityArrayForPbPb[kCENTRALITY+1] = {0.,5.,10.,20.,30.,40.,50.,60.,70.,80.};
+//const TString centralityArrayForPbPb_string[kCENTRALITY] = {"0-5","5-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80"};
+//================================correction
+
+class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
+ public:
+  AliAnalysisTaskBFPsi(const char *name = "AliAnalysisTaskBFPsi");
+  virtual ~AliAnalysisTaskBFPsi(); 
+   
+  virtual void   UserCreateOutputObjects();
+  virtual void   UserExec(Option_t *option);
+  virtual void   FinishTaskOutput();
+  virtual void   Terminate(Option_t *);
+
+  //========================correction
+  virtual void   SetInputCorrection(TString filename, 
+                                   Int_t nCentralityBins, 
+                                   Double_t *centralityArrayForCorrections);
+  //========================correction
+  // void SetDebugLevel() {fDebugLevel = kTRUE;} //hides overloaded virtual function
+
+  void SetAnalysisObject(AliBalancePsi *const analysis) {
+    fBalance         = analysis;
+    }
+  void SetShufflingObject(AliBalancePsi *const analysisShuffled) {
+    fRunShuffling = kTRUE;
+    fShuffledBalance = analysisShuffled;
+  }
+  void SetMixingObject(AliBalancePsi *const analysisMixed) {
+    fRunMixing = kTRUE;
+    fMixedBalance = analysisMixed;
+  }
+  void SetMixingWithEventPlane(Bool_t bMixingWithEventPlane = kTRUE) { fRunMixingEventPlane = bMixingWithEventPlane; }
+  void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
+  void SetAnalysisCutObject(AliESDtrackCuts *const trackCuts) {
+    fESDtrackCuts = trackCuts;}
+  void SetVertexDiamond(Double_t vx, Double_t vy, Double_t vz) {
+    fVxMax = vx;
+    fVyMax = vy;
+    fVzMax = vz;
+  }
+
+  //==============AOD analysis==============//
+  void SetAODtrackCutBit(Int_t bit){
+    fnAODtrackCutBit = bit;
+  }
+
+  void SetKinematicsCutsAOD(Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax){
+    fPtMin  = ptmin;  fPtMax  = ptmax;
+    fEtaMin = etamin; fEtaMax = etamax;
+  }
+
+  void SetExtraDCACutsAOD(Double_t DCAxy, Double_t DCAz){
+    fDCAxyCut  = DCAxy;
+    fDCAzCut = DCAz;
+  }
+
+   void SetExtraTPCCutsAOD(Double_t maxTPCchi2, Int_t minNClustersTPC){
+    fTPCchi2Cut      = maxTPCchi2;
+    fNClustersTPCCut = minNClustersTPC;
+  }
+
+  //==============MC analysis==============//
+  void SetKinematicsCutsMC(Double_t ptmin, Double_t ptmax,
+                           Double_t etamin, Double_t etamax){
+    fPtMin  = ptmin; fPtMax  = ptmax;
+    fEtaMin = etamin; fEtaMax = etamax;
+  }
+  void UseFlowAfterBurner(TF1 *gDifferentialV2) {
+    fDifferentialV2 = gDifferentialV2;
+    fUseFlowAfterBurner = kTRUE;
+  }
+  void ExcludeResonancesInMC() {fExcludeResonancesInMC = kTRUE;}
+  void ExcludeElectronsInMC()  {fExcludeElectronsInMC = kTRUE;}
+
+  void SetPDGCode(Int_t gPdgCode) {
+    fUseMCPdgCode = kTRUE;
+    fPDGCodeToBeAnalyzed = gPdgCode;
+  }
+
+  //Centrality
+  void SetCentralityEstimator(const char* centralityEstimator) {fCentralityEstimator = centralityEstimator;}
+  const char* GetCentralityEstimator(void)  const              {return fCentralityEstimator;}
+  void SetCentralityPercentileRange(Double_t min, Double_t max) { 
+    fUseCentrality = kTRUE;
+    fCentralityPercentileMin=min;
+    fCentralityPercentileMax=max;
+  }
+  void SetImpactParameterRange(Double_t min, Double_t max) { 
+    fUseCentrality = kTRUE;
+    fImpactParameterMin=min;
+    fImpactParameterMax=max;
+  }
+
+  //multiplicity
+  void SetMultiplicityEstimator(const char* multiplicityEstimator) {fMultiplicityEstimator = multiplicityEstimator;}
+  const char* GetMultiplicityEstimator(void)  const              {return fMultiplicityEstimator;}
+  void SetMultiplicityRange(Double_t min, Double_t max) {
+    fUseMultiplicity = kTRUE;
+    fNumberOfAcceptedTracksMin = min;
+    fNumberOfAcceptedTracksMax = max;}
+  
+  // additional event cuts (default = kFALSE)
+  void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}
+  void CheckFirstEventInChunk() {fCheckFirstEventInChunk = kTRUE;}
+  void CheckPileUp() {fCheckPileUp = kTRUE;}
+  void CheckPrimaryFlagAOD() {fCheckPrimaryFlagAOD = kTRUE;}
+  void UseMCforKinematics() {fUseMCforKinematics = kTRUE;}
+  void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }
+  Bool_t AcceptEventCentralityWeight(Double_t centrality);
+
+  
+  //Acceptance filter
+  void SetAcceptanceParameterization(TF1 *parameterization) {
+    fAcceptanceParameterization = parameterization;}
+
+  //pid
+  enum kDetectorUsedForPID { kTPCpid, kTOFpid, kTPCTOF }; // default TPC & TOF pid (via GetTPCpid & GetTOFpid)  
+  enum kParticleOfInterest { kMuon, kElectron, kPion, kKaon, kProton };  
+
+  void SetUseBayesianPID(Double_t gMinProbabilityValue) {
+    fUsePID = kTRUE; fUsePIDnSigma = kFALSE; fUsePIDPropabilities = kTRUE;
+    fMinAcceptedPIDProbability = gMinProbabilityValue; }
+
+  void SetUseNSigmaPID(Double_t gMaxNSigma) {
+    fUsePID = kTRUE; fUsePIDPropabilities = kFALSE; fUsePIDnSigma = kTRUE;
+    fPIDNSigma = gMaxNSigma; }
+
+  void SetParticleOfInterest(kParticleOfInterest poi) {
+    fParticleOfInterest = poi;}
+  void SetDetectorUsedForPID(kDetectorUsedForPID detConfig) {
+    fPidDetectorConfig = detConfig;}
+    void SetEventClass(TString receivedEventClass){
+        fEventClass = receivedEventClass;
+    }
+    
+  void SetCustomBinning(TString receivedCustomBinning) { fCustomBinning = receivedCustomBinning; }
+
+
+    // electron rejection
+    void SetElectronRejection(Double_t gMaxNSigma){
+      fElectronRejection = kTRUE;
+      fElectronRejectionNSigma = gMaxNSigma;
+    }
+
+    void SetElectronOnlyRejection(Double_t gMaxNSigma){
+      fElectronRejection       = kTRUE;
+      fElectronOnlyRejection   = kTRUE;
+      fElectronRejectionNSigma = gMaxNSigma;
+    }
+
+    void SetElectronRejectionPt(Double_t minPt,Double_t maxPt){
+      fElectronRejectionMinPt  = minPt;
+      fElectronRejectionMaxPt  = maxPt;
+    }
+
+    void SetVZEROCalibrationFile(const char* filename, const char* lhcPeriod);
+
+ private:
+  Double_t    IsEventAccepted(AliVEvent* event);
+  Double_t    GetRefMultiOrCentrality(AliVEvent* event);
+  Double_t    GetReferenceMultiplicityFromAOD(AliVEvent* event);
+  Double_t    GetEventPlane(AliVEvent* event);
+  //===============================correction
+  Double_t    GetTrackbyTrackCorrectionMatrix(Double_t vEta, 
+                                             Double_t vPhi, 
+                                             Double_t vPt, 
+                                             Short_t vCharge, 
+                                             Double_t gCentrality);
+  //===============================correction
+  TObjArray* GetAcceptedTracks(AliVEvent* event, Double_t gCentrality, Double_t gReactionPlane);
+  TObjArray* GetShuffledTracks(TObjArray* tracks, Double_t gCentrality);
+
+  Double_t GetChannelEqualizationFactor(Int_t run, Int_t channel);
+  Double_t GetEqualizationFactor(Int_t run, const char *side);
+  Bool_t fDebugLevel; // debug level
+
+  TClonesArray* fArrayMC; //! AOD object  //+++++++++++++++++++++
+  AliBalancePsi *fBalance; //BF object
+  Bool_t fRunShuffling;//run shuffling or not
+  AliBalancePsi *fShuffledBalance; //BF object (shuffled)
+  Bool_t fRunMixing;//run mixing or not
+  Bool_t fRunMixingEventPlane;//run mixing with Event Plane
+  Int_t  fMixingTracks;
+  AliBalancePsi *fMixedBalance; //TriggeredBF object (mixed)
+  AliEventPoolManager*     fPoolMgr;         //! event pool manager
+
+  TList *fList; //fList object
+  TList *fListBF; //fList object
+  TList *fListBFS; //fList object
+  TList *fListBFM; //fList object
+  TList *fHistListPIDQA;  //! list of histograms
+
+  TH2F *fHistEventStats; //event stats
+  TH2F *fHistCentStats; //centrality stats
+  TH2F *fHistCentStatsUsed; //centrality stats USED +++++++++++++++++++++++
+  TH1F *fHistTriggerStats; //trigger stats
+  TH1F *fHistTrackStats; //Track filter bit stats
+  TH1F *fHistVx; //x coordinate of the primary vertex
+  TH1F *fHistVy; //y coordinate of the primary vertex
+  TH2F *fHistVz; //z coordinate of the primary vertex
+
+  TH2F *fHistTPCvsVZEROMultiplicity; //VZERO vs TPC reference multiplicity
+  TH2F *fHistVZEROSignal; //VZERO channel vs signal
+
+  TH2F *fHistEventPlane; //event plane distribution
+
+  TH2F *fHistClus;//number of clusters (QA histogram)
+  TH2F *fHistDCA;//DCA  (QA histogram)
+  TH2F *fHistChi2;//track chi2 (QA histogram)
+  TH2F *fHistPt;//transverse momentum (QA histogram)
+  TH2F *fHistEta;//pseudorapidity (QA histogram)
+  TH2F *fHistRapidity;//rapidity (QA histogram)
+  TH2F *fHistPhi;//phi (QA histogram)
+  TH3F *fHistEtaPhiPos;//eta-phi pos particles (QA histogram)                   
+  TH3F *fHistEtaPhiNeg;//eta-phi neg particles (QA histogram)
+  TH2F *fHistPhiBefore;//phi before v2 afterburner (QA histogram)
+  TH2F *fHistPhiAfter;//phi after v2 afterburner (QA histogram)
+  TH2F *fHistPhiPos;//phi for positive particles (QA histogram)
+  TH2F *fHistPhiNeg;//phi for negative particles (QA histogram)
+  TH2F *fHistV0M;//V0 multiplicities (QA histogram)
+  TH2F *fHistRefTracks;//reference track multiplicities (QA histogram)
+
+  //============PID============//
+  TH2D *fHistdEdxVsPTPCbeforePID;//TPC dEdx vs momentum before PID cuts (QA histogram)
+  TH2D *fHistBetavsPTOFbeforePID;//beta vs momentum before PID cuts (QA histogram)
+  TH2D *fHistProbTPCvsPtbeforePID; //TPC probability vs pT before PID cuts (QA histogram)
+  TH2D *fHistProbTOFvsPtbeforePID;//TOF probability vs pT before PID cuts (QA histogram)
+  TH2D *fHistProbTPCTOFvsPtbeforePID;//TOF/TPC probability vs pT before PID cuts (QA histogram)
+  TH2D *fHistNSigmaTPCvsPtbeforePID;//TPC nsigma vs pT before PID cuts (QA histogram)
+  TH2D *fHistNSigmaTOFvsPtbeforePID;//TOF nsigma vs pT before PID cuts (QA histogram)
+  TH2D *fHistBetaVsdEdXbeforePID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++
+  TH2D *fHistNSigmaTPCTOFvsPtbeforePID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++
+  TH2D *fHistdEdxVsPTPCafterPID;//TPC dEdx vs momentum after PID cuts (QA histogram)
+  TH2D *fHistBetavsPTOFafterPID;//beta vs momentum after PID cuts (QA histogram)
+  TH2D *fHistProbTPCvsPtafterPID; //TPC probability vs pT after PID cuts (QA histogram)
+  TH2D *fHistProbTOFvsPtafterPID;//TOF probability vs pT after PID cuts (QA histogram)
+  TH2D *fHistProbTPCTOFvsPtafterPID;//TOF/TPC probability vs pT after PID cuts (QA histogram)
+  TH2D *fHistNSigmaTPCvsPtafterPID;//TPC nsigma vs pT after PID cuts (QA histogram)
+  TH2D *fHistNSigmaTOFvsPtafterPID;//TOF nsigma vs pT after PID cuts (QA histogram)
+  TH2D *fHistBetaVsdEdXafterPID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++
+  TH2D *fHistNSigmaTPCTOFvsPtafterPID;//TPCTOF  before PID cuts (QA histogram)//+++++++++++++++++++++
+
+  TH2D *fHistdEdxVsPTPCbeforePIDelectron; //+++++++
+  TH2D *fHistNSigmaTPCvsPtbeforePIDelectron; //+++++++
+  TH2D *fHistdEdxVsPTPCafterPIDelectron; //+++++++
+  TH2D *fHistNSigmaTPCvsPtafterPIDelectron; //+++++++
+  
+  TH3F *fHistCorrectionPlus[kCENTRALITY]; //====correction
+  TH3F *fHistCorrectionMinus[kCENTRALITY]; //===correction
+  Double_t fCentralityArrayForCorrections[kCENTRALITY];
+  Int_t fCentralityArrayBinsForCorrections;
+
+  TH1* fCentralityWeights;                  // for centrality flattening
+
+  AliPIDResponse *fPIDResponse;     //! PID response object
+  AliPIDCombined       *fPIDCombined;     //! combined PID object
+  
+  kParticleOfInterest  fParticleOfInterest;//analyzed particle
+  kDetectorUsedForPID   fPidDetectorConfig;//used detector for PID
+
+  Bool_t fUsePID; //flag to use PID 
+  Bool_t fUsePIDnSigma;//flag to use nsigma method for PID
+  Bool_t fUsePIDPropabilities;//flag to use probability method for PID
+  Double_t fPIDNSigma;//nsigma cut for PID
+  Double_t fMinAcceptedPIDProbability;//probability cut for PID
+
+  Bool_t   fElectronRejection;//flag to use electron rejection
+  Bool_t   fElectronOnlyRejection;//flag to use electron rejection with exclusive electron PID (no other particle in nsigma range)
+  Double_t fElectronRejectionNSigma;//nsigma cut for electron rejection
+  Double_t fElectronRejectionMinPt;//minimum pt for electron rejection (default = 0.)
+  Double_t fElectronRejectionMaxPt;//maximum pt for electron rejection (default = 1000.)
+  //============PID============//
+
+  AliESDtrackCuts *fESDtrackCuts; //ESD track cuts
+
+  TString fCentralityEstimator;      //"V0M","TRK","TKL","ZDC","FMD"
+  Bool_t fUseCentrality;//use the centrality (PbPb) or not (pp)
+  Double_t fCentralityPercentileMin;//centrality percentile min
+  Double_t fCentralityPercentileMax;//centrality percentile max
+  Double_t fImpactParameterMin;//impact parameter min (used for MC)
+  Double_t fImpactParameterMax;//impact parameter max (used for MC)
+
+  TString fMultiplicityEstimator;//"V0M","V0A","V0C","TPC"
+  Bool_t fUseMultiplicity;//use the multiplicity cuts
+  Double_t fNumberOfAcceptedTracksMin;//min. number of number of accepted tracks (used for the multiplicity dependence study - pp)
+  Double_t fNumberOfAcceptedTracksMax;//max. number of number of accepted tracks (used for the multiplicity dependence study - pp)
+  TH2F *fHistNumberOfAcceptedTracks;//hisot to store the number of accepted tracks
+  TH1F *fHistMultiplicity;//hisot to store the number of accepted tracks //++++++++++++++++++
+
+  Bool_t fUseOfflineTrigger;//Usage of the offline trigger selection
+  Bool_t fCheckFirstEventInChunk;//Usage of the "First Event in Chunk" check (not needed for new productions)
+  Bool_t fCheckPileUp;//Usage of the "Pile-Up" event check
+  Bool_t fCheckPrimaryFlagAOD;// Usage of check on AliAODtrack::kPrimary (default = OFF)
+  Bool_t fUseMCforKinematics;//Usage of MC information for filling the kinematics information of particles (only in MCAODrec mode)
+
+  Double_t fVxMax;//vxmax
+  Double_t fVyMax;//vymax
+  Double_t fVzMax;//vzmax
+
+  Int_t fnAODtrackCutBit;//track cut bit from track selection (only used for AODs)
+
+  Double_t fPtMin;//only used for AODs
+  Double_t fPtMax;//only used for AODs
+  Double_t fPtMinForCorrections;//only used for AODs
+  Double_t fPtMaxForCorrections;//only used for AODs
+  Double_t fPtBinForCorrections; //=================================correction
+  Double_t fEtaMin;//only used for AODs
+  Double_t fEtaMax;//only used for AODs
+  Double_t fEtaMinForCorrections;//only used for AODs
+  Double_t fEtaMaxForCorrections;//only used for AODs
+  Double_t fEtaBinForCorrections; //=================================correction
+  Double_t fPhiMin; //=================================correction 
+  Double_t fPhiMax; //=================================correction
+  Double_t fPhiMinForCorrections;//only used for AODs
+  Double_t fPhiMaxForCorrections;//only used for AODs
+  Double_t fPhiBinForCorrections; //=================================correction
+
+  Double_t fDCAxyCut;//only used for AODs
+  Double_t fDCAzCut;//only used for AODs
+
+  Double_t fTPCchi2Cut;//only used for AODs
+  Int_t fNClustersTPCCut;//only used for AODs
+
+  TF1 *fAcceptanceParameterization;//acceptance filter used for MC
+
+  TF1 *fDifferentialV2;//pt-differential v2 (from real data)
+  Bool_t fUseFlowAfterBurner;//Usage of a flow after burner
+
+  Bool_t fExcludeResonancesInMC;//flag to exclude the resonances' decay products (and conversion) from the MC analysis
+  Bool_t fExcludeElectronsInMC;//flag to exclude the electrons from the MC analysis
+  Bool_t fUseMCPdgCode; //Boolean to analyze a set of particles in MC
+  Int_t fPDGCodeToBeAnalyzed; //Analyze a set of particles in MC
+  TString fEventClass; //Can be "EventPlane", "Centrality", "Multiplicity"
+  TString fCustomBinning;//for setting customized binning (for output AliTHn of AliBalancePsi)
+  
+  //VZERO calibration
+  TH1F *fHistVZEROAGainEqualizationMap;//VZERO calibration map
+  TH1F *fHistVZEROCGainEqualizationMap;//VZERO calibration map
+  TH2F *fHistVZEROChannelGainEqualizationMap; //VZERO calibration map
+
+  AliAnalysisTaskBFPsi(const AliAnalysisTaskBFPsi&); // not implemented
+  AliAnalysisTaskBFPsi& operator=(const AliAnalysisTaskBFPsi&); // not implemented
+  
+  ClassDef(AliAnalysisTaskBFPsi, 6); // example of analysis
+};
+
+
+
+#endif