AliPhysics  6bc8652 (6bc8652)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskJetExtractor.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKJETEXTRACTOR_H
2 #define ALIANALYSISTASKJETEXTRACTOR_H
3 
4 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 class THn;
8 class AliAODVertex;
9 class AliBasicJet;
11 
12 //###############################################################################################################################################3
13 
25 //
27  public:
28 
30  AliAnalysisTaskJetExtractor(const char *name);
33  void Terminate(Option_t *option);
34 
35  // ################## SETTERS
36  void SetExtractionCuts(Double_t percentage, Double_t minPt, Double_t maxPt, Int_t minCent = -1, Int_t maxCent = -1)
37  {
38  fExtractionPercentage = percentage;
39  fExtractionCutMinPt = minPt;
40  fExtractionCutMaxPt = maxPt;
41  fExtractionCutMinCent = minCent;
42  fExtractionCutMaxCent = maxCent;
43  }
44 
47  void SetTruthParticleArrayName(const char* val) { fTruthParticleArrayName = val; }
50  void SetAddPIDSignal(Bool_t val) { fAddPIDSignal = val; }
51 
52  void SetExtractionCutListPIDHM(const char* val)
53  {
54  fExtractionListPIDsHM.clear();
55  TString tmpStr = val;
56  TObjArray* tmpArr = tmpStr.Tokenize(",");
57  for (Int_t i=0; i<tmpArr->GetEntries(); i++)
58  {
59  Int_t val = atoi((static_cast<TObjString*>(tmpArr->At(i)))->GetString().Data());
60  fExtractionListPIDsHM.push_back(val);
61  }
62  fExtractionCutUseHM = kTRUE;
63  fExtractionCutUseIC = kFALSE;
64  }
65 
66  void SetExtractionCutListPIDIC(const char* val)
67  {
68  fExtractionListPIDsIC.clear();
69  TString tmpStr = val;
70  TObjArray* tmpArr = tmpStr.Tokenize(",");
71  for (Int_t i=0; i<tmpArr->GetEntries(); i++)
72  {
73  Int_t val = atoi((static_cast<TObjString*>(tmpArr->At(i)))->GetString().Data());
74  fExtractionListPIDsIC.push_back(val);
75  }
76  fExtractionCutUseIC = kTRUE;
77  fExtractionCutUseHM = kFALSE;
78  }
79  // ##################
80 
81  protected:
83  void ExecOnce();
84  Bool_t Run();
85  // ##################
87  void AddJetToTree(AliEmcalJet* jet);
88  // ##################
91  // ##################
94  void GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading);
95 
97  void CalculateJetType(AliEmcalJet* jet, Int_t& typeIC, Int_t& typeHM);
98  Double_t GetTrackImpactParameter(const AliVVertex* vtx, AliAODTrack* track);
99  void AddSecondaryVertices(const AliVVertex* vtx, AliEmcalJet* jet, AliBasicJet& basicJet);
100  void AddPIDInformation(AliVParticle* particle, AliBasicJetConstituent& constituent);
101 
102 
103  // ################## BASIC EVENT VARIABLES
108  TRandom3* fRandom;
109 
110  // ################## CURRENT PROPERTIES
121 
122  // ################## CUTS
130  std::vector<Int_t> fExtractionListPIDsHM;
131  std::vector<Int_t> fExtractionListPIDsIC;
132 
133 
140 
141 
142  // ######### HISTOGRAM FUNCTIONS
143  void FillHistogram(const char * key, Double_t x);
144  void FillHistogram(const char * key, Double_t x, Double_t y);
145  void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add);
146  void FillHistogram3D(const char * key, Double_t x, Double_t y, Double_t z, Double_t add = 0);
147  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");
148  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");
149  template <class T> T* AddHistogram3D(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, Int_t zBins = 100, Double_t zMin = 0.0, Double_t zMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis", const char* zTitle = "z axis");
150 
151 
152  private:
153  AliAnalysisTaskJetExtractor(const AliAnalysisTaskJetExtractor&); // not implemented
155 
157  ClassDef(AliAnalysisTaskJetExtractor, 1) // Jet extraction task
159 };
160 
161 
162 //###############################################################################################################################################3
163 
173 //
175 {
176  public:
178  AliBasicPID(Float_t its, Float_t tpc, Float_t tof, Float_t trd, Short_t truthPID, Short_t recoPID)
179  : fSignalITS(its), fSignalTPC(tpc), fSignalTOF(tof), fSignalTRD(trd), fTruthPID(truthPID), fRecoPID(recoPID)
180  {
181  }
182  ~AliBasicPID();
183 
188  Short_t TruthPID() { return fTruthPID; }
189  Short_t RecoPID() { return fRecoPID; }
190 
191  private:
198 };
199 
200 //###############################################################################################################################################3
201 
211 //
213 {
214  public:
215  AliBasicJetConstituent() : fEta(0), fPhi(0), fpT(0), fCharge(0), fVx(0), fVy(0), fVz(0), fImpactParameter(0), fPID(0) {}
217  : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge), fVx(vx), fVy(vy), fVz(vz), fImpactParameter(z), fPID(0)
218  {
219  }
221 
222  Float_t Pt() { return fpT; }
223  Float_t Phi() { return fPhi; }
224  Float_t Eta() { return fEta; }
225  Short_t Charge() { return fCharge; }
226 
227  Float_t Vx() { return fVx; }
228  Float_t Vy() { return fVy; }
229  Float_t Vz() { return fVz; }
230 
232  AliBasicPID* PID() { return &fPID.at(0); }
233 
234  void SetPIDSignal(Float_t its, Float_t tpc, Float_t tof, Float_t trd, Short_t truthPID, Short_t recoPID)
235  {
236  if(fPID.size()) fPID.clear();
237  AliBasicPID* newPID = new AliBasicPID(its,tpc,tof,trd,truthPID,recoPID);
238  fPID.push_back(*newPID);
239  }
240 
241  private:
246 
250 
252  std::vector<AliBasicPID> fPID;
253 };
254 
255 //###############################################################################################################################################3
256 
266 //
268 {
269  public:
272  : fVx(vx), fVy(vy), fVz(vz), fChi2(chi2), fDispersion(dispersion)
273  {
274  }
276 
277  Float_t Vx() { return fVx; }
278  Float_t Vy() { return fVy; }
279  Float_t Vz() { return fVz; }
280 
281  Float_t Chi2() { return fChi2; }
283  private:
284 
290 };
291 
292 //###############################################################################################################################################3
303 //
305 {
306  public:
308  AliBasicJet(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t radius, Float_t area, Int_t partidIC, Int_t partidHM, Float_t bgrd, Float_t magfield, Float_t vtxX, Float_t vtxY, Float_t vtxZ, Long64_t id, Short_t cent)
309  : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge), fRadius(radius), fArea(area), fMotherInitialCollision(partidIC), fMotherHadronMatching(partidHM), fBackgroundDensity(bgrd), fMagneticField(magfield), fVertexX(vtxX), fVertexY(vtxY), fVertexZ(vtxZ), fEventID(id), fCentrality(cent), fConstituents()
310  {}
311  ~AliBasicJet();
312 
313  // Basic jet properties
314  Double_t Pt() { return fpT; }
315  Double_t TruePt() { return fTruepT; }
316  Double_t Phi() { return fPhi; }
317  Double_t Eta() { return fEta; }
318  Short_t Charge() { return fCharge; }
319  Double_t Radius() { return fRadius; }
320  Double_t Area() { return fArea; }
325  Double_t VertexX() { return fVertexX; }
326  Double_t VertexY() { return fVertexY; }
327  Double_t VertexZ() { return fVertexZ; }
328  Long64_t EventID() { return fEventID; }
332  void SetTruePt(Double_t val) {fTruepT = val;}
333 
334  // Basic constituent functions
337  {
338  AliBasicJetConstituent c (eta, phi, pt, charge, vx, vy, vz, z);
339  AddJetConstituent(&c);
340  }
341  void AddJetConstituent(AliBasicJetConstituent* constituent) {fConstituents.push_back(*constituent); }
342 
343  // Basic secondary vertex functions
345  void AddSecondaryVertex(Float_t vx, Float_t vy, Float_t vz, Float_t chi2=0, Float_t dispersion=0)
346  {
347  AliBasicJetSecondaryVertex vtx (vx, vy, vz, chi2, dispersion);
348  AddSecondaryVertex(&vtx);
349  }
351 
352  private:
369 
370  std::vector<AliBasicJetSecondaryVertex> fSecondaryVertices;
371  std::vector<AliBasicJetConstituent> fConstituents;
372 
373 };
374 
375 
376 #endif
Int_t charge
Int_t fExtractionCutMinCent
Extraction cut: minimum centrality.
void CalculateJetType(AliEmcalJet *jet, Int_t &typeIC, Int_t &typeHM)
Float_t fChi2
Chi2/ndf for vertex.
std::vector< AliBasicJetSecondaryVertex > fSecondaryVertices
vector of sec. vertices
void AddPIDInformation(AliVParticle *particle, AliBasicJetConstituent &constituent)
AliEmcalJet * fCurrentInitialParton1
! jet that matches the initial parton 1 (PYTHIA)
void SetExtractionCutListPIDIC(const char *val)
double Double_t
Definition: External.C:58
TString fTruthParticleArrayName
Array name of MC particles in event (mcparticles)
const char * title
Definition: MakeQAPdf.C:26
AliAnalysisTaskJetExtractor & operator=(const AliAnalysisTaskJetExtractor &)
Double_t fExtractionCutMinPt
Extraction cut: minimum pT.
long long Long64_t
Definition: External.C:43
AliBasicJetConstituent * GetJetConstituent(Int_t index)
Float_t fDispersion
Dispersion of vertex.
T * AddHistogram3D(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, Int_t zBins=100, Double_t zMin=0.0, Double_t zMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
Float_t fSignalITS
ITS PID signal.
AliEmcalJet * fCurrentLeadingJet
! leading jet (calculated event-by-event)
Int_t fExtractionCutMaxCent
Extraction cut: maximum centrality.
Container with name, TClonesArray and cuts for particles.
Double_t fSecondaryVertexMaxChi2
Max chi2 of secondary vertex (others will be discarded)
Double_t fSecondaryVertexMaxDispersion
Max dispersion of secondary vertex (others will be discarded)
TCanvas * c
Definition: TestFitELoss.C:172
Int_t fMotherHadronMatching
PDG code of source particle (according to matched hadrons around the jet)
void AddJetConstituent(AliBasicJetConstituent *constituent)
AliTrackContainer * fTracksCont
! Tracks
void AddSecondaryVertices(const AliVVertex *vtx, AliEmcalJet *jet, AliBasicJet &basicJet)
Simple class containing basic information for a constituent.
Float_t fBackgroundDensity
background
void SetExtractionCuts(Double_t percentage, Double_t minPt, Double_t maxPt, Int_t minCent=-1, Int_t maxCent=-1)
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")
void SetExtractionCutListPIDHM(const char *val)
void AddSecondaryVertex(Float_t vx, Float_t vy, Float_t vz, Float_t chi2=0, Float_t dispersion=0)
Int_t fCurrentInitialParton2Type
type of initial parton 2
Simple class containing basic information for a jet.
Bool_t fExtractionCutUseIC
Extraction cut: Use IC PID.
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
void SetSecondaryVertexMaxDispersion(Double_t val)
AliBasicJetSecondaryVertex(Float_t vx, Float_t vy, Float_t vz, Float_t chi2, Float_t dispersion)
Simple class containing available (raw) information from PID detectors.
AliEmcalJet * fCurrentInitialParton2
! jet that matches the initial parton 2 (PYTHIA)
void AddSecondaryVertex(AliBasicJetSecondaryVertex *vtx)
Float_t fVertexX
event vertex X
Long64_t fEventID
Unique event id.
AliBasicJet(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t radius, Float_t area, Int_t partidIC, Int_t partidHM, Float_t bgrd, Float_t magfield, Float_t vtxX, Float_t vtxY, Float_t vtxZ, Long64_t id, Short_t cent)
void SetTruePt(Double_t val)
void FillHistogram3D(const char *key, Double_t x, Double_t y, Double_t z, Double_t add=0)
int Int_t
Definition: External.C:63
Int_t fCurrentNJetsInEvents
number of jets in event
void * fJetsTreeBuffer
! buffer for one jet (that will be saved to the tree)
TRandom3 * fRandom
random number generator
float Float_t
Definition: External.C:68
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")
Short_t fTruthPID
truth PID
Float_t fVx
production vertex X
Bool_t fFoundIC
status var showing that IC has been found
Float_t fVertexY
event vertex Y
Float_t fVz
production vertex Z
Float_t fArea
jet area
Double_t fExtractionPercentage
Percentage of extracted jets.
Float_t fVy
production vertex Y
AliBasicJetSecondaryVertex * GetSecondaryVertex(Int_t index)
std::vector< Int_t > fExtractionListPIDsIC
list of PIDs (initial collision) that will be accepted
AliEmcalJet * fCurrentSubleadingJet
! subleading jet (calculated event-by-event)
Double_t GetTrackImpactParameter(const AliVVertex *vtx, AliAODTrack *track)
Float_t fRadius
jet radius
Short_t fCentrality
centrality
Int_t fMotherInitialCollision
PDG code of source particle (= initial collision quark/hadron)
short Short_t
Definition: External.C:23
Float_t fMagneticField
event magnetic field
void SetTruthParticleArrayName(const char *val)
void FillHistogram(const char *key, Double_t x)
Simple class containing basic information for a secondary vertex This class is used to save secondary...
std::vector< AliBasicPID > fPID
PID.
void SetInitialCollisionMatchingRadius(Double_t val)
Bool_t fExtractionCutUseHM
Extraction cut: Use hadron matching PID.
std::vector< Int_t > fExtractionListPIDsHM
list of PIDs (hadron matching) that will be accepted
Bool_t fAddPIDSignal
Add pid signal to each jet constituent.
Int_t fCurrentInitialParton1Type
type of initial parton 1
Double_t fExtractionCutMaxPt
Extraction cut: minimum pT.
std::vector< AliBasicJetConstituent > fConstituents
vector of constituents
Short_t fRecoPID
reco PID
Float_t fSignalTRD
TRD PID signal.
Double_t fHadronMatchingRadius
Matching radius to search for beauty/charm hadrons around jet.
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Float_t fSignalTOF
TOF PID signal.
Int_t fCurrentJetTypeHM
current jet type from hadron matching
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
void GetLeadingJets(const char *opt, AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
Float_t fImpactParameter
impact parameter z
void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t vx=0, Float_t vy=0, Float_t vz=0, Float_t z=0)
void SetPIDSignal(Float_t its, Float_t tpc, Float_t tof, Float_t trd, Short_t truthPID, Short_t recoPID)
TTree * fJetsTree
! Jets that will be saved to a tree (optionally)
Int_t fCurrentJetTypeIC
current jet type from initial collision (PYTHIA)
void FillJetControlHistograms(AliEmcalJet *jet)
Double_t fInitialCollisionMatchingRadius
Matching radius to find a jet of the IC.
Container for jet within the EMCAL jet framework.
AliBasicJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Float_t vx, Float_t vy, Float_t vz, Float_t z)
AliBasicPID(Float_t its, Float_t tpc, Float_t tof, Float_t trd, Short_t truthPID, Short_t recoPID)
Float_t fSignalTPC
TPC PID signal.
Float_t fVertexZ
event vertex Z
Float_t fTruepT
true pT (optional, e.g. from matching)