AliPhysics  5eaf189 (5eaf189)
AliAnalysisTaskEmcalJetHCorrelations.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEmcalJetHCorrelations_H
2 #define AliAnalysisTaskEmcalJetHCorrelations_H
3 
20 #include <vector>
21 
22 class TH1;
23 class TH2;
24 class TH3;
25 class THnSparse;
26 class AliEmcalJet;
27 class AliEventPoolManager;
28 class AliTLorentzVector;
29 
30 class AliEmcalJet;
31 class AliJetContainer;
33 
34 #include "THistManager.h"
36 
37 namespace PWGJE {
38 namespace EMCALJetTasks {
39 
41  public:
46  enum jetBias_t {
47  kDisableBias = 10000
48  };
49 
57  kEffPP = 10,
58  };
59 
61  AliAnalysisTaskEmcalJetHCorrelations(const char *name);
63 
64  Double_t GetTrackBias() const { return fTrackBias; }
65  Double_t GetClusterBias() const { return fClusterBias; }
66 
67  // Jet bias - setters
69  virtual void SetTrackBias(Double_t b) { fTrackBias = b; }
71  virtual void SetClusterBias(Double_t b) { fClusterBias = b; }
72 
73  // Event trigger/mixed selection - setters
75  virtual void SetTriggerType(UInt_t te) { fTriggerType = te; }
91 
92  // Mixed events
93  virtual void SetEventMixing(Bool_t enable) { fDoEventMixing = enable;}
94  virtual void SetNumberOfMixingTracks(Int_t tracks) { fNMixingTracks = tracks; }
97  virtual void SetNCentBinsMixedEvent(Bool_t centbins) { fNCentBinsMixedEvent = centbins; }
98  // Switch to cut out some unneeded sparse axis
100  void SetDoWiderTrackBin(Bool_t wtrbin) { fDoWiderTrackBin = wtrbin; }
101  // Set efficiency correction
105  // Setup JES correction
108 
110 
111  // Corrections
112  // Public so that it can be tested externally
114 
115  virtual void UserCreateOutputObjects();
116 
117  // AddTask
119  const char *nTracks = "usedefault",
120  const char *nCaloClusters = "usedefault",
121  // Jet options
122  const Double_t trackBias = 5,
123  const Double_t clusterBias = 5,
124  // Mixed event options
125  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
126  const Int_t minNTracksMixedEvent = 5000,
127  const Int_t minNEventsMixedEvent = 5,
128  const UInt_t nCentBinsMixedEvent = 10,
129  // Triggers
130  UInt_t trigEvent = AliVEvent::kAny,
131  UInt_t mixEvent = AliVEvent::kAny,
132  // Options
133  const Bool_t lessSparseAxes = kFALSE,
134  const Bool_t widerTrackBin = kFALSE,
135  // Corrections
137  const Bool_t JESCorrection = kFALSE,
138  const char * JESCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root",
139  const char * JESCorrectionHistName = "JESCorrection",
140  const char *suffix = "biased"
141  );
142 
143  bool ConfigureForStandardAnalysis(std::string trackName = "usedefault",
144  std::string clusName = "usedefault",
145  const double jetConstituentPtCut = 3,
146  const double trackEta = 0.8,
147  const double jetRadius = 0.2);
148 
149  bool ConfigureForEmbeddingAnalysis(std::string trackName = "usedefault",
150  std::string clusName = "caloClustersCombined",
151  const double jetConstituentPtCut = 3,
152  const double trackEta = 0.8,
153  const double jetRadius = 0.2,
154  const std::string & jetTag = "hybridLevelJets",
155  const std::string & correlationsTracksCutsPeriod = "lhc11a");
156 
157  protected:
158 
159  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
160  // Will be resolved when we move fully to the THnSparse
169  };
170 
171  // EMCal framework functions
172  void ExecOnce();
173  Bool_t Run();
174 
175  // Utility functions
176  AliParticleContainer * CreateParticleOrTrackContainer(const std::string & collectionName) const;
177 
178  // Determine if a jet has been matched
179  bool CheckForMatchedJet(AliJetContainer * jets, AliEmcalJet * jet, const std::string & histName);
180  // Apply artificial tracking inefficiency
181  bool CheckArtificialTrackEfficiency(unsigned int trackIndex, std::vector<unsigned int> & rejectedTrackIndices, bool useRejectedList);
182  // Reduce event mixing memory usage
183  TObjArray* CloneAndReduceTrackList(std::vector<unsigned int> & rejectedTrackIndices, const bool useRejectedList);
184  // Histogram helper functions
185  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
186  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
187  // Binning helper functions
188  Int_t GetTrackPtBin(Double_t pt) const;
189  UInt_t RetrieveTriggerMask() const;
190  // Helper functions
191  void InitializeArraysToZero();
192  void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR);
193  Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const;
194  // Test for biased jet
196  // Corrections
197  Double_t EffCorrection(Double_t trkETA, Double_t trkPT) const;
198 
199  // Fill methods which allow for the JES correction
200  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
201  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
202  void AccessSetOfYBinValues(TH2D * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
203 
204  // Jet bias
207  // Event Mixing
213  AliEventPoolManager *fPoolMgr;
214  // Event selection types
218  // Efficiency correction
221  // JES correction
224  // Histogram binning variables
231 
232  // Histograms
238 
241  THnSparse *fhnMixedEvents;
242  THnSparse *fhnJH;
243  THnSparse *fhnTrigger;
244 
245  // Pb-Pb Efficiency correction coefficients
246  static Double_t p0_10SG[17];
247  static Double_t p10_30SG[17];
248  static Double_t p30_50SG[17];
249  static Double_t p50_90SG[17];
250  // Good Runs
251  static Double_t p0_10G[17];
252  static Double_t p10_30G[17];
253  static Double_t p30_50G[17];
254  static Double_t p50_90G[17];
255 
256  private:
257 
260 
262 };
263 
264 } /* namespace EMCALJetTasks */
265 } /* namespace PWGJE */
266 
267 #endif
bool CheckArtificialTrackEfficiency(unsigned int trackIndex, std::vector< unsigned int > &rejectedTrackIndices, bool useRejectedList)
Bool_t fNoMixedEventJESCorrection
True if the jet energy scale correction should be applied to mixed event histograms.
void AccessSetOfYBinValues(TH2D *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
bool ConfigureForEmbeddingAnalysis(std::string trackName="usedefault", std::string clusName="caloClustersCombined", const double jetConstituentPtCut=3, const double trackEta=0.8, const double jetRadius=0.2, const std::string &jetTag="hybridLevelJets", const std::string &correlationsTracksCutsPeriod="lhc11a")
const char * filename
Definition: TestFCM.C:1
double Double_t
Definition: External.C:58
bool CheckForMatchedJet(AliJetContainer *jets, AliEmcalJet *jet, const std::string &histName)
Definition: External.C:244
Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const
AliAnalysisTaskEmcalJetHCorrelations & operator=(const AliAnalysisTaskEmcalJetHCorrelations &)
TH2D * fJESCorrectionHist
Histogram containing the jet energy scale correction.
virtual void SetTrackBias(Double_t b)
Require a track with pt > b in jet.
TH1 * fHistJetPtBias[6]
! Jet pt spectrum of jets which meet the constituent bias criteria (the array corresponds to centrali...
Bool_t fDoLessSparseAxes
True if there should be fewer THnSparse axes.
Double_t fMaxMatchedJetDistance
Maximum distance between two matched jets.
Bool_t fDoWiderTrackBin
True if the track pt bins in the THnSparse should be wider.
UInt_t fTriggerType
Event selection for jets (ie triggered events).
bool ConfigureForStandardAnalysis(std::string trackName="usedefault", std::string clusName="usedefault", const double jetConstituentPtCut=3, const double trackEta=0.8, const double jetRadius=0.2)
Container for particles within the EMCAL framework.
TObjArray * CloneAndReduceTrackList(std::vector< unsigned int > &rejectedTrackIndices, const bool useRejectedList)
AliParticleContainer * CreateParticleOrTrackContainer(const std::string &collectionName) const
BeamType
Switch for the beam type.
double GetMinimumSharedMomentumFraction() const
Mimimum shared momentum fraction for matched jet.
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
int Int_t
Definition: External.C:63
virtual void SetClusterBias(Double_t b)
Require a cluster with pt > b in jet.
unsigned int UInt_t
Definition: External.C:33
static AliAnalysisTaskEmcalJetHCorrelations * AddTaskEmcalJetHCorrelations(const char *nTracks="usedefault", const char *nCaloClusters="usedefault", const Double_t trackBias=5, const Double_t clusterBias=5, 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 Bool_t lessSparseAxes=kFALSE, const Bool_t widerTrackBin=kFALSE, const AliAnalysisTaskEmcalJetHCorrelations::ESingleTrackEfficiency_t singleTrackEfficiency=AliAnalysisTaskEmcalJetHCorrelations::kEffDisable, 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")
Definition: External.C:228
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kFALSE)
virtual void SetMixedEventTriggerType(UInt_t me)
Set the mixed event trigger selection.
Bool_t RetrieveAndInitializeJESCorrectionHist(TString filename, TString histName, Double_t trackBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias, Double_t clusterBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias)
Double_t EffCorrection(Double_t trkETA, Double_t trkPT, AliAnalysisTaskEmcal::BeamType beamType) const
Bool_t GetRequireMatchedJetWhenEmbedding() const
Require jet to be matched when embedding.
Double_t fMinSharedMomentumFraction
Minimum shared momentum with matched jet.
Bool_t fRequireMatchedJetWhenEmbedding
True if jets are required to be matched (ie. jet->MatchedJet() != nullptr)
TH2 * fHistTrackEtaPhi[7]
! Track eta-phi distribution (the array corresponds to track pt)
Definition: External.C:220
TH1 * fHistJetPt[6]
! Jet pt spectrum (the array corresponds to centrality bins)
Bool_t fDisableFastPartition
True if task should be disabled for the fast partition, where the EMCal is not included.
void SetArtificialTrackingInefficiency(double eff)
Artificial tracking inefficiency from 0 to 1. 1.0 (default) will disable it.
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Container class for histograms.
Definition: THistManager.h:99
void ExecOnce()
Perform steps needed to initialize the analysis.
TH2 * fHistJetHEtaPhi
! Eta-phi distribution of jets which are in jet-hadron correlations
void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector &particleOne, AliVParticle *particleTwo, Double_t &deltaEta, Double_t &deltaPhi, Double_t &deltaR)
! Auto configure the single track efficiency based on the beam type, centrality, and run quality (num...
ESingleTrackEfficiency_t fSingleTrackEfficiencyCorrectionType
Control the efficiency correction. See EffCorrection() for meaning of values.
const Int_t nbins
bool Bool_t
Definition: External.C:53
virtual void SetTriggerType(UInt_t te)
Set the trigger event trigger selection.
! Arbitrarily large value which can be used to disable the constituent bias. Can be used for either t...
void SetDisableFastPartition(Bool_t b=kTRUE)
True if the task should be disabled for the fast partition.
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
Container for jet within the EMCAL jet framework.
bool fRequireMatchedPartLevelJet
True if matched jets are required to be matched to a particle level jet.
Definition: External.C:196
Double_t fArtificialTrackInefficiency
Artificial track inefficiency. Enabled if < 1.0.