01db107d1f3c3e331037b0a06a4b51fc792938ba
[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 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 ////////////////
19 class AliJetHeader;
20 class AliESDEvent;
21 class AliAODEvent;
22 class AliAODJet;
23 class AliGenPythiaEventHeader;
24 class AliCFManager;
25
26 class TList;
27 class TChain;
28 class TH2F;
29 class TH1F;
30 class TH3F;
31 class TProfile;
32
33
34
35 class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
36 {
37  public:
38     AliAnalysisTaskJetCluster();
39     AliAnalysisTaskJetCluster(const char* name);
40     virtual ~AliAnalysisTaskJetCluster() {;}
41     // Implementation of interface methods
42     virtual void UserCreateOutputObjects();
43     virtual void Init();
44     virtual void LocalInit() { Init(); }
45     virtual void UserExec(Option_t *option);
46     virtual void Terminate(Option_t *option);
47     virtual Bool_t Notify();
48
49     virtual void SetUseGlobalSelection(Bool_t b){fUseGlobalSelection = b;}
50     virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
51     virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
52     virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
53     virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
54     virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
55     virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
56
57     // for Fast Jet
58     fastjet::JetAlgorithm        GetAlgorithm()         const {return fAlgorithm;}
59     fastjet::Strategy            GetStrategy()          const {return fStrategy;}
60     fastjet::RecombinationScheme GetRecombScheme()      const {return fRecombScheme;}
61     fastjet::AreaType            GetAreaType()          const {return fAreaType;}
62     // Setters
63     void SetRparam(Double_t f)                           {fRparam = f;}
64     void SetAlgorithm(fastjet::JetAlgorithm f)           {fAlgorithm = f;}
65     void SetStrategy(fastjet::Strategy f)                {fStrategy = f;}
66     void SetRecombScheme(fastjet::RecombinationScheme f) {fRecombScheme = f;}
67     void SetAreaType(fastjet::AreaType f)                {fAreaType = f;}
68
69     // Helper
70     //
71
72     // we have different cases
73     // AOD reading -> MC from AOD
74     // ESD reading -> MC from Kinematics
75     // this has to match with our selection of input events
76     enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance};
77     enum {kMaxJets = 4};
78     enum {kMaxCorrelation =  3};
79     enum {kMaxRadius =       5};
80     
81
82  private:
83
84     AliAnalysisTaskJetCluster(const AliAnalysisTaskJetCluster&);
85     AliAnalysisTaskJetCluster& operator=(const AliAnalysisTaskJetCluster&);
86
87     Int_t GetListOfTracks(TList *list,Int_t type);
88
89     AliAODEvent  *fAOD; // where we take the jets from can be input or output AOD
90
91     Bool_t        fUseAODTrackInput;      // take track from input AOD not from ouptu AOD
92     Bool_t        fUseAODMCInput;         // take MC from input AOD not from ouptu AOD
93     Bool_t        fUseGlobalSelection;    // Limit the eta of the generated jets
94     UInt_t        fFilterMask;             // filter bit for slecected tracks
95     Int_t         fTrackTypeRec;          // type of tracks used for FF 
96     Int_t         fTrackTypeGen;          // type of tracks used for FF 
97     Float_t       fAvgTrials;             // Average nimber of trials
98     Float_t       fExternalWeight;        // external weight
99     Float_t       fRecEtaWindow;          // eta window used for corraltion plots between rec and gen 
100     // Fast jet
101     Double_t fRparam;
102     fastjet::JetAlgorithm fAlgorithm; //fastjet::kt_algorithm
103     fastjet::Strategy fStrategy;  //= fastjet::Best;
104     fastjet::RecombinationScheme fRecombScheme; // = fastjet::BIpt_scheme;
105     fastjet::AreaType fAreaType; 
106
107     TProfile*     fh1Xsec;   // pythia cross section and trials
108     TH1F*         fh1Trials; // trials are added
109     TH1F*         fh1PtHard;  // Pt har of the event...       
110     TH1F*         fh1PtHardNoW;  // Pt har of the event without weigt       
111     TH1F*         fh1PtHardTrials;  // Number of trials 
112
113     TH1F*         fh1NJetsRec; // number of reconstructed jets
114     TH1F*         fh1NConstRec;// number of constiutens in leading jet
115     TH1F*         fh1NConstLeadingRec;// number of constiutens in leading jet
116     TH1F*         fh1PtJetsRecIn;  // Jet pt for all jets
117     TH1F*         fh1PtJetsLeadingRecIn;  // Jet pt for all jets
118     TH1F*         fh1PtJetConstRec;// pt of constituents
119     TH1F*         fh1PtJetConstLeadingRec;// pt of constituents
120     TH1F*         fh1PtTracksRecIn;  // track pt for all tracks
121     TH1F*         fh1PtTracksLeadingRecIn;  // track pt for all tracks
122
123     // Randomized track histos
124     TH1F*         fh1NJetsRecRan; // number of reconstructed jets from randomized
125     TH1F*         fh1NConstRecRan;// number of constiutens in leading jet
126     TH1F*         fh1PtJetsLeadingRecInRan;  // Jet pt for all jets
127     TH1F*         fh1NConstLeadingRecRan;// number of constiutens in leading jet
128     TH1F*         fh1PtJetsRecInRan;  // Jet pt for all jets
129
130     TH1F*         fh1PtTracksGenIn;  // track pt for all tracks
131     TH1F*         fh1Nch;            // charged particle mult
132
133     TH2F*         fh2NRecJetsPt;            // Number of found jets above threshold
134     TH2F*         fh2NRecTracksPt;          // Number of found tracks above threshold
135     TH2F*         fh2NConstPt;           // number of constituents vs. pt
136     TH2F*         fh2NConstLeadingPt;           // number of constituents vs. pt
137     TH2F*         fh2JetPhiEta;             // jet phi eta
138     TH2F*         fh2LeadingJetPhiEta;      // leading jet phi eta
139     TH2F*         fh2JetEtaPt;              // leading jet eta
140     TH2F*         fh2LeadingJetEtaPt;              // leading jet eta
141     TH2F*         fh2TrackEtaPt;              // track eta
142     TH2F*         fh2LeadingTrackEtaPt;       // leading track eta
143     TH2F*         fh2JetsLeadingPhiEta;     // jet phi eta
144     TH2F*         fh2JetsLeadingPhiPt;      // jet correlation with leading jet
145     TH2F*         fh2TracksLeadingPhiEta;   // track correlation with leading track
146     TH2F*         fh2TracksLeadingPhiPt;    // track correlation with leading track
147     TH2F*         fh2TracksLeadingJetPhiPt; // track correlation with leading Jet
148     TH2F*         fh2JetsLeadingPhiPtW;      // jet correlation with leading jet
149     TH2F*         fh2TracksLeadingPhiPtW;   // track correlation with leading track
150     TH2F*         fh2TracksLeadingJetPhiPtW; // track correlation with leading Jet
151     TH2F*         fh2NRecJetsPtRan;            // Number of found jets above threshold
152     TH2F*         fh2NConstPtRan;           // number of constituents vs. pt
153     TH2F*         fh2NConstLeadingPtRan;           // number of constituents vs. pt
154     TH2F*         fh2PtNch;               // p_T of cluster vs. multiplicity,
155     TH2F*         fh2PtNchRan;            // p_T of cluster vs. multiplicity,random
156     TH2F*         fh2PtNchN;               // p_T of cluster vs. multiplicity, weigthed with constituents
157     TH2F*         fh2PtNchNRan;            // p_T of cluster vs. multiplicity, weigthed with constituents random
158     TH2F*         fh2TracksLeadingJetPhiPtRan; // track correlation with leading Jet
159     TH2F*         fh2TracksLeadingJetPhiPtWRan; // track correlation with leading Jet
160     TList *fHistList; // Output list
161    
162
163     ClassDef(AliAnalysisTaskJetCluster, 3) // Analysis task for standard jet analysis
164 };
165  
166 #endif