]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGCF/Correlations/DPhi/TriggerPID/AliTwoParticlePIDCorr.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / TriggerPID / AliTwoParticlePIDCorr.h
index 27b27aa658a869db03e5a035385d6fc0d7903bea..baf60df5a18e00ef4e9dee6f9501e7f8fb7550a2 100644 (file)
@@ -13,14 +13,20 @@ class TList;
 //class AliESDtrackCuts;
 class TSeqCollection;
 class AliPIDResponse;
+class AliPIDCombined;  
 class AliAODEvent;
 class AliAODTrack;
 class AliAODVertex;
 class AliEventPoolManager;
 class TFormula;
-//class AliAnalysisUtils;
+class AliAnalysisUtils;
 class LRCParticlePID;
 class AliVParticle;
+class AliCFContainer;
+class AliCFGridSparse;
+class THnBase;
+class AliTHn;
+class TProfile;
 
 
 #include <TObject.h> //LRCParticlePID is a derived class from"TObject"
@@ -34,6 +40,8 @@ class AliVParticle;
 #include "AliVParticle.h"
 #include "TParticle.h"
 #include "AliLog.h"
+#include "AliTHn.h"
+#include "TBits.h"
 
 
 #ifndef ALIANALYSISTASKSE_H
@@ -47,14 +55,16 @@ namespace AliPIDNameSpace {
     NSigmaTPC = 0,
     NSigmaTOF,
     NSigmaTPCTOF,  // squared sum
-    NSigmaPIDType=NSigmaTPCTOF
+    Bayes    
   };
+  const Int_t NSigmaPIDType=NSigmaTPCTOF;//number of Nsigma PID types
     
   enum AliDetectorType
   {
-    TPC = 0,
-    TOF,
-    NDetectors
+    fITS = 0,
+    fTPC,
+    fTOF,
+    fNDetectors
   };
   
   
@@ -91,18 +101,41 @@ class AliTwoParticlePIDCorr : public AliAnalysisTaskSE {
     virtual void    doAODevent();
     virtual void    doMCAODevent();
     virtual void     Terminate(Option_t *);
-    void SetCustomBinning(TString receivedCustomBinning) { fCustomBinning = receivedCustomBinning; }
-    void SetAsymmetricBin(THnSparse *h,Int_t axisno,Double_t *arraybin,Int_t arraybinsize,TString axisTitle); 
+  void    SetSharedClusterCut(Double_t value) { fSharedClusterCut = value; }
+  void    SetSharedTPCmapCut(Double_t value1) { fSharedTPCmapCut = value1; }
+  void    SetSharedfraction_Pair_cut(Double_t value2) { fSharedfraction_Pair_cut = value2; }
+
 
+  void SettwoTrackEfficiencyCutDataReco(Bool_t twoTrackEfficiencyCutDataReco,Float_t twoTrackEfficiencyCutValue1,Float_t TwoTrackCutMinRadius,Float_t TwoTrackCutMaxRadius)
+  {
+    ftwoTrackEfficiencyCutDataReco=twoTrackEfficiencyCutDataReco;
+    twoTrackEfficiencyCutValue=twoTrackEfficiencyCutValue1;
+    fTwoTrackCutMinRadius=TwoTrackCutMinRadius;
+    fTwoTrackCutMaxRadius=TwoTrackCutMaxRadius;
+  }
+  void SetVertextype(Int_t Vertextype){fVertextype=Vertextype;}                                                 //Check it every time
+    void SetZvtxcut(Double_t zvtxcut) {fzvtxcut=zvtxcut;}
+    void SetCustomBinning(TString receivedCustomBinning) { fCustomBinning = receivedCustomBinning; }
+    void SetMaxNofMixingTracks(Int_t MaxNofMixingTracks) {fMaxNofMixingTracks=MaxNofMixingTracks;}               //Check it every time
   void SetCentralityEstimator(TString CentralityMethod) { fCentralityMethod = CentralityMethod;}
+  void SetPPVsMultUtils(Bool_t val)  {fPPVsMultUtils = val;}
   void SetSampleType(TString SampleType) {fSampleType=SampleType;}
+  void SetRequestEventPlane(Bool_t RequestEventPlane,Bool_t V2,Bool_t V3,TString EPdetector,Bool_t IsAfter2011){
+fRequestEventPlane=RequestEventPlane;
+fV2=V2;
+fV3=V3;
+fEPdet=EPdetector;
+fIsAfter2011=IsAfter2011;
+}
   void SetAnalysisType(TString AnalysisType){fAnalysisType=AnalysisType;}
   void SetFilterBit(Int_t FilterBit) {fFilterBit=FilterBit;}
+  void SetTrackStatus(UInt_t status) { fTrackStatus = status; }
   void SetfilltrigassoUNID(Bool_t filltrigassoUNID){ffilltrigassoUNID=filltrigassoUNID;}
   void SetfilltrigUNIDassoID(Bool_t filltrigUNIDassoID){ffilltrigUNIDassoID=filltrigUNIDassoID;}
   void SetfilltrigIDassoUNID(Bool_t filltrigIDassoUNID){ffilltrigIDassoUNID=filltrigIDassoUNID;}
   void SetfilltrigIDassoID(Bool_t filltrigIDassoID){ ffilltrigIDassoID=filltrigIDassoID;}
   void SetfilltrigIDassoIDMCTRUTH(Bool_t filltrigIDassoIDMCTRUTH){ffilltrigIDassoIDMCTRUTH=filltrigIDassoIDMCTRUTH;}
+  void SetSelectHighestPtTrig(Bool_t SelectHighestPtTrig){fSelectHighestPtTrig=SelectHighestPtTrig;}
   void SetTriggerSpeciesSelection(Bool_t TriggerSpeciesSelection,Int_t TriggerSpecies,Bool_t containPIDtrig){
     fTriggerSpeciesSelection=TriggerSpeciesSelection;//if it is KTRUE then Set containPIDtrig=kFALSE
     fTriggerSpecies=TriggerSpecies;
@@ -114,7 +147,13 @@ class AliTwoParticlePIDCorr : public AliAnalysisTaskSE {
     fAssociatedSpecies=AssociatedSpecies;
     fcontainPIDasso=containPIDasso;
   }
-  // void SetRejectPileUp(Bool_t rejectPileUp) {frejectPileUp=rejectPileUp;}
+
+  void SettingChargeCounting(Int_t val) {SetChargeAxis=val;}
+
+ void SetFIllPIDQAHistos(Bool_t FIllPIDQAHistos){fFIllPIDQAHistos=FIllPIDQAHistos;}
+  void SetRejectPileUp(Bool_t rejectPileUp) {frejectPileUp=rejectPileUp;}
+  void SetCheckFirstEventInChunk(Bool_t CheckFirstEventInChunk) {fCheckFirstEventInChunk=CheckFirstEventInChunk;}
+
   void SetKinematicCuts(Float_t minPt, Float_t maxPt,Float_t mineta,Float_t maxeta)
   {
     fminPt=minPt;
@@ -122,13 +161,6 @@ class AliTwoParticlePIDCorr : public AliAnalysisTaskSE {
     fmineta=mineta;
     fmaxeta=maxeta;
   }
-  void SetAsymmetricnSigmaCut( Float_t minprotonsigmacut,Float_t maxprotonsigmacut,Float_t minpionsigmacut,Float_t maxpionsigmacut)
-  {
-    fminprotonsigmacut=minprotonsigmacut;
-    fmaxprotonsigmacut=maxprotonsigmacut;
-    fminpionsigmacut=minpionsigmacut;
-    fmaxpionsigmacut=maxpionsigmacut;
-  }
   void SetDcaCut(Bool_t dcacut,Double_t dcacutvalue)
   {
     fdcacut=dcacut;
@@ -139,9 +171,20 @@ class AliTwoParticlePIDCorr : public AliAnalysisTaskSE {
     ffillhistQAReco=fillhistQAReco;
     ffillhistQATruth=fillhistQATruth;
   }
+  void SetPtordering(Bool_t PtOrderDataReco,Bool_t PtOrderMCTruth)
+  {
+    fPtOrderDataReco=PtOrderDataReco;
+    fPtOrderMCTruth=PtOrderMCTruth;
+  }
+  void SetWeightPerEvent(Bool_t flag) {  fWeightPerEvent = flag;}
   void Setselectprimarydatareco(Bool_t onlyprimarydatareco) {fonlyprimarydatareco=onlyprimarydatareco;}
   void SetselectprimaryTruth(Bool_t selectprimaryTruth) {fselectprimaryTruth=selectprimaryTruth;}
   void SetCombinedNSigmaCut(Double_t NSigmaPID) {fNSigmaPID=NSigmaPID;}
+  void SetHighPtKaonNSigmaPID(Float_t HighPtKaonSigma,Float_t HighPtKaonNSigmaPID)
+  {
+    fHighPtKaonSigma=HighPtKaonSigma;
+    fHighPtKaonNSigmaPID=HighPtKaonNSigmaPID;
+  }
   void IgnoreoverlappedTracks(Bool_t UseExclusiveNSigma){fUseExclusiveNSigma=UseExclusiveNSigma;}
   void SetRemoveTracksT0Fill( Bool_t RemoveTracksT0Fill){fRemoveTracksT0Fill=RemoveTracksT0Fill;}
   void SetPairSelectCharge(Int_t SelectCharge){fSelectCharge=SelectCharge;}
@@ -187,39 +230,76 @@ fPtTOFPIDmax=PtTOFPIDmax;
 
  void SetEffcorectionfilePathName(TString efffilename) {fefffilename=efffilename;}
  
- private:
+
+  //PID Type
+  void SetPIDType(PIDType PIDmethod) { fPIDType = PIDmethod; }
+  PIDType GetPIDType() {return fPIDType; }
+  //NSigma cut
+  //set cut on beyesian probability
+  void SetBayesCut(Double_t cut){fBayesCut=cut;}
+  void SetdiffPIDcutvalues(Bool_t diffPIDcutvalues,Double_t PIDCutval1, Double_t PIDCutval2, Double_t PIDCutval3,Double_t PIDCutval4){
+    fdiffPIDcutvalues=diffPIDcutvalues;
+    fPIDCutval1=PIDCutval1;
+    fPIDCutval2=PIDCutval2;
+    fPIDCutval3=PIDCutval3;
+    fPIDCutval4=PIDCutval4;
+  }
+ void  SetRandomizeReactionPlane(Bool_t RandomizeReactionPlane){fRandomizeReactionPlane=RandomizeReactionPlane;}
+   //****************************************************************************************EP related part
+  void OpenInfoCalbration(Int_t run);
+  void SetTPCclusterN(Int_t ncl){fNcluster=ncl;};
+   //****************************************************************************************EP related part
+
+
+ private:                                                                                      
  //histograms
     TList *fOutput;        //! Output list
+    TList *fOutputList;        //! Output list
+    TList *fList;              //! List for output objects
+
+
     TString    fCentralityMethod;     // Method to determine centrality
+    Bool_t fPPVsMultUtils;//switch to ON quantile information for pp 7 TeV case
     TString    fSampleType;     // pp,p-Pb,Pb-Pb
+    Bool_t fRequestEventPlane; //only for PbPb
     Int_t    fnTracksVertex;        // QA tracks pointing to principal vertex
     AliAODVertex* trkVtx;//!
     Float_t zvtx;
     Int_t    fFilterBit;         // track selection cuts
+     UInt_t         fTrackStatus;       // if non-0, the bits set in this variable are required for each track
+    Double_t       fSharedClusterCut;  // cut on shared clusters (only for AOD, give the actual cut value)
+    Double_t fSharedTPCmapCut;//cut on TPC shared map(set any non negative value to implement this cut automatically, no meaning of the value itself)
+    Double_t fSharedfraction_Pair_cut;//cut on pairs at the correlation level to check whether the correlating pair has large shared clusters(set fraction percentage to be set as cut off)
+    Int_t fVertextype;
+    Int_t skipParticlesAbove;
     Double_t fzvtxcut;
     Bool_t ffilltrigassoUNID;
     Bool_t ffilltrigUNIDassoID;
     Bool_t ffilltrigIDassoUNID;
     Bool_t ffilltrigIDassoID;
     Bool_t ffilltrigIDassoIDMCTRUTH;
+    Int_t fMaxNofMixingTracks;
     Bool_t fPtOrderMCTruth;
+    Bool_t fPtOrderDataReco;
+    Bool_t fWeightPerEvent;
     Bool_t fTriggerSpeciesSelection;
     Bool_t fAssociatedSpeciesSelection;
+    Bool_t fRandomizeReactionPlane;
     Int_t fTriggerSpecies;
     Int_t fAssociatedSpecies;
     TString fCustomBinning;//for setting customized binning
     TString fBinningString;//final binning string
+    Bool_t fSelectHighestPtTrig;
     Bool_t fcontainPIDtrig;
     Bool_t fcontainPIDasso;
-    // Bool_t frejectPileUp;
+    Int_t SetChargeAxis;
+     Bool_t frejectPileUp;
+     Bool_t fCheckFirstEventInChunk;
     Float_t fminPt;
     Float_t fmaxPt;
     Float_t fmineta;
     Float_t fmaxeta;
-    Float_t fminprotonsigmacut;
-    Float_t fmaxprotonsigmacut;
-    Float_t fminpionsigmacut;
-    Float_t fmaxpionsigmacut;
     Bool_t fselectprimaryTruth;
     Bool_t fonlyprimarydatareco;
     Bool_t fdcacut;
@@ -233,6 +313,9 @@ fPtTOFPIDmax=PtTOFPIDmax;
     Double_t fmaxPtComboeff;
     Double_t fminPtAsso;
     Double_t fmaxPtAsso;
+    Double_t fmincentmult;
+    Double_t fmaxcentmult;
+    TH1F *fPriHistShare;//!
     TH1F *fhistcentrality;//!
     TH1F *fEventCounter; //!
     TH2F *fEtaSpectrasso;//!
@@ -252,8 +335,90 @@ fPtTOFPIDmax=PtTOFPIDmax;
     TH2F *fPioncont;//!
     TH2F *fKaoncont;//!
     TH2F *fProtoncont;//!
-
-    TH2D* fCentralityCorrelation;  //! centrality vs multiplicity
+    TH2F *fUNIDcont;//!
+    TH2F *fEventno;//!
+    TH2F *fEventnobaryon;//!
+    TH2F *fEventnomeson;//!
+    TH2F *fhistJetTrigestimate;//!
+    TH3F* fTwoTrackDistancePtdip;//!
+    TH3F* fTwoTrackDistancePtdipmix;//!
+    TH3F* fTwoTrackDistancePt[2];    //! control histograms for two-track efficiency study: dphi*_min vs deta (0 = before cut, 1 = after cut)
+    TH3F* fTwoTrackDistancePtmix[2];    //! control histograms for two-track efficiency study: dphi*_min vs deta (0 = before cut, 1 = after cut)
+
+    TH2D* fCentralityCorrelation;  //! centrality vs Tracks multiplicity
+ //VZERO calibration
+  TH1F *fHistVZEROAGainEqualizationMap;//VZERO calibration map
+  TH1F *fHistVZEROCGainEqualizationMap;//VZERO calibration map
+  TH2F *fHistVZEROChannelGainEqualizationMap; //VZERO calibration map
+  TH1* fCentralityWeights;                  // for centrality flattening
+
+    TH2F *fHistCentStats; //!centrality stats
+    TH2F *fHistRefmult;//!
+    TH2F *fHistEQVZEROvsTPCmultiplicity;//!
+    TH2F *fHistEQVZEROAvsTPCmultiplicity;//!
+    TH2F *fHistEQVZEROCvsTPCmultiplicity;//!
+    TH2F *fHistVZEROCvsEQVZEROCmultiplicity;//!
+    TH2F *fHistVZEROAvsEQVZEROAmultiplicity;//!
+    TH2F *fHistVZEROCvsVZEROAmultiplicity;//!
+    TH2F *fHistEQVZEROCvsEQVZEROAmultiplicity;//!
+    TH2F *fHistVZEROSignal;//!
+    TH2F *fHistEventPlaneTruth;//!
+    TH2D *fHistPsiMinusPhi;//! psi - phi QA histogram
+    TH3F *fEventPlanePID;//!
+   //****************************************************************************************EP related part
+
+    Float_t evplaneMC,fgPsi2v0a,fgPsi2v0c,fgPsi2tpc; // current Psi2
+   Float_t fgPsi3v0a,fgPsi3v0c,fgPsi3tpc; // current Psi3
+   Float_t fgPsi2v0aMC,fgPsi2v0cMC,fgPsi2tpcMC; // current Psi2
+   Float_t fgPsi3v0aMC,fgPsi3v0cMC,fgPsi3tpcMC,gReactionPlane; // current Psi3
+  Bool_t fV2; // switch to set the harmonics
+  Bool_t fV3; // switch to set the harmonics
+  Bool_t fIsAfter2011; // switch for 2011 and later runs
+
+  //    Int_t nCentrBin = 9;          //  cenrality bins
+
+  //
+  // Cuts and options
+  //
+
+  Int_t fRun;                       // current run checked to load VZERO calibrations
+
+  Int_t fNcluster;           // Numer of TPC cluster required
+
+  TString fEPdet; //Set the name of the event plane to be used to reconstruct the event plane
+    
+  // Output objects
+  TProfile *fMultV0;                //! object containing VZERO calibration information
+  Float_t fV0Cpol;          //! loaded by OADB
+  Float_t fV0Apol;          //! loaded by OADB
+  Float_t fMeanQ[9][2][2];           // and recentering
+  Float_t fWidthQ[9][2][2];          // ...
+  Float_t fMeanQv3[9][2][2];         // also for v3
+  Float_t fWidthQv3[9][2][2];        // ...
+
+  TProfile *fHResTPCv0A2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResTPCv0C2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResv0Cv0A2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResTPCv0A3;    //! also for v3
+  TProfile *fHResTPCv0C3;   //! also for v3
+  TProfile *fHResv0Cv0A3;   //! also for v3
+
+ TProfile *fHResMA2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResMC2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResAC2;   //! TProfile for subevent resolution (output)
+  TProfile *fHResMA3;    //! also for v3
+  TProfile *fHResMC3;   //! also for v3
+  TProfile *fHResAC3;   //! also for v3
+
+  TH2F *fPhiRPTPC;          //! EP distribution vs. centrality (v2)
+  TH2F *fPhiRPTPCv3;          //! EP distribution vs. centrality (v2)
+  TH2F *fPhiRPv0A;          //! EP distribution vs. centrality (v2)
+  TH2F *fPhiRPv0C;          //! EP distribution vs. centrality (v2)
+  TH2F *fPhiRPv0Av3;      //! EP distribution vs. centrality (v3)
+  TH2F *fPhiRPv0Cv3;      //! EP distribution vs. centrality (v3)
+    //****************************************************************************************EP related part
+
+    TH2F* fControlConvResoncances; //! control histograms for cuts on conversions and resonances
 
     TH2F *fHistoTPCdEdx;//!
     TH2F *fHistoTOFbeta;//!
@@ -271,64 +436,90 @@ fPtTOFPIDmax=PtTOFPIDmax;
     TH1F *fProtonPhi;//!
     // TH3F *fHistocentNSigmaTPC;//! nsigma TPC
     // TH3F *fHistocentNSigmaTOF;//! nsigma TOF 
-    
-    THnSparse *fCorrelatonTruthPrimary;//!
-    THnSparse *fCorrelatonTruthPrimarymix;//!
-    THnSparse *fTHnCorrUNID;//!
-    THnSparse *fTHnCorrUNIDmix;//!
-    THnSparse *fTHnCorrID;//!
-    THnSparse *fTHnCorrIDmix;//!
-    THnSparse *fTHnCorrIDUNID;//!
-    THnSparse *fTHnCorrIDUNIDmix;//!
-    THnSparse *fTHnTrigcount;//!
-    THnSparse *fTHnTrigcountMCTruthPrim;//!
+    AliTHn *fCorrelatonTruthPrimary;//!
+    AliTHn *fCorrelatonTruthPrimarymix;//!
+    AliTHn *fTHnCorrUNID;//!
+    AliTHn *fTHnCorrUNIDmix;//!
+    AliTHn *fTHnCorrID;//!
+    AliTHn *fTHnCorrIDmix;//!
+    AliTHn *fTHnCorrIDUNID;//!
+    AliTHn *fTHnCorrIDUNIDmix;//!
+    AliTHn *fTHnTrigcount;//!
+    AliTHn *fTHnTrigcountMCTruthPrim;//!
+    AliTHn* fTrackHistEfficiency[6]; //! container for tracking efficiency and contamination (all particles filled including leading one): axes: eta, pT, particle species:::::::::0 pion, 1 kaon,2 proton,3 mesons,4 kaons+protons,5 all
 
     
-    TH1F *fHistQA[16]; //!
+    TH1F *fHistQA[16]; //!                  
      
-    THnSparse *fTHnrecomatchedallPid[6];//!                 //0 pion, 1 kaon,2 proton,3 mesons,4 kaons+protons,5 all
-    THnSparse *fTHngenprimPidTruth[6];//!
+   
     THnSparse *effcorection[6];//!
     // THnF *effmap[6];  
-    //TH2F* fControlConvResoncances; //! control histograms for cuts on conversions and resonances
 
-    Int_t ClassifyTrack(AliAODTrack* track,AliAODVertex* vertex,Float_t magfield);
+    Int_t ClassifyTrack(AliAODTrack* track,AliAODVertex* vertex,Float_t magfield,Bool_t fill);
   Double_t* GetBinning(const char* configuration, const char* tag, Int_t& nBins);
 
 
-  void Fillcorrelation(TObjArray *trackstrig,TObjArray *tracksasso,Double_t cent,Float_t vtx,Float_t bSign,Bool_t fPtOrder,Bool_t twoTrackEfficiencyCut,Bool_t mixcase,TString fillup);//mixcase=kTRUE in case of mixing; 
+  void Fillcorrelation(Float_t ReactionPlane,TObjArray *trackstrig,TObjArray *tracksasso,Double_t cent,Float_t vtx,Float_t weight,Bool_t firstTime,Float_t bSign,Bool_t fPtOrder,Bool_t twoTrackEfficiencyCut,Bool_t mixcase,TString fillup);//mixcase=kTRUE in case of mixing; 
+ Bool_t CalculateSharedFraction(const TBits *triggerPadMap,const TBits *assocPadMap,const TBits *triggerShareMap,const TBits *assocShareMap);
  Float_t GetTrackbyTrackeffvalue(AliAODTrack* track,Double_t cent,Float_t evzvtx, Int_t parpid);
 
+ //Fill PID and Event planes
+ void FillPIDEventPlane(Double_t centrality,Int_t par,Float_t trigphi,Float_t fReactionPlane);
+
 //Mixing functions
-  void DefineEventPool();
-  // AliAnalysisUtils *fUtils;
+ // void DefineEventPool();
   AliEventPoolManager    *fPoolMgr;//! 
   TClonesArray          *fArrayMC;//!
   TString          fAnalysisType;          // "MC", "ESD", "AOD"
   TString fefffilename;
-
     //PID part histograms
 
   //PID functions
     Bool_t HasTPCPID(AliAODTrack *track) const; // has TPC PID
     Bool_t HasTOFPID(AliAODTrack *track) const; // has TOF PID
-    Float_t GetBeta(AliAODTrack *track);
-    void CalculateNSigmas(AliAODTrack *track);
-    Int_t FindMinNSigma(AliAODTrack *track);
-    Bool_t* GetDoubleCounting(AliAODTrack * trk);
-    Int_t GetParticle(AliAODTrack * trk);  
-   
-   
-          
+    Double_t GetBeta(AliAODTrack *track);
+    void CalculateNSigmas(AliAODTrack *track, Bool_t FIllQAHistos);
+    Int_t FindMinNSigma(AliAODTrack *track, Bool_t FIllQAHistos);
+    Bool_t* GetDoubleCounting(AliAODTrack * trk, Bool_t FIllQAHistos);
+    Int_t GetParticle(AliAODTrack * trk, Bool_t FIllQAHistos);  
+     TH2F* GetHistogram2D(const char * name);//return histogram "name" from fOutputList
+
+     Bool_t ftwoTrackEfficiencyCutDataReco; 
+    Float_t fTwoTrackCutMinRadius;
+    Float_t fTwoTrackCutMaxRadius;        
    Float_t twoTrackEfficiencyCutValue;
   //Pid objects
   AliPIDResponse *fPID; //! PID
+  AliPIDCombined   *fPIDCombined;     //! PIDCombined
+
+  //set PID Combined
+  void SetPIDCombined(AliPIDCombined *obj){fPIDCombined=obj;}
+  AliPIDCombined *GetPIDCombined(){return fPIDCombined;}
+  Double_t GetBayesCut(){return fBayesCut;}
+  Int_t GetIDBayes(AliAODTrack *trk, Bool_t FIllQAHistos);//calculate the PID according to bayesian PID
+  UInt_t CalcPIDCombined(AliAODTrack *track,Int_t detMask, Double_t* prob) const;
+  Bool_t* GetAllCompatibleIdentitiesNSigma(AliAODTrack * trk, Bool_t FIllQAHistos);//All the identities are true
+
+
   Int_t eventno;
   Float_t fPtTOFPIDmin; //lower pt bound for the TOCTOF combined circular pid
   Float_t fPtTOFPIDmax; //uper pt bound for the TOCTOF combined circular pid
   Bool_t fRequestTOFPID;//if true returns kSpUndefined if the TOF signal is missing
   PIDType fPIDType; // PID type  Double_t fNSigmaPID; // number of sigma for PID cut
+  Bool_t fFIllPIDQAHistos; //Switch for filling the nSigma histos
   Double_t fNSigmaPID; // number of sigma for PID cut
+  Double_t fBayesCut; // Cut on Bayesian probability
+ Bool_t fdiffPIDcutvalues;
+ Double_t fPIDCutval1;
+ Double_t fPIDCutval2;
+ Double_t fPIDCutval3;
+ Double_t fPIDCutval4;
+
+  Float_t fHighPtKaonNSigmaPID;// number of sigma for PID cut for Kaons above fHighPtKaonSigma(-1 default, no cut applied)
+  Float_t fHighPtKaonSigma;//lower pt bound for the fHighPtKaonNSigmaPID to be set >0(i.e. to make it applicable)
   Bool_t fUseExclusiveNSigma;//if true returns the identity only if no double counting(i.e not in the overlap area)
   Bool_t fRemoveTracksT0Fill;//if true remove tracks for which only StartTime from To-Fill is available (worst resolution)
  Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
@@ -345,12 +536,10 @@ fPtTOFPIDmax=PtTOFPIDmax;
     Bool_t fRemoveDuplicates;// remove particles with the same label (double reconstruction)
     Bool_t fapplyTrigefficiency;//if kTRUE then eff correction calculation starts
     Bool_t fapplyAssoefficiency;//if kTRUE then eff correction calculation starts
-    Bool_t ffillefficiency;//if kTRUE then THNsparses used for eff. calculation are filled up
-    Bool_t fSkipAssoEff;
-    Bool_t fSkipTrigEff;
+    Bool_t ffillefficiency;  //if kTRUE then THNsparses used for eff. calculation are filled up
     Bool_t fmesoneffrequired;
     Bool_t fkaonprotoneffrequired;
-    //  AliAnalysisUtils*     fAnalysisUtils;      // points to class with common analysis utilities
+   AliAnalysisUtils*     fAnalysisUtils;      // points to class with common analysis utilities
   TFormula*      fDCAXYCut;          // additional pt dependent cut on DCA XY (only for AOD)
 
 
@@ -360,12 +549,33 @@ fPtTOFPIDmax=PtTOFPIDmax;
   //Int_t fPIDMethod; // PID method
 
  //functions
+  Bool_t CheckTrack(AliAODTrack * part);
   Float_t PhiRange(Float_t DPhi);
   Float_t GetInvMassSquared(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2);
 Float_t GetInvMassSquaredCheap(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2);
   Float_t GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign);
   TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
-          
+
+
+  void ShiftTracks(TObjArray* tracks, Double_t angle);
+  Bool_t AcceptEventCentralityWeight(Double_t centrality);
+
+  //get event plane
+  Float_t GetEventPlane(AliAODEvent *event,Bool_t truth,Double_t v0Centr);
+  Double_t GetAcceptedEventMultiplicity(AliAODEvent *aod,Bool_t truth);//returns centrality after event(mainly vertex) selection IsEventAccepted  GetAcceptedEventMultiplicity
+  
+  //get vzero equalization
+  Double_t GetEqualizationFactor(Int_t run, const char* side);
+  Double_t GetChannelEqualizationFactor(Int_t run,Int_t channel);
+  void SetVZEROCalibrationFile(const char* filename,const char* lhcPeriod);
+  void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }
+
+  Double_t GetRefMultiOrCentrality(AliAODEvent *event, Bool_t truth);
+  Double_t GetReferenceMultiplicityVZEROFromAOD(AliAODEvent *event);//mainly important for pp 7 TeV
+
+
+
+
     
     AliTwoParticlePIDCorr(const AliTwoParticlePIDCorr&); // not implemented
     AliTwoParticlePIDCorr& operator=(const AliTwoParticlePIDCorr&); // not implemented
@@ -374,8 +584,8 @@ Float_t GetInvMassSquaredCheap(Float_t pt1, Float_t eta1, Float_t phi1, Float_t
 };
 class LRCParticlePID : public TObject {
 public:
- LRCParticlePID(Int_t par,Short_t icharge,Float_t pt,Float_t eta, Float_t phi,Float_t effcorrectionval)
-   :fparticle(par),fcharge(icharge),fPt(pt), fEta(eta), fPhi(phi),feffcorrectionval(effcorrectionval)  {}
+ LRCParticlePID(Int_t par,Short_t icharge,Float_t pt,Float_t eta, Float_t phi,Float_t effcorrectionval,const TBits *clustermap,const TBits *sharemap)
+   :fparticle(par),fcharge(icharge),fPt(pt), fEta(eta), fPhi(phi),feffcorrectionval(effcorrectionval),fTPCClusterMap(clustermap),fTPCHitShareMap(sharemap) {}
   virtual ~LRCParticlePID() {}
 
   
@@ -386,7 +596,9 @@ public:
     virtual Short_t Charge()      const { return fcharge; }
     Float_t geteffcorrectionval() const {return feffcorrectionval;}
     virtual Bool_t IsEqual(const TObject* obj) const { return (obj->GetUniqueID() == GetUniqueID()); }
-
+    virtual void SetPhi(Double_t phiv) { fPhi = phiv; }
+    virtual const TBits * GetTPCPadMap() {return fTPCClusterMap; }
+    virtual const TBits * GetTPCSharedMap() {return fTPCHitShareMap; }
 
 private:
   LRCParticlePID(const LRCParticlePID&);  // not implemented
@@ -398,8 +610,13 @@ private:
   Float_t fEta;
   Float_t fPhi;
   Float_t feffcorrectionval;
+   const TBits   *fTPCClusterMap;
+   const TBits   *fTPCHitShareMap;
   ClassDef(LRCParticlePID, 1);
 } ;
 
 #endif
 
+//(fSampleType=="pp_2_76" || fCentralityMethod.EndsWith("_MANUAL"))
+//(fSampleType=="pp_2_76" || fCentralityMethod.EndsWith("_MANUAL") || (fSampleType=="pp_7" && fPPVsMultUtils==kFALSE))
+//(fCentralityMethod.EndsWith("_MANUAL"))