]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/JetTasks/AliAnalysisTaskJetSpectrum2.h
memory leak fixed
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskJetSpectrum2.h
CommitLineData
b99018c6 1
3b7ffecf 2#ifndef ALIANALYSISTASKJETSPECTRUM2_H
3#define ALIANALYSISTASKJETSPECTRUM2_H
4
5/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8// **************************************
9// Task used for the correction of determiantion of reconstructed jet spectra
10// Compares input (gen) and output (rec) jets
11// *******************************************
12
13#include "AliAnalysisTaskSE.h"
14#include "THnSparse.h" // cannot forward declare ThnSparseF
15
16////////////////
17class AliJetHeader;
18class AliESDEvent;
19class AliAODEvent;
a31b8a87 20class AliAODExtension;
3b7ffecf 21class AliAODJet;
d7117cbd 22class AliVParticle;
c2785065 23class AliAODJetEventBackground;
3b7ffecf 24class AliGenPythiaEventHeader;
25class AliCFManager;
b99018c6 26class AliTHn;
3b7ffecf 27
28class TList;
29class TChain;
c2785065 30class TH1F;
3b7ffecf 31class TH2F;
32class TH3F;
742ee86c 33class TRandom3;
3b7ffecf 34class TProfile;
2eded560 35class TProfile2D;
b1cd90b5 36class TSTring;
3b7ffecf 37
38
39class AliAnalysisTaskJetSpectrum2 : public AliAnalysisTaskSE
40{
41 public:
42 AliAnalysisTaskJetSpectrum2();
43 AliAnalysisTaskJetSpectrum2(const char* name);
44 virtual ~AliAnalysisTaskJetSpectrum2() {;}
45 // Implementation of interface methods
46 virtual void UserCreateOutputObjects();
47 virtual void Init();
48 virtual void LocalInit() { Init(); }
49 virtual void UserExec(Option_t *option);
50 virtual void Terminate(Option_t *option);
51 virtual Bool_t Notify();
52
b5cc0c6d 53 virtual void SetUseGlobalSelection(Bool_t b){fUseGlobalSelection = b;}
f4132e7d 54 virtual void SetEventClass(Int_t i){fEventClass = i;}
3b7ffecf 55 virtual void SetExternalWeight(Float_t f){fExternalWeight = f;}
56 virtual void SetUseExternalWeightOnly(Bool_t b){fUseExternalWeightOnly = b;}
565584e8 57 virtual void SetAODJetInput(Bool_t b){fUseAODJetInput = b;}
58 virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
59 virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
3b7ffecf 60 virtual void SetLimitGenJetEta(Bool_t b){fLimitGenJetEta = b;}
a31b8a87 61 virtual void SetJetEtaWindow(Float_t f){fJetRecEtaWindow = f;}
62 virtual void SetTrackEtaWindow(Float_t f){fTrackRecEtaWindow = f;}
63 virtual void SetNMatchJets(Short_t f){fNMatchJets = f;}
9280dfa6 64 virtual void SetMinJetPt(Float_t f){fMinJetPt = f;}
7b822bc5 65 virtual void SetNRPBins(Short_t i){fNRPBins = i;}
742ee86c 66 virtual void SetFlagJetType(Int_t iType,Int_t iF){fFlagJetType[iType] = iF;}
a31b8a87 67 virtual void SetMinTrackPt(Float_t f){fMinTrackPt = f;}
9280dfa6 68 virtual void SetDeltaPhiWindow(Float_t f){fDeltaPhiWindow = f;}
3b7ffecf 69 virtual void SetAnalysisType(Int_t i){fAnalysisType = i;}
70 virtual void SetBranchGen(const char* c){fBranchGen = c;}
71 virtual void SetBranchRec(const char* c){fBranchRec = c;}
37eb26ea 72 virtual void SetBranchBkgRec(const char* c){fBranchBkgRec = c;}
73 virtual void SetBranchBkgGen(const char* c){fBranchBkgGen = c;}
3b7ffecf 74 virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
75 virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
76 virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
9fd4cc3e 77 virtual void SetMatching(Bool_t b = kTRUE){fDoMatching = b;}
2eded560 78 virtual void SetRPMethod(Int_t i){fRPMethod = i;}
f2dd0695 79 virtual void SetEventSelectionMask(UInt_t i){fEventSelectionMask = i;}
2eded560 80
a31b8a87 81 virtual void SetNonStdFile(char* c){fNonStdFile = c;}
3b7ffecf 82
83
84 // Helper
85 //
86
87 // we have different cases
88 // AOD reading -> MC from AOD
89 // ESD reading -> MC from Kinematics
90 // this has to match with our selection of input events
565584e8 91 enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance};
3b7ffecf 92 enum {kAnaMC = 0x1, kAnaMCESD = 0x2};
3170a3f8 93 enum {kMaxJets = 2};
a2522483 94 enum {kJetRec = 0, kJetGen, kJetRecFull, kJetGenFull, kJetTypes}; //
3b7ffecf 95 enum {kMaxCorrelation = 3};
96
97 //
98 // 0 all jets
99 // 1 all jet in eta window
100 // 2 all jets with partner
101 // 3 all jets in eta window with partner
102 // 4 all jets with partner in eta window
103 enum {kStep0 = 0, kStep1, kStep2, kStep3, kStep4,kMaxStep};
104
105
106 private:
107
108 AliAnalysisTaskJetSpectrum2(const AliAnalysisTaskJetSpectrum2&);
109 AliAnalysisTaskJetSpectrum2& operator=(const AliAnalysisTaskJetSpectrum2&);
110
a31b8a87 111 void MakeJetContainer();
112 Int_t GetListOfTracks(TList *list,Int_t type);
113 void FillTrackHistos(TList &particlesList,int iType);
742ee86c 114 Float_t GetCentrality();
115 Bool_t CalculateReactionPlaneAngle(const TList *trackList);
116 Int_t GetPhiBin(Double_t phi);
c08c3ad2 117 Double_t GetPhiWeight(Double_t phi,Double_t signedpt);
a31b8a87 118 Int_t GetListOfJets(TList *list,TClonesArray* jarray,Int_t type);
119 void FillJetHistos(TList &jetsList,TList &particlesList,Int_t iType);
120
121 void FillMatchHistos(TList &recJetsList,TList &genJetsList);
122
123 Bool_t JetSelected(AliAODJet *jet);
37eb26ea 124 Int_t MultFromJetRefs(TClonesArray *jets);
d7117cbd 125 AliVParticle *LeadingTrackFromJetRefs(AliAODJet* jet);
126 AliVParticle *LeadingTrackInCone(AliAODJet* jet,TList *list,Float_t r = 0.4);
127
37eb26ea 128
3493c3a9 129 AliJetHeader *fJetHeaderRec;//! The jet header that can be fetched from the userinfo
130 AliJetHeader *fJetHeaderGen;//! The jet header that can fetched from the userinfo
a31b8a87 131 AliAODEvent *fAODIn; //! where we take the jets from
132 AliAODEvent *fAODOut; //! where we take the jets from
133 AliAODExtension *fAODExtension; //! where we take the jets from can be input or output AOD
b99018c6 134 AliTHn *fhnJetContainer; //! like particle container in corrfw with different steps need AliCFContainer with Scale(), and clone() to do the same
135 AliTHn *fhnCorrelation; //! response matrix for unfolding
136 THnSparseF *fhnEvent; //! event counts
137 TF1 *f1PtScale; //! correction function to correct to the average true jet energy depending on p_T,rec
3b7ffecf 138
139 TString fBranchRec; // AOD branch name for reconstructed
140 TString fBranchGen; // AOD brnach for genereated
37eb26ea 141 TString fBranchBkgRec; //AOD branch for background
142 TString fBranchBkgGen; //AOD branch for background
a31b8a87 143 TString fNonStdFile; // name of delta aod file to catch the extension
3b7ffecf 144
742ee86c 145 TRandom3* fRandomizer; //! randomizer
146
565584e8 147 Bool_t fUseAODJetInput; // take jet from input AOD not from ouptu AOD
148 Bool_t fUseAODTrackInput; // take track from input AOD not from ouptu AOD
149 Bool_t fUseAODMCInput; // take MC from input AOD not from ouptu AOD
b5cc0c6d 150 Bool_t fUseGlobalSelection; // Limit the eta of the generated jets
3b7ffecf 151 Bool_t fUseExternalWeightOnly; // use only external weight
152 Bool_t fLimitGenJetEta; // Limit the eta of the generated jets
b99018c6 153 Bool_t fDoMatching; // switch on the matching between rec and gen
a31b8a87 154 Short_t fNMatchJets; // number of leading jets considered from the list
7b822bc5 155 Short_t fNRPBins; // number of bins with respect to RP
f2dd0695 156 UInt_t fFilterMask; // filter bit for slecected tracks
157 UInt_t fEventSelectionMask; // Selection information used to filter events
3b7ffecf 158 Int_t fAnalysisType; // Analysis type
159 Int_t fTrackTypeRec; // type of tracks used for FF
160 Int_t fTrackTypeGen; // type of tracks used for FF
742ee86c 161 Int_t fFlagJetType[kJetTypes]; // disable the filling and booking of certain JetType histos
f4132e7d 162 Int_t fEventClass; // event class to be looked at for this instance of the task
2eded560 163 Int_t fRPMethod; // method for subevent calculation
3b7ffecf 164 Float_t fAvgTrials; // Average nimber of trials
165 Float_t fExternalWeight; // external weight
a31b8a87 166 Float_t fJetRecEtaWindow; // eta window for rec jets
167 Float_t fTrackRecEtaWindow; // eta window for rec tracks
9280dfa6 168 Float_t fMinJetPt; // limits the jet p_T in addition to what already is done in the jet finder, this is important for jet matching for JF with lo threshold
a31b8a87 169 Float_t fMinTrackPt; // limits the track p_T
26fa06fb 170 Float_t fDeltaPhiWindow; // minium angle between dijets
742ee86c 171 Float_t fCentrality; // ! centrality
172 Float_t fRPAngle; // ! RP angle of the reaction plane
37eb26ea 173 Int_t fMultRec; // ! reconstructed track multiplicity
174 Int_t fMultGen; // ! generated track multiplicity
7b822bc5 175
3b7ffecf 176
3493c3a9 177 TProfile* fh1Xsec; //! pythia cross section and trials
178 TH1F* fh1Trials; //! trials are added
179 TH1F* fh1PtHard; //! Pt har of the event...
180 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
181 TH1F* fh1PtHardTrials; //! Number of trials
57ca1193 182 TH1F* fh1ZVtx; //! z-vtx distribution
7b822bc5 183 TH1F* fh1RP; //! RP distribution
742ee86c 184 TH1F* fh1Centrality; //! centrality distribution
37eb26ea 185 TH1F* fh1TmpRho; //! just temporary histo for calculation
186 TH2F* fh2MultRec; //! reconstructed track multiplicity
187 TH2F* fh2MultGen; //! generated track multiplicity
742ee86c 188 TH2F* fh2RPCentrality; //! RP vs centrality
37eb26ea 189
a31b8a87 190 TH2F* fh2PtFGen; //! found vs generated
3493c3a9 191 TH2F* fh2RelPtFGen; //! relative difference between generated and found
742ee86c 192
37eb26ea 193
9a83d4af 194
a31b8a87 195 // Jet histos second go
196
197 TH1F* fh1NJets[kJetTypes]; //! nr of gen jets
198 TH1F* fh1SumPtTrack[kJetTypes]; //! sum over all track pT
199
37eb26ea 200 TH1F* fh1PtIn[kJetTypes][kMaxJets+1]; //! Jet pt
3170a3f8 201 TH1F* fh1PtJetsIn[kJetTypes]; //! Jet pt for all jets
202 TH1F* fh1PtTracksIn[kJetTypes]; //! track pt for all tracks
cb883243 203 TH1F* fh1PtTracksInLow[kJetTypes]; //! track pt for all tracks
a31b8a87 204
205 TH2F* fh2NJetsPt[kJetTypes]; //! Number of found jets above threshold
a2522483 206 TH2F* fh2NTracksPt[kJetTypes]; //! Number of tracks above threshold
2eded560 207 TProfile2D *fp2MultRPPhiTrackPt[kJetTypes]; //! for mean pT vs RP
208 TProfile2D *fp2CentRPPhiTrackPt[kJetTypes]; //! for mean pT vs RP
90a006c2 209 THnSparseF *fhnJetPt[kJetTypes]; //! jet pt information for analysis
210 THnSparseF *fhnJetPtQA[kJetTypes]; //! jet pt information for QA
211 THnSparseF *fhnTrackPt[kJetTypes]; //! track pt information for analysis
212 THnSparseF *fhnTrackPtQA[kJetTypes]; //! track pt information for analysis
7b822bc5 213
d7117cbd 214 TH2F* fh2LTrackPtJetPt[kJetTypes][kMaxJets+1]; //! leading track within the jet vs jet pt
a31b8a87 215
216 TH1F* fh1DijetMinv[kJetTypes]; //! dijet inv mass
217 TH2F* fh2DijetDeltaPhiPt[kJetTypes]; //! dijet delta phi vs pt
218 TH2F* fh2DijetAsymPt[kJetTypes]; //! dijet asym vs pt after delta phi cut
219 TH2F* fh2DijetPt2vsPt1[kJetTypes]; //! dijet pt2 vs pt1
220 TH2F* fh2DijetDifvsSum[kJetTypes]; //! dijet dif vs sum
221
7b822bc5 222
f4132e7d 223 TList *fHistList; //! Output list
3b7ffecf 224
225
2eded560 226 ClassDef(AliAnalysisTaskJetSpectrum2, 17) // Analysis task for standard jet analysis
3b7ffecf 227};
228
229#endif