]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliAnalysisTaskJetCluster.h
Update
[u/mrichter/AliRoot.git] / JETAN / AliAnalysisTaskJetCluster.h
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 comparing 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 ////////////////
19 class AliJetHeader;
20 class AliESDEvent;
21 class AliAODEvent;
22 class AliAODExtension;
23 class AliAODJet;
24 class AliGenPythiaEventHeader;
25 class AliCFManager;
26 class AliAODJetEventBackground;
27 class AliJetFinder;
28 class TList;
29 class TChain;
30 class TH2F;
31 class TH1F;
32 class TH3F;
33 class TProfile;
34 class TRandom3;
35 class TRefArray;
36 class TClonesArray;
37
38 class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
39 {
40  public:
41     AliAnalysisTaskJetCluster();
42     AliAnalysisTaskJetCluster(const char* name);
43     virtual ~AliAnalysisTaskJetCluster();
44     // Implementation of interface methods
45     virtual void UserCreateOutputObjects();
46     virtual void Init();
47     virtual void LocalInit() { Init(); }
48     virtual void UserExec(Option_t *option);
49     virtual void Terminate(Option_t *option);
50     virtual Bool_t Notify();
51
52     
53
54     virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
55     virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
56     virtual void SetEventSelection(Bool_t b){fEventSelection = b;}
57     virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
58     virtual void SetTrackEtaWindow(Float_t f){fTrackEtaWindow = f;}
59     virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
60     virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
61     virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
62     virtual void SetCentralityCut(Float_t xLo,Float_t xUp){fCentCutLo = xLo; fCentCutUp = xUp;}
63     virtual void SetFilterMask(UInt_t i,Int_t iType = 0){fFilterMask = i;
64       fFilterType = iType;}
65     virtual void SetJetTriggerPtCut(Float_t x){fJetTriggerPtCut = x;}    
66     virtual void SetVtxCuts(Float_t z,Float_t r = 1){fVtxZCut = z; fVtxR2Cut = r *r;}    
67     virtual void SetBackgroundBranch(const char* c){fBackgroundBranch = c;}
68     virtual const char* GetBackgroundBranch(){return fBackgroundBranch.Data();}    
69     virtual void SetNSkipLeadingRan(Int_t x){fNSkipLeadingRan = x;}
70     virtual void SetNSkipLeadingCone(Int_t x){fNSkipLeadingCone = x;}
71     virtual void SetNRandomCones(Int_t x){fNRandomCones = x;}
72
73     virtual void SetJetOutputBranch(const char *c){fNonStdBranch = c;}
74     virtual const char* GetJetOutputBranch(){return fNonStdBranch.Data();}
75     virtual void SetJetOutputFile(const char *c){fNonStdFile = c;}
76     virtual const char* GetJetOutputFile(){return fNonStdFile.Data();}
77     virtual void SetMaxTrackPtInJet(Float_t x){fMaxTrackPtInJet = x;}
78     virtual void SetJetOutputMinPt(Float_t x){fJetOutputMinPt = x;}
79     virtual void SetBackgroundCalc(Bool_t b){fUseBackgroundCalc = b;} 
80
81
82
83     // for Fast Jet
84     fastjet::JetAlgorithm        GetAlgorithm()         const {return fAlgorithm;}
85     fastjet::Strategy            GetStrategy()          const {return fStrategy;}
86     fastjet::RecombinationScheme GetRecombScheme()      const {return fRecombScheme;}
87     fastjet::AreaType            GetAreaType()          const {return fAreaType;}
88     // Setters
89     void SetRparam(Double_t f)                           {fRparam = f;}
90     void SetAlgorithm(fastjet::JetAlgorithm f)           {fAlgorithm = f;}
91     void SetStrategy(fastjet::Strategy f)                {fStrategy = f;}
92     void SetRecombScheme(fastjet::RecombinationScheme f) {fRecombScheme = f;}
93     void SetAreaType(fastjet::AreaType f)                {fAreaType = f;}
94     void SetGhostArea(Double_t f) {fGhostArea = f;}
95     void SetActiveAreaRepeats(Int_t f) {fActiveAreaRepeats = f;}
96     void SetGhostEtamax(Double_t f) {fGhostEtamax = f;}
97
98
99
100     // Helper
101     //
102
103     // we have different cases
104     // AOD reading -> MC from AOD
105     // ESD reading -> MC from Kinematics
106     // this has to match with our selection of input events
107     enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance, kTrackAODextra, kTrackAODextraonly};
108     enum {kMaxJets = 4};
109     enum {kMaxCorrelation =  3};
110     enum {kMaxRadius =       5};
111     enum {kMaxCent =         4};
112     
113
114  private:
115
116     AliAnalysisTaskJetCluster(const AliAnalysisTaskJetCluster&);
117     AliAnalysisTaskJetCluster& operator=(const AliAnalysisTaskJetCluster&);
118
119     Int_t GetListOfTracks(TList *list,Int_t type);
120
121     AliAODEvent     *fAOD;                // ! where we take the jets from can be input or output AOD
122     AliAODExtension *fAODExtension;       // ! AOD extension in case we write a non-sdt branch to a separate file and the aod is standard
123     TRefArray       *fRef;               // ! trefarray for track references within the jet
124     Bool_t        fUseAODTrackInput;      // take track from input AOD not from ouptu AOD
125     Bool_t        fUseAODMCInput;         // take MC from input AOD not from ouptu AOD
126     Bool_t        fUseBackgroundCalc;     // switches on background calculations
127     Bool_t        fEventSelection;        // use the event selection of this task, otherwise analyse all
128     UInt_t        fFilterMask;            // filter bit for slecected tracks
129     UInt_t        fFilterType;            // filter type 0 = all, 1 = ITSTPC, 2 = TPC
130     Int_t         fTrackTypeRec;          // type of tracks used for FF 
131     Int_t         fTrackTypeGen;          // type of tracks used for FF 
132     Int_t         fNSkipLeadingRan;       // number of leading tracks to be skipped in the randomized event
133     Int_t         fNSkipLeadingCone;      // number of leading jets to be for the random cones
134     Int_t         fNRandomCones;          // number of generated random cones
135     Float_t       fAvgTrials;             // Average nimber of trials
136     Float_t       fExternalWeight;        // external weight
137     Float_t       fTrackEtaWindow;        // eta window used for corraltion plots between rec and gen 
138     Float_t       fRecEtaWindow;          // eta window used for corraltion plots between rec and gen 
139     Float_t       fTrackPtCut;            // minimum track pt to be accepted
140     Float_t       fJetOutputMinPt;        // minimum p_t for jets to be written out
141     Float_t       fMaxTrackPtInJet;       // maximum track pt within a jet for flagging...
142     Float_t       fJetTriggerPtCut;       // minimum jwt pT for AOD to be written
143     Float_t       fVtxZCut;               // zvtx cut
144     Float_t       fVtxR2Cut;              // R vtx cut (squared) 
145     Float_t       fCentCutUp;             // upper limit on centrality
146     Float_t       fCentCutLo;             // lower limit on centrality
147     // output configurartion
148     TString       fNonStdBranch;      // the name of the non-std branch name, if empty no branch is filled
149     TString       fBackgroundBranch;  // name of the branch used for background subtraction
150     TString       fNonStdFile;        // The optional name of the output file the non-std brnach is written to
151     
152
153     // Fast jet
154     Double_t fRparam;
155     fastjet::JetAlgorithm fAlgorithm; //fastjet::kt_algorithm
156     fastjet::Strategy fStrategy;  //= fastjet::Best;
157     fastjet::RecombinationScheme fRecombScheme; // = fastjet::BIpt_scheme;
158     fastjet::AreaType fAreaType; 
159     Double_t fGhostArea;
160     Int_t fActiveAreaRepeats;
161     Double_t fGhostEtamax;
162
163     TClonesArray  *fTCAJetsOut; //! TCA of output jets
164     TClonesArray  *fTCAJetsOutRan; //! TCA of output jets in randomized event
165     TClonesArray  *fTCARandomConesOut; //! TCA of output jets in randomized event
166     TClonesArray  *fTCARandomConesOutRan; //! TCA of output jets in randomized event
167     AliAODJetEventBackground *fAODJetBackgroundOut; //! jet background to be written out
168
169     TRandom3*     fRandom;   //! random number generator
170     TProfile*     fh1Xsec;   //! pythia cross section and trials
171     TH1F*         fh1Trials; //! trials are added
172     TH1F*         fh1PtHard;  //! Pt har of the event...       
173     TH1F*         fh1PtHardNoW;  //! Pt har of the event without weigt       
174     TH1F*         fh1PtHardTrials;  //! Number of trials 
175
176     TH1F*         fh1NJetsRec; //! number of reconstructed jets
177     TH1F*         fh1NConstRec;//! number of constiutens in leading jet
178     TH1F*         fh1NConstLeadingRec;//! number of constiutens in leading jet
179     TH1F*         fh1PtJetsRecIn;  //! Jet pt for all jets
180     TH1F*         fh1PtJetsLeadingRecIn;  //! Jet pt for all jets
181     TH1F*         fh1PtJetConstRec;//! pt of constituents
182     TH1F*         fh1PtJetConstLeadingRec;// pt of constituents
183     TH1F*         fh1PtTracksRecIn;  //! track pt for all tracks
184     TH1F*         fh1PtTracksLeadingRecIn;  //! track pt for all tracks
185
186     // Randomized track histos
187     TH1F*         fh1NJetsRecRan; //! number of reconstructed jets from randomized
188     TH1F*         fh1NConstRecRan;//! number of constiutens in leading jet
189     TH1F*         fh1PtJetsLeadingRecInRan;  //! Jet pt for all jets
190     TH1F*         fh1NConstLeadingRecRan;//! number of constiutens in leading jet
191     TH1F*         fh1PtJetsRecInRan;  //! Jet pt for all jets
192
193     TH1F*         fh1PtTracksGenIn;  //! track pt for all tracks
194     TH1F*         fh1Nch;            //! charged particle mult
195     TH1F*         fh1BiARandomCones[3]; //! Residual distribtion from reandom cones on real event
196     TH1F*         fh1BiARandomConesRan[3]; //! Residual distribtion from reandom cones on random event
197     TH1F*         fh1CentralityPhySel;          // ! centrality of anaylsed events 
198     TH1F*         fh1Centrality;                // ! centrality of anaylsed events 
199     TH1F*         fh1CentralitySelect;          // ! centrality of selected events 
200     TH1F*         fh1ZPhySel;          // ! centrality of anaylsed events 
201     TH1F*         fh1Z;                // ! centrality of anaylsed events 
202     TH1F*         fh1ZSelect;          // ! centrality of selected events 
203
204
205     TH2F*         fh2NRecJetsPt;            //! Number of found jets above threshold
206     TH2F*         fh2NRecTracksPt;          //! Number of found tracks above threshold
207     TH2F*         fh2NConstPt;           //! number of constituents vs. pt
208     TH2F*         fh2NConstLeadingPt;           //! number of constituents vs. pt
209     TH2F*         fh2JetPhiEta;             //! jet phi eta
210     TH2F*         fh2LeadingJetPhiEta;      //! leading jet phi eta
211     TH2F*         fh2JetEtaPt;              //! leading jet eta
212     TH2F*         fh2LeadingJetEtaPt;              //! leading jet eta
213     TH2F*         fh2TrackEtaPt;              //! track eta
214     TH2F*         fh2LeadingTrackEtaPt;       //! leading track eta
215     TH2F*         fh2JetsLeadingPhiEta;     //! jet phi eta
216     TH2F*         fh2JetsLeadingPhiPt;      //! jet correlation with leading jet
217     TH2F*         fh2TracksLeadingPhiEta;   //! track correlation with leading track
218     TH2F*         fh2TracksLeadingPhiPt;    //! track correlation with leading track
219     TH2F*         fh2TracksLeadingJetPhiPt; //! track correlation with leading Jet
220     TH2F*         fh2JetsLeadingPhiPtW;      //! jet correlation with leading jet
221     TH2F*         fh2TracksLeadingPhiPtW;   //! track correlation with leading track
222     TH2F*         fh2TracksLeadingJetPhiPtW; //! track correlation with leading Jet
223     TH2F*         fh2NRecJetsPtRan;            //! Number of found jets above threshold
224     TH2F*         fh2NConstPtRan;           //! number of constituents vs. pt
225     TH2F*         fh2NConstLeadingPtRan;           //! number of constituents vs. pt
226     TH2F*         fh2PtNch;               //! p_T of cluster vs. multiplicity,
227     TH2F*         fh2PtNchRan;            //! p_T of cluster vs. multiplicity,random
228     TH2F*         fh2PtNchN;               //! p_T of cluster vs. multiplicity, weigthed with constituents
229     TH2F*         fh2PtNchNRan;            //! p_T of cluster vs. multiplicity, weigthed with constituents random
230     TH2F*         fh2TracksLeadingJetPhiPtRan; //! track correlation with leading Jet
231     TH2F*         fh2TracksLeadingJetPhiPtWRan; //! track correlation with leading Jet
232
233
234     TH2F*         fh2JetsLeadingPhiPtC[kMaxCent]; //! jet correlation with leading jet    
235     TH2F*         fh2JetsLeadingPhiPtWC[kMaxCent];      //! jet correlation with leading jet
236     TH2F*         fh2TracksLeadingJetPhiPtC[kMaxCent]; //! track correlation with leading Jet
237     TH2F*         fh2TracksLeadingJetPhiPtWC[kMaxCent]; //! track correlation with leading Jet
238
239     TList *fHistList; //!leading tracks to be skipped in the randomized event Output list
240    
241
242     ClassDef(AliAnalysisTaskJetCluster, 19) 
243 };
244  
245 #endif