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