AliPhysics  5b5fbb3 (5b5fbb3)
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 class AliBasicParticle;
8 class AliAODPid;
9 
10 //###############################################################################################################################################3
20 //
22 {
23  public:
25  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)
26  {
27  fCutName = cutName;
28  fOutputName = outputName;
29  fPtMin = minPt;
30  fPtMax = maxPt;
31  fCentMin = minCent;
32  fCentMax = maxCent;
33 
34  fCutLowerPercentageOffset = lowerOffset;
35  fCut2DOffset = offset2D;
36  fCut2DSlope = slope2D;
37 
38  fJetVetoPt = jetVetoPt;
39 
40  fAcceptedJets = 0;
41  fArrayIndex = -1;
42  }
43  Bool_t IsCutFulfilled(Double_t pt, Double_t mcPt, Double_t cent, Double_t ptRatio, Double_t vetoPt)
44  {
45  // Simple kinematic cuts
46  if(pt < fPtMin || pt >= fPtMax)
47  return kFALSE;
48  if(cent < fCentMin || cent >= fCentMax)
49  return kFALSE;
50 
51  // jet veto
52  if(vetoPt >= fJetVetoPt)
53  return kFALSE;
54 
55  // Lower MC percentage cut
56  if(ptRatio < fCutLowerPercentageOffset)
57  return kFALSE;
58 
59  // Value of the 2D cut line. We cut everything above that
60  Double_t cutLineValue = fCut2DSlope*mcPt + fCut2DOffset;
61  if(ptRatio > cutLineValue)
62  return kFALSE;
63 
64  return kTRUE;
65  }
66 
75 
79 
80 
83 };
84 
85 //###############################################################################################################################################3
86 
98 //
100  public:
101 
103  AliAnalysisTaskChargedJetsHadronCF(const char *name);
105 
106  void UserCreateOutputObjects();
107  void Terminate(Option_t *option);
108 
109  // ######### SETTERS/GETTERS
110  void ActivateJetEmbedding(const char* embArray, const char* embTrackArray, Double_t maxDistance, Int_t numMatchedJets)
111  {
112  fJetEmbeddingMaxDistance = maxDistance;
113  fJetEmbeddingArrayName = embArray;
114  fJetEmbeddingTrackArrayName = embTrackArray;
115  fJetEmbeddingNumMatchedJets = numMatchedJets;
116  }
117  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)
118  {
119  AliChargedJetsHadronCFCuts tmpCut(cutName, outputName, minPt, maxPt, minCent, maxCent, lowerOffset, offset2D, slope2D, jetVetoPt);
120  fJetEmbeddingCuts.push_back(tmpCut);
121  }
122 
123  void SetJetVetoArrayName(const char* name) { fJetVetoArrayName = name; }
124  void SetJetVetoJetByJet(Bool_t val) { fJetVetoJetByJet = val; }
125  void SetUsePerTrackMCPercentage(Bool_t val) { fJetEmbeddingUsePerTrackMCPercentage = val; }
126  void SetUseBgrdForMCPercentage(Bool_t val) { fJetEmbeddingUseBgrdForMCPercentage = val; }
127  void SetCreateEmbeddingPtPlotPerCut(Bool_t val) { fJetEmbeddingCreatePtPlotPerCut = val; }
128  void SetConstPtFilterBit(Int_t val) { fConstPtFilterBit = val; }
129  void SetNumberOfCentralityBins(Int_t val) { fNumberOfCentralityBins = val; }
130  void SetJetParticleArrayName(const char* name) { fJetParticleArrayName = name; }
131  void SetTrackParticleArrayName(const char* name) { fTrackParticleArrayName = name; }
132 
133  void SetJetOutputMode(Int_t mode) {fJetOutputMode = mode;}
134  void ActivateEventExtraction(Double_t percentage, Double_t minJetPt, Double_t maxJetPt) {fEventExtractionPercentage = percentage; fEventExtractionMinJetPt = minJetPt; fEventExtractionMaxJetPt = maxJetPt;}
135  void SetTrackExtractionPercentagePower(Double_t val) { fTrackExtractionPercentagePower = val; }
136 
137  void SetNumRandomConesPerEvent(Int_t val) { fNumRandomConesPerEvent = val; }
138 
139  void SetUseConstituents(Bool_t data, Bool_t mc) { fUseDataConstituents = data; fUseMCConstituents = mc;}
140 
141  void SetRemoveEventOutliers(Bool_t val) { fRemoveEventOutliers = val; }
142 
143 
144  protected:
145  void ExecOnce();
146  Bool_t Run();
147 
148  // ######### META FUNCTIONS
149  void BinLogAxis(const THn *h, Int_t axisNumber);
150  void AddEventToTree();
151  void AddJetToOutputArray(AliEmcalJet* jet, Int_t arrayIndex, Int_t& jetsAlreadyInArray);
152  void AddTrackToOutputArray(AliVTrack* track);
153  void AddTrackToTree(AliVTrack* track);
154  void FillHistogramsTracks(AliVTrack* track);
155  void FillHistogramsJets(AliEmcalJet* jet, const char* cutName);
156  Bool_t IsJetSelected(AliEmcalJet* jet);
157 
163 
166  std::vector<TClonesArray*> fJetsOutput;
167  TClonesArray *fTracksOutput;
170  TClonesArray *fJetEmbeddingArray;
178  std::vector<AliChargedJetsHadronCFCuts> fJetEmbeddingCuts;
179 
180  TClonesArray *fJetVetoArray;
183  std::vector<AliEmcalJet*> fMatchedJets;
184  std::vector<AliEmcalJet*> fMatchedJetsReference;
185  TRandom3* fRandom;
188  AliAODPid* fTreeBufferPID;
192 
196 
197  // Criteria for the selection of jets that are passed to the correlation task
199 
200  // Event properties
207 
208  // ######### HISTOGRAM FUNCTIONS
209  void FillHistogram(const char * key, Double_t x);
210  void FillHistogram(const char * key, Double_t x, Double_t y);
211  void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add);
212  void FillHistogram3D(const char * key, Double_t x, Double_t y, Double_t z, Double_t add = 0);
213 
214  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");
215  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");
216  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");
217 
218  // ######### HELPER FUNCTIONS
219  void CalculateJetType(AliEmcalJet* jet, Int_t& typeIC, Int_t& typeHM);
220  void GetTrackMCRatios(AliEmcalJet* jet, AliEmcalJet* mcJet, Double_t& trackRatio, Double_t& ptRatio);
221  AliEmcalJet* GetVetoJet(AliEmcalJet* jet);
222  AliEmcalJet* GetLeadingVetoJet();
223 
224  AliEmcalJet* GetReferenceJet(AliEmcalJet* jet);
225  Bool_t IsTrackInCone(AliVParticle* track, Double_t eta, Double_t phi, Double_t radius);
226  void GetInitialCollisionJets();
227  void GetMatchingJets();
228 
229  void GetLeadingJets(const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading);
230  void GetLeadingJetsInArray(TClonesArray* arr, const char* opt, AliEmcalJet*& jetLeading, AliEmcalJet*& jetSubLeading);
231  void CalculateEventProperties();
232 
233 
234  private:
236  AliAnalysisTaskChargedJetsHadronCF &operator=(const AliAnalysisTaskChargedJetsHadronCF&); // not implemented
237 
239  ClassDef(AliAnalysisTaskChargedJetsHadronCF, 12) // Charged jet+h analysis support task
241 };
242 
243 
244 
245 #endif
Int_t fArrayIndex
array index that holds the output array index
Double_t fEventExtractionMaxJetPt
maximum jet pt of recorded events
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.
const char * title
Definition: MakeQAPdf.C:27
std::vector< AliChargedJetsHadronCFCuts > fJetEmbeddingCuts
Cuts used in jet embedding.
Double_t fCentMax
valid for centralities below
Container with name, TClonesArray and cuts for particles.
Support task for (charged) jet-hadron correlations.
AliBasicParticle * fTreeBufferTrack
! Tree of extracted jets (buffer)
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
Bool_t fUseMCConstituents
If true, tracks with labels >= 10000 will be processed.
std::vector< AliEmcalJet * > fMatchedJetsReference
Jets matched in an event (reference)
Double_t fEventExtractionPercentage
percentage of events that is recorded
std::vector< TClonesArray * > fJetsOutput
! vector of arrays of basic correlation particles attached to the event (jets)
AliEmcalJet * fSubleadingJet
! subleading jet (calculated event-by-event)
Double_t fCentMin
valid for centralities above
Container class of cuts for AliAnalysisTaskChargedJetsHadronCF.
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
TClonesArray * fJetEmbeddingArray
! Array of generated jets imported into task (for embedding)
Double_t fTrackExtractionPercentagePower
Extraction percentage for tracks.
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)
Bool_t fJetEmbeddingCreatePtPlotPerCut
create TH3 per cut or only once
int Int_t
Definition: External.C:63
AliAODPid * fTreeBufferPID
! Tree of extracted jets (buffer)
TString fJetParticleArrayName
Name of fJetsOutput array (if one uses only one)
TString fJetEmbeddingArrayName
Name of array used to match jets.
Int_t fNumberOfCentralityBins
Number of centrality bins.
Int_t fTreeBufferPDG
! Tree of extracted jets (buffer)
std::vector< AliEmcalJet * > fMatchedJets
Jets matched in an event (embedded)
TString fJetEmbeddingTrackArrayName
Name of array used to match tracks of jets.
Bool_t fUseDataConstituents
If true, tracks with labels < 10000 will be processed.
TString fTrackParticleArrayName
Name of fTracksOutput array.
Int_t mode
Definition: anaM.C:41
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 fPtMax
valid for jets below this pT
void ActivateJetEmbedding(const char *embArray, const char *embTrackArray, Double_t maxDistance, Int_t numMatchedJets)
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.
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
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:51
Bool_t fJetEmbeddingUseBgrdForMCPercentage
When cutting on MC percentage, use bgrd. corr to calculate MC percentage.
const char Option_t
Definition: External.C:48
void ActivateEventExtraction(Double_t percentage, Double_t minJetPt, Double_t maxJetPt)
bool Bool_t
Definition: External.C:53
Double_t fJetEmbeddingMaxDistance
Max distance allowed to accept an embedded jet.
Double_t yMin
Int_t fAcceptedJets
! number accepted jets (calculated event-by-event)
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)
Int_t fNumRandomConesPerEvent
Number of random cones thrown in one event.
Double_t yMax
Int_t fConstPtFilterBit
For const pt plot, filter bit.