AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskChargedJetsHadronCF.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKCHARGEDJETSHADRONCF_H
2 #define ALIANALYSISTASKCHARGEDJETSHADRONCF_H
3 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 class THn;
7 
8 //###############################################################################################################################################3
18 //
20 {
21  public:
23  AliChargedJetsHadronCFCuts(const char* cutName, const char* outputName, Double_t minPt, Double_t maxPt, Double_t minCent, Double_t maxCent, Double_t lowerOffset, Double_t offset2D, Double_t slope2D, Double_t jetVetoPt)
24  {
25  fCutName = cutName;
26  fOutputName = outputName;
27  fPtMin = minPt;
28  fPtMax = maxPt;
29  fCentMin = minCent;
30  fCentMax = maxCent;
31 
32  fCutLowerPercentageOffset = lowerOffset;
33  fCut2DOffset = offset2D;
34  fCut2DSlope = slope2D;
35 
36  fJetVetoPt = jetVetoPt;
37 
38  fAcceptedJets = 0;
39  fArrayIndex = -1;
40  }
41  Bool_t IsCutFulfilled(Double_t pt, Double_t mcPt, Double_t cent, Double_t ptRatio, Double_t vetoPt)
42  {
43  // Simple kinematic cuts
44  if(pt < fPtMin || pt >= fPtMax)
45  return kFALSE;
46  if(cent < fCentMin || cent >= fCentMax)
47  return kFALSE;
48 
49  // jet veto
50  if(vetoPt >= fJetVetoPt)
51  return kFALSE;
52 
53  // Lower MC percentage cut
54  if(ptRatio < fCutLowerPercentageOffset)
55  return kFALSE;
56 
57  // Value of the 2D cut line. We cut everything above that
58  Double_t cutLineValue = fCut2DSlope*mcPt + fCut2DOffset;
59  if(ptRatio > cutLineValue)
60  return kFALSE;
61 
62  return kTRUE;
63  }
64 
73 
77 
78 
81 };
82 
83 //###############################################################################################################################################3
84 
96 //
98  public:
99 
101  AliAnalysisTaskChargedJetsHadronCF(const char *name);
103 
105  void Terminate(Option_t *option);
106 
107  // ######### SETTERS/GETTERS
108  void ActivateJetEmbedding(const char* embArray, const char* embTrackArray, Double_t maxDistance, Int_t numMatchedJets)
109  {
110  fJetEmbeddingMaxDistance = maxDistance;
111  fJetEmbeddingArrayName = embArray;
112  fJetEmbeddingTrackArrayName = embTrackArray;
113  fJetEmbeddingNumMatchedJets = numMatchedJets;
114  }
115  void AddJetEmbeddingCut(const char* cutName, const char* outputName, Double_t minPt, Double_t maxPt, Double_t minCent, Double_t maxCent, Double_t lowerOffset, Double_t offset2D, Double_t slope2D, Double_t jetVetoPt)
116  {
117  AliChargedJetsHadronCFCuts tmpCut(cutName, outputName, minPt, maxPt, minCent, maxCent, lowerOffset, offset2D, slope2D, jetVetoPt);
118  fJetEmbeddingCuts.push_back(tmpCut);
119  }
120 
121  void SetJetVetoArrayName(const char* name) { fJetVetoArrayName = name; }
128  void SetJetParticleArrayName(const char* name) { fJetParticleArrayName = name; }
129  void SetTrackParticleArrayName(const char* name) { fTrackParticleArrayName = name; }
131 
135 
136  void ActivateJetExtraction(Double_t percentage, Double_t minPt, Double_t maxPt) {fExtractionPercentage = percentage; fExtractionMinPt = minPt; fExtractionMaxPt = maxPt;}
137  void ActivateEventExtraction(Double_t percentage, Double_t minJetPt, Double_t maxJetPt) {fEventExtractionPercentage = percentage; fEventExtractionMinJetPt = minJetPt; fEventExtractionMaxJetPt = maxJetPt;}
138 
139  protected:
140  void ExecOnce();
141  Bool_t Run();
142 
143  // ######### META FUNCTIONS
144  void BinLogAxis(const THn *h, Int_t axisNumber);
145  void AddJetToTree(AliEmcalJet* jet);
146  void AddEventToTree();
147  void AddJetToOutputArray(AliEmcalJet* jet, Int_t arrayIndex, Int_t& jetsAlreadyInArray);
148  void AddTrackToOutputArray(AliVTrack* track);
149  void FillHistogramsTracks(AliVTrack* track);
150  void FillHistogramsJets(AliEmcalJet* jet, const char* cutName);
152 
163 
167  std::vector<TClonesArray*> fJetsOutput;
168  TClonesArray *fTracksOutput;
171  TClonesArray *fJetEmbeddingArray;
179  std::vector<AliChargedJetsHadronCFCuts> fJetEmbeddingCuts;
180 
181  TClonesArray *fJetVetoArray;
184  std::vector<AliEmcalJet*> fMatchedJets;
185  std::vector<AliEmcalJet*> fMatchedJetsReference;
186  TRandom3* fRandom;
187 
188 
189  // Criteria for the selection of jets that are passed to the correlation task
193 
194  // Event properties
201 
202  // ######### HISTOGRAM FUNCTIONS
203  void FillHistogram(const char * key, Double_t x);
204  void FillHistogram(const char * key, Double_t x, Double_t y);
205  void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add);
206  void FillHistogram3D(const char * key, Double_t x, Double_t y, Double_t z, Double_t add = 0);
207 
208  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");
209  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");
210  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");
211 
212  // ######### HELPER FUNCTIONS
213  void CalculateJetType(AliEmcalJet* jet, Int_t& typeIC, Int_t& typeHM);
214  void GetTrackMCRatios(AliEmcalJet* jet, AliEmcalJet* mcJet, Double_t& trackRatio, Double_t& ptRatio);
217 
219  Bool_t IsTrackInCone(AliVParticle* track, Double_t eta, Double_t phi, Double_t radius);
221  void GetMatchingJets();
222 
223  void GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading);
224  void GetLeadingJetsInArray(TClonesArray* arr, const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading);
226 
227 
228  private:
231 
233  ClassDef(AliAnalysisTaskChargedJetsHadronCF, 10) // Charged jet+h analysis support task
235 };
236 
237 
238 //###############################################################################################################################################3
239 
249 //
251 {
252  public:
253  AliBasicJetConstituent() : fEta(0), fPhi(0), fpT(0), fCharge(0), fPID(0), fVx(0), fVy(0), fVz(0) {}
255  : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge), fPID(pid), fVx(vx), fVy(vy), fVz(vz)
256  {
257  }
259 
260  Float_t Pt() { return fpT; }
261  Float_t Phi() { return fPhi; }
262  Float_t Eta() { return fEta; }
263  Short_t Charge() { return fCharge; }
264  Short_t PID() { return fPID; }
265 
266  Float_t Vx() { return fVx; }
267  Float_t Vy() { return fVy; }
268  Float_t Vz() { return fVz; }
269 
270  private:
276 
280 };
281 
282 //###############################################################################################################################################3
293 //
295 {
296  public:
298  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)
299  : 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()
300  {}
301  ~AliBasicJet();
302 
303  // Basic jet properties
304  Double_t Pt() { return fpT; }
305  Double_t TruePt() { return fTruepT; }
306  Double_t Phi() { return fPhi; }
307  Double_t Eta() { return fEta; }
308  Short_t Charge() { return fCharge; }
309  Double_t Radius() { return fRadius; }
310  Double_t Area() { return fArea; }
315  Double_t VertexX() { return fVertexX; }
316  Double_t VertexY() { return fVertexY; }
317  Double_t VertexZ() { return fVertexZ; }
318  Long64_t EventID() { return fEventID; }
321 
322  // Basic constituent functions
324  void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Short_t pid=0, Float_t vx=0, Float_t vy=0, Float_t vz=0)
325  {
326  AliBasicJetConstituent c (eta, phi, pt, charge, pid, vx, vy, vz);
327  AddJetConstituent(&c);
328  }
329  void AddJetConstituent(AliBasicJetConstituent* constituent) {fConstituents.push_back(*constituent); }
330  void SetTruePt(Double_t val) {fTruepT = val;}
331 
332 
333  private:
350 
351  std::vector<AliBasicJetConstituent> fConstituents;
352 
353 };
354 
355 
356 #endif
Int_t charge
Int_t fArrayIndex
array index that holds the output array index
Double_t fEventExtractionMaxJetPt
maximum jet pt of recorded events
void AddJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Short_t pid=0, Float_t vx=0, Float_t vy=0, Float_t vz=0)
double Double_t
Definition: External.C:58
Double_t fPtMin
valid for jets above this pT
Bool_t fJetVetoJetByJet
If true, the jet veto will be applied on a jet-by-jet basis.
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")
const char * title
Definition: MakeQAPdf.C:26
void GetLeadingJets(const char *opt, AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
std::vector< AliChargedJetsHadronCFCuts > fJetEmbeddingCuts
Cuts used in jet embedding.
Double_t fCentMax
valid for centralities below
long long Long64_t
Definition: External.C:43
AliBasicJetConstituent * GetJetConstituent(Int_t index)
void * fJetsTreeBuffer
! buffer for one jet (that will be saved to the tree)
Container with name, TClonesArray and cuts for particles.
Support task for (charged) jet-hadron correlations.
Int_t fPythiaExtractionMode
Mode which PYTHIA-jets to extract for fJetOutputMode==6: 0: all, 1: quark-jets, 2: gluon jets...
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)
Int_t fJetOutputMode
mode which jets are written to array (0: all accepted, 1: leading, 2: subleading, 3: leading+subleadi...
Double_t fEventExtractionMinJetPt
minimum jet pt of recorded events
std::vector< AliEmcalJet * > fMatchedJetsReference
Jets matched in an event (reference)
Double_t fEventExtractionPercentage
percentage of events that is recorded
Simple class containing basic information for a constituent.
std::vector< TClonesArray * > fJetsOutput
! vector of arrays of basic correlation particles attached to the event (jets)
Float_t fBackgroundDensity
background
AliEmcalJet * fSubleadingJet
! subleading jet (calculated event-by-event)
Double_t fCentMin
valid for centralities above
Simple class containing basic information for a jet.
void FillHistogram3D(const char *key, Double_t x, Double_t y, Double_t z, Double_t add=0)
Container class of cuts for AliAnalysisTaskChargedJetsHadronCF.
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
Bool_t fPythiaExtractionUseHadronMatching
Use hadron matching to select/label jets (works for b,c,s and others)
void GetLeadingJetsInArray(TClonesArray *arr, const char *opt, AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
TClonesArray * fJetEmbeddingArray
! Array of generated jets imported into task (for embedding)
void GetTrackMCRatios(AliEmcalJet *jet, AliEmcalJet *mcJet, Double_t &trackRatio, Double_t &ptRatio)
Float_t fVertexX
event vertex X
Long64_t fEventID
Unique event id.
void AddJetEmbeddingCut(const char *cutName, const char *outputName, Double_t minPt, Double_t maxPt, Double_t minCent, Double_t maxCent, Double_t lowerOffset, Double_t offset2D, Double_t slope2D, Double_t jetVetoPt)
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)
Bool_t fJetEmbeddingCreatePtPlotPerCut
create TH3 per cut or only once
int Int_t
Definition: External.C:63
TString fJetParticleArrayName
Name of fJetsOutput array (if one uses only one)
float Float_t
Definition: External.C:68
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")
TString fJetEmbeddingArrayName
Name of array used to match jets.
Int_t fNumberOfCentralityBins
Number of centrality bins.
std::vector< AliEmcalJet * > fMatchedJets
Jets matched in an event (embedded)
TString fJetEmbeddingTrackArrayName
Name of array used to match tracks of jets.
Float_t fVertexY
event vertex Y
Double_t fExtractionPercentage
percentage that is recorded
TString fTrackParticleArrayName
Name of fTracksOutput array.
AliBasicJetConstituent(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Short_t pid, Float_t vx, Float_t vy, Float_t vz)
Int_t mode
Definition: anaM.C:40
AliChargedJetsHadronCFCuts(const char *cutName, const char *outputName, Double_t minPt, Double_t maxPt, Double_t minCent, Double_t maxCent, Double_t lowerOffset, Double_t offset2D, Double_t slope2D, Double_t jetVetoPt)
TClonesArray * fTracksOutput
! Array of basic correlation particles attached to the event (tracks)
AliEmcalJet * fLeadingJet
! leading jet (calculated event-by-event)
Double_t fExtractionMinPt
minimum pt of recorded jets
void AddJetToOutputArray(AliEmcalJet *jet, Int_t arrayIndex, Int_t &jetsAlreadyInArray)
Int_t fMotherInitialCollision
PDG code of source particle (= initial collision quark/hadron)
Double_t fPtMax
valid for jets below this pT
void ActivateJetEmbedding(const char *embArray, const char *embTrackArray, Double_t maxDistance, Int_t numMatchedJets)
short Short_t
Definition: External.C:23
Float_t fMagneticField
event magnetic field
TTree * fJetsTree
! Jets that will be saved to a tree (optionally)
Bool_t IsTrackInCone(AliVParticle *track, Double_t eta, Double_t phi, Double_t radius)
Bool_t fJetEmbeddingUsePerTrackMCPercentage
When cutting on MC percentage, calculate it per track and not for all MC tracks.
Int_t fAcceptedJets
temporary var that holds how many jets passed
TString fJetVetoArrayName
Name of array used for veto jets.
Short_t fPID
most probably PID code/PDG code
Int_t fJetEmbeddingNumMatchedJets
Number of matched leading jets that will be used.
AliEmcalJet * fInitialPartonMatchedJet1
! On PYTHIA data and fJetOutputMode=6, this holds the PDG code of the initial collisions that was mat...
AliEmcalJet * fInitialPartonMatchedJet2
! On PYTHIA data and fJetOutputMode=6, this holds the PDG code of the initial collisions that was mat...
TString fOutputName
array name that is used to output objects associated with this cuts
std::vector< AliBasicJetConstituent > fConstituents
vector of constituents
Base task in the EMCAL jet framework.
Bool_t IsCutFulfilled(Double_t pt, Double_t mcPt, Double_t cent, Double_t ptRatio, Double_t vetoPt)
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Bool_t fJetEmbeddingUseBgrdForMCPercentage
When cutting on MC percentage, use bgrd. corr to calculate MC percentage.
AliAnalysisTaskChargedJetsHadronCF & operator=(const AliAnalysisTaskChargedJetsHadronCF &)
const char Option_t
Definition: External.C:48
void ActivateEventExtraction(Double_t percentage, Double_t minJetPt, Double_t maxJetPt)
Double_t fExtractionMaxPt
maximum pt of recorded jets
bool Bool_t
Definition: External.C:53
void CalculateJetType(AliEmcalJet *jet, Int_t &typeIC, Int_t &typeHM)
Double_t fJetEmbeddingMaxDistance
Max distance allowed to accept an embedded jet.
void FillHistogramsJets(AliEmcalJet *jet, const char *cutName)
void ActivateJetExtraction(Double_t percentage, Double_t minPt, Double_t maxPt)
Double_t fHadronMatchingRadius
Radius used in the hadron matching (MC jet extraction)
Int_t fAcceptedJets
! number accepted jets (calculated event-by-event)
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 for jet within the EMCAL jet framework.
TClonesArray * fJetVetoArray
! Array of jets imported into task used for veto a matching/embedding
Int_t fAcceptedTracks
! number accepted tracks (calculated event-by-event)
Float_t fVertexZ
event vertex Z
Float_t fTruepT
true pT (optional, e.g. from matching)
Int_t fConstPtFilterBit
For const pt plot, filter bit.