AliPhysics  bba8f44 (bba8f44)
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 
35 
37  public:
42  enum jetBias_t {
43  kDisableBias = 10000
44  };
45 
53  kEffPP = 10,
54  };
55 
57  AliAnalysisTaskEmcalJetHCorrelations(const char *name);
59 
60  Double_t GetTrackBias() const { return fTrackBias; }
61  Double_t GetClusterBias() const { return fClusterBias; }
62 
63  // Jet bias - setters
65  virtual void SetTrackBias(Double_t b) { fTrackBias = b; }
67  virtual void SetClusterBias(Double_t b) { fClusterBias = b; }
68 
69  // Event trigger/mixed selection - setters
71  virtual void SetTriggerType(UInt_t te) { fTriggerType = te; }
83 
84  // Mixed events
85  virtual void SetEventMixing(Bool_t enable) { fDoEventMixing = enable;}
86  virtual void SetNumberOfMixingTracks(Int_t tracks) { fNMixingTracks = tracks; }
89  virtual void SetNCentBinsMixedEvent(Bool_t centbins) { fNCentBinsMixedEvent = centbins; }
90  // Switch to cut out some unneeded sparse axis
92  void SetDoWiderTrackBin(Bool_t wtrbin) { fDoWiderTrackBin = wtrbin; }
93  // Set efficiency correction
97  // Setup JES correction
98  void SetJESCorrectionHist(TH2D * hist) { fJESCorrectionHist = hist; }
100 
102 
103  // Corrections
104  // Public so that it can be tested externally
106 
107  virtual void UserCreateOutputObjects();
108 
109  // AddTask
111  const char *nTracks = "usedefault",
112  const char *nCaloClusters = "usedefault",
113  // Jet options
114  const Double_t trackBias = 5,
115  const Double_t clusterBias = 5,
116  // Mixed event options
117  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
118  const Int_t minNTracksMixedEvent = 5000,
119  const Int_t minNEventsMixedEvent = 5,
120  const UInt_t nCentBinsMixedEvent = 10,
121  // Triggers
122  UInt_t trigEvent = AliVEvent::kAny,
123  UInt_t mixEvent = AliVEvent::kAny,
124  // Options
125  const Bool_t lessSparseAxes = kFALSE,
126  const Bool_t widerTrackBin = kFALSE,
127  // Corrections
129  const Bool_t JESCorrection = kFALSE,
130  const char * JESCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root",
131  const char * JESCorrectionHistName = "JESCorrection",
132  const char *suffix = "biased"
133  );
134 
135  bool ConfigureForStandardAnalysis(std::string trackName = "usedefault",
136  std::string clusName = "usedefault",
137  const double jetConstituentPtCut = 3,
138  const double trackEta = 0.8,
139  const double jetRadius = 0.2);
140 
141  bool ConfigureForEmbeddingAnalysis(std::string trackName = "usedefault",
142  std::string clusName = "caloClustersCombined",
143  const double jetConstituentPtCut = 3,
144  const double trackEta = 0.8,
145  const double jetRadius = 0.2,
146  const std::string & jetTag = "hybridJets",
147  const std::string & correlationsTracksCutsPeriod = "lhc11a");
148 
149  protected:
150 
151  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
152  // Will be resolved when we move fully to the THnSparse
161  };
162 
163  // EMCal framework functions
164  void ExecOnce();
165  Bool_t Run();
166 
167  // Utility functions
168  AliParticleContainer * CreateParticleOrTrackContainer(std::string const & collectionName) const;
169 
170  // Determine if a jet has been matched
171  bool CheckForMatchedJet(AliJetContainer * jets, AliEmcalJet * jet);
172  // Apply artificial tracking inefficiency
173  bool CheckArtificialTrackEfficiency(unsigned int trackIndex, std::vector<unsigned int> & rejectedTrackIndices, bool useRejectedList);
174  // Reduce event mixing memory usage
175  TObjArray* CloneAndReduceTrackList(std::vector<unsigned int> & rejectedTrackIndices, const bool useRejectedList);
176  // Histogram helper functions
177  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
178  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
179  // Binning helper functions
180  Int_t GetTrackPtBin(Double_t pt) const;
181  UInt_t RetrieveTriggerMask() const;
182  // Helper functions
183  void InitializeArraysToZero();
184  void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR);
185  Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const;
186  // Test for biased jet
188  // Corrections
189  Double_t EffCorrection(Double_t trkETA, Double_t trkPT) const;
190 
191  // Fill methods which allow for the JES correction
192  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
193  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
194  void AccessSetOfYBinValues(TH2D * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
195 
196  // Jet bias
199  // Event Mixing
205  AliEventPoolManager *fPoolMgr;
206  // Event selection types
210  // Efficiency correction
213  // JES correction
216  // Histogram binning variables
221 
222  // Histograms
227 
230  THnSparse *fhnMixedEvents;
231  THnSparse *fhnJH;
232  THnSparse *fhnTrigger;
233 
234  // Pb-Pb Efficiency correction coefficients
235  static Double_t p0_10SG[17];
236  static Double_t p10_30SG[17];
237  static Double_t p30_50SG[17];
238  static Double_t p50_90SG[17];
239  // Good Runs
240  static Double_t p0_10G[17];
241  static Double_t p10_30G[17];
242  static Double_t p30_50G[17];
243  static Double_t p50_90G[17];
244 
245  private:
246 
249 
253 };
254 #endif
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
Bool_t RetrieveAndInitializeJESCorrectionHist(TString filename, TString histName, Double_t trackBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias, Double_t clusterBias=AliAnalysisTaskEmcalJetHCorrelations::kDisableBias)
Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kFALSE)
const char * filename
Definition: TestFCM.C:1
virtual void SetTrackBias(Double_t b)
Require a track with pt > b in jet.
void SetDisableFastPartition(Bool_t b=kTRUE)
True if the task should be disabled for the fast partition.
jetBias_t
Default value used to disable constituent bias.
double Double_t
Definition: External.C:58
static Double_t p50_90SG[17]
50-90% centrality semi-good runs
AliParticleContainer * CreateParticleOrTrackContainer(std::string const &collectionName) const
Double_t fMinSharedMomentumFraction
Minimum shared momentum with matched jet.
Bool_t fDisableFastPartition
True if task should be disabled for the fast partition, where the EMCal is not included.
void AccessSetOfYBinValues(TH2D *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
Definition: External.C:244
Bool_t GetRequireMatchedJetWhenEmbedding() const
Require jet to be matched when embedding.
static Double_t p0_10SG[17]
0-10% centrality semi-good runs
double GetMinimumSharedMomentumFraction() const
Mimimum shared momentum fraction for matched jet.
Bool_t fRequireMatchedJetWhenEmbedding
True if jets are required to be matched (ie. jet->MatchedJet() != nullptr)
ESingleTrackEfficiency_t fSingleTrackEfficiencyCorrectionType
Control the efficiency correction. See EffCorrection() for meaning of values.
static Double_t p10_30G[17]
10-30% centrality good runs
virtual void SetMixedEventTriggerType(UInt_t me)
Set the mixed event trigger selection.
TH2D * fJESCorrectionHist
Histogram containing the jet energy scale correction.
TH1 * fHistJetPt[6]
! Jet pt spectrum (the array corresponds to centrality bins)
void ExecOnce()
Perform steps needed to initialize the analysis.
TH2 * fHistJetHEtaPhi
! Eta-phi distribution of jets which are in jet-hadron correlations
UInt_t fTriggerType
Event selection for jets (ie triggered events).
Container for particles within the EMCAL framework.
TObjArray * CloneAndReduceTrackList(std::vector< unsigned int > &rejectedTrackIndices, const bool useRejectedList)
BeamType
Switch for the beam type.
TH2 * fHistTrackEtaPhi[7]
! Track eta-phi distribution (the array corresponds to track pt)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
! Explicitly select pp single track efficiency
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="hybridJets", const std::string &correlationsTracksCutsPeriod="lhc11a")
bool CheckForMatchedJet(AliJetContainer *jets, AliEmcalJet *jet)
Definition: External.C:228
bool CheckArtificialTrackEfficiency(unsigned int trackIndex, std::vector< unsigned int > &rejectedTrackIndices, bool useRejectedList)
virtual void SetTriggerType(UInt_t te)
Set the trigger event trigger selection.
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")
Bool_t fDoWiderTrackBin
True if the track pt bins in the THnSparse should be wider.
THnSparse * fhnMixedEvents
! Mixed events THnSparse
UInt_t fMixingEventType
Event selection for mixed events.
static Double_t p50_90G[17]
50-90% centrality good runs
! Number of elements in mixed event multiplicity binned arrays
Int_t fMinNTracksMixedEvents
threshold to use event pool # tracks
AliAnalysisTaskEmcalJetHCorrelations & operator=(const AliAnalysisTaskEmcalJetHCorrelations &)
! Arbitrarily large value which can be used to disable the constituent bias. Can be used for either t...
bool ConfigureForStandardAnalysis(std::string trackName="usedefault", std::string clusName="usedefault", const double jetConstituentPtCut=3, const double trackEta=0.8, const double jetRadius=0.2)
Bool_t fNoMixedEventJESCorrection
True if the jet energy scale correction should be applied to mixed event histograms.
AliEventPoolManager * fPoolMgr
! Event pool manager
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
static Double_t p0_10G[17]
0-10% centrality good runs
Definition: External.C:220
! Auto configure the single track efficiency based on the beam type, centrality, and run quality (num...
Base task in the EMCAL jet framework.
Double_t EffCorrection(Double_t trkETA, Double_t trkPT, AliAnalysisTaskEmcal::BeamType beamType) const
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
ESingleTrackEfficiency_t
Define the single track efficiency to apply.
static Double_t p30_50SG[17]
30-50% centrality semi-good runs
void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector &particleOne, AliVParticle *particleTwo, Double_t &deltaEta, Double_t &deltaPhi, Double_t &deltaR)
binArrayLimits_t
Define the number of elements in various arrays.
const Int_t nbins
Bool_t fDoLessSparseAxes
True if there should be fewer THnSparse axes.
bool Bool_t
Definition: External.C:53
Jet-hadron correlations analysis task for central Pb-Pb and pp.
UInt_t fNCentBinsMixedEvent
N cent bins for the event mixing pool.
void SetSingleTrackEfficiencyType(ESingleTrackEfficiency_t trackEffType)
TH1 * fHistJetPtBias[6]
! Jet pt spectrum of jets which meet the constituent bias criteria (the array corresponds to centrali...
virtual void SetClusterBias(Double_t b)
Require a cluster with pt > b in jet.
Int_t fMinNEventsMixedEvents
threshold to use event pool # events
Int_t fNMixingTracks
size of track buffer for event mixing
void SetArtificialTrackingInefficiency(double eff)
Artificial tracking inefficiency from 0 to 1. 1.0 (default) will disable it.
static Double_t p30_50G[17]
30-50% centrality good runs
Container for jet within the EMCAL jet framework.
static Double_t p10_30SG[17]
10-30% centrality semi-good runs
Definition: External.C:196
Double_t fArtificialTrackInefficiency
Artificial track inefficiency. Enabled if < 1.0.