coverity fixes
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliUEHist.h
CommitLineData
a75aacd6 1#ifndef AliUEHist_H
2#define AliUEHist_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id: AliUEHist.h 20164 2007-08-14 15:31:50Z morsch $ */
8
9// encapsulate histogram and corrections for one underlying event histogram
10
11#include "TObject.h"
c7245604 12#include "TString.h"
a75aacd6 13
14class AliCFContainer;
15class TH1;
144bd037 16class TH1F;
a75aacd6 17class TH3;
18class TH1D;
2a910c25 19class TH2;
a75aacd6 20class TH2D;
21class TCollection;
22class AliCFGridSparse;
c32a0ca9 23class THnSparse;
a75aacd6 24
25class AliUEHist : public TObject
26{
27 public:
28 AliUEHist(const char* reqHist = "");
29 virtual ~AliUEHist();
30
ff458f69 31 const UInt_t fkRegions;
a75aacd6 32 enum Region { kToward = 0, kAway, kMin, kMax };
33
34 static const Int_t fgkCFSteps;
35 enum CFStep { kCFStepAll = 0, kCFStepTriggered, kCFStepVertex, kCFStepAnaTopology, kCFStepTrackedOnlyPrim, kCFStepTracked, kCFStepReconstructed, kCFStepRealLeading, kCFStepBiasStudy, kCFStepBiasStudy2 };
36
37 const char* GetRegionTitle(Region region);
38 const char* GetStepTitle(CFStep step);
39
40 AliCFContainer* GetTrackHist(Region region) { return fTrackHist[region]; }
41 AliCFContainer* GetEventHist() { return fEventHist; }
b1831bcb 42 AliCFContainer* GetTrackHistEfficiency() { return fTrackHistEfficiency; }
a75aacd6 43
44 void SetTrackHist(Region region, AliCFContainer* hist) { fTrackHist[region] = hist; }
45 void SetEventHist(AliCFContainer* hist) { fEventHist = hist; }
ada1a03f 46 void SetTrackHistEfficiency(AliCFContainer* hist) { fTrackHistEfficiency = hist; }
a75aacd6 47
b1831bcb 48 void CopyReconstructedData(AliUEHist* from);
49
85bfac17 50 TH1* GetUEHist(CFStep step, Region region, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1, Int_t multBinBegin = 0, Int_t multBinEnd = -1, Int_t twoD = 0, Bool_t etaNorm = kTRUE);
c7245604 51 TH1* GetPtHist(CFStep step, Region region, Float_t ptLeadMin, Float_t ptLeadMax, Int_t multBinBegin, Int_t multBinEnd, Float_t phiMin, Float_t phiMax, Float_t etaMin, Float_t etaMax, Bool_t skipPhiNormalization = kFALSE);
a75aacd6 52
2a910c25 53 TH1* GetTrackEfficiency(CFStep step1, CFStep step2, Int_t axis1, Int_t axis2 = -1, Int_t source = 1, Int_t axis3 = -1);
a75aacd6 54 TH1* GetEventEfficiency(CFStep step1, CFStep step2, Int_t axis1, Int_t axis2 = -1, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1);
c7245604 55 TH1* GetBias(CFStep step1, CFStep step2, Int_t region, const char* axis, Float_t leadPtMin = 0, Float_t leadPtMax = -1, Int_t weighting = 0);
a75aacd6 56
57 TH1D* GetTrackingEfficiency(Int_t axis);
58 TH2D* GetTrackingEfficiency();
2a910c25 59 TH2D* GetTrackingEfficiencyCentrality();
a75aacd6 60
61 TH1D* GetTrackingContamination(Int_t axis);
62 TH2D* GetTrackingContamination();
2a910c25 63 TH2D* GetTrackingContaminationCentrality();
a75aacd6 64
65 TH1D* GetTrackingCorrection(Int_t axis);
66 TH2D* GetTrackingCorrection();
67
144bd037 68 TH1D* GetTrackingEfficiencyCorrection(Int_t axis);
69 TH2D* GetTrackingEfficiencyCorrection();
2a910c25 70 TH2D* GetTrackingEfficiencyCorrectionCentrality();
71
72 TH2* GetCorrelatedContamination();
6f803f6c 73
df269636 74 void ExtendTrackingEfficiency(Bool_t verbose = kFALSE);
144bd037 75
a75aacd6 76 void Correct(AliUEHist* corrections);
77 void CorrectTracks(CFStep step1, CFStep step2, TH1* trackCorrection, Int_t var1, Int_t var2 = -1);
144bd037 78 void CorrectTracks(CFStep step1, CFStep step2, Int_t region, TH1* trackCorrection, Int_t var1, Int_t var2 = -1);
2a910c25 79 void CorrectEvents(CFStep step1, CFStep step2, TH1* eventCorrection, Int_t var1, Int_t var2 = -1);
80 void CorrectCorrelatedContamination(CFStep step1, Int_t region, TH1* trackCorrection);
a75aacd6 81
82 void SetCombineMinMax(Bool_t flag) { fCombineMinMax = flag; }
83
84 void SetEtaRange(Float_t etaMin, Float_t etaMax) { fEtaMin = etaMin; fEtaMax = etaMax; }
85 void SetPtRange(Float_t ptMin, Float_t ptMax) { fPtMin = ptMin; fPtMax = ptMax; }
2a910c25 86 void SetCentralityRange(Float_t min, Float_t max) { fCentralityMin = min; fCentralityMax = max; }
85bfac17 87 void SetZVtxRange(Float_t min, Float_t max) { fZVtxMin = min; fZVtxMax = max; }
a75aacd6 88
144bd037 89 void SetContaminationEnhancement(TH1F* hist) { fContaminationEnhancement = hist; }
90
2a910c25 91 void SetHistogramType(const char* histogramType) { fHistogramType = histogramType; }
92
144bd037 93 void CountEmptyBins(AliUEHist::CFStep step, Float_t ptLeadMin, Float_t ptLeadMax);
94
e741fadd 95 void AdditionalDPhiCorrection(Int_t step);
96
ada1a03f 97 void SetBinLimits(AliCFGridSparse* grid);
98 void ResetBinLimits(AliCFGridSparse* grid);
99
d1c75d06 100 AliUEHist(const AliUEHist &c);
a75aacd6 101 AliUEHist& operator=(const AliUEHist& corr);
102 virtual void Copy(TObject& c) const;
103
104 virtual Long64_t Merge(TCollection* list);
c7245604 105 void Scale(Double_t factor);
106 void Reset();
a75aacd6 107
108protected:
109 void SetStepNames(AliCFContainer* container);
110 void WeightHistogram(TH3* hist1, TH1* hist2);
c32a0ca9 111 void MultiplyHistograms(THnSparse* grid, THnSparse* target, TH1* histogram, Int_t var1, Int_t var2);
a75aacd6 112
113 AliCFContainer* fTrackHist[4]; // container for track level distributions in four regions (toward, away, min, max) and at four analysis steps
114 AliCFContainer* fEventHist; // container for event level distribution at four analysis steps
b1831bcb 115 AliCFContainer* fTrackHistEfficiency; // container for tracking efficiency and contamination (all particles filled including leading one): axes: eta, pT, particle species
a75aacd6 116
117 Float_t fEtaMin; // eta min for projections
118 Float_t fEtaMax; // eta max for projections
119 Float_t fPtMin; // pT min for projections (for track pT, not pT,lead)
120 Float_t fPtMax; // pT max for projections (for track pT, not pT,lead)
2a910c25 121 Float_t fCentralityMin; // centrality min for projections
122 Float_t fCentralityMax; // centrality max for projections
85bfac17 123 Float_t fZVtxMin; // z vtx min for projections
124 Float_t fZVtxMax; // z vtx max for projections
a75aacd6 125
144bd037 126 TH1F* fContaminationEnhancement; // histogram that contains the underestimation of secondaries in the MC as function of pT
127
a75aacd6 128 Bool_t fCombineMinMax; // flag to combine min and max to a general towards region
129
130 AliCFContainer* fCache; //! cache variable for GetTrackEfficiency
131
c7245604 132 TString fHistogramType; // what is stored in this histogram
133
85bfac17 134 ClassDef(AliUEHist, 8) // underlying event histogram container
a75aacd6 135};
136
137#endif