AliPhysics  f9b5d69 (f9b5d69)
AliAnalysisTaskEmcalJetHCorrelations.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEmcalJetHCorrelations_H
2 #define AliAnalysisTaskEmcalJetHCorrelations_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  AliAnalysisTaskEmcalJetHCorrelations(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; }
64 
65  // Mixed events
66  virtual void SetEventMixing(Bool_t enable) { fDoEventMixing = enable;}
67  virtual void SetNumberOfMixingTracks(Int_t tracks) { fNMixingTracks = tracks; }
70  virtual void SetNCentBinsMixedEvent(Bool_t centbins) { fNCentBinsMixedEvent = centbins; }
71  // Switch to cut out some unneeded sparse axis
73  void SetDoWiderTrackBin(Bool_t wtrbin) { fDoWiderTrackBin = wtrbin; }
74  // set efficiency correction
75  void SetDoEffCorr(Int_t effcorr) { fDoEffCorrection = effcorr; }
76  // Setup JES correction
77  void SetJESCorrectionHist(TH2D * hist) { fJESCorrectionHist = hist; }
79 
81 
82  // Corrections
83  // Public so that it can be tested externally
85 
86  virtual void UserCreateOutputObjects();
87 
88  // AddTask
90  const char *nTracks = "usedefault",
91  const char *nCaloClusters = "usedefault",
92  // Jet options
93  const Double_t trackBias = 5,
94  const Double_t clusterBias = 5,
95  // Mixed event options
96  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
97  const Int_t minNTracksMixedEvent = 5000,
98  const Int_t minNEventsMixedEvent = 5,
99  const UInt_t nCentBinsMixedEvent = 10,
100  // Triggers
101  UInt_t trigEvent = AliVEvent::kAny,
102  UInt_t mixEvent = AliVEvent::kAny,
103  // Options
104  const Bool_t lessSparseAxes = kFALSE,
105  const Bool_t widerTrackBin = kFALSE,
106  // Corrections
107  const Int_t doEffCorrSW = 0,
108  const Bool_t JESCorrection = kFALSE,
109  const char * JESCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root",
110  const char * JESCorrectionHistName = "JESCorrection",
111  const char *suffix = "biased"
112  );
113 
114  bool ConfigureForStandardAnalysis(std::string trackName = "usedefault",
115  std::string clusName = "usedefault",
116  const double jetConstituentPtCut = 3,
117  const double trackEta = 0.8,
118  const double jetRadius = 0.2);
119 
120  bool ConfigureForEmbeddingAnalysis(std::string trackName = "usedefault",
121  std::string clusName = "caloClustersCombined",
122  const double jetConstituentPtCut = 3,
123  const double trackEta = 0.8,
124  const double jetRadius = 0.2,
125  const std::string & jetTag = "hybridJets",
126  const std::string & correlationsTracksCutsPeriod = "lhc11a");
127 
128  protected:
129 
130  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
131  // Will be resolved when we move fully to the THnSparse
140  };
141 
142  // EMCal framework functions
143  Bool_t Run();
144 
145  // Utility functions
146  AliParticleContainer * CreateParticleOrTrackContainer(std::string const & collectionName) const;
147 
148  // Reduce event mixing memory usage
150  // Histogram helper functions
151  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
152  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
153  // Binning helper functions
154  Int_t GetTrackPtBin(Double_t pt) const;
155  UInt_t RetrieveTriggerMask() const;
156  // Helper functions
157  void InitializeArraysToZero();
158  void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR);
159  Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const;
160  // Test for biased jet
162  // Corrections
163  Double_t EffCorrection(Double_t trkETA, Double_t trkPT) const;
164 
165  // Fill methods which allow for the JES correction
166  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
167  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
168  void AccessSetOfYBinValues(TH2D * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
169 
170  // Jet bias
173  // Event Mixing
179  AliEventPoolManager *fPoolMgr;
180  // Event selection types
184  // Efficiency correction
186  // JES correction
189  // Histogram binning variables
193 
194  // TODO: Consider moving to THistManager
199 
202  THnSparse *fhnMixedEvents;
203  THnSparse *fhnJH;
204  THnSparse *fhnTrigger;
205 
206  // Pb-Pb Efficiency correction coefficients
207  static Double_t p0_10SG[17];
208  static Double_t p10_30SG[17];
209  static Double_t p30_50SG[17];
210  static Double_t p50_90SG[17];
211  // Good Runs
212  static Double_t p0_10G[17];
213  static Double_t p10_30G[17];
214  static Double_t p30_50G[17];
215  static Double_t p50_90G[17];
216 
217  private:
218 
221 
225 };
226 #endif
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 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")
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 parititon.
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
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
Bool_t fRequireMatchedJetWhenEmbedding
True if jets are required to be matched (ie. jet->MatchedJet() != nullptr)
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)
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.
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
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")
Definition: External.C:228
virtual void SetTriggerType(UInt_t te)
Set the trigger event trigger selection.
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
Int_t fDoEffCorrection
Control the efficiency correction. See EffCorrection() for meaning of values.
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
static Double_t p0_10G[17]
0-10% centrality good runs
Definition: External.C:220
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
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.
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
static Double_t p30_50G[17]
30-50% centrality good runs
static Double_t p10_30SG[17]
10-30% centrality semi-good runs
Definition: External.C:196