]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/JetTasks/AliAnalysisTaskJetSpectrum2.h
a490ee760f5e73a9c63561df0e81ac45ea0f501d
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskJetSpectrum2.h
1 #ifndef ALIANALYSISTASKJETSPECTRUM2_H
2 #define ALIANALYSISTASKJETSPECTRUM2_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 the correction of determiantion of reconstructed jet spectra
9 // Compares input (gen) and output (rec) jets   
10 // *******************************************
11
12 #include  "AliAnalysisTaskSE.h"
13 #include  "THnSparse.h" // cannot forward declare ThnSparseF
14
15 ////////////////
16 class AliJetHeader;
17 class AliESDEvent;
18 class AliAODEvent;
19 class AliAODJet;
20 class AliAODJetEventBackground;
21 class AliGenPythiaEventHeader;
22 class AliCFManager;
23
24 class TList;
25 class TChain;
26 class TH1F;
27 class TH2F;
28 class TH3F;
29 class TProfile;
30 class TSTring;
31
32
33 class AliAnalysisTaskJetSpectrum2 : public AliAnalysisTaskSE
34 {
35  public:
36     AliAnalysisTaskJetSpectrum2();
37     AliAnalysisTaskJetSpectrum2(const char* name);
38     virtual ~AliAnalysisTaskJetSpectrum2() {;}
39     // Implementation of interface methods
40     virtual void UserCreateOutputObjects();
41     virtual void Init();
42     virtual void LocalInit() { Init(); }
43     virtual void UserExec(Option_t *option);
44     virtual void Terminate(Option_t *option);
45     virtual Bool_t Notify();
46
47     virtual void SetUseGlobalSelection(Bool_t b){fUseGlobalSelection = b;}
48     virtual void SetExternalWeight(Float_t f){fExternalWeight = f;}
49     virtual void SetUseExternalWeightOnly(Bool_t b){fUseExternalWeightOnly = b;}
50     virtual void SetAODJetInput(Bool_t b){fUseAODJetInput = b;}
51     virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
52     virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
53     virtual void SetLimitGenJetEta(Bool_t b){fLimitGenJetEta = b;}
54     virtual void SetBkgSubtraction(Bool_t b){fBkgSubtraction = b;}
55     virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
56     virtual void SetMinJetPt(Float_t f){fMinJetPt = f;}
57     virtual void SetDeltaPhiWindow(Float_t f){fDeltaPhiWindow = f;}
58     virtual void SetAnalysisType(Int_t i){fAnalysisType = i;}
59     virtual void SetBranchGen(const char* c){fBranchGen = c;}
60     virtual void SetBranchRec(const char* c){fBranchRec = c;}
61     virtual void SetBranchBkg(const char* c){fBranchBkg = c;}  
62     virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
63     virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
64     virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
65     virtual void SetEventSelectionMask(UInt_t i){fEventSelectionMask = i;}
66     // use for the CF
67
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 {kAnaMC =  0x1, kAnaMCESD = 0x2};
78     enum {kMaxJets = 4};
79     enum {kMaxCorrelation =  3};
80     
81     // 
82     // 0 all jets
83     // 1 all jet in eta window
84     // 2 all jets with partner
85     // 3 all jets in eta window with partner
86     // 4 all jets with partner in eta window
87     enum {kStep0 = 0, kStep1, kStep2, kStep3, kStep4,kMaxStep};
88
89
90  private:
91
92     AliAnalysisTaskJetSpectrum2(const AliAnalysisTaskJetSpectrum2&);
93     AliAnalysisTaskJetSpectrum2& operator=(const AliAnalysisTaskJetSpectrum2&);
94
95     void MakeJetContainer();
96     Int_t GetListOfTracks(TList *list,Int_t type);
97
98     AliJetHeader *fJetHeaderRec;
99     AliJetHeader *fJetHeaderGen;
100     AliAODEvent  *fAOD; // where we take the jets from can be input or output AOD
101     THnSparseF   *fhnJetContainer[kMaxStep*2];   // like particle container in corrfw with different steps need AliCFContainer with Scale(), and clone() to do the same
102     THnSparseF   *fhnCorrelation;           // response matrix for unfolding 
103     THnSparseF   *fhnCorrelationPhiZRec;       // response matrix for unfolding in max Z rec bins
104
105     TF1          *f1PtScale;                // correction function to correct to the average true jet energy depending on p_T,rec
106
107     TString       fBranchRec;  // AOD branch name for reconstructed
108     TString       fBranchGen;  // AOD brnach for genereated
109     TString       fBranchBkg;  //AOD branch for background 
110
111     Bool_t        fUseAODJetInput;        // take jet from input AOD not from ouptu AOD
112     Bool_t        fUseAODTrackInput;      // take track from input AOD not from ouptu AOD
113     Bool_t        fUseAODMCInput;         // take MC from input AOD not from ouptu AOD
114     Bool_t        fUseGlobalSelection;    // Limit the eta of the generated jets
115     Bool_t        fUseExternalWeightOnly; // use only external weight
116     Bool_t        fLimitGenJetEta;        // Limit the eta of the generated jets
117     Bool_t        fBkgSubtraction;        //flag for bckg subtraction
118     UInt_t        fFilterMask;            // filter bit for slecected tracks
119     UInt_t        fEventSelectionMask;    // Selection information used to filter events
120     Int_t         fAnalysisType;          // Analysis type 
121     Int_t         fTrackTypeRec;          // type of tracks used for FF 
122     Int_t         fTrackTypeGen;          // type of tracks used for FF 
123     Float_t       fAvgTrials;             // Average nimber of trials
124     Float_t       fExternalWeight;        // external weight
125     Float_t       fRecEtaWindow;          // eta window used for corraltion plots between rec and gen 
126     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
127     Float_t       fDeltaPhiWindow;        // minium angle between dijets
128
129
130     TProfile*     fh1Xsec;   // pythia cross section and trials
131     TH1F*         fh1Trials; // trials are added
132     TH1F*         fh1PtHard;  // Pt har of the event...       
133     TH1F*         fh1PtHardNoW;  // Pt har of the event without weigt       
134     TH1F*         fh1PtHardTrials;  // Number of trials 
135     TH1F*         fh1NGenJets;      // nr of gen jets
136     TH1F*         fh1NRecJets;      // nr of rec jets
137     TH1F*         fh1PtTrackRec;    // track pt
138     TH1F*         fh1SumPtTrackRec; // sum over all track pT    
139     TH1F*         fh1SumPtTrackAreaRec; // sum over all track pT    
140     TH1F*         fh1TmpRho;            // just temporary histo for calculation
141
142
143     TH1F*         fh1PtRecIn[kMaxJets];  // Jet pt for all this info is also in the THNsparse      
144     TH1F*         fh1PtGenIn[kMaxJets];  // Jet pt with corellated generated jet    
145
146     TH1F*         fh1PtJetsRecIn;  // Jet pt for all jets
147     TH1F*         fh1PtJetsLeadingRecIn;  // Jet pt for all jets
148     TH1F*         fh1PtTracksRecIn;  // track pt for all tracks
149     TH1F*         fh1PtTracksLeadingRecIn;  // track pt for all tracks
150     TH1F*         fh1PtTracksGenIn;  // track pt for all tracks
151     
152
153     TH2F*         fh2NRecJetsPt;            // Number of found jets above threshold
154     TH2F*         fh2NRecTracksPt;          // Number of found tracks above threshold
155     TH2F*         fh2JetsLeadingPhiEta;     // jet correlation with leading jet
156     TH2F*         fh2JetsLeadingPhiPt;      // jet correlation with leading jet
157     TH2F*         fh2TracksLeadingPhiEta;   // track correlation with leading track
158     TH2F*         fh2TracksLeadingPhiPt;    // track correlation with leading track
159     TH2F*         fh2TracksLeadingJetPhiPt; // track correlation with leading track
160     TH2F*         fh2JetPtJetPhi;           // Phi distribution of accepted jets 
161     TH2F*         fh2TrackPtTrackPhi;       // phi distribution of accepted tracks
162     TH2F*         fh2RelPtFGen;             // relative difference between generated and found 
163     TH2F*         fh2PhiPt[kMaxJets];    // delta phi correlation of tracks with the jet      
164     TH2F*         fh2PhiEta[kMaxJets];   // eta   phi correlation of tracks with the jet      
165     TH2F*         fh2RhoPtRec[kMaxJets];    // jet shape variable rho
166     TH2F*         fh2PsiPtRec[kMaxJets];    // jet shape variable psi
167     TH2F*         fh2RhoPtGen[kMaxJets];    //
168     TH2F*         fh2PsiPtGen[kMaxJets];    //
169     TH2F*         fh2FragRec[kMaxJets];     // fragmentation function
170     TH2F*         fh2FragLnRec[kMaxJets];   // fragmetation in xi
171     TH2F*         fh2FragGen[kMaxJets];     // fragmentation function
172     TH2F*         fh2FragLnGen[kMaxJets];   // fragmetation in xi
173
174
175
176     // Dijet histos
177     TH2F*   fh2DijetDeltaPhiPt;      // dijet delta phi vs pt
178     TH2F*   fh2DijetAsymPt;          // dijet asym vs pt
179     TH2F*   fh2DijetAsymPtCut;       // dijet asym vs pt after delta phi cut
180     TH2F*   fh2DijetDeltaPhiDeltaEta; // dijet delta phi delta eta
181     TH2F*   fh2DijetPt2vsPt1;          // dijet pt2 vs pt1
182     TH2F*   fh2DijetDifvsSum;          // dijet dif vs sum
183     TH1F*   fh1DijetMinv;            // dijet inv mass
184     TH1F*   fh1DijetMinvCut;         // dijet inv after delta phi cut
185     //background histos
186     
187     TH1F*         fh1Bkg1;
188     TH1F*         fh1Bkg2;
189     TH1F*         fh1Sigma1;
190     TH1F*         fh1Sigma2;
191     TH1F*         fh1Area1;
192     TH1F*         fh1Area2;
193
194     TH1F*         fh1Ptjet;
195     TH1F*         fh1Ptjetsub1;
196     TH1F*         fh1Ptjetsub2;
197     TH1F*         fh1Ptjethardest;
198     TH1F*         fh1Ptjetsubhardest1;
199     TH1F*         fh1Ptjetsubhardest2;
200     TH2F*         fh1Rhovspthardest1;
201     TH2F*         fh1Rhovspthardest2;
202     TH2F*         fh1Errorvspthardest1;
203     TH2F*         fh1Errorvspthardest2;
204
205     TList *fHistList; // Output list
206    
207
208     ClassDef(AliAnalysisTaskJetSpectrum2, 7) // Analysis task for standard jet analysis
209 };
210  
211 #endif