o updates for PbPb analysis of B->J/psi (Fiorella)
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCorePP.h
CommitLineData
ad869500 1#ifndef ALIANALYSISTASKJETCOREPP_H
2#define ALIANALYSISTASKJETCOREPP_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7// **************************************
8// This task performs hadron-trigger recoil jet correlations
9// Output pT spectrum of jet given trigger pT
8e103a56 10// Author: filip krizek 16th March 2013
ad869500 11// *******************************************
12
13class TH1F;
14class TH1D;
15class TH1I;
16class TH2F;
17class TH3F;
80ac66f6 18class TList;
ad869500 19class THnSparse;
8e103a56 20class TRandom3;
80ac66f6 21class TArrayI;
ea603b64 22class TProfile;
23class TFile;
24class TKey;
ad869500 25class AliESDEvent;
26class AliAODExtension;
27class AliAODEvent;
ea603b64 28class AliGenPythiaEventHeader;
ad869500 29
30#include "AliAnalysisTaskSE.h"
31#include "AliVEvent.h"
32
33class AliAnalysisTaskJetCorePP : public AliAnalysisTaskSE {
34public:
35 AliAnalysisTaskJetCorePP();
36 AliAnalysisTaskJetCorePP(const char *name);
37 AliAnalysisTaskJetCorePP(const AliAnalysisTaskJetCorePP& a);
38 AliAnalysisTaskJetCorePP& operator=(const AliAnalysisTaskJetCorePP& a); // not implemented
39 virtual ~AliAnalysisTaskJetCorePP();
40 virtual void LocalInit() {Init();}
41 virtual void Init();
42 virtual void UserCreateOutputObjects();
43 virtual void UserExec(Option_t *option);
44 virtual void Terminate(const Option_t*);
ea603b64 45 virtual Bool_t Notify();
ad869500 46
47 virtual void SetBranchName(const TString &name){ fJetBranchName = name; }
255cb71c 48 virtual void SetBranchNameChargMC(const TString &name){ fJetBranchNameChargMC = name; }
49 virtual void SetBranchNameFullMC(const TString &name){ fJetBranchNameFullMC = name; }
50 virtual void SetBranchNameBg(const TString &name){ fJetBranchNameBg = name; }
51 virtual void SetBranchNameBgChargMC(const TString &name){ fJetBranchNameBgChargMC = name; }
ad869500 52 virtual void SetNonStdFile(char* c){fNonStdFile = c;}
53 virtual void SetSystem(Int_t sys) { fSystem = sys; }
54 virtual void SetJetR(Float_t jR) { fJetParamR = jR; }
55 virtual void SetOfflineTrgMask(AliVEvent::EOfflineTriggerTypes mask) { fOfflineTrgMask = mask; }
56 virtual void SetMinContribVtx(Int_t n) { fMinContribVtx = n; }
57 virtual void SetVtxZMin(Float_t z) { fVtxZMin = z; }
58 virtual void SetVtxZMax(Float_t z) { fVtxZMax = z; }
59 virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
60 virtual void SetCentMin(Float_t cent) { fCentMin = cent; }
61 virtual void SetCentMax(Float_t cent) { fCentMax = cent; }
62 virtual void SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
63 virtual void SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; }
64 virtual void SetTriggerEtaCut(Float_t eta) { fTriggerEtaCut = eta; }
65 virtual void SetTrackEtaCut(Float_t eta) { fTrackEtaCut = eta; }
66 virtual void SetTrackLowPtCut(Float_t pt) { fTrackLowPtCut=pt; }
8e103a56 67 virtual void SetTriggerType(Int_t tt){ fHardest=tt;}
68 virtual void SetEventNumberRangeLow(Int_t rl){ fEventNumberRangeLow=rl;}
69 virtual void SetEventNumberRangeHigh(Int_t rh){ fEventNumberRangeHigh=rh;}
70 virtual void SetTriggerPtRangeLow(Float_t tl){ fTriggerPtRangeLow=tl;}
71 virtual void SetTriggerPtRangeHigh(Float_t th){ fTriggerPtRangeHigh=th;}
72
ad869500 73
74 Double_t RelativePhi(Double_t angle1, Double_t angle2);
75
76private:
77 //private member functions
78 Int_t GetListOfTracks(TList *list); //returns index of trig and track list
80ac66f6 79 //Double_t GetBackgroundInPerpCone(Float_t jetR, Double_t jetPhi, Double_t jetEta, TList* trkList); //sums pT in the cone perp in phi to jet
80 Bool_t SelectMCGenTracks(AliVParticle *trk, TList *trkList, Double_t &ptLeading, Int_t &index, Int_t counter);
81 void FillEffHistos(TList *recList, TList *genList);
255cb71c 82 void EstimateBgRhoAlaCMS(TList *listJetBg, TList *listJet, Double_t &rhoMedian, Double_t& rhoImprovedCMS);//CMS method to estimate bg
83 void ReadTClonesArray(TString bname, TList *list); //init jets lists
ad869500 84 //private member objects
85 AliESDEvent *fESD; //! ESD object
86 AliAODEvent *fAODIn; //! AOD event for AOD input tracks
87 AliAODEvent *fAODOut; //! AOD event
88 AliAODExtension *fAODExtension; //! where we take the jets from can be input or output AOD
89
90 // jets to compare
91 TString fJetBranchName; // name of jet branch
255cb71c 92 TString fJetBranchNameChargMC; // name of jet branch
93 TString fJetBranchNameFullMC; // name of jet branch
94 TString fJetBranchNameBg; // name of bg (kt) jet branch
95 TString fJetBranchNameBgChargMC; // name of bg (kT) jet branch
80ac66f6 96 TList *fListJets; //! jet list reconstructed level
255cb71c 97 TList *fListJetsGen; //! jet list generator level
160dbdb8 98 TList *fListJetsGenFull; //! jet list generator level full jets
255cb71c 99 TList *fListJetsBg; //! bg jet list reconstructed level
100 TList *fListJetsBgGen; //! bg jet list generator level
101
ad869500 102
103 TString fNonStdFile; // name of delta aod file to catch the extension
104
105 // event selection
106 Int_t fSystem; // collision system pp=0, pPb=1
107 Float_t fJetParamR; // jet cone resolution (radius) R
108 AliVEvent::EOfflineTriggerTypes fOfflineTrgMask; // mask of offline trigs
109 Int_t fMinContribVtx; // min numb of trk contrib for prim vertex
110 Float_t fVtxZMin; // lower bound on vertex z
111 Float_t fVtxZMax; // upper bound on vertex z
112 UInt_t fFilterMask; // filter bit for slected tracks
113 Float_t fCentMin; // lower bound on centrality
114 Float_t fCentMax; // upper bound on centrality
115 Float_t fJetEtaMin; // lower bound on eta for found jets
116 Float_t fJetEtaMax; // upper bound on eta for found jets
117 Float_t fTriggerEtaCut; // lower bound on eta for trigger track
118 Float_t fTrackEtaCut; // upper bound on eta for trigger track
119 Float_t fTrackLowPtCut; // upper bound on eta for trigger track
120
121
122 TList *fOutputList; //! output data container
123 TH1I *fHistEvtSelection; //! event selection statistic
124 TH2F *fh2Ntriggers; //trigger pT versus centrality
125 THnSparse *fHJetSpec; //Recoil jet spectrum
255cb71c 126 THnSparse *fHJetSpecSubUeMedian; //Recoil jet spectrum, jet pT corrected by kT median
127 THnSparse *fHJetSpecSubUeCMS; //Recoil jet spectrum, jet pT corrected by weighted kT median ala CMS
ad869500 128
129 //Diagnostics
255cb71c 130 THnSparse *fHJetUeMedian; //UE background from kT median
131 THnSparse *fHJetUeCMS; //UE background from weighted kT median ala CMS
132 THnSparse *fHRhoUeMedianVsCMS; //EBE UE from Median vs CMS
133 //THnSparse *fHJetDensity; //density of jet with A>0.07 //fk
134 //THnSparse *fHJetDensityA4; //density of jets with A>0.4 //fk
7fc3d134 135 TH2D *fhJetPhi; //Azimuthal distribution of jets
136 TH2D *fhTriggerPhi; //Azimuthal distribution of trigger hadron
137 TH2D *fhJetEta; //Pseudorapidity distribution of jets
138 TH2D *fhTriggerEta; //Pseudorapidity distribution of trigger hadron
ad869500 139 TH1D *fhVertexZ; //z vertex distribution
140 TH1D *fhVertexZAccept; //z vertex distribution after cut
141 TH1D *fhContribVtx; //contributors to vertex
142 TH1D *fhContribVtxAccept; //contributors to vertex after cut
143 TH1D *fhDphiTriggerJet; //Deltaphi between trigger and jet
144 TH1D *fhDphiTriggerJetAccept; //Deltaphi between trigger and jet after cut
145 TH1D *fhCentrality; //Deltaphi between trigger and jet
146 TH1D *fhCentralityAccept; //Deltaphi between trigger and jet after cut
147
255cb71c 148 //THnSparse *fHJetPtRaw; //bg unsubtr. vs bg subtr. pT spectrum of jets vs jet area
149 //THnSparse *fHLeadingJetPtRaw; //bg unsubtr. vs bg. subtr. leading jet pT vs area
150 //THnSparse *fHDphiVsJetPtAll; //Dphitrigger-jet versus jet pt for all jets given pTtrigg
7fc3d134 151
80ac66f6 152 //MC generator level
153 TH2D *fhJetPtGenVsJetPtRec; //jet respose matrix
255cb71c 154 TH2D *fhJetPtGenVsJetPtRecSubUeMedian; //jet respose matrix both pT with subtracted kT median bg
155 TH2D *fhJetPtGenVsJetPtRecSubUeCMS; //jet respose matrix both pT with subtracted weighted kT median bg
156 TH1D *fhJetPtGen; //generated pT spectrum of jets
157 TH1D *fhJetPtSubUeMedianGen; //generated pT spectrum of jets with subtracted kT median
158 TH1D *fhJetPtSubUeCMSGen; //generated pT spectrum of jets withe subtr weighted kT median ala CMS
160dbdb8 159 TH2D *fhJetPtGenChargVsJetPtGenFull; //generated pT spectrum of full jets
160 TH1D *fhJetPtGenFull; // generated pT spectrum of full jets
80ac66f6 161 TH2F *fh2NtriggersGen; //trigger pT versus centrality in generator level
255cb71c 162 THnSparse *fHJetSpecGen; //Recoil jet spectrum at generator level
163 THnSparse *fHJetSpecSubUeMedianGen; //Recoil jet spectrum at gen level, jet pT corrected by kT median
164 THnSparse *fHJetSpecSubUeCMSGen; //Recoil jet spectrum at gen level, jet pT corrected by weighted kT median ala CMS
165 THnSparse *fHJetUeMedianGen; //UE background from kT median
166 THnSparse *fHJetUeCMSGen; //UE background from weighted kT median ala CMS
80ac66f6 167 TH2D *fhPtTrkTruePrimRec; // pt spectrum of true reconstructed primary tracks
168 TH2D *fhPtTrkTruePrimGen; // pt spectrum of true generated primary track
169 TH2D *fhPtTrkSecOrFakeRec; // pt spectrum of reconstructed fake or secondary tracks
255cb71c 170 THnSparse *fHRhoUeMedianVsCMSGen; //EBE UE from Median vs CMS generator level
80ac66f6 171
255cb71c 172 Bool_t fIsChargedMC; //flag analysis on MC data with true and on the real data false
173 Bool_t fIsFullMC; //flag analysis on MC data with true and on the real data false
80ac66f6 174 TArrayI faGenIndex; // labels of particles on MC generator level
175 TArrayI faRecIndex; // labels of particles on reconstructed track level
ad869500 176 const Double_t fkAcceptance; //eta times phi Alice coverage
80ac66f6 177 const Double_t fkDeltaPhiCut; //Delta phi cut on trigger-jet distance in azimuth
ea603b64 178
179 TProfile* fh1Xsec; //! pythia cross section and trials
180 TH1F* fh1Trials; //! trials are added
181 TH1F* fh1AvgTrials; //! trials are added
182 TH1F* fh1PtHard; //! Pt har of the event...
183 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
184 TH1F* fh1PtHardTrials; //! Number of trials
185 Float_t fAvgTrials; // Average number of trials
186
8e103a56 187
188 Int_t fHardest; // trigger type 0=single incl, 1=LP
189 Int_t fEventNumberRangeLow; // lower range of selected event numbers
190 Int_t fEventNumberRangeHigh; // high range of selected event numbers
191 Float_t fTriggerPtRangeLow; // lower range of selected trigger pt
192 Float_t fTriggerPtRangeHigh; // upper range of selected trigger pt
193
194 TRandom3* fRandom; // TRandom3
195
255cb71c 196 ClassDef(AliAnalysisTaskJetCorePP, 8); //has to end with number larger than 0
ad869500 197};
198
199#endif
200