AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetHMEC.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; }
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 
84  // AddTask
86  const char *nTracks = "usedefault",
87  const char *nCaloClusters = "usedefault",
88  // Jet options
89  const Double_t trackBias = 5,
90  const Double_t clusterBias = 5,
91  // Mixed event options
92  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
93  const Int_t minNTracksMixedEvent = 5000,
94  const Int_t minNEventsMixedEvent = 5,
95  const UInt_t nCentBinsMixedEvent = 10,
96  // Triggers
97  UInt_t trigEvent = AliVEvent::kAny,
98  UInt_t mixEvent = AliVEvent::kAny,
99  // Options
100  const Bool_t lessSparseAxes = kFALSE,
101  const Bool_t widerTrackBin = kFALSE,
102  // Corrections
103  const Int_t doEffCorrSW = 0,
104  const Bool_t JESCorrection = kFALSE,
105  const char * JESCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/JESCorrection.root",
106  const char * JESCorrectionHistName = "JESCorrection",
107  const char *suffix = "biased"
108  );
109 
110  bool ConfigureForStandardAnalysis(std::string trackName = "usedefault",
111  std::string clusName = "usedefault",
112  const double jetConstituentPtCut = 3,
113  const double trackEta = 0.8,
114  const double jetRadius = 0.2);
115 
116  bool ConfigureForEmbeddingAnalysis(std::string trackName = "usedefault",
117  std::string clusName = "caloClustersCombined",
118  const double jetConstituentPtCut = 3,
119  const double trackEta = 0.8,
120  const double jetRadius = 0.2,
121  const std::string & jetTag = "hybridJets",
122  const std::string & correlationsTracksCutsPeriod = "lhc11a");
123 
124  protected:
125 
126  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
127  // Will be resolved when we move fully to the THnSparse
133  kMaxJetPtBins = 5,
134  kMaxTrackPtBins = 7,
135  kMaxCentralityBins = 5,
137  kMaxEtaBins = 3
138  };
139 
140  // EMCal framework functions
141  Bool_t Run();
142 
143  // Utility functions
144  AliParticleContainer * CreateParticleOrTrackContainer(std::string const & collectionName) const;
145 
146  // Reduce event mixing memory usage
148  // Histogram helper functions
149  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
150  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
151  // Binning helper functions
152  Int_t GetEtaBin(Double_t eta) const;
153  Int_t GetTrackPtBin(Double_t pt) const;
154  Int_t GetJetPtBin(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  // Test for biased jet
161  // Corrections
162  Double_t EffCorrection(Double_t trkETA, Double_t trkPT) const;
163 
164  // Fill methods which allow for the JES correction
165  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
166  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kFALSE);
167  void AccessSetOfYBinValues(TH2D * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
168 
169  // Jet bias
172  // Event Mixing
178  AliEventPoolManager *fPoolMgr;
179  // Event selection types
183  // Efficiency correction
185  // JES correction
188  // Histogram binning variables
191 
192  // TODO: Consider moving to THistManager
193  TH1 *fHistTrackPt;
195  TH2 *fHistTrackEtaPhi[7];
197 
198  TH1 *fHistJetPt[6];
199  TH1 *fHistJetPtBias[6];
200  TH2 *fHistJetH[6][5][3];
201  TH2 *fHistJetHBias[6][5][3];
202  TH3 *fHistJHPsi;
203  THnSparse *fhnMixedEvents;
204  THnSparse *fhnJH;
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)
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.
TH2 * fHistJetHBias[6][5][3]
! Jet-hadron correlations of jets which meet the constituent bias criteria (the arrays correspond to ...
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
static Double_t p0_10SG[17]
0-10% centrality semi-good runs
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.
TH2 * fHistJetH[6][5][3]
! Jet-hadron correlations (the arrays correspond to centrality, jet pt bins, and eta bins) ...
virtual void SetNCentBinsMixedEvent(Bool_t centbins)
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
virtual void SetNumberOfMixingTracks(Int_t tracks)
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