From Filip Krizek
[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; }
8aa19603 55 virtual void SetBgJetR(Float_t bgjR) { fBgJetParamR = bgjR; }
56 virtual void SetBgMaxJetPt(Float_t mpt){ fBgMaxJetPt = mpt;}
d1405a52
ML
57 virtual void SetRndTrials(Int_t nt){ fnTrials = nt;}
58 virtual void SetFreeAreaFrac(Float_t frac){ fJetFreeAreaFrac = frac;}
8aa19603 59 virtual void SetBgConeR(Float_t cr){ fBgConeR = cr; }
ad869500 60 virtual void SetOfflineTrgMask(AliVEvent::EOfflineTriggerTypes mask) { fOfflineTrgMask = mask; }
61 virtual void SetMinContribVtx(Int_t n) { fMinContribVtx = n; }
62 virtual void SetVtxZMin(Float_t z) { fVtxZMin = z; }
63 virtual void SetVtxZMax(Float_t z) { fVtxZMax = z; }
64 virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
65 virtual void SetCentMin(Float_t cent) { fCentMin = cent; }
66 virtual void SetCentMax(Float_t cent) { fCentMax = cent; }
67 virtual void SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
68 virtual void SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; }
69 virtual void SetTriggerEtaCut(Float_t eta) { fTriggerEtaCut = eta; }
70 virtual void SetTrackEtaCut(Float_t eta) { fTrackEtaCut = eta; }
71 virtual void SetTrackLowPtCut(Float_t pt) { fTrackLowPtCut=pt; }
8e103a56 72 virtual void SetTriggerType(Int_t tt){ fHardest=tt;}
73 virtual void SetEventNumberRangeLow(Int_t rl){ fEventNumberRangeLow=rl;}
74 virtual void SetEventNumberRangeHigh(Int_t rh){ fEventNumberRangeHigh=rh;}
75 virtual void SetTriggerPtRangeLow(Float_t tl){ fTriggerPtRangeLow=tl;}
76 virtual void SetTriggerPtRangeHigh(Float_t th){ fTriggerPtRangeHigh=th;}
8aa19603 77 virtual void SetFillResponseMatrix(Bool_t brm){ fFillRespMx = brm;}
ad869500 78
79 Double_t RelativePhi(Double_t angle1, Double_t angle2);
80
81private:
82 //private member functions
8aa19603 83 Int_t GetListOfTracks(TList *list); //returns index of trig and track list
84
80ac66f6 85 Bool_t SelectMCGenTracks(AliVParticle *trk, TList *trkList, Double_t &ptLeading, Int_t &index, Int_t counter);
86 void FillEffHistos(TList *recList, TList *genList);
8aa19603 87
d1405a52 88 void EstimateBgRhoMedian(TList *listJet, TList* listPart, Double_t &rhoMedian, Int_t mode);//median method to estimate bg
8aa19603 89 void EstimateBgCone(TList *listJet, TList* listPart, Double_t &rhoPerpCone);//perp cone method to estimate bg
255cb71c 90 void ReadTClonesArray(TString bname, TList *list); //init jets lists
ad869500 91 //private member objects
92 AliESDEvent *fESD; //! ESD object
93 AliAODEvent *fAODIn; //! AOD event for AOD input tracks
94 AliAODEvent *fAODOut; //! AOD event
95 AliAODExtension *fAODExtension; //! where we take the jets from can be input or output AOD
96
97 // jets to compare
98 TString fJetBranchName; // name of jet branch
255cb71c 99 TString fJetBranchNameChargMC; // name of jet branch
100 TString fJetBranchNameFullMC; // name of jet branch
101 TString fJetBranchNameBg; // name of bg (kt) jet branch
102 TString fJetBranchNameBgChargMC; // name of bg (kT) jet branch
80ac66f6 103 TList *fListJets; //! jet list reconstructed level
255cb71c 104 TList *fListJetsGen; //! jet list generator level
160dbdb8 105 TList *fListJetsGenFull; //! jet list generator level full jets
8aa19603 106 TList *fListJetsBg; //! jet list reconstructed level to be removed from bg
107 TList *fListJetsBgGen; //! jet list generator level to be removed from bg
255cb71c 108
ad869500 109
110 TString fNonStdFile; // name of delta aod file to catch the extension
111
112 // event selection
113 Int_t fSystem; // collision system pp=0, pPb=1
114 Float_t fJetParamR; // jet cone resolution (radius) R
8aa19603 115 Float_t fBgJetParamR; // jet cone resolution (radius) R of jet to be removed from bg
116 Float_t fBgMaxJetPt; // max pt of jets accepted in bg
117 Float_t fBgConeR; //perp cone R used to assess bg
ad869500 118 AliVEvent::EOfflineTriggerTypes fOfflineTrgMask; // mask of offline trigs
119 Int_t fMinContribVtx; // min numb of trk contrib for prim vertex
120 Float_t fVtxZMin; // lower bound on vertex z
121 Float_t fVtxZMax; // upper bound on vertex z
122 UInt_t fFilterMask; // filter bit for slected tracks
123 Float_t fCentMin; // lower bound on centrality
124 Float_t fCentMax; // upper bound on centrality
125 Float_t fJetEtaMin; // lower bound on eta for found jets
126 Float_t fJetEtaMax; // upper bound on eta for found jets
127 Float_t fTriggerEtaCut; // lower bound on eta for trigger track
128 Float_t fTrackEtaCut; // upper bound on eta for trigger track
129 Float_t fTrackLowPtCut; // upper bound on eta for trigger track
130
131
132 TList *fOutputList; //! output data container
133 TH1I *fHistEvtSelection; //! event selection statistic
134 TH2F *fh2Ntriggers; //trigger pT versus centrality
135 THnSparse *fHJetSpec; //Recoil jet spectrum
255cb71c 136 THnSparse *fHJetSpecSubUeMedian; //Recoil jet spectrum, jet pT corrected by kT median
8aa19603 137 THnSparse *fHJetSpecSubUeCone; //Recoil jet spectrum, jet pT corrected by perp cone rho
ad869500 138
139 //Diagnostics
255cb71c 140 THnSparse *fHJetUeMedian; //UE background from kT median
8aa19603 141 THnSparse *fHJetUeCone; //UE background from perp cone
142 THnSparse *fHRhoUeMedianVsCone; //EBE UE from perp cone
255cb71c 143 //THnSparse *fHJetDensity; //density of jet with A>0.07 //fk
144 //THnSparse *fHJetDensityA4; //density of jets with A>0.4 //fk
7fc3d134 145 TH2D *fhJetPhi; //Azimuthal distribution of jets
146 TH2D *fhTriggerPhi; //Azimuthal distribution of trigger hadron
147 TH2D *fhJetEta; //Pseudorapidity distribution of jets
148 TH2D *fhTriggerEta; //Pseudorapidity distribution of trigger hadron
ad869500 149 TH1D *fhVertexZ; //z vertex distribution
150 TH1D *fhVertexZAccept; //z vertex distribution after cut
151 TH1D *fhContribVtx; //contributors to vertex
152 TH1D *fhContribVtxAccept; //contributors to vertex after cut
153 TH1D *fhDphiTriggerJet; //Deltaphi between trigger and jet
154 TH1D *fhDphiTriggerJetAccept; //Deltaphi between trigger and jet after cut
155 TH1D *fhCentrality; //Deltaphi between trigger and jet
156 TH1D *fhCentralityAccept; //Deltaphi between trigger and jet after cut
157
255cb71c 158 //THnSparse *fHJetPtRaw; //bg unsubtr. vs bg subtr. pT spectrum of jets vs jet area
159 //THnSparse *fHLeadingJetPtRaw; //bg unsubtr. vs bg. subtr. leading jet pT vs area
160 //THnSparse *fHDphiVsJetPtAll; //Dphitrigger-jet versus jet pt for all jets given pTtrigg
7fc3d134 161
80ac66f6 162 //MC generator level
163 TH2D *fhJetPtGenVsJetPtRec; //jet respose matrix
255cb71c 164 TH2D *fhJetPtGenVsJetPtRecSubUeMedian; //jet respose matrix both pT with subtracted kT median bg
8aa19603 165 TH2D *fhJetPtGenVsJetPtRecSubUeCone; //jet respose matrix both pT with subtracted weighted kT median bg
255cb71c 166 TH1D *fhJetPtGen; //generated pT spectrum of jets
167 TH1D *fhJetPtSubUeMedianGen; //generated pT spectrum of jets with subtracted kT median
8aa19603 168 TH1D *fhJetPtSubUeConeGen; //generated pT spectrum of jets with perp cone
160dbdb8 169 TH2D *fhJetPtGenChargVsJetPtGenFull; //generated pT spectrum of full jets
170 TH1D *fhJetPtGenFull; // generated pT spectrum of full jets
80ac66f6 171 TH2F *fh2NtriggersGen; //trigger pT versus centrality in generator level
255cb71c 172 THnSparse *fHJetSpecGen; //Recoil jet spectrum at generator level
173 THnSparse *fHJetSpecSubUeMedianGen; //Recoil jet spectrum at gen level, jet pT corrected by kT median
8aa19603 174 THnSparse *fHJetSpecSubUeConeGen; //Recoil jet spectrum at gen level, jet pT corrected with rho from cone
255cb71c 175 THnSparse *fHJetUeMedianGen; //UE background from kT median
8aa19603 176 THnSparse *fHJetUeConeGen; //UE background from Perp Cone
80ac66f6 177 TH2D *fhPtTrkTruePrimRec; // pt spectrum of true reconstructed primary tracks
178 TH2D *fhPtTrkTruePrimGen; // pt spectrum of true generated primary track
179 TH2D *fhPtTrkSecOrFakeRec; // pt spectrum of reconstructed fake or secondary tracks
8aa19603 180 THnSparse *fHRhoUeMedianVsConeGen; //EBE UE from Median vs Perp Cone generator level
d1405a52
ML
181
182 TH1D *fhEntriesToMedian; //how many entries were used to calculate
183 TH1D *fhEntriesToMedianGen; //how many entries were used to calculate in MC
184 TH1D *fhCellAreaToMedian; //how many entries were used to calculate
185 TH1D *fhCellAreaToMedianGen; //how many entries were used to calculate in MC
186
187
255cb71c 188 Bool_t fIsChargedMC; //flag analysis on MC data with true and on the real data false
189 Bool_t fIsFullMC; //flag analysis on MC data with true and on the real data false
80ac66f6 190 TArrayI faGenIndex; // labels of particles on MC generator level
191 TArrayI faRecIndex; // labels of particles on reconstructed track level
ad869500 192 const Double_t fkAcceptance; //eta times phi Alice coverage
80ac66f6 193 const Double_t fkDeltaPhiCut; //Delta phi cut on trigger-jet distance in azimuth
ea603b64 194
195 TProfile* fh1Xsec; //! pythia cross section and trials
196 TH1F* fh1Trials; //! trials are added
197 TH1F* fh1AvgTrials; //! trials are added
198 TH1F* fh1PtHard; //! Pt har of the event...
199 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
200 TH1F* fh1PtHardTrials; //! Number of trials
201 Float_t fAvgTrials; // Average number of trials
202
8e103a56 203
204 Int_t fHardest; // trigger type 0=single incl, 1=LP
205 Int_t fEventNumberRangeLow; // lower range of selected event numbers
206 Int_t fEventNumberRangeHigh; // high range of selected event numbers
207 Float_t fTriggerPtRangeLow; // lower range of selected trigger pt
208 Float_t fTriggerPtRangeHigh; // upper range of selected trigger pt
209
8aa19603 210 Bool_t fFillRespMx; //fill response matrix files
211
8e103a56 212
8aa19603 213 TRandom3* fRandom; // TRandom3
d1405a52
ML
214 Int_t fnTrials; //number of random trials to measure cell area
215 Float_t fJetFreeAreaFrac; //fraction of area in cell free of jets
8aa19603 216 const Int_t fnPhi; //number of cells in phi
217 const Int_t fnEta; //number of cells in eta
218 const Double_t fEtaSize; //cell size in eta
219 const Double_t fPhiSize; //cell size in phi
220 const Double_t fCellArea; //cell area
221 Double_t fSafetyMargin; //enlarge a bit the jet size to avoid contamination of UE
222
d1405a52 223 ClassDef(AliAnalysisTaskJetCorePP, 10); //has to end with number larger than 0
ad869500 224};
225
226#endif
227