Fixed minor mem leak in the d'tor and added protection
[u/mrichter/AliRoot.git] / JETAN / AliAnalysisTaskJetCluster.h
CommitLineData
dbf053f0 1#ifndef ALIANALYSISTASKJETCLUSTER_H
2#define ALIANALYSISTASKJETCLUSTER_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// task used for comapring different jets D parmaters from fastjet
9// *******************************************
10
11#include "AliAnalysisTaskSE.h"
12#include "THnSparse.h" // cannot forward declare ThnSparseF
13#include "fastjet/ClusterSequenceArea.hh"
14#include "fastjet/AreaDefinition.hh"
15#include "fastjet/JetDefinition.hh"
16#include "fastjet/PseudoJet.hh"
17
18////////////////
19class AliJetHeader;
20class AliESDEvent;
21class AliAODEvent;
54424110 22class AliAODExtension;
dbf053f0 23class AliAODJet;
24class AliGenPythiaEventHeader;
25class AliCFManager;
d6e66a82 26class AliAODJetEventBackground;
27class AliJetFinder;
dbf053f0 28class TList;
29class TChain;
30class TH2F;
31class TH1F;
32class TH3F;
33class TProfile;
54424110 34class TRefArray;
dbf053f0 35
36
37class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
38{
39 public:
40 AliAnalysisTaskJetCluster();
41 AliAnalysisTaskJetCluster(const char* name);
54424110 42 virtual ~AliAnalysisTaskJetCluster();
dbf053f0 43 // Implementation of interface methods
44 virtual void UserCreateOutputObjects();
45 virtual void Init();
46 virtual void LocalInit() { Init(); }
47 virtual void UserExec(Option_t *option);
48 virtual void Terminate(Option_t *option);
49 virtual Bool_t Notify();
50
d6e66a82 51
52
dbf053f0 53 virtual void SetUseGlobalSelection(Bool_t b){fUseGlobalSelection = b;}
54 virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
55 virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
56 virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
57 virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
58 virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
54424110 59 virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
dbf053f0 60 virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
d6e66a82 61
bd80a748 62 virtual void SetNSkipLeadingRan(Int_t x){fNSkipLeadingRan = x;}
63
54424110 64 virtual void SetJetOutputBranch(const char *c){fNonStdBranch = c;}
65 virtual void SetJetOutputFile(const char *c){fNonStdFile = c;}
66 virtual void SetJetOutputMinPt(Float_t x){fJetOutputMinPt = x;}
21ead515 67 virtual void SetBackgroundCalc(Bool_t b){fUseBackgroundCalc = b;}
54424110 68
dbf053f0 69 // for Fast Jet
70 fastjet::JetAlgorithm GetAlgorithm() const {return fAlgorithm;}
71 fastjet::Strategy GetStrategy() const {return fStrategy;}
72 fastjet::RecombinationScheme GetRecombScheme() const {return fRecombScheme;}
73 fastjet::AreaType GetAreaType() const {return fAreaType;}
74 // Setters
75 void SetRparam(Double_t f) {fRparam = f;}
76 void SetAlgorithm(fastjet::JetAlgorithm f) {fAlgorithm = f;}
77 void SetStrategy(fastjet::Strategy f) {fStrategy = f;}
78 void SetRecombScheme(fastjet::RecombinationScheme f) {fRecombScheme = f;}
79 void SetAreaType(fastjet::AreaType f) {fAreaType = f;}
d6e66a82 80 void SetGhostArea(Double_t f) {fGhostArea = f;}
81 void SetActiveAreaRepeats(Int_t f) {fActiveAreaRepeats = f;}
82 void SetGhostEtamax(Double_t f) {fGhostEtamax = f;}
83
84
dbf053f0 85
86 // Helper
87 //
88
89 // we have different cases
90 // AOD reading -> MC from AOD
91 // ESD reading -> MC from Kinematics
92 // this has to match with our selection of input events
93 enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance};
94 enum {kMaxJets = 4};
95 enum {kMaxCorrelation = 3};
96 enum {kMaxRadius = 5};
97
98
99 private:
100
101 AliAnalysisTaskJetCluster(const AliAnalysisTaskJetCluster&);
102 AliAnalysisTaskJetCluster& operator=(const AliAnalysisTaskJetCluster&);
103
104 Int_t GetListOfTracks(TList *list,Int_t type);
105
54424110 106 AliAODEvent *fAOD; // ! where we take the jets from can be input or output AOD
107 AliAODExtension *fAODExtension; // ! AOD extension in case we write a non-sdt branch to a separate file and the aod is standard
108 TRefArray *fRef; // ! trefarray for track references within the jet
dbf053f0 109 Bool_t fUseAODTrackInput; // take track from input AOD not from ouptu AOD
110 Bool_t fUseAODMCInput; // take MC from input AOD not from ouptu AOD
111 Bool_t fUseGlobalSelection; // Limit the eta of the generated jets
21ead515 112 Bool_t fUseBackgroundCalc; // switches on background calculations
54424110 113 UInt_t fFilterMask; // filter bit for slecected tracks
dbf053f0 114 Int_t fTrackTypeRec; // type of tracks used for FF
115 Int_t fTrackTypeGen; // type of tracks used for FF
bd80a748 116 Int_t fNSkipLeadingRan; // number of leading tracks to be skipped in the randomized event
dbf053f0 117 Float_t fAvgTrials; // Average nimber of trials
118 Float_t fExternalWeight; // external weight
119 Float_t fRecEtaWindow; // eta window used for corraltion plots between rec and gen
54424110 120 Float_t fTrackPtCut; // minimum track pt to be accepted
121 Float_t fJetOutputMinPt; // minimum p_t for jets to be written out
122
123 // output configurartion
124 TString fNonStdBranch; // the name of the non-std branch name, if empty no branch is filled
125 TString fNonStdFile; // The optional name of the output file the non-std brnach is written to
126
127
dbf053f0 128 // Fast jet
129 Double_t fRparam;
130 fastjet::JetAlgorithm fAlgorithm; //fastjet::kt_algorithm
131 fastjet::Strategy fStrategy; //= fastjet::Best;
132 fastjet::RecombinationScheme fRecombScheme; // = fastjet::BIpt_scheme;
133 fastjet::AreaType fAreaType;
d6e66a82 134 Double_t fGhostArea;
135 Int_t fActiveAreaRepeats;
136 Double_t fGhostEtamax;
137 TProfile* fh1Xsec; //! pythia cross section and trials
138 TH1F* fh1Trials; //! trials are added
139 TH1F* fh1PtHard; //! Pt har of the event...
140 TH1F* fh1PtHardNoW; //! Pt har of the event without weigt
141 TH1F* fh1PtHardTrials; //! Number of trials
142
143 TH1F* fh1NJetsRec; //! number of reconstructed jets
144 TH1F* fh1NConstRec;//! number of constiutens in leading jet
145 TH1F* fh1NConstLeadingRec;//! number of constiutens in leading jet
146 TH1F* fh1PtJetsRecIn; //! Jet pt for all jets
147 TH1F* fh1PtJetsLeadingRecIn; //! Jet pt for all jets
148 TH1F* fh1PtJetConstRec;//! pt of constituents
dbf053f0 149 TH1F* fh1PtJetConstLeadingRec;// pt of constituents
d6e66a82 150 TH1F* fh1PtTracksRecIn; //! track pt for all tracks
151 TH1F* fh1PtTracksLeadingRecIn; //! track pt for all tracks
dbf053f0 152
153 // Randomized track histos
d6e66a82 154 TH1F* fh1NJetsRecRan; //! number of reconstructed jets from randomized
155 TH1F* fh1NConstRecRan;//! number of constiutens in leading jet
156 TH1F* fh1PtJetsLeadingRecInRan; //! Jet pt for all jets
157 TH1F* fh1NConstLeadingRecRan;//! number of constiutens in leading jet
158 TH1F* fh1PtJetsRecInRan; //! Jet pt for all jets
159
160 TH1F* fh1PtTracksGenIn; //! track pt for all tracks
161 TH1F* fh1Nch; //! charged particle mult
82a35b1a 162 TH1F* fh1BiARandomCones[3]; //! Residual distribtion from reandom cones on real event
163 TH1F* fh1BiARandomConesRan[3]; //! Residual distribtion from reandom cones on random event
164
d6e66a82 165
166 TH2F* fh2NRecJetsPt; //! Number of found jets above threshold
167 TH2F* fh2NRecTracksPt; //! Number of found tracks above threshold
168 TH2F* fh2NConstPt; //! number of constituents vs. pt
169 TH2F* fh2NConstLeadingPt; //! number of constituents vs. pt
170 TH2F* fh2JetPhiEta; //! jet phi eta
171 TH2F* fh2LeadingJetPhiEta; //! leading jet phi eta
172 TH2F* fh2JetEtaPt; //! leading jet eta
173 TH2F* fh2LeadingJetEtaPt; //! leading jet eta
174 TH2F* fh2TrackEtaPt; //! track eta
175 TH2F* fh2LeadingTrackEtaPt; //! leading track eta
176 TH2F* fh2JetsLeadingPhiEta; //! jet phi eta
177 TH2F* fh2JetsLeadingPhiPt; //! jet correlation with leading jet
178 TH2F* fh2TracksLeadingPhiEta; //! track correlation with leading track
179 TH2F* fh2TracksLeadingPhiPt; //! track correlation with leading track
180 TH2F* fh2TracksLeadingJetPhiPt; //! track correlation with leading Jet
181 TH2F* fh2JetsLeadingPhiPtW; //! jet correlation with leading jet
182 TH2F* fh2TracksLeadingPhiPtW; //! track correlation with leading track
183 TH2F* fh2TracksLeadingJetPhiPtW; //! track correlation with leading Jet
184 TH2F* fh2NRecJetsPtRan; //! Number of found jets above threshold
185 TH2F* fh2NConstPtRan; //! number of constituents vs. pt
186 TH2F* fh2NConstLeadingPtRan; //! number of constituents vs. pt
187 TH2F* fh2PtNch; //! p_T of cluster vs. multiplicity,
188 TH2F* fh2PtNchRan; //! p_T of cluster vs. multiplicity,random
189 TH2F* fh2PtNchN; //! p_T of cluster vs. multiplicity, weigthed with constituents
190 TH2F* fh2PtNchNRan; //! p_T of cluster vs. multiplicity, weigthed with constituents random
191 TH2F* fh2TracksLeadingJetPhiPtRan; //! track correlation with leading Jet
192 TH2F* fh2TracksLeadingJetPhiPtWRan; //! track correlation with leading Jet
82a35b1a 193
dbf053f0 194 TList *fHistList; // Output list
195
196
21ead515 197 ClassDef(AliAnalysisTaskJetCluster, 7)
dbf053f0 198};
199
200#endif