Ernesto's changes for train running
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskUE.h
CommitLineData
f3050824 1#ifndef ALIANALYSISTASKUE_H
2#define ALIANALYSISTASKUE_H
6ef5bfa4 3
f3050824 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6ef5bfa4 6
c4396fd4 7#include "AliAnalysisTask.h"
f3050824 8
9class AliESDEvent;
10class AliAODEvent;
11class TH1F;
12class TH2F;
13class TH1I;
623ed0a0 14class TProfile;
f3050824 15class TVector3;
6ef5bfa4 16class TTree;
f3050824 17
6ef5bfa4 18class AliAnalysisTaskUE : public AliAnalysisTask
19 {
20 public:
21 AliAnalysisTaskUE(const char* name="AliAnalysisTaskUE");
22 virtual ~AliAnalysisTaskUE() {;}
23
1e996f55 24 // Implementation of interace methods
623ed0a0 25 virtual Bool_t Notify();
6ef5bfa4 26 virtual void ConnectInputData(Option_t *);
27 virtual void CreateOutputObjects();
28 virtual void Exec(Option_t *option);
29 virtual void Terminate(Option_t *);
7fa8b2da 30
31 //Select the trigger
32 void SelectTrigger(Int_t trig) { fTrigger = trig; }
33
6ef5bfa4 34 // Setters
35 virtual void SetDebugLevel( Int_t level ) { fDebug = level; }
36 void SetPtRangeInHist( Int_t bin, Double_t min, Double_t max ) {
37 fBinsPtInHist = bin;
38 fMinJetPtInHist = min;
39 fMaxJetPtInHist = max;
40 }
c4396fd4 41
42 // Read deltaAODs
43 void ReadDeltaAOD() { fDeltaAOD = kTRUE; }
44 void SelectDeltaAODBranch(const char* val) { fDeltaAODBranch = val; }
45
623ed0a0 46 // Setters for MC
47 void SetUseMCBranch(){fUseMCParticleBranch = kTRUE;}
48 void SetConstrainDistance(Bool_t val1, Double_t val2){ fMinDistance = val2; fConstrainDistance = val1;}
49 void SetSimulateChJetPt(){fSimulateChJetPt = kTRUE;}
50 void SetUseAODMCParticle(){fUseAliStack = kFALSE;}
6ef5bfa4 51
52 void SetAnaTopology( Int_t val ) { fAnaType = val; }
53 void SetRegionType( Int_t val ) { fRegionType = val; }
54 void SetUseChPartJet( Int_t val ) { fUseChPartJet = val; }
9d9a3c85 55 void SetUseChargeHadrons( Bool_t val ){ fUseChargeHadrons = val; }
6ef5bfa4 56 void SetPtSumOrdering( Bool_t val ) { fOrdering = val; }
57 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
58 void SetJetsOnFly( Bool_t val ) { fJetsOnFly = val; }
59 void SetConeRadius( Double_t val ) { fConeRadius = val; }
623ed0a0 60 void SetConePosition(Int_t val) { fConePosition= val; }
6ef5bfa4 61 void SetUseSingleCharge() { fUseSingleCharge = kTRUE; }
62 void SetUseNegativeChargeType() { fUsePositiveCharge = kFALSE; }
63 // Jet cuts
623ed0a0 64 void SetPtMinChPartJet( Double_t val ) { fChJetPtMin = val; }
6ef5bfa4 65 void SetJet1EtaCut( Double_t val ) { fJet1EtaCut = val; }
66 void SetJet2DeltaPhiCut( Double_t val ) { fJet2DeltaPhiCut = val; }
67 void SetJet2RatioPtCut( Double_t val ) { fJet2RatioPtCut = val; }
68 void SetJet3PtCut( Double_t val ) { fJet3PtCut = val; }
69 // track cuts
70 void SetTrackPtCut( Double_t val ) { fTrackPtCut = val; }
71 void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
72
73 private:
74 AliAnalysisTaskUE(const AliAnalysisTaskUE &det);
75 AliAnalysisTaskUE& operator=(const AliAnalysisTaskUE &det);
76
77 void AnalyseUE();
78 Int_t IsTrackInsideRegion(TVector3 *jetVect, TVector3 *partVect);
79 void CreateHistos();
80 void SetRegionArea(TVector3 *jetVect);
81 void FillSumPtRegion( Double_t leadingE, Double_t ptMax, Double_t ptMin );
82 void FillAvePartPtRegion( Double_t leadingE, Double_t ptMax, Double_t ptMin );
83 void FillMultRegion( Double_t leadingE, Double_t nTrackPtmax, Double_t nTrackPtmin, Double_t ptMin );
84 TObjArray* FindChargedParticleJets();
85 void QSortTracks(TObjArray &a, Int_t first, Int_t last);
86 void WriteSettings();
87
7fa8b2da 88 Int_t fTrigger; //Trigger flag as defined in AliAnalysisHelperJetTasks.h
c4396fd4 89 Int_t fDebug; // Debug flag
90 Bool_t fDeltaAOD; // Read jets from delta AOD
91 TString fDeltaAODBranch; // Jet branch name from delta AOD
92 TClonesArray* fArrayJets; // Array of Jets from delta AOD
93
6ef5bfa4 94 AliAODEvent* fAOD; //! AOD Event
95 AliAODEvent* fAODjets; //! AOD Event for reconstructed on the fly (see ConnectInputData()
96 TList* fListOfHistos; // Output list of histograms
97
98 // Config
99 Int_t fBinsPtInHist; // # bins for Pt histos range
100 Double_t fMinJetPtInHist; // min Jet Pt value for histo range
101 Double_t fMaxJetPtInHist; // max Jet Pt value for histo range
102
623ed0a0 103 // For MC
104 Bool_t fUseMCParticleBranch; // Run Over mcparticles branch in AOD
105 Bool_t fConstrainDistance; // Constrain Distance between rec jet and pyth
106 Double_t fMinDistance; // Minimum distance between rec jet and pyth
107 Bool_t fSimulateChJetPt; // Naive simulation of charged jet Pt from original Jet in MC Header
108 Bool_t fUseAliStack; // Use AliSatck for particle info otherwise "mcparticles" branch in AOD
109
6ef5bfa4 110 // Cuts
111 Int_t fAnaType; // Analysis type on jet topology:
112 // 1=inclusive (default)
113 // 2=back to back inclusive
114 // 3=back to back exclusive
115 // 4=gama jet (back to back) ???
116 // Minimum bias
117 // 31 = Semi jet (charged leading particle jets)
118 // 32 = Random jetcone ?
119 // 33 = Swiss chees ?
120
121 // UE analysis is conducted in different type of regions
122 // Transverse are those like defined in: R. Field Acta Physica Polonica B. Vol 36 No. 2 pg 167 (2005)
123 // Cone regions like defined in: Phys. Rev. D 70, 072002 (2004)
124 Int_t fRegionType; // 1 = transverse regions (default)
125 // 2 = cone regions
126 Double_t fConeRadius; // if selected Cone-like region type, set Radius (=0.7 default)
623ed0a0 127 Int_t fConePosition; // This parameter set how will cone center in transversal zone will be set
128 // 1 : To be used in any jet topology (default value)
129 // eta_cone = eta_leadingjet
130 // phi_cone = phi_leadingjet + - 90
131 // 2 : To be used in multiple jet topology (code will cry otherwise)
132 // eta_cone = (eta_leadingjet + eta_subleadingjet)/2
133 // phi_cone = phi_leadingjet + - 90
6ef5bfa4 134 Double_t fAreaReg; // Area of the region To be used as normalization factor when filling histograms
135 // if fRegionType = 2 not always it is included within eta range
136 Bool_t fUseChPartJet; // Use "Charged Particle Jet" instead of jets from AOD
137 // see FindChargedParticleJets()
9d9a3c85 138 Bool_t fUseChargeHadrons; // Only use charge hadrons
6ef5bfa4 139
140 // Theoreticians ask for tools charge-aware
141 // especially those which are related to multiplicity and MC-tunings
142 // see arXiv:hep-ph/0507008v3
143 Bool_t fUseSingleCharge; //Make analysis for a single type of charge (=kFALSE default)
144 Bool_t fUsePositiveCharge; //If Single type of charge used then set which one (=kTRUE default positive)
6ef5bfa4 145 Int_t fOrdering; // Pt and multiplicity summation ordering:
146 // 1=CDF-like -independent sorting according quantity to be scored: Double sorting- (default)
147 // if Pt summation will be scored take Pt minimum between both zones and
148 // fill Pt Max. and Min. histog. accordingly
149 // if Multiplicity summation will be scored take Mult. minimum between both zones and
150 // fill Mult Max and Min histog. accordingly
151 // Bib:
152 // 2=Marchesini-like (Only Pt sorting: Single sorting)
153 // sort only according Pt summation scored, find minimum between both zones and
154 // fill Pt and Multiplicity Max and Min summation histog. following only this criterium
155 // Bib: Phys. Rev. D 38, 3419 (1988)
156 // 3=User Selection sorting (NOTE: USER must implement it within cxx)
157
158 UInt_t fFilterBit; // Select tracks from an specific track cut (default 0xFF all track selected)
159 Bool_t fJetsOnFly; // if jets are reconstructed on the fly from AOD tracks (see ConnectInputData() )
160
623ed0a0 161 // Jet cuts
162 Double_t fChJetPtMin; // Min Pt for charged Particle Jet
6ef5bfa4 163 Double_t fJet1EtaCut; // |jet1 eta| < fJet1EtaCut (fAnaType = 1,2,3)
164 Double_t fJet2DeltaPhiCut; // |Jet1.Phi - Jet2.Phi| < fJet2DeltaPhiCut (fAnaType = 2,3)
165 Double_t fJet2RatioPtCut; // Jet2.Pt/Jet1Pt > fJet2RatioPtCut (fAnaType = 2,3)
166 Double_t fJet3PtCut; // Jet3.Pt < fJet3PtCut (fAnaType = 3)
167 // track cuts
168 Double_t fTrackPtCut; // Pt cut of tracks in the regions
169 Double_t fTrackEtaCut; // Eta cut on tracks in the regions (fRegionType=1)
519378fb 170 Double_t fAvgTrials; // average trials used to fill the fh1Triasl histogram in case we do not have trials on a event by event basis
c4396fd4 171
6ef5bfa4 172 // Histograms ( are owned by fListOfHistos TList )
173 TH1F* fhNJets; //!
174 TH1F* fhEleadingPt; //!
175
176 TH1F* fhMinRegPtDist; //!
177 TH1F* fhRegionMultMin; //!
178 TH1F* fhMinRegAvePt; //!
179 TH1F* fhMinRegSumPt; //!
180 TH1F* fhMinRegMaxPtPart; //!
181 TH1F* fhMinRegSumPtvsMult; //!
182
9d9a3c85 183 TH2F* fhdNdEtaPhiDist; //!
6ef5bfa4 184 TH2F* fhFullRegPartPtDistVsEt; //!
185 TH2F* fhTransRegPartPtDistVsEt; //!
186
187 TH1F* fhRegionSumPtMaxVsEt; //!
188 TH1I* fhRegionMultMax; //!
189 TH1F* fhRegionMultMaxVsEt; //!
190 TH1F* fhRegionSumPtMinVsEt; //!
191 TH1F* fhRegionMultMinVsEt; //!
192 TH1F* fhRegionAveSumPtVsEt; //!
193 TH1F* fhRegionDiffSumPtVsEt; //!
194
195 TH1F* fhRegionAvePartPtMaxVsEt; //!
196 TH1F* fhRegionAvePartPtMinVsEt; //!
197 TH1F* fhRegionMaxPartPtMaxVsEt; //!
198
623ed0a0 199 // TH2F* fhValidRegion; //! test to be canceled
200
201 TProfile* fh1Xsec; //!
202 TH1F* fh1Trials; //!
203
6ef5bfa4 204 TTree* fSettingsTree; //! Fast Settings saving
205
623ed0a0 206
6ef5bfa4 207
9d9a3c85 208 ClassDef( AliAnalysisTaskUE, 4); // Analysis task for Underlying Event analysis
6ef5bfa4 209 };
f3050824 210
f3050824 211#endif
6ef5bfa4 212
213