Major update of the HFE package (comments inside the code
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFE.h
index cef17b1..10d0f28 100644 (file)
 #include "AliAnalysisTaskSE.h"
 #endif
 
-#ifndef ROOT_THnSparse
-#include <THnSparse.h>
-#endif
-
-class AliHFEpid;
+class AliHFEcontainer;
+class AliHFEcollection;
 class AliHFEcuts;
+class AliHFEelecbackground;
 class AliHFEmcQA;
+class AliHFEpid;
+class AliHFEpidQAmanager;
 class AliHFEsecVtx;
-class AliHFEelecbackground;
-class AliHFEcollection;
+class AliHFEsignalCuts;
+class AliHFEvarManager;
+class AliHFEtaggedTrackAnalysis;
 class AliCFManager;
 class AliVEvent;
 class AliMCEvent;
@@ -41,8 +42,6 @@ class AliVParticle;
 class AliTriggerAnalysis;
 class TH1I; 
 class TList;
-class TH3D;
-class TF1;
 
 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
   public:
@@ -54,7 +53,9 @@ class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
       kPriVtx = 0,
       kSecVtx = 1,
       kIsElecBackGround = 2,
-      kPostProcess = 3
+      kPostProcess = 3,
+      kDEstep = 4,
+      kTaggedTrackAnalysis = 5
     };
     enum CreationProcess_t{
       kSignalCharm = 0,
@@ -80,95 +81,77 @@ class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
     Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
     Bool_t HasMCData() const { return TestBit(kHasMCdata); }
     Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
+
+    // Get Components for configuration
+    AliHFEvarManager *GetVarManager() const { return fVarManager; }
+    AliHFEpid *GetPID() const { return fPID; }
+
     void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
+    void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
     void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
     void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
     void SwitchOnPlugin(Int_t plug);
     void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
-    void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
-    void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
+    void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
+    void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
     void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
-    void AddPIDdetector(TString detector);
     void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
     void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
-    void SetWeightFactors(TH3D * const weightFactors);
-    void SetWeightFactorsFunction(TF1 * const weightFactorsFunction);
     void SetBackGroundFactorsFunction(TF1 * const backGroundFactorsFunction) { fBackGroundFactorsFunction = backGroundFactorsFunction; };
     void PrintStatus() const;
+    void ReadCentrality();
+    void RejectionPileUpVertexRangeEventCut();  
  
   private:
     enum{
       kHasMCdata = BIT(19),
       kAODanalysis = BIT(20)
     };
-    class LabelContainer{
-      public:
-        LabelContainer(Int_t capacity);
-        ~LabelContainer() {delete[] fContainer; };
-
-        Bool_t Append(Int_t label);
-        Bool_t Find(Int_t Label) const;
-        Int_t Next();
-        void ResetIterator(){ fCurrent = fBegin; }
 
-      private:
-        LabelContainer(const LabelContainer &);
-        LabelContainer &operator=(const LabelContainer &);
-        Int_t *fContainer;    // the Container for the labels
-        Int_t *fBegin;        // Pointer to the first entry
-        Int_t *fEnd;          // Pointer to the end of the container
-        Int_t *fLast;         // Pointer to the last entry
-        Int_t *fCurrent;      // Current entry to mimic an iterator
-    };
-
-    Bool_t IsGammaElectron(const AliVParticle * const track) const;
-    Int_t  IsSignalElectron(const AliVParticle * const track) const;
     Bool_t FillProductionVertex(const AliVParticle * const track) const;
-    Double_t FindWeight(Double_t pt, Double_t eta, Double_t phi) const;
     void MakeParticleContainer();
     void MakeEventContainer();
+    void InitPIDperformanceQA();
     void ProcessMC();
     void ProcessESD();
     void ProcessAOD();
-    void FilterTaggedTrack(AliESDtrack *track, Int_t species);
     Bool_t PreSelectTrack(AliESDtrack *track) const;
     Bool_t ProcessMCtrack(AliVParticle *track);
-    Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen,Double_t weight);
-    
+    Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
     ULong_t fQAlevel;                     // QA level
-    TString fPIDdetectors;                // Detectors for Particle Identification
-    UInt_t fPIDstrategy;                  // PID Strategy
-    Double_t fTPCBetheBlochParameters[5]; // TPC Bethe-Bloch Parameters
     UShort_t fPlugins;                    // Enabled Plugins
-    Bool_t  fWeighting;                   // Weighting or not for the efficiency maps
-    TH3D *fWeightFactors;                 // Weight factors
-    TF1  *fWeightFactorsFunction;         // Weight factors
+    Bool_t fFillSignalOnly;               // Fill container only with MC Signal Tracks
+    Bool_t fRemovePileUp;                 // Remove Pile Up
+    Bool_t fIdentifiedAsPileUp;           // Identified as pile-up
+    Bool_t fIdentifiedAsOutInz;           // Out Of Range in z
+    Bool_t fPassTheEventCut;              // Pass The Event Cut
+    Float_t fCentralityF;                 // Centrality
     TF1  *fBackGroundFactorsFunction;     // BackGround factors
+    AliHFEcontainer *fContainer;          //! The HFE container
+    AliHFEvarManager *fVarManager;        // The var manager as the backbone of the analysis
+    AliHFEsignalCuts *fSignalCuts;        //! MC true signal (electron coming from certain source) 
     AliCFManager *fCFM;                   //! Correction Framework Manager
-    AliCFManager *fV0CF;                  //! Correction Framework Manager for V0-tagged tracks
     AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
-    AliCFContainer * fHadronicBackground; //! Container for hadronic Background
-    TList *fCorrelation;                  //! response matrix for unfolding  
-    THnSparseF *fPIDperformance;          //! info on contamination and yield of electron spectra
-    THnSparseF *fSignalToBackgroundMC;    //! Signal To Background Studies on pure MC information
-    AliHFEpid *fPID;                      //! PID
-    AliHFEpid *fPIDtagged;                // PID oject for tagged tracks (identical clone without QA)
+    AliHFEpid *fPID;                      // PID
+    AliHFEpidQAmanager *fPIDqa;           //! PID QA
     AliHFEpid *fPIDpreselect;             // PID oject for pre-selected tracks (without QA)
     AliHFEcuts *fCuts;                    // Cut Collection
-    AliHFEcuts *fCutsTagged;              // Cut Collection for tagged tracks
+    AliHFEcuts *fTaggedTrackCuts;         // Cut Collection for V0 tagged tracks
     AliHFEcuts *fCutspreselect;           // Cut Collection for pre-selected tracks
     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
     AliHFEelecbackground *fElecBackGround;//! Background analysis
     AliHFEmcQA *fMCQA;                    //! MC QA
-    TH1I *fNEvents;                       //! counter for the number of Events
-    TH1I *fNElectronTracksEvent;          //! Number of Electron candidates after PID decision per Event
+    AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis;     //!Analyse V0-tagged tracks
+
+    //-----------QA and output---------------
     TList *fQA;                           //! QA histos for the cuts
     TList *fOutput;                       //! Container for Task Output
     TList *fHistMCQA;                     //! Output container for MC QA histograms 
     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
     TList *fHistELECBACKGROUND;           //! Output container for electron background analysis
     AliHFEcollection *fQACollection;      //! Tasks own QA collection
+    //---------------------------------------
 
     ClassDef(AliAnalysisTaskHFE, 2)       // The electron Analysis Task
 };