]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/AliAnalysisTaskJetCore.h
changes from fzhou, mconnors and myself
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCore.h
1 #ifndef ALIANALYSISTASKJETCORE_H
2 #define ALIANALYSISTASKJETCORE_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 computes several jet observables like 
9 // the fraction of energy in inner and outer coronnas,
10 // the distance from track to jet axis and a 
11 // correlation strength distribution of particles inside jets.    
12 // Author: lcunquei@cern.ch
13 // *******************************************
14
15 class TH1F;
16 class TH1I;
17 class TH2F;
18 class TH3F;
19 class THnSparse;
20 class AliESDEvent;
21 class AliAODExtension;
22 class AliAODEvent;
23
24 #include "AliAnalysisTaskSE.h"
25 #include "AliVEvent.h"
26
27 class AliAnalysisTaskJetCore : public AliAnalysisTaskSE {
28 public:
29    AliAnalysisTaskJetCore();
30    AliAnalysisTaskJetCore(const char *name);
31    virtual ~AliAnalysisTaskJetCore();
32    virtual void     LocalInit() {Init();}
33    virtual void     Init();
34    virtual void     UserCreateOutputObjects();
35    virtual void     UserExec(Option_t *option);
36    virtual void     Terminate(const Option_t*);
37
38    virtual Int_t      GetNInputTracks();
39      
40    Double_t RelativePhi(Double_t angle1,Double_t angle2);     
41    Int_t   GetPhiBin(Double_t phi);
42    virtual THnSparse* NewTHnSparseF(const char* name, UInt_t entries);
43    virtual void       GetDimParams(Int_t iEntry,TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax);
44    virtual AliVEvent::EOfflineTriggerTypes GetOfflineTrgMask() const { return fOfflineTrgMask; }
45    virtual void     GetBranchNames(TString &branch1, TString &branch2) const { branch1 = fJetBranchName[0]; branch2 = fJetBranchName[1]; }
46    virtual Bool_t   GetIsPbPb() const { return fIsPbPb; }
47    virtual Int_t    GetMinContribVtx() const { return fMinContribVtx; };
48    virtual Float_t  GetVtxZMin() const { return fVtxZMin; }
49    virtual Float_t  GetVtxZMax() const { return fVtxZMax; }
50    virtual Int_t    GetEvtClassMin() const { return fEvtClassMin; }
51    virtual Int_t    GetEvtClassMax() const { return fEvtClassMax; }
52    virtual Float_t  GetCentMin() const { return fCentMin; }
53    virtual Float_t  GetCentMax() const { return fCentMax; }
54    virtual Int_t    GetNInputTracksMin() const { return fNInputTracksMin; }
55    virtual Int_t    GetNInputTracksMax() const { return fNInputTracksMax; } 
56    virtual Float_t  GetJetEtaMin() const { return fJetEtaMin; }
57    virtual Float_t  GetJetEtaMax() const { return fJetEtaMax; }
58    virtual Float_t  GetJetPtMin() const { return fJetPtMin; }
59    virtual Float_t  GetJetPtFractionMin() const { return fJetPtFractionMin; }
60    virtual Int_t    GetNMatchJets() const { return fNMatchJets; }
61    virtual void     SetBranchNames(const TString &branch1, const TString &branch2);
62    virtual void     SetBackgroundBranch(TString &branch) { fBackgroundBranch = branch;}
63    virtual void     SetIsPbPb(Bool_t b=kTRUE) { fIsPbPb = b; }
64    virtual void     SetOfflineTrgMask(AliVEvent::EOfflineTriggerTypes mask) { fOfflineTrgMask = mask; }
65    virtual void     SetMinContribVtx(Int_t n) { fMinContribVtx = n; }
66    virtual void     SetVtxZMin(Float_t z) { fVtxZMin = z; }
67    virtual void     SetVtxZMax(Float_t z) { fVtxZMax = z; }
68    virtual void     SetEvtClassMin(Int_t evtClass) { fEvtClassMin = evtClass; }
69    virtual void     SetEvtClassMax(Int_t evtClass) { fEvtClassMax = evtClass; }
70    virtual void     SetFilterMask(UInt_t i){fFilterMask = i;}
71    virtual void     SetFilterType(Int_t iType){fFilterType=iType;}
72    virtual void     SetRadioFrac(Float_t radiofrac) { fRadioFrac = radiofrac; }
73    virtual void     SetMinDist(Float_t minDist) { fMinDist = minDist; }
74    virtual void     SetCentMin(Float_t cent) { fCentMin = cent; }
75    virtual void     SetCentMax(Float_t cent) { fCentMax = cent; }
76    virtual void     SetNInputTracksMin(Int_t nTr) { fNInputTracksMin = nTr; }
77    virtual void     SetNInputTracksMax(Int_t nTr) { fNInputTracksMax = nTr; }
78    virtual void     SetAngStructCloseTracks(Int_t yesno){fAngStructCloseTracks=yesno;}
79    virtual void     SetCheckMethods(Int_t yesno){fCheckMethods=yesno;}
80    virtual void     SetEventMixing(Int_t yesno){fDoEventMixing=yesno;}
81    virtual void     SetFlagPhiBkg(Int_t yesno){fFlagPhiBkg=yesno;}
82    virtual void     SetFlagEtaBkg(Int_t yesno){fFlagEtaBkg=yesno;}
83    virtual void     SetFlagJetHadron(Int_t yesno){fFlagJetHadron=yesno;}
84    virtual void     SetFlagRandom(Int_t yesno){fFlagRandom=yesno;}
85    virtual void     SetFlagOnlyRecoil(Int_t yesno){fFlagOnlyRecoil=yesno;}
86    virtual void     SetNRPBins(Int_t bins){fNRPBins=bins;}
87    virtual void     SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
88    virtual void     SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
89    virtual void     SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; }
90    virtual void     SetJetPtMin(Float_t pt) { fJetPtMin = pt; }
91    virtual void     SetJetTriggerExclude(UChar_t i) { fJetTriggerExcludeMask = i; }
92    virtual void     SetJetPtFractionMin(Float_t frac) { fJetPtFractionMin = frac; }
93    virtual void     SetNMatchJets(Int_t n) { fNMatchJets = n; }
94    virtual void     SetFillEvent(Bool_t b) { fbEvent = b; }
95    virtual void     SetKeepJets(Bool_t b = kTRUE) { fKeepJets = b; }
96    virtual void     SetNonStdFile(char* c){fNonStdFile = c;} 
97     enum {kTrackUndef = 0, kTrackAOD, kTrackKineAll,kTrackKineCharged, kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance};
98
99 private:
100    // ESD/AOD events
101    AliESDEvent *fESD;    //! ESD object
102    AliAODEvent *fAODIn;    //! AOD event for AOD input tracks
103     AliAODEvent *fAODOut;    //! AOD event 
104     AliAODExtension  *fAODExtension; //! where we take the jets from can be input or output AOD
105     Int_t   GetListOfTracks(TList *list);
106    Int_t   GetHardestTrackBackToJet(AliAODJet *jet);
107    Int_t   GetListOfTracksCloseToJet(TList *list,AliAODJet *jet);
108    // jets to compare
109    TString fJetBranchName[2]; //  name of jet branches to compare
110    TList *fListJets[2];       //! jet lists
111
112    TString fBackgroundBranch;
113    TString       fNonStdFile; // name of delta aod file to catch the extension
114    // event selection
115    Bool_t fIsPbPb;         // is Pb-Pb (fast embedding) or p-p (detector response)
116    AliVEvent::EOfflineTriggerTypes fOfflineTrgMask; // mask of offline triggers to accept
117    Int_t   fMinContribVtx; // minimum number of track contributors for primary vertex
118    Float_t fVtxZMin;      // lower bound on vertex z
119    Float_t fVtxZMax;      // upper bound on vertex z
120    Int_t   fEvtClassMin;          // lower bound on event class
121    Int_t   fEvtClassMax;          // upper bound on event class
122    UInt_t  fFilterMask;            // filter bit for slecected tracks
123    Int_t   fFilterType;               
124    Float_t fRadioFrac;                          //!size of the concentric cone
125    Float_t fMinDist;   
126    Float_t fCentMin;      // lower bound on centrality
127    Float_t fCentMax;      // upper bound on centrality
128    Int_t   fNInputTracksMin;  // lower bound of nb. of input tracks
129    Int_t   fNInputTracksMax;  // upper bound of nb. of input tracks
130    Int_t   fAngStructCloseTracks;//only constituents or all tracks with R<0.8 for the angular structure
131    Int_t   fCheckMethods;     //to look into more detail into the core
132    Int_t   fDoEventMixing;
133    Int_t   fFlagPhiBkg;
134    Int_t   fFlagEtaBkg;
135    Int_t   fFlagJetHadron;
136    Int_t   fFlagRandom;
137    Int_t   fFlagOnlyRecoil;
138    Int_t   fTrackTypeRec;
139    Int_t   fRPAngle;
140    Int_t   fNRPBins;
141    Float_t fJetEtaMin;        // lower bound on eta for found jets
142    Float_t fJetEtaMax;        // upper bound on eta for found jets
143    Int_t   fNevents;          // number of events
144    Int_t   fTindex;           // index reference
145    Int_t   fTrigBufferIndex;  //index for the buffering
146    Int_t   fCountAgain;       //index for the buffering
147    Float_t fJetPtMin;         // minimum jet pT
148    UChar_t fJetTriggerExcludeMask; // mask for jet triggeres to exclude
149    Float_t fJetPtFractionMin; // minimum fraction for positiv match of jets
150    Int_t   fNMatchJets;       // maximal nb. of jets taken for matching
151    Double_t fMatchMaxDist;     // maximal distance of matching jets
152    Bool_t  fKeepJets;          // keep jets with negative pt after background subtraction
153   
154
155    // output objects
156    const Int_t fkNbranches;                   //! number of branches to be read
157    const Int_t fkEvtClasses;                  //! number of event classes
158    
159    TList *fOutputList;                        //! output data container
160    Bool_t fbEvent;                            // fill fhnEvent
161    TH1I  *fHistEvtSelection;                  //! event selection statistic
162    THnSparse *fhnDeltaR;                     //! variables per jet
163    THnSparse *fhnMixedEvents;                //!mixed events matrix
164  
165
166    TH2F      *fh2JetCoreMethod1C10;          //Energy fraction in the core C10 method 1
167    TH2F      *fh2JetCoreMethod2C10;          //Energy fraction in the core C10 method 2
168    TH2F      *fh2JetCoreMethod1C20;          //Energy fraction in the core C20 method 1 
169    TH2F      *fh2JetCoreMethod2C20;          //Energy fraction in the core C20 method 2
170    TH2F      *fh2JetCoreMethod1C30;          //Energy fraction in the core C30 method 1
171    TH2F      *fh2JetCoreMethod2C30;          //Energy fraction in the core C30 method 2
172    TH2F      *fh2JetCoreMethod1C60;          //Energy fraction in the core C60 method 1
173    TH2F      *fh2JetCoreMethod2C60;          //Energy fraction in the core C60 method 2
174      TH3F*      fh3JetTrackC3060;           //C3060 pt2
175      TH3F*      fh3JetTrackC20;             //C10 pt2
176      TH2F*      fh2AngStructpt1C10;         //Average 
177      TH2F*      fh2AngStructpt2C10;         //C10 pt2
178      TH2F*      fh2AngStructpt3C10;         //C10 pt3
179      TH2F*      fh2AngStructpt4C10;         //C10 pt4
180      TH2F*      fh2AngStructpt1C20;         //C20 pt1
181      TH2F*      fh2AngStructpt2C20;         //C20 pt2
182      TH2F*      fh2AngStructpt3C20;         //C20 pt3 
183      TH2F*      fh2AngStructpt4C20;         //C20 pt4
184      TH2F*      fh2AngStructpt1C30;         //C30 pt1
185      TH2F*      fh2AngStructpt2C30;         //C30 pt2
186      TH2F*      fh2AngStructpt3C30;         //C30 pt3
187      TH2F*      fh2AngStructpt4C30;         //C30 pt4
188      TH2F*      fh2AngStructpt1C60;         //C60 pt1
189      TH2F*      fh2AngStructpt2C60;         //C60 pt2
190      TH2F*      fh2AngStructpt3C60;         //C60 pt3
191      TH2F*      fh2AngStructpt4C60;         //C60 pt4
192   
193      TH2F*      fh2Ntriggers;              //triggers
194      TH2F*      fh2Ntriggers2;             //centrality bias of triggers 
195      TH3F*      fh3JetDensity;             //jet density
196      TH3F*      fh3JetDensityA4;           //jet density
197      TH2F*      fh2RPJets;                  //reaction plane Jets
198      TH2F*      fh2RPT;                     //reaction plane TT 
199      TH3F*      fh3spectriggeredC20RP;       //spec wrt RP
200      TH3F*      fh3spectriggeredC20;           //triggered spectra
201      TH3F*      fh3spectriggeredC3060;         //triggered spectra
202
203      
204      Double_t            fTrigBuffer[10][7];      //!buffer for triggers   
205
206    AliAnalysisTaskJetCore(const AliAnalysisTaskJetCore&); // not implemented
207    AliAnalysisTaskJetCore& operator=(const AliAnalysisTaskJetCore&); // not implemented
208
209    ClassDef(AliAnalysisTaskJetCore, 4);
210 };
211
212 #endif
213