AliPhysics  cdeda5a (cdeda5a)
 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 
4 class TH1;
5 class TH2;
6 class TH3;
7 class THnSparse;
8 class AliEmcalJet;
9 class AliEventPoolManager;
10 class AliTLorentzVector;
11 
13 
15  public:
16  enum jetBias_t {
17  kDisableBias = 10000
18  };
19 
21  AliAnalysisTaskEmcalJetHMEC(const char *name);
23 
24 
25  // Jet bias - setters
26  virtual void SetTrackBias(Double_t b) { fTrackBias = b; } //require a track with pt > b in jet
27  virtual void SetClusterBias(Double_t b) { fClusterBias = b; } //require a cluster with pt > b in jet
28  // Event trigger/mixed selection - setters
29  virtual void SetTriggerType(UInt_t te) { fTriggerType = te; }
31  // Mixed events
32  virtual void SetEventMixing(Bool_t enable) { fDoEventMixing = enable;}
33  virtual void SetNumberOfMixingTracks(Int_t tracks) { fNMixingTracks = tracks; }
36  virtual void SetNCentBinsMixedEvent(Bool_t centbins) { fNCentBinsMixedEvent = centbins; }
37  // Switch to cut out some unneeded sparse axis
39  void SetDoWiderTrackBin(Bool_t wtrbin) { fDoWiderTrackBin = wtrbin; }
40  // set efficiency correction
41  void SetDoEffCorr(Int_t effcorr) { fDoEffCorrection = effcorr; }
42  virtual void SetEffCorrFunc(Double_t efffunc) { fEffFunctionCorrection = efffunc; }
43  // Set embedding correction
45 
46  virtual void UserCreateOutputObjects();
47  virtual void Terminate(Option_t *);
48 
49  // AddTask
51  const char *nTracks = "usedefault",
52  const char *nCaloClusters = "usedefault",
53  // Jet options
54  const Double_t trackBias = 5,
55  const Double_t clusterBias = 5,
56  const Double_t minJetArea = 0.4,
57  // Mixed event options
58  const Int_t nTracksMixedEvent = 0, // Additionally acts as a switch for enabling mixed events
59  const Int_t minNTracksMixedEvent = 5000,
60  const Int_t minNEventsMixedEvent = 5,
61  const UInt_t nCentBinsMixedEvent = 10,
62  // Triggers
63  UInt_t trigEvent = AliVEvent::kAny,
64  UInt_t mixEvent = AliVEvent::kAny,
65  // Options
66  const char *CentEst = "V0M",
67  const Int_t nCentBins = 5,
68  const Double_t trackEta = 0.9,
69  const Bool_t lessSparseAxes = 0,
70  const Bool_t widerTrackBin = 0,
71  // Corrections
72  const Int_t doEffCorrSW = 0,
73  const Bool_t embeddingCorrection = kFALSE,
74  const char * embeddingCorrectionFilename = "alien:///alice/cern.ch/user/r/rehlersi/embeddingCorrection.root",
75  const char * embeddingCorrectionHistName = "embeddingCorrection",
76  const char *suffix = "biased"
77  );
78 
79  protected:
80 
81  // NOTE: This is not an ideal way to resolve the size of histogram initialization.
82  // Will be resolved when we move fully to the THnSparse
89  };
90 
91  // EMCal framework functions
92  void ExecOnce();
93  Bool_t Run();
94 
95  // Reduce event mixing memory usage
97  // Histogram helper functions
98  virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
99  virtual void GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
100  // Binning helper functions
101  virtual Int_t GetEtaBin(Double_t eta) const;
102  virtual Int_t GetTrackPtBin(Double_t pt) const;
103  virtual Int_t GetJetPtBin(Double_t pt) const;
104  // Helper functions
105  void InitializeArraysToZero();
106  void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR);
107  // Test for biased jet
109  // Corrections
110  virtual Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const; // efficiency correction function
111  // Fill methods which allow for the embedding correction
112  void FillHist(TH1 * hist, Double_t fillValue, Double_t weight = 1.0, Bool_t noCorrection = kTRUE);
113  void FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight = 1.0, Bool_t noCorrection = kTRUE);
114  void accessSetOfYBinValues(TH2F * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor = -1.0);
115 
116  // Jet bias
119  // Event Mixing
125  AliEventPoolManager *fPoolMgr;
126  // Event selection types
129  // Efficiency correction
132  // Embedding correction
134  // Histogram binning variables
137 
138  // TODO: Consider moving to THistManager
143 
146  TH2 *fHistJetH[6][5][3];
147  TH2 *fHistJetHBias[6][5][3];
149  THnSparse *fhnMixedEvents;
150  THnSparse *fhnJH;
151 
152  private:
153 
154  AliAnalysisTaskEmcalJetHMEC(const AliAnalysisTaskEmcalJetHMEC&); // not implemented
156 
158 };
159 #endif
void accessSetOfYBinValues(TH2F *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
virtual void SetTriggerType(UInt_t te)
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
Definition: External.C:236
UInt_t fNCentBinsMixedEvent
N cent bins for the event mixing pool.
Definition: External.C:244
virtual Int_t GetTrackPtBin(Double_t pt) const
ClassDef(AliAnalysisTaskEmcalJetHMEC, 11)
AliEventPoolManager * fPoolMgr
! Event pool manager
Int_t nCentBins
virtual Int_t GetJetPtBin(Double_t pt) const
Int_t fMinNTracksMixedEvents
threshold to use event pool # tracks
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
AliAnalysisTaskEmcalJetHMEC & operator=(const AliAnalysisTaskEmcalJetHMEC &)
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 char *CentEst="V0M", const Int_t nCentBins=5, const Double_t trackEta=0.9, const Bool_t lessSparseAxes=0, const Bool_t widerTrackBin=0, const Int_t doEffCorrSW=0, const Bool_t embeddingCorrection=kFALSE, const char *embeddingCorrectionFilename="alien:///alice/cern.ch/user/r/rehlersi/embeddingCorrection.root", const char *embeddingCorrectionHistName="embeddingCorrection", const char *suffix="biased")
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TH3 * fHistJHPsi
! Psi angle distribution
virtual void SetMinNTracksForMixedEvents(Int_t nmt)
virtual Int_t GetEtaBin(Double_t eta) const
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kTRUE)
Double_t fClusterBias
Jet cluster bias.
virtual void SetClusterBias(Double_t b)
virtual void SetEventMixing(Bool_t enable)
Definition: External.C:220
virtual void SetNumberOfMixingTracks(Int_t tracks)
THnSparse * fhnMixedEvents
! Mixed events THnSparse
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)
const char Option_t
Definition: External.C:48
virtual void SetMinNEventsForMixedEvents(Int_t nme)
virtual void SetEffCorrFunc(Double_t efffunc)
const Int_t nbins
bool Bool_t
Definition: External.C:53
Int_t fNMixingTracks
size of track buffer for event mixing
virtual Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const
Definition: External.C:196
virtual void SetNCentBinsMixedEvent(Bool_t centbins)
virtual void SetTrackBias(Double_t b)
THnSparse * fhnJH
! JetH THnSparse
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)