- added 2D histogram for correlation between nch & ngamma
[u/mrichter/AliRoot.git] / PWGJE / FlavourJetTasks / AliAnalysisTaskFlavourJetCorrelations.h
CommitLineData
c683985a 1#ifndef ALIANALYSISTASKFLAVOURJETCORRELATIONS_H
2#define ALIANALYSISTASKFLAVOURJETCORRELATIONS_H
3/**************************************************************************
b2705b43 4* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5* *
6* Author: The ALICE Off-line Project. *
7* Contributors are mentioned in the code where appropriate. *
8* *
9* Permission to use, copy, modify and distribute this software and its *
10* documentation strictly for non-commercial purposes is hereby granted *
11* without fee, provided that the above copyright notice appears in all *
12* copies and that both the copyright notice and this permission notice *
13* appear in the supporting documentation. The authors make no claims *
14* about the suitability of this software for any purpose. It is *
15* provided "as is" without express or implied warranty. *
16**************************************************************************/
c683985a 17
18//-----------------------------------------------------------------------
19// Author : A. Grelli, Utrecht University
20// C. Bianchin, Utrecht University
21// X. Zhang, LBNL
22//-----------------------------------------------------------------------
23
24
25#include <TH2F.h>
26#include "AliAODEvent.h"
27#include "AliPicoTrack.h"
28#include "AliAnalysisTaskEmcalJet.h"
29
30class TH3F;
31class TParticle ;
32class TClonesArray ;
33class AliMCParticle;
34class AliAODMCParticle;
35class AliRDHFCuts;
36class AliEmcalJet;
37class AliAODRecoDecayHF;
38class AliAODRecoCascadeHF;
39class AliAODEvent;
40
41class AliAnalysisTaskFlavourJetCorrelations : public AliAnalysisTaskEmcalJet
42{
b2705b43 43
44public:
45
46 enum ECandidateType{ kD0toKpi, kDstartoKpipi };
47
48 AliAnalysisTaskFlavourJetCorrelations();
49 AliAnalysisTaskFlavourJetCorrelations(const Char_t* name,AliRDHFCuts* cuts, ECandidateType candtype, Bool_t jetOnly=kFALSE);
50 virtual ~AliAnalysisTaskFlavourJetCorrelations();
51
52 virtual void UserCreateOutputObjects();
53 virtual Bool_t Run();
54 virtual void Terminate(Option_t *);
55 virtual void Init();
56 virtual void LocalInit() {Init();}
57
58 // inizializations
59 Bool_t DefineHistoForAnalysis();
60
61 // set MC usage
62 void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
63 Bool_t GetMC() const {return fUseMCInfo;}
64 // set usage of reconstructed tracks
65 void SetUseReco(Bool_t reco) {fUseReco=reco;}
66 Bool_t GetUseReco() const {return fUseReco;}
67 //no setter because needed in the constructor
68 Bool_t GetJetOnlyMode() const {return fJetOnlyMode;}
69 void SetTypeDJetSelection(Int_t type) {fTypeDInJet=type;} //see IsDInJet for possibilities
70 Int_t GetTypeDJetSelection() const {return fTypeDInJet;}
71
72 void SetMassLimits(Double_t range, Int_t pdg);
73 void SetMassLimits(Double_t lowlimit, Double_t uplimit);
74
75 //jet reconstruction algorithm
76 void SetJetArrayName(TString jetArrName) {fJetArrName=jetArrName;};
77 TString GetJetArrayName() const {return fJetArrName;};
78
79 // trigger on jet events
80 void SetTriggerOnLeadingJet(Bool_t triggerOnLeadingJet) {fLeadingJetOnly=triggerOnLeadingJet;};
81 Bool_t GetTriggerOnLeadingJet() const {return fLeadingJetOnly;}
82
83
84 // Array of D0 width for the Dstar
85 Bool_t SetD0WidthForDStar(Int_t nptbins,Float_t* width);
86
87 //Bool_t FillMCDJetInfo(AliPicoTrack *jetTrk,AliEmcalJet* jet, TClonesArray *mcArray,Double_t ptjet);
88 void FillHistogramsRecoJetCorr(AliVParticle* candidate, AliEmcalJet *jet, AliAODEvent* aodEvent);
89 void FillHistogramsD0JetCorr(AliAODRecoDecayHF* candidate, Double_t dPhi, Double_t phiD, Double_t z, Double_t ptD, Double_t ptj, AliAODEvent* aodEvent);
90
91 void FillHistogramsDstarJetCorr(AliAODRecoCascadeHF* dstar, Double_t dPhi, Double_t phiD, Double_t z, Double_t ptD, Double_t ptj);
92 void FillHistogramsMCGenDJetCorr(Double_t dPhi, Double_t phiD, Double_t z,Double_t ptD,Double_t ptjet);
93 void SideBandBackground(AliAODRecoCascadeHF *candDstar, AliEmcalJet *jet);
94 void MCBackground(AliAODRecoDecayHF *candbg);
95 void FillMassHistograms(Double_t mass,Double_t ptD);
96 void FlagFlavour(AliEmcalJet* jet);
97 Int_t IsDzeroSideBand(AliAODRecoCascadeHF *candDstar);
98
99private:
100
101 AliAnalysisTaskFlavourJetCorrelations(const AliAnalysisTaskFlavourJetCorrelations &source);
102 AliAnalysisTaskFlavourJetCorrelations& operator=(const AliAnalysisTaskFlavourJetCorrelations& source);
103
104 Double_t Z(AliVParticle* part,AliEmcalJet* jet) const;
105 Float_t DeltaR(AliVParticle *p1, AliVParticle *p2) const;
106 Bool_t AreDaughtersInJet(AliEmcalJet *thejet, AliAODRecoDecayHF* charm, Int_t*& daughOutOfJet, AliAODTrack**& dtrks, Bool_t fillH);
107 Bool_t IsDInJet(AliEmcalJet *thejet, AliAODRecoDecayHF* charm, Bool_t fillH=kFALSE);
108 void RecalculateMomentum(Double_t* pj, const Double_t* pmissing) const;
109
110
111 Bool_t fUseMCInfo; // Use MC info
112 Bool_t fUseReco; // use reconstructed tracks when running on MC
113 Int_t fCandidateType; // Dstar or D0
114 Int_t fPDGmother; // PDG code of D meson
115 Int_t fNProngs; // number of prong of the decay channel
116 Int_t fPDGdaughters[4]; // PDG codes of daughters
117 Float_t fSigmaD0[30]; //
118 TString fBranchName; // AOD branch name
119 AliRDHFCuts *fCuts; // Cuts
120
121 Double_t fMinMass; // mass lower limit histogram
122 Double_t fMaxMass; // mass upper limit histogram
123
124 TString fJetArrName; // name of the jet array, taken from the task running the jet finder
125 TString fCandArrName; // string which correspond to the candidate type
126 Bool_t fLeadingJetOnly; // use only the leading jet in the event to make the correlations
127 Double_t fJetRadius; // jet radius (filled from the JetContainer)
128 TClonesArray *fCandidateArray; //! contains candidates selected by AliRDHFCuts
129 TClonesArray *fSideBandArray; //! contains candidates selected by AliRDHFCuts::IsSelected(kTracks), to be used for side bands (DStar case only!!)
130 Bool_t fJetOnlyMode; //switch to simple version which analyses jets only
131 Double_t fPmissing[3]; // jet missing momentum due to D mesons out of cone
132 Double_t fPtJet; // pt jet, if requeted corrected with the missing pt
133 Bool_t fIsDInJet; // flag D meson in jet
134 Int_t fTypeDInJet; // way of selecting D in jets (see IsDInJet in cxx)
135 TClonesArray *fTrackArr; //array of the tracks used in the jet finder
136
137 ClassDef(AliAnalysisTaskFlavourJetCorrelations,5); // class for charm-jet CorrelationsExch
c683985a 138};
139
140#endif