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