]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/totEt/AliAnalysisEt.h
fixing rare crash
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEt.h
index 81efbc5dddec9c5e088b457b6005f9f1086b570a..4e8d844461e3d7e092000011943149fa98409a85 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef ALIANALYSISET_H
+#define ALIANALYSISET_H
 //_________________________________________________________________________
 //  Utility Class for transverse energy studies
 //  Base class for ESD & MC analysis
@@ -6,17 +8,26 @@
 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
 //_________________________________________________________________________
 
-#ifndef ALIANALYSISET_H
-#define ALIANALYSISET_H
-
-class AliCentrality;
 #include "AliAnalysisEtCommon.h"
 #include "THnSparse.h"
-
+#include "AliESDCaloCluster.h"
+#include "AliAnalysisEtCuts.h"
+#include "AliAnalysisEtTrackMatchCorrections.h"
+#include <vector>
+#include "Rtypes.h"
+#include "AliAnalysisEtSelector.h"
+#include "AliAnalysisEtSelectorEmcal.h"
+#include "AliAnalysisEtSelectorPhos.h"
+
+class AliAnalysisEtRecEffCorrection;
+class AliAnalysisEtTrackMatchCorrections;
+class AliAnalysisEtSelector;
+class AliCentrality;
 class TString;
 class TTree;
 class TH2F;
 class TH1F;
+class TH1I;
 class AliVEvent;
 class TList;
 class TString;
@@ -24,16 +35,17 @@ class AliESDtrackCuts;
 class AliAnalysisEtCuts;
 class AliESDCaloCluster;
 //class THnSparseD;
+class AliPIDResponse;
 
 class AliAnalysisEt : public AliAnalysisEtCommon
 {
 public:
-   
+
     AliAnalysisEt();
     virtual ~AliAnalysisEt();
-  
+
 public:
-  
+
     /** Analyse the event! */
 
     virtual Int_t AnalyseEvent(AliVEvent *event);
@@ -44,21 +56,21 @@ public:
     /** Initialise the analysis, must be overloaded. */
     virtual void Init();
 
-    /** 
-    * Creates the histograms, must be overloaded if you want to add your own. 
+    /**
+    * Creates the histograms, must be overloaded if you want to add your own.
     * Uses the fHistogramNameSuffix to create proper histogram names
     */
     virtual void CreateHistograms();
     virtual void CreateTrees();
     TH2F* CreateEtaEHisto2D(TString name, TString title, TString ztitle);
-       TH2F* CreateEtaPtHisto2D(TString name, TString title, TString ztitle);
-       TH2F* CreateEtaEtHisto2D(TString name, TString title, TString ztitle);
-       TH2F* CreateResEHisto2D(TString name, TString title, TString ztitle);
-       TH2F* CreateResPtHisto2D(TString name, TString title, TString ztitle);
+    TH2F* CreateEtaPtHisto2D(TString name, TString title, TString ztitle);
+    TH2F* CreateEtaEtHisto2D(TString name, TString title, TString ztitle);
+    TH2F* CreateResEHisto2D(TString name, TString title, TString ztitle);
+    TH2F* CreateResPtHisto2D(TString name, TString title, TString ztitle);
     THnSparseF* CreateClusterHistoSparse(TString name, TString title);
     THnSparseF* CreateNeutralPartHistoSparse(TString name, TString title);
     THnSparseF* CreateChargedPartHistoSparse(TString name, TString title);
-       
+
     /** Fills the histograms, must be overloaded if you want to add your own */
     virtual void FillHistograms();
 
@@ -66,168 +78,218 @@ public:
     virtual void ResetEventValues();
 
     /** Total Et in the event (without acceptance cuts) */
-    Double_t GetTotEt() const { return fTotEt; }
+    Double_t GetTotEt() const {
+        return fTotEt;
+    }
 
-    /** Total Et in the event within the acceptance cuts */
-    Double_t GetTotEtAcc() const { return fTotEtAcc; }
+    /** Total neutral Et in the event (without acceptance cuts) */
+    Double_t GetTotNeutralEt() const {
+        return fTotNeutralEt;
+    }
 
-   /** Total neutral Et in the event (without acceptance cuts) */
-    Double_t GetTotNeutralEt() const { return fTotNeutralEt; }
-
-    /** Total neutral Et in the event within the acceptance cuts */
-    Double_t GetTotNeutralEtAcc() const { return fTotNeutralEtAcc; }
-    
     /** Total charged Et in the event (without acceptance cuts) */
-    Double_t GetTotChargedEt() const { return fTotChargedEt; }
+    Double_t GetTotChargedEt() const {
+        return fTotChargedEt;
+    }
 
-    /** Total charged Et in the event within the acceptance cuts */
-    Double_t GetTotChargedEtAcc() const { return fTotChargedEtAcc; }
+    void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts) {
+        fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;
+    }
 
-    void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
-    
     /** Set the centrality object */
-    void SetCentralityObject(AliCentrality *cent) { fCentrality = cent; }
-    
+    void SetCentralityObject(AliCentrality *cent) {
+        fCentrality = cent;
+    }
+
     /** Get contribution from non-removed charged particles */
-    virtual Double_t GetChargedContribution(Int_t /*clusterMultiplicity*/) {return 0;}
+    Double_t GetChargedContribution(Int_t clusterMultiplicity) {
+        return fTmCorrections->ChargedContr(clusterMultiplicity);
+    }
 
     /** Get contribution from non-removed neutral particles */
-    virtual Double_t GetNeutralContribution(Int_t /*clusterMultiplicity*/) {return 0;}
-    
+    Double_t GetNeutralContribution(Int_t clusterMultiplicity) {
+        return fTmCorrections->NeutralContr(clusterMultiplicity);
+    }
+
     /** Get contribution from removed gammas */
-    virtual Double_t GetGammaContribution(Int_t /*clusterMultiplicity*/) {return 0;}
+    Double_t GetGammaContribution(Int_t clusterMultiplicity) {
+        return fTmCorrections->GammaContr(clusterMultiplicity);
+    }
+
+    /** Get contribution from secondaries */
+    Double_t GetSecondaryContribution(Int_t clusterMultiplicity) {
+        return fTmCorrections->SecondaryContr(clusterMultiplicity);
+    }
+
+    void MakeSparseHistograms() {
+        fMakeSparse=kTRUE;
+    }
+    
+    AliAnalysisEtCuts * GetCuts() const { return fCuts; }
+    
 
-    void MakeSparseHistograms(){fMakeSparse=kTRUE;}
+    // Read in corrections
+    Int_t ReadCorrections(TString filename);  // Read in corrections
+    
 
 protected:
 
     //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
-    Double_t CalculateTransverseEnergy(AliESDCaloCluster *cluster);
+    
+    // Return corrected cluster E_T
+    Double_t CorrectForReconstructionEfficiency(const AliESDCaloCluster &cluster,Int_t cent = 0);
+    
+    // Track matching (hadrdonic contamination) corrections
+    AliAnalysisEtTrackMatchCorrections *fTmCorrections;
+    
+    // Reconstruction efficiency corrections
+    AliAnalysisEtRecEffCorrection *fReCorrections;
+    
+    TTree *fEventSummaryTree; // Contains event level information
 
-    Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */    
-    Double_t fTotEtAcc;/** Total Et in the event within the acceptance cuts */
+    TTree *fAcceptedTree; // Tree for information about accepted particles
     
-    Double_t fTotNeutralEt;/** Total neutral Et in the event */    
-    Double_t fTotNeutralEtAcc;/** Total neutral Et in the event within the acceptance cuts */    
-    Double_t fTotChargedEt;/** Total charged Et in the event */    
-    Double_t fTotChargedEtAcc;/** Total charged Et in the event within the acceptance cuts */
+    TTree *fDepositTree; // optional TTree for energy deposit measurements
+    
+    Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */
+
+    Double_t fTotEtAcc;/** Total Et in the event (without acceptance cuts) */
+
+    Double_t fTotNeutralEt;/** Total neutral Et in the event */
+
+    Double_t fTotNeutralEtAcc;/** Total neutral Et in the event */
+
+    Double_t fTotChargedEt;/** Total charged Et in the event */
+
+    Double_t fTotChargedEtAcc;/** Total charged Et in the event */
 
-    Int_t fMultiplicity;/** Multiplicity of particles in the event */    
-    Int_t fChargedMultiplicity;/** Multiplicity of charged particles in the event */    
+    Int_t fMultiplicity;/** Multiplicity of particles in the event */
+    Int_t fChargedMultiplicity;/** Multiplicity of charged particles in the event */
     Int_t fNeutralMultiplicity; /** Multiplicity of neutral particles in the event */
-    
-    Double_t fBaryonEt;     /** Et of identified baryons; calo based (Rec only for now) */    
-    Double_t fAntiBaryonEt; /** Et of identified anti-baryons; calo based (Rec only for now) */
-    Double_t fMesonEt;     /** Et of identified mesons; calo based (Rec only for now) */
 
     Double_t fProtonEt; /** Et of identified protons */
-    Double_t fPionEt; /** Et of identified pions */
-    Double_t fChargedKaonEt; /** Et of identified charged kaons */
-    Double_t fMuonEt; /** Et of identified muons */
-    Double_t fElectronEt; /** Et of identified electrons */
+    Double_t fAntiProtonEt; /** Et of identified protons */
+
     Double_t fNeutronEt; /** Et of neutrons (MC only for now) */
     Double_t fAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
-    Double_t fGammaEt; /** Et of identified electrons (MC only for now) */
-   
-    Double_t fProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
-    Double_t fPionEtAcc; /** Et of identified pions in calorimeter acceptance */    
-    Double_t fChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
-    Double_t fMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
-    Double_t fElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
     
-    Float_t fEnergyDeposited; /** Energy deposited in calorimeter */
-    Float_t fEnergyTPC; /** Energy measured in TPC */
-    Short_t fCharge; /** Charge of the particle */
-    Short_t fParticlePid; /** Particle PID */
-    Float_t fPidProb; /** Probability of PID */
-    Bool_t fTrackPassedCut; /** The track is accepted by ESDTrackCuts */
-
-    Int_t fCentClass; // centrality class
-        
-    Double_t fEtaCut;/** Cut in eta (standard |eta| < 0.5 )*/
+    Double_t fPi0Et; // Et of identified pi0
+    Double_t fPiPlusEt; // Et of identified pi+
+    Double_t fPiMinusEt; // Et of identified pi-
+    
+    Double_t fKPlusEt; // Et of identified K+ 
+    Double_t fKMinusEt; // Et of identified K- 
+    Double_t fK0sEt; // Et of identified K0 short
+    Double_t fK0lEt; // Et of identified K0 long
+    
+    Double_t fMuMinusEt; // Et of identified mu- 
+    Double_t fMuPlusEt; // Et of identified mu+ 
 
-    /** Eta cut for our acceptance */
-    Double_t fEtaCutAcc; // Eta cut for our acceptance
+    Double_t fEMinusEt; // Et of identified e-
+    Double_t fEPlusEt; // Et of identified e+
     
-    /** Min phi cut for our acceptance in radians */    
-    Double_t fPhiCutAccMin; // Min phi cut for our acceptance in radians     
+    Double_t fGammaEt; /** Et of identified electrons (MC only for now) */
+
+    Double_t fProtonRemovedEt; /** Et of identified protons */
+    Double_t fAntiProtonRemovedEt; /** Et of identified protons */
+
+    Double_t fNeutronRemovedEt; /** Et of neutrons (MC only for now) */
+    Double_t fAntiNeutronRemovedEt; /** Et of anti-neutrons (MC only for now) */
     
-    /** Max phi cut for our acceptance in radians */
-    Double_t fPhiCutAccMax; // Max phi cut for our acceptance in radians 
+    Double_t fPi0RemovedEt; // Removed Et of identified pi0
+    Double_t fPiPlusRemovedEt; // Removed Et of identified pi+
+    Double_t fPiMinusRemovedEt; // Removed Et of identified pi-
+
+    Double_t fKPlusRemovedEt; // Removed Et of identified K+ 
+    Double_t fKMinusRemovedEt; // Removed Et of identified K- 
+    Double_t fK0sRemovedEt; // Removed Et of identified K0 short
+    Double_t fK0lRemovedEt; // Removed Et of identified K0 long
     
-    /** Detector radius */
-    Double_t fDetectorRadius; // Detector radius 
+    Double_t fMuMinusRemovedEt; // Removed Et of identified mu- 
+    Double_t fMuPlusRemovedEt; // Removed Et of identified mu+ 
     
-    /** Cut on the cluster energy */    
-    Double_t fClusterEnergyCut; // Cut on the cluster energy 
+    Double_t fEMinusRemovedEt; // Removed Et of identified e-
+    Double_t fEPlusRemovedEt; // Removed Et of identified e+
     
-    /** Minimum energy to cut on single cell cluster */
-    Double_t fSingleCellEnergyCut;  // Minimum energy to cut on single cell cluster
+    Double_t fGammaRemovedEt; /** Removed Et of identified electrons (MC only for now) */
+
+    Double_t fProtonMult; /** Mult of identified protons */
+    Double_t fAntiProtonMult; /** Mult of identified protons */
+
+    Double_t fNeutronMult; /** Mult of neutrons (MC only for now) */
+    Double_t fAntiNeutronMult; /** Mult of anti-neutrons (MC only for now) */
     
-    Double_t fTrackDistanceCut; // cut on track distance    
+    Double_t fPi0Mult; // Mult of identified pi0
+    Double_t fPiPlusMult; // Mult of identified pi+
+    Double_t fPiMinusMult; // Mult of identified pi-
     
-    Double_t fTrackDxCut; // cut on track distance in x
+    Double_t fKPlusMult; // Mult of identified K+ 
+    Double_t fKMinusMult; // Mult of identified K- 
+    Double_t fK0sMult; // Mult of identified K0 short
+    Double_t fK0lMult; // Mult of identified K0 long
     
-    Double_t fTrackDzCut; // cut on track distance in z
+    Double_t fMuMinusMult; // Mult of identified mu- 
+    Double_t fMuPlusMult; // Mult of identified mu+ 
+
+    Double_t fEMinusMult; // Mult of identified e-
+    Double_t fEPlusMult; // Mult of identified e+
     
+    Double_t fGammaMult; /** Mult of identified electrons (MC only for now) */
 
-    // Declare the histograms
+    Double_t fProtonRemovedMult; /** Mult of identified protons */
+    Double_t fAntiProtonRemovedMult; /** Mult of identified protons */
 
-    /** The full Et spectrum measured */
-    TH1F *fHistEt; //Et spectrum
+    Double_t fNeutronRemovedMult; /** Mult of neutrons (MC only for now) */
+    Double_t fAntiNeutronRemovedMult; /** Mult of anti-neutrons (MC only for now) */
+    
+    Double_t fPi0RemovedMult; // Removed Mult of identified pi0
+    Double_t fPiPlusRemovedMult; // Removed Mult of identified pi+
+    Double_t fPiMinusRemovedMult; // Removed Mult of identified pi-
+
+    Double_t fKPlusRemovedMult; // Removed Mult of identified K+ 
+    Double_t fKMinusRemovedMult; // Removed Mult of identified K- 
+    Double_t fK0sRemovedMult; // Removed Mult of identified K0 short
+    Double_t fK0lRemovedMult; // Removed Mult of identified K0 long
+    
+    Double_t fMuMinusRemovedMult; // Removed Mult of identified mu- 
+    Double_t fMuPlusRemovedMult; // Removed Mult of identified mu+ 
+    
+    Double_t fEMinusRemovedMult; // Removed Mult of identified e-
+    Double_t fEPlusRemovedMult; // Removed Mult of identified e+
+    
+    Double_t fGammaRemovedMult; /** Removed Mult of identified electrons (MC only for now) */
 
-    /** The full charged Et spectrum measured */
-    TH1F *fHistChargedEt; //Charged Et spectrum 
+    Float_t fEnergyDeposited; /** Energy deposited in calorimeter */
+    Float_t fMomentumTPC; /** Momentum measured in TPC */
+    Short_t fCharge; /** Charge of the particle */
+    Short_t fParticlePid; /** Particle PID */
+    Float_t fPidProb; /** Probability of PID */
+    Bool_t fTrackPassedCut; /** The track is accepted by ESDTrackCuts */
 
-    /** The full neutral Et spectrum measured */
-    TH1F *fHistNeutralEt; //Neutral Et spectrum
+    Int_t fCentClass; // centrality class
 
-    /** The Et spectrum within the calorimeter acceptance */
-    TH1F *fHistEtAcc; //Et in acceptance
+    /** Detector radius */
+    Double_t fDetectorRadius; // Detector radius
 
-    /** The charged Et spectrum within the calorimeter acceptance */
-    TH1F *fHistChargedEtAcc; //Charged Et in acceptance
+    /** Minimum energy to cut on single cell cluster */
+    Double_t fSingleCellEnergyCut;  // Minimum energy to cut on single cell cluster
 
-    /** The neutral Et spectrum within the calorimeter acceptance */
-    TH1F *fHistNeutralEtAcc; //Et in acceptance
+    Double_t fChargedEnergyRemoved; // Charged energy removed
+    Double_t fNeutralEnergyRemoved; // Neutral energy removed
+    Double_t fGammaEnergyAdded; // gamma energy added
 
-    /** Multiplicity of particles in the events */
-    TH1F *fHistMult; //Multiplicity
+    // Declare the histograms
 
-    /** Charged multiplicity of particles in the events */
-    TH1F *fHistChargedMult; //Charged multiplicity
+    /** The EM Et spectrum measured */
+    TH1F *fHistEt; //Et spectrum
 
-    /** Neutral multiplicity of particles in the events */
-    TH1F *fHistNeutralMult; //Neutral multiplicity
+    /** Multiplicity of neutral particles in the events */
+    TH1F *fHistNeutralMult; //Multiplicity
 
-    /* Acceptance plots */
+    // Acceptance plots 
     TH2F *fHistPhivsPtPos; //phi vs pT plot for positive tracks
     TH2F *fHistPhivsPtNeg; //phi vs pT plot for negative tracks
 
-    /* PID plots */
-    TH1F *fHistBaryonEt; /** Et of identified baryons */    
-    TH1F *fHistAntiBaryonEt; /** Et of identified anti-baryons */
-    TH1F *fHistMesonEt; /** Et of identified mesons */
-
-    TH1F *fHistProtonEt; /** Et of identified protons */
-    TH1F *fHistPionEt; /** Et of identified protons */
-    TH1F *fHistChargedKaonEt; /** Et of identified charged kaons */
-    TH1F *fHistMuonEt; /** Et of identified muons */
-    TH1F *fHistElectronEt; /** Et of identified electrons */
-    TH1F *fHistNeutronEt; /** Et of neutrons (MC only for now) */
-    TH1F *fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
-    TH1F *fHistGammaEt; /** Et of gammas (MC only for now) */
-    
-    TH1F *fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
-    TH1F *fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */    
-    TH1F *fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
-    TH1F *fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
-    TH1F *fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
-    
-    /* Correction plots */
-    TH1F *fHistTMDeltaR; /* Track matching plots; Rec only for now */
-    TH2F *fHistTMDxDz; /* Track matching plots; Rec only for now */
-  
     /* Auxiliary Histogram variables */
     static Float_t fgEtaAxis[17];//bins for eta axis of histograms
     static Int_t fgnumOfEtaBins;//number of eta bins
@@ -237,43 +299,28 @@ protected:
     static Int_t fgNumOfEBins;//number of pt bins
     static Float_t fgRAxis[48];//bins for R axis
     static Int_t fgNumOfRBins;//number of R bins
-       
-       
-    TTree *fTree; // optional TTree
-    TTree *fTreeDeposit; // optional TTree for energy deposit measurements
 
-   /** Centrality object */
+    /** Centrality object */
     AliCentrality *fCentrality; //Centrality object
-    
-    Short_t fDetector;     /** Which detector? (-1 -> PHOS, 1 -> EMCAL)*/
 
     Bool_t fMakeSparse;//Boolean for whether or not to make sparse histograms
+
+    TH1I *fCutFlow; // Cut flow
     
-    THnSparseF *fSparseHistTracks;     /** THnSparse histograms */
-    
-    THnSparseF *fSparseHistClusters;     /** THnSparse histograms */
-    
-    /** ET sparse valuses */
-    THnSparseF *fSparseHistEt; //!
-       
-    /** Values for sparse hists */
-    Double_t *fSparseTracks; //!
-    
-    /** Values for sparse hists */
-    Double_t *fSparseClusters; //!
-    
-    /** ET sparse valuses */
-    Double_t *fSparseEt; //!
-    
-    
-    
+    AliAnalysisEtSelector *fSelector; // Selector class
+
+    AliPIDResponse *fPIDResponse;
+
 
 private:
+   
+  
+    
     //Declare private to avoid compilation warning
     AliAnalysisEt & operator = (const AliAnalysisEt & g) ;//cpy assignment
     AliAnalysisEt(const AliAnalysisEt & g) ; // cpy ctor
 
-    ClassDef(AliAnalysisEt, 1);
+    ClassDef(AliAnalysisEt, 3);
 };
 
 #endif // ALIANALYSISET_H