AliPhysics  e469bb5 (e469bb5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetExtractor.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEmcalJetExtractor_H
2 #define AliAnalysisTaskEmcalJetExtractor_H
3 
4 // $Id$
5 
6 class TH1;
7 class TH2;
8 class TH3;
9 class AliJetContainer;
12 class AliRhoParameter;
13 
14 #include <vector>
16 
17 
18 //###############################################################################################################################################3
19 
20 
22  public:
23 
25  AliAnalysisTaskEmcalJetExtractor(const char *name);
27 
29  void Initialize(Int_t modus, const char* treeName);
30  void DefineExtraction(Int_t type, Int_t criterium, Double_t minPt, Double_t maxPt, Double_t percentage);
31 
32  protected:
33  void ExecOnce();
34  Bool_t FillHistograms() ;
35  Bool_t Run() ;
36 
39  void* fJetBuffer;
40  TTree* fJetsOutput;
41  Int_t fCounter; // Event counter
42  TRandom3* fRandom; // Randomizer object
43  Bool_t fIsExtractionDefined; // trigger if extraction is defined
44  Int_t fExtractionType; // specifies how the jets are saved. 0-AliEmcalJet,1-AliBasicJet,2-AliBasicJet w/constituents
45  Int_t fExtractionCriterium; // criterium for extraction: 0-MinBias
46  Double_t fExtractionMinPt; // Jet min pt for extraction
47  Double_t fExtractionMaxPt; // Jet max pt for extraction
48  Double_t fExtractionPercentage; // extraction percentage, rest is thrown away
49 
50  private:
53 
54  void PrintSettings(); // Show all relevant settings (to be executed once after task is started)
55 
56  // ######### HISTOGRAM HELPER FUNCTIONS
57  void FillHistogram(const char * key, Double_t x);
58  void FillHistogram(const char * key, Double_t x, Double_t y);
59  void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add);
60  template <class T> T* AddHistogram1D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis");
61  template <class T> T* AddHistogram2D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, Int_t yBins = 100, Double_t yMin = 0.0, Double_t yMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis", const char* zTitle = "z axis");
62 
63 
64  ClassDef(AliAnalysisTaskEmcalJetExtractor, 1) // Jet extractor task
65 };
66 
67 //###############################################################################################################################################3
68 
69 class AliBasicJetConstituent : public TObject
70 {
71  public:
72  AliBasicJetConstituent() : fEta(0), fPhi(0), fpT(0), fCharge(0) {}
73  AliBasicJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
74  : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
75  {
76  }
78 
79  Bool_t IsEqual(const TObject* obj) { return (obj->GetUniqueID() == GetUniqueID()); }
80  Double_t Pt() { return fpT; }
81  Double_t Phi() { return fPhi; }
82  Double_t Eta() { return fEta; }
83  Short_t Charge() { return fCharge; }
84 
85  private:
86  Float_t fEta; // eta
87  Float_t fPhi; // phi
88  Float_t fpT; // pT
89  Short_t fCharge; // charge
90 
91  ClassDef( AliBasicJetConstituent, 1); // very basic jet constituent object
92 };
93 
94 //###############################################################################################################################################3
95 
96 class AliBasicJet : public TObject
97 {
98  public:
100  AliBasicJet(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t radius, Float_t area, Float_t bgrd, Long64_t id, Short_t cent)
101  : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge), fRadius(radius), fArea(area), fBackgroundDensity(bgrd), fEventID(id), fCentrality(cent), fConstituents()
102  {
103  }
105 
106  // Basic jet properties
107  Bool_t IsEqual(const TObject* obj) { return (obj->GetUniqueID() == GetUniqueID()); }
108  Double_t Pt() { return fpT; }
109  Double_t Phi() { return fPhi; }
110  Double_t Eta() { return fEta; }
111  Short_t Charge() { return fCharge; }
112  Double_t Radius() { return fRadius; }
113  Double_t Area() { return fArea; }
114  Double_t BackgroundDensity() { return fBackgroundDensity; }
115  Long64_t EventID() { return fEventID; }
116  Short_t Centrality() { return fCentrality; }
117  Int_t GetNumbersOfConstituents() { return fConstituents.size(); }
118 
119  // Basic constituent functions
120  AliBasicJetConstituent* GetJetConstituent(Int_t index) { return &fConstituents[index]; }
121  void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
122  {
123  AliBasicJetConstituent c (eta, phi, pt, charge);
124  AddJetConstituent(&c);
125  }
126  void AddJetConstituent(AliBasicJetConstituent* constituent) {fConstituents.push_back(*constituent); }
127 
128 
129  private:
130  Float_t fEta; // eta
131  Float_t fPhi; // phi
132  Float_t fpT; // pT
133  Short_t fCharge; // charge
134  Float_t fRadius; // jet radius
135  Float_t fArea; // jet area
136  Float_t fBackgroundDensity; // background
137  Long64_t fEventID; // Unique event id
138  Short_t fCentrality; // centrality
139 
140  std::vector<AliBasicJetConstituent> fConstituents; // vector of constituents
141 
142  ClassDef( AliBasicJet, 2); // very basic jet object
143 };
144 
145 #endif
Int_t charge
void Initialize(Int_t modus, const char *treeName)
const char * title
Definition: MakeQAPdf.C:26
AliBasicJetConstituent * GetJetConstituent(Int_t index)
AliAnalysisTaskEmcalJetExtractor & operator=(const AliAnalysisTaskEmcalJetExtractor &)
Container with name, TClonesArray and cuts for particles.
AliBasicJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
TTree * fJetsOutput
buffer for one jet (that will be saved to the tree)
void AddJetConstituent(AliBasicJetConstituent *constituent)
Container for particles within the EMCAL framework.
Bool_t IsEqual(const TObject *obj)
Int_t fCounter
Jets that will be saved to a tree.
void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
AliBasicJet(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t radius, Float_t area, Float_t bgrd, Long64_t id, Short_t cent)
T * AddHistogram1D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis")
std::vector< AliBasicJetConstituent > fConstituents
void DefineExtraction(Int_t type, Int_t criterium, Double_t minPt, Double_t maxPt, Double_t percentage)
ClassDef(AliBasicJet, 2)
ClassDef(AliBasicJetConstituent, 1)
Bool_t IsEqual(const TObject *obj)
T * AddHistogram2D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, Int_t yBins=100, Double_t yMin=0.0, Double_t yMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
Container structure for EMCAL clusters.
void FillHistogram(const char *key, Double_t x)