AliPhysics  48852ec (48852ec)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetHMEC.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEmcalJetHMEC_H
2 #define AliAnalysisTaskEmcalJetHMEC_H
3 
20 class TH1;
21 class TH2;
22 class TH3;
23 class THnSparse;
24 class AliEmcalJet;
25 class AliEventPoolManager;
26 class AliTLorentzVector;
27 
29 
31  public:
36  enum jetBias_t {
37  kDisableBias = 10000
38  };
39 
41  AliAnalysisTaskEmcalJetHMEC(const char *name);
43 
44  Double_t GetTrackBias() const { return fTrackBias; }
45  Double_t GetClusterBias() const { return fClusterBias; }
46 
47  // Jet bias - setters
49  virtual void SetTrackBias(Double_t b) { fTrackBias = b; }
51  virtual void SetClusterBias(Double_t b) { fClusterBias = b; }
52 
53  // Event trigger/mixed selection - setters
55  virtual void SetTriggerType(UInt_t te) { fTriggerType = te; }
61  // Mixed events
62  virtual void SetEventMixing(Bool_t enable) { fDoEventMixing = enable;}
63  virtual void SetNumberOfMixingTracks(Int_t tracks) { fNMixingTracks = tracks; }
66  virtual void SetNCentBinsMixedEvent(Bool_t centbins) { fNCentBinsMixedEvent = centbins; }
67  // Switch to cut out some unneeded sparse axis
69  void SetDoWiderTrackBin(Bool_t wtrbin) { fDoWiderTrackBin = wtrbin; }
70  // set efficiency correction
71  void SetDoEffCorr(Int_t effcorr) { fDoEffCorrection = effcorr; }
72  // Setup JES correction
73  void SetJESCorrectionHist(TH2D * hist) { fJESCorrectionHist = hist; }
75 
77 
78  // Corrections
79  // Public so that it can be tested externally
81 
82  virtual void UserCreateOutputObjects();
83  virtual void Terminate(Option_t *);
84 
85  // AddTask
87  const char *nTracks = "usedefault",
88  const char *nCaloClusters = "usedefault",
89  // Jet options
90  const Double_t trackBias = 5,
91  const Double_t clusterBias = 5,
92  const Double_t minJetArea = 0.4,
93  // Mixed event options
94  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
95  const Int_t minNTracksMixedEvent = 5000,
96  const Int_t minNEventsMixedEvent = 5,
97  const UInt_t nCentBinsMixedEvent = 10,
98  // Triggers
99  UInt_t trigEvent = AliVEvent::kAny,
100  UInt_t mixEvent = AliVEvent::kAny,
101  // Options
102  const Double_t trackEta = 0.9,
103  const Bool_t lessSparseAxes = 0,
104  const Bool_t widerTrackBin = 0,
105  // Corrections
106  const Int_t doEffCorrSW = 0,
107  const Bool_t JESCorrection = kFALSE,
108  const char * JESCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root",
109  const char * JESCorrectionHistName = "JESCorrection",
110  const char *suffix = "biased"
111  );
112 
113  protected:
114 
115  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
116  // Will be resolved when we move fully to the THnSparse
127  };
128 
129  // EMCal framework functions
130  void ExecOnce();
131  Bool_t Run();
132 
133  // Reduce event mixing memory usage
135  // Histogram helper functions
136  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
137  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
138  // Binning helper functions
139  Int_t GetEtaBin(Double_t eta) const;
140  Int_t GetTrackPtBin(Double_t pt) const;
141  Int_t GetJetPtBin(Double_t pt) const;
142  // Helper functions
143  void InitializeArraysToZero();
144  void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR);
145  // Test for biased jet
147  // Corrections
148  Double_t EffCorrection(Double_t trkETA, Double_t trkPT) const;
149 
150  // Fill methods which allow for the JES correction
151  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
152  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
153  void AccessSetOfYBinValues(TH2D * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
154 
155  // Jet bias
158  // Event Mixing
164  AliEventPoolManager *fPoolMgr;
165  // Event selection types
169  // Efficiency correction
171  // JES correction
174  // Histogram binning variables
177 
178  // TODO: Consider moving to THistManager
183 
186  TH2 *fHistJetH[6][5][3];
187  TH2 *fHistJetHBias[6][5][3];
189  THnSparse *fhnMixedEvents;
190  THnSparse *fhnJH;
191 
192  // Pb-Pb Efficiency correction coefficients
193  static Double_t p0_10SG[17];
194  static Double_t p10_30SG[17];
195  static Double_t p30_50SG[17];
196  static Double_t p50_90SG[17];
197  // Good Runs
198  static Double_t p0_10G[17];
199  static Double_t p10_30G[17];
200  static Double_t p30_50G[17];
201  static Double_t p50_90G[17];
202 
203  private:
204 
205  AliAnalysisTaskEmcalJetHMEC(const AliAnalysisTaskEmcalJetHMEC&); // not implemented
207 
209  ClassDef(AliAnalysisTaskEmcalJetHMEC, 12);
211 };
212 #endif
Jet-hadron correlations analysis task for central Pb-Pb and pp.
const char * filename
Definition: TestFCM.C:1
virtual void SetTriggerType(UInt_t te)
Set the trigger event trigger selection.
void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector &particleOne, AliVParticle *particleTwo, Double_t &deltaEta, Double_t &deltaPhi, Double_t &deltaR)
Bool_t fDoEventMixing
flag to do evt mixing
double Double_t
Definition: External.C:58
Int_t fMinNEventsMixedEvents
threshold to use event pool # events
UInt_t fNCentBinsMixedEvent
N cent bins for the event mixing pool.
TH2D * fJESCorrectionHist
Histogram containing the jet energy scale correction.
Definition: External.C:244
! Number of elements in track pt binned arrays
! Number of elements in mixed event multiplicity binned arrays
static AliAnalysisTaskEmcalJetHMEC * AddTaskEmcalJetHMEC(const char *nTracks="usedefault", const char *nCaloClusters="usedefault", const Double_t trackBias=5, const Double_t clusterBias=5, const Double_t minJetArea=0.4, const Int_t nTracksMixedEvent=0, const Int_t minNTracksMixedEvent=5000, const Int_t minNEventsMixedEvent=5, const UInt_t nCentBinsMixedEvent=10, UInt_t trigEvent=AliVEvent::kAny, UInt_t mixEvent=AliVEvent::kAny, const Double_t trackEta=0.9, const Bool_t lessSparseAxes=0, const Bool_t widerTrackBin=0, const Int_t doEffCorrSW=0, const Bool_t JESCorrection=kFALSE, const char *JESCorrectionFilename="alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root", const char *JESCorrectionHistName="JESCorrection", const char *suffix="biased")
TH1 * fHistTrackPt
! Track pt spectrum
! Number of elements in jet pt binned arrays
Bool_t RetrieveAndInitializeJESCorrectionHist(TString filename, TString histName, Double_t trackBias=AliAnalysisTaskEmcalJetHMEC::kDisableBias, Double_t clusterBias=AliAnalysisTaskEmcalJetHMEC::kDisableBias)
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
static Double_t p50_90SG[17]
50-90% centrality semi-good runs
static Double_t p0_10SG[17]
0-10% centrality semi-good runs
TH2 * fHistJetHEtaPhi
! Eta-phi distribution of jets which are in jet-hadron correlations
AliEventPoolManager * fPoolMgr
! Event pool manager
jetBias_t
Default value used to disable constituent bias.
void ExecOnce()
Perform steps needed to initialize the analysis.
TH2 * fHistJetHBias[6][5][3]
! Jet-hadron correlations of jets which meet the constituent bias criteria (the arrays correspond to ...
static Double_t p50_90G[17]
50-90% centrality good runs
Int_t fDoEffCorrection
Control the efficiency correction. See EffCorrection() for meaning of values.
Bool_t fDoWiderTrackBin
True if the track pt bins in the THnSparse should be wider.
Int_t fMinNTracksMixedEvents
threshold to use event pool # tracks
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
! Number of elements in eta binned arrays
AliAnalysisTaskEmcalJetHMEC & operator=(const AliAnalysisTaskEmcalJetHMEC &)
! Arbitrarily large value which can be used to disable the constituent bias. Can be used for either t...
TH1 * fHistJetPtBias[6]
! Jet pt spectrum of jets which meet the constituent bias criteria (the array corresponds to centrali...
BeamType
Switch for the beam type.
static Double_t p30_50SG[17]
30-50% centrality semi-good runs
TH1 * fHistJetPt[6]
! Jet pt spectrum (the array corresponds to centrality bins)
static Double_t p10_30G[17]
10-30% centrality good runs
static Double_t p0_10G[17]
0-10% centrality good runs
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TH3 * fHistJHPsi
! Psi angle distribution
Bool_t fNoMixedEventJESCorrection
True if the jet energy scale correction should be applied to mixed event histograms.
virtual void SetMinNTracksForMixedEvents(Int_t nmt)
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kFALSE)
UInt_t fTriggerType
Event selection for jets (ie triggered events).
Definition: External.C:228
static Double_t p30_50G[17]
30-50% centrality good runs
Double_t fClusterBias
Jet cluster bias.
virtual void SetClusterBias(Double_t b)
Require a cluster with pt > b in jet.
virtual void SetEventMixing(Bool_t enable)
static Double_t p10_30SG[17]
10-30% centrality semi-good runs
Bool_t fDisableFastPartition
True if task should be disabled for the fast partition, where the EMCal is not included.
TH2 * fHistJetEtaPhi
! Jet eta-phi distribution
Definition: External.C:220
virtual void SetNumberOfMixingTracks(Int_t tracks)
binArrayLimits_t
Define the number of elements in various arrays.
Double_t EffCorrection(Double_t trkETA, Double_t trkPT, AliAnalysisTaskEmcal::BeamType beamType) const
! Number of elements in centrality binned arrays
THnSparse * fhnMixedEvents
! Mixed events THnSparse
void AccessSetOfYBinValues(TH2D *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
virtual void SetMixedEventTriggerType(UInt_t me)
Set the mixed event trigger selection.
Bool_t fDoLessSparseAxes
True if there should be fewer THnSparse axes.
const char Option_t
Definition: External.C:48
virtual void SetMinNEventsForMixedEvents(Int_t nme)
const Int_t nbins
bool Bool_t
Definition: External.C:53
void SetDisableFastPartition(Bool_t b=kTRUE)
True if the task should be disabled for the fast parititon.
Int_t fNMixingTracks
size of track buffer for event mixing
UInt_t fMixingEventType
Event selection for mixed events.
Definition: External.C:196
virtual void SetNCentBinsMixedEvent(Bool_t centbins)
virtual void SetTrackBias(Double_t b)
Require a track with pt > b in jet.
TH2 * fHistJetH[6][5][3]
! Jet-hadron correlations (the arrays correspond to centrality, jet pt bins, and eta bins) ...
THnSparse * fhnJH
! JetH THnSparse
TH2 * fHistTrackEtaPhi[7]
! Track eta-phi distribution (the array corresponds to track pt)
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)