]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/AliAnalysisTaskJetCorePP.h
new task to find jet trigger candidates (loop over EMCal L1 patches over threshold...
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCorePP.h
1 #ifndef ALIANALYSISTASKJETCOREPP_H
2 #define ALIANALYSISTASKJETCOREPP_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 // This task performs hadron-trigger recoil jet correlations 
9 // Output pT spectrum of jet given trigger pT 
10 // Author: filip krizek 16th March 2013
11 // *******************************************
12
13 class TH1F;
14 class TH1D;
15 class TH1I;
16 class TH2F;
17 class TH3F;
18 class TList;
19 class THnSparse;
20 class TRandom3;
21 class TArrayI; 
22 class TProfile;
23 class TFile;
24 class TKey;
25 class AliESDEvent;
26 class AliAODExtension;
27 class AliAODEvent;
28 class AliGenPythiaEventHeader;
29
30 #include "AliAnalysisTaskSE.h"
31 #include "AliVEvent.h"
32
33 class AliAnalysisTaskJetCorePP : public AliAnalysisTaskSE {
34 public:
35    AliAnalysisTaskJetCorePP();
36    AliAnalysisTaskJetCorePP(const char *name);
37    AliAnalysisTaskJetCorePP(const AliAnalysisTaskJetCorePP& a); 
38    AliAnalysisTaskJetCorePP& operator=(const AliAnalysisTaskJetCorePP& a); // not implemented
39    virtual ~AliAnalysisTaskJetCorePP();
40    virtual void  LocalInit() {Init();}
41    virtual void  Init();
42    virtual void  UserCreateOutputObjects();
43    virtual void  UserExec(Option_t *option);
44    virtual void  Terminate(const Option_t*);
45    virtual Bool_t Notify();
46  
47    virtual void  SetBranchName(const TString &name){ fJetBranchName = name; } 
48    virtual void  SetBranchNameMC(const TString &name){ fJetBranchNameMC = name; } 
49    virtual void  SetNonStdFile(char* c){fNonStdFile = c;} 
50    virtual void  SetSystem(Int_t sys) { fSystem = sys; } 
51    virtual void  SetJetR(Float_t jR) { fJetParamR = jR; }
52    virtual void  SetOfflineTrgMask(AliVEvent::EOfflineTriggerTypes mask) { fOfflineTrgMask = mask; } 
53    virtual void  SetMinContribVtx(Int_t n) { fMinContribVtx = n; } 
54    virtual void  SetVtxZMin(Float_t z) { fVtxZMin = z; }
55    virtual void  SetVtxZMax(Float_t z) { fVtxZMax = z; } 
56    virtual void  SetFilterMask(UInt_t i){fFilterMask = i;} 
57    virtual void  SetCentMin(Float_t cent) { fCentMin = cent; }
58    virtual void  SetCentMax(Float_t cent) { fCentMax = cent; } 
59    virtual void  SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
60    virtual void  SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; } 
61    virtual void  SetTriggerEtaCut(Float_t eta) { fTriggerEtaCut = eta; }
62    virtual void  SetTrackEtaCut(Float_t eta) { fTrackEtaCut = eta; }
63    virtual void  SetTrackLowPtCut(Float_t pt) { fTrackLowPtCut=pt; } 
64    virtual void  SetTriggerType(Int_t tt){ fHardest=tt;}
65    virtual void  SetEventNumberRangeLow(Int_t rl){ fEventNumberRangeLow=rl;}
66    virtual void  SetEventNumberRangeHigh(Int_t rh){ fEventNumberRangeHigh=rh;}  
67    virtual void  SetTriggerPtRangeLow(Float_t tl){ fTriggerPtRangeLow=tl;}   
68    virtual void  SetTriggerPtRangeHigh(Float_t th){ fTriggerPtRangeHigh=th;}  
69
70
71    Double_t RelativePhi(Double_t angle1, Double_t angle2); 
72
73 private:
74    //private member functions
75    Int_t   GetListOfTracks(TList *list); //returns index of trig and track list 
76    //Double_t GetBackgroundInPerpCone(Float_t jetR, Double_t jetPhi, Double_t jetEta, TList* trkList); //sums pT in the cone perp in phi to jet
77    Bool_t SelectMCGenTracks(AliVParticle *trk, TList *trkList, Double_t &ptLeading, Int_t &index, Int_t counter);
78    void FillEffHistos(TList *recList, TList *genList);
79
80    //private member objects
81    AliESDEvent *fESD;    //! ESD object
82    AliAODEvent *fAODIn;  //! AOD event for AOD input tracks
83    AliAODEvent *fAODOut; //! AOD event 
84    AliAODExtension  *fAODExtension; //! where we take the jets from can be input or output AOD
85
86    // jets to compare
87    TString fJetBranchName; //  name of jet branch 
88    TString fJetBranchNameMC; //  name of jet branch 
89    TList  *fListJets;      //! jet list reconstructed level
90    TList  *fListJetsGen;   //! jet list generator level  
91
92    TString fNonStdFile;    // name of delta aod file to catch the extension
93
94    // event selection
95    Int_t   fSystem;        // collision system  pp=0, pPb=1  
96    Float_t fJetParamR;     // jet cone resolution (radius) R 
97    AliVEvent::EOfflineTriggerTypes fOfflineTrgMask; // mask of offline trigs 
98    Int_t   fMinContribVtx; // min numb of trk contrib for prim vertex 
99    Float_t fVtxZMin;       // lower bound on vertex z 
100    Float_t fVtxZMax;       // upper bound on vertex z 
101    UInt_t  fFilterMask;    // filter bit for slected tracks  
102    Float_t fCentMin;       // lower bound on centrality 
103    Float_t fCentMax;       // upper bound on centrality 
104    Float_t fJetEtaMin;     // lower bound on eta for found jets 
105    Float_t fJetEtaMax;     // upper bound on eta for found jets 
106    Float_t fTriggerEtaCut; // lower bound on eta for trigger track
107    Float_t fTrackEtaCut;   // upper bound on eta for trigger track 
108    Float_t fTrackLowPtCut; // upper bound on eta for trigger track
109    
110    
111    TList *fOutputList;          //! output data container 
112    TH1I  *fHistEvtSelection;    //! event selection statistic 
113    TH2F      *fh2Ntriggers;     //trigger pT versus centrality 
114    THnSparse *fHJetSpec;      //Recoil jet spectrum  
115    
116    //Diagnostics
117    THnSparse *fHJetDensity;       //density of jet with A>0.07  //fk
118    THnSparse *fHJetDensityA4;     //density of jets with A>0.4 //fk
119    TH2D *fhJetPhi;     //Azimuthal distribution of jets
120    TH2D *fhTriggerPhi; //Azimuthal distribution of trigger hadron
121    TH2D *fhJetEta;     //Pseudorapidity distribution of jets
122    TH2D *fhTriggerEta; //Pseudorapidity distribution of trigger hadron
123    TH1D *fhVertexZ;    //z vertex distribution 
124    TH1D *fhVertexZAccept;    //z vertex distribution after cut
125    TH1D *fhContribVtx;    //contributors to vertex 
126    TH1D *fhContribVtxAccept;    //contributors to vertex after cut
127    TH1D *fhDphiTriggerJet;  //Deltaphi between trigger and jet 
128    TH1D *fhDphiTriggerJetAccept;  //Deltaphi between trigger and jet after cut
129    TH1D *fhCentrality;  //Deltaphi between trigger and jet 
130    TH1D *fhCentralityAccept;  //Deltaphi between trigger and jet after cut
131
132    THnSparse *fHJetPtRaw;      //bg unsubtr. vs bg subtr. pT spectrum of jets vs jet area
133    THnSparse *fHLeadingJetPtRaw; //bg unsubtr. vs bg. subtr. leading jet pT vs area 
134    THnSparse *fHDphiVsJetPtAll;   //Dphitrigger-jet  versus jet pt for all jets given pTtrigg  
135
136    //MC generator level
137    TH2D      *fhJetPtGenVsJetPtRec; //jet respose matrix  
138    TH1D      *fhJetPtGen;           //generated pT spectrum of jets  
139    TH2F      *fh2NtriggersGen; //trigger pT versus centrality in generator level
140    THnSparse *fHJetSpecGen;    //Recoil jet spectrum in generator level 
141    TH2D      *fhPtTrkTruePrimRec; // pt spectrum of true reconstructed primary tracks    
142    TH2D      *fhPtTrkTruePrimGen; // pt spectrum of true generated primary track    
143    TH2D      *fhPtTrkSecOrFakeRec; // pt spectrum of reconstructed fake or secondary tracks    
144    
145    Bool_t fIsMC;   //flag analysis on MC data with true and on the real data false
146    TArrayI faGenIndex;   // labels of particles on MC generator level  
147    TArrayI faRecIndex;   // labels of particles on reconstructed track level
148    const Double_t fkAcceptance; //eta times phi  Alice coverage  
149    const Double_t fkDeltaPhiCut; //Delta phi cut on  trigger-jet distance in azimuth
150  
151    TProfile*     fh1Xsec;   //! pythia cross section and trials
152    TH1F*         fh1Trials; //! trials are added
153    TH1F*         fh1AvgTrials; //! trials are added
154    TH1F*         fh1PtHard;  //! Pt har of the event...      
155    TH1F*         fh1PtHardNoW;  //! Pt har of the event without weigt      
156    TH1F*         fh1PtHardTrials;  //! Number of trials
157    Float_t       fAvgTrials;       // Average number of trials
158
159    
160    Int_t   fHardest;               // trigger type 0=single incl, 1=LP 
161    Int_t   fEventNumberRangeLow;   // lower range of selected event numbers  
162    Int_t   fEventNumberRangeHigh;  // high range of selected event numbers  
163    Float_t fTriggerPtRangeLow;   // lower range of selected trigger pt
164    Float_t fTriggerPtRangeHigh;  // upper range of selected trigger pt
165
166    TRandom3* fRandom;           // TRandom3 
167
168    ClassDef(AliAnalysisTaskJetCorePP, 5);  //has to end with number larger than 0
169 };
170
171 #endif
172