1 #ifndef ALIANALYSISTASKCHARGEDJETSPA_H
2 #define ALIANALYSISTASKCHARGEDJETSPA_H
12 class AliRhoParameter;
15 class AliAnalysisUtils;
18 class AliAnalysisTaskChargedJetsPA : public AliAnalysisTaskSE {
20 // ######### CONTRUCTORS/DESTRUCTORS AND STD FUNCTIONS
21 AliAnalysisTaskChargedJetsPA() : AliAnalysisTaskSE(), fOutputList(0), fAnalyzeJets(1), fAnalyzeJetProfile(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fAnalyzeMassCorrelation(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseDefaultVertexCut(1), fUsePileUpCut(1), fSetCentralityToOne(0), fPartialAnalysisNParts(1), fPartialAnalysisIndex(0), fJetArray(0), fTrackArray(0), fBackgroundJetArray(0), fJetArrayName(0), fTrackArrayName(0), fBackgroundJetArrayName(0), fNumPtHardBins(11), fUsePtHardBin(-1), fRhoTaskName(), fNcoll(6.88348), fRandConeRadius(0.4), fSignalJetRadius(0.4), fBackgroundJetRadius(0.4), fTRBackgroundConeRadius(0.6), fNumberRandCones(8), fNumberExcludedJets(-1), fDijetMaxAngleDeviation(10.0), fPhysicalJetRadius(0.6), fSignalJetEtaWindow(0.5), fBackgroundJetEtaWindow(0.5), fTrackEtaWindow(0.9), fMinTrackPt(0.150), fMinJetPt(0.15), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(20), fCentralityType("V0A"), fFirstLeadingJet(0), fSecondLeadingJet(0), fNumberSignalJets(0), fCrossSection(0.0), fTrials(0.0), fRandom(0), fHelperClass(0), fInitialized(0), fTaskInstanceCounter(0), fHistList(0), fHistCount(0), fIsDEBUG(0), fEventCounter(0)
23 for(Int_t i=0;i<1024;i++)
24 fSignalJets[i] = NULL;
27 AliAnalysisTaskChargedJetsPA(const char *name, const char* trackArrayName, const char* jetArrayName, const char* backgroundJetArrayName);
28 virtual ~AliAnalysisTaskChargedJetsPA();
29 virtual void UserCreateOutputObjects();
30 virtual void UserExec(Option_t *option);
31 virtual Bool_t UserNotify();
32 virtual void Terminate(Option_t *);
34 // ######### SETTERS/GETTERS
35 void SetAnalyzeJets(Bool_t val) {fAnalyzeJets = val;}
36 void SetAnalyzeJetProfile(Bool_t val) {fAnalyzeJetProfile = val;}
37 void SetAnalyzeQA(Bool_t val) {fAnalyzeQA = val;}
38 void SetAnalyzeBackground(Bool_t val) {fAnalyzeBackground = val;}
39 void SetAnalyzeDeprecatedBackgrounds(Bool_t val) {fAnalyzeDeprecatedBackgrounds = val;}
40 void SetAnalyzePythia(Bool_t val) {fAnalyzePythia = val;}
41 void SetAnalyzeMassCorrelation(Bool_t val) {fAnalyzeMassCorrelation = val;}
42 void SetAnalyzePartialEvents(Int_t nParts, Int_t index) {fPartialAnalysisNParts = nParts; fPartialAnalysisIndex = index;}
43 void SetUseDefaultVertexCut (Bool_t val) {fUseDefaultVertexCut = val;}
44 void SetUsePileUpCut (Bool_t val) {fUsePileUpCut = val;}
45 void SetCentralityToOne (Bool_t val) {fSetCentralityToOne = val;}
46 void SetNumberOfCentralityBins(Int_t val) {fNumberOfCentralityBins = val;}
47 void SetTrackMinPt(Double_t minPt) {fMinJetPt = minPt;}
48 void SetSignalJetMinPt(Double_t minPt) {fMinJetPt = minPt;}
49 void SetSignalJetMinArea(Double_t minArea) {fMinJetArea = minArea;}
50 void SetBackgroundJetMinPt(Double_t minPt) {fMinBackgroundJetPt = minPt;}
51 void SetDijetLeadingMinPt(Double_t minPt) {fMinDijetLeadingPt = minPt;}
52 void SetNumberOfPtHardBins(Int_t count) {fNumPtHardBins = count;}
53 void SetUsePtHardBin(Int_t number) {fUsePtHardBin = number;}
54 void SetNumberOfRandConesPerEvent(Int_t count) {fNumberRandCones = count;}
55 void SetRandConeRadius(Double_t radius) {fRandConeRadius = radius;}
56 void SetSignalJetRadius(Double_t radius) {fSignalJetRadius = radius;}
57 void SetBackgroundJetRadius(Double_t radius) {fBackgroundJetRadius = radius;}
58 void SetTRBackgroundConeRadius(Double_t radius) {fTRBackgroundConeRadius = radius;}
59 void SetCentralityType(const char* type) {fCentralityType = type;}
60 void SetExternalRhoTaskName(const char* name) {fRhoTaskName = name;}
61 void SetDijetMaxAngleDeviation(Double_t degrees) {fDijetMaxAngleDeviation = degrees/360.0 * TMath::TwoPi();} // degrees are more comfortable
62 void SetAcceptanceWindows(Double_t trackEta, Double_t signalJetRadius, Double_t bgrdJetRadius){fTrackEtaWindow = trackEta; fSignalJetRadius = signalJetRadius; fBackgroundJetRadius = bgrdJetRadius; fSignalJetEtaWindow = fTrackEtaWindow-fSignalJetRadius; fBackgroundJetEtaWindow = fTrackEtaWindow-fBackgroundJetRadius;}
63 Int_t GetInstanceCounter() {return fTaskInstanceCounter;}
67 // ######### MAIN CALCULATION FUNCTIONS
69 Int_t GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets);
70 Double_t GetCorrectedJetPt(AliEmcalJet* jet, Double_t background);
71 Double_t GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability = 0);
73 void GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike);
74 void GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS);
76 void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion);
77 void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular);
78 void GetPPBackgroundDensity(Double_t& background, AliEmcalJet* jet);
79 Double_t GetConePt(Double_t eta, Double_t phi, Double_t radius);
80 Double_t GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background);
82 Double_t GetPythiaTrials();
84 Double_t GetExternalRho();
86 void GetPerpendicularCone(Double_t vecPhi, Double_t vecTheta, Double_t& conePt);
88 // ######### CHECK FUNCTIONS
89 Bool_t IsTrackInAcceptance(AliVParticle* track);
90 Bool_t IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius);
91 Bool_t IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex);
92 Bool_t IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2);
94 Bool_t IsEventInAcceptance(AliVEvent* event);
95 Bool_t IsBackgroundJetInAcceptance(AliEmcalJet* jet);
96 Bool_t IsSignalJetInAcceptance(AliEmcalJet* jet);
97 Bool_t IsDijet(AliEmcalJet* jet1, AliEmcalJet* jet2);
99 // ######### HELPER FUNCTIONS
100 Double_t EtaToTheta(Double_t arg);
101 Double_t ThetaToEta(Double_t arg);
102 Double_t GetDeltaPhi(Double_t phi1, Double_t phi2);
103 Double_t MCGetOverlapCircleRectancle(Double_t cPosX, Double_t cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax);
104 Double_t MCGetOverlapMultipleCirclesRectancle(Int_t numCircles, std::vector<Double_t> cPosX, std::vector<Double_t> cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax);
107 // ######### HISTOGRAM FUNCTIONS
108 void FillHistogram(const char * key, Double_t x);
109 void FillHistogram(const char * key, Double_t x, Double_t y);
110 void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add);
111 const char* GetHistoName(const char* name)
114 return Form("%s_MC", name);
115 return Form("%s", name);
117 template <class T> T* AddHistogram1D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis");
118 template <class T> T* AddHistogram2D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, Int_t yBins = 100, Double_t yMin = 0.0, Double_t yMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis", const char* zTitle = "z axis");
120 // ######### STANDARD FUNCTIONS
121 void Calculate(AliVEvent* event);
125 TList* fOutputList; //! Output list
126 // ########## USAGE TRIGGERS
127 Bool_t fAnalyzeJets; // trigger if jets should be processed
128 Bool_t fAnalyzeJetProfile; // trigger if jet profile should be analyzed
129 Bool_t fAnalyzeQA; // trigger if QA should be done
130 Bool_t fAnalyzeBackground; // trigger if background should be processed
131 Bool_t fAnalyzeDeprecatedBackgrounds; // trigger if old background estimates should be processed
132 Bool_t fAnalyzePythia; // trigger if pythia properties should be processed
133 Bool_t fAnalyzeMassCorrelation;// trigger if jet pt/constituent mass should be compared
134 Bool_t fHasTracks; // trigger if tracks are actually valid
135 Bool_t fHasJets; // trigger if jets are actually valid
136 Bool_t fHasBackgroundJets; // trigger if background is actually valid
137 Bool_t fIsKinematics; // trigger if data is kinematics only (for naming reasons)
138 Bool_t fUseDefaultVertexCut; // trigger if automatic vertex cut from helper class should be done
139 Bool_t fUsePileUpCut; // trigger if pileup cut should be done
140 Bool_t fSetCentralityToOne; // trigger if centrality val. should be set to one for every event (failsafe)
141 Int_t fPartialAnalysisNParts; // take only every Nth event
142 Int_t fPartialAnalysisIndex; // using e.g. only every 5th event, this specifies which one
145 // ########## SOURCE INFORMATION
146 TClonesArray* fJetArray; //! object containing the jets
147 TClonesArray* fTrackArray; //! object containing the tracks
148 TClonesArray* fBackgroundJetArray; //! object containing background jets
149 TString* fJetArrayName; // name of object containing the jets
150 TString* fTrackArrayName; // name of object containing the tracks
151 TString* fBackgroundJetArrayName;// name of object containing event wise bckgrds
152 Int_t fNumPtHardBins; // Number of used pt hard bins
153 Int_t fUsePtHardBin; // That pt hard bin will be analyzed when not -1
154 TString fRhoTaskName; // name of rho task for this analysis
155 // ########## JET/DIJET/RC PROPERTIES
156 Double_t fNcoll; // Variable for Ncoll
157 Double_t fRandConeRadius; // Radius for the random cones
158 Double_t fSignalJetRadius; // Radius for the signal jets
159 Double_t fBackgroundJetRadius; // Radius for the KT background jets
160 Double_t fTRBackgroundConeRadius;// Radius for the jets excluded in track background
161 Int_t fNumberRandCones; // Number of random cones to be put into one event
162 Int_t fNumberExcludedJets; // Number of jets to be excluded from backgrounds
163 Double_t fDijetMaxAngleDeviation;// Max angle deviation from pi between two jets to be accept. as dijet
164 Double_t fPhysicalJetRadius; // Rough size considered for the real jet
166 Double_t fSignalJetEtaWindow; // +- window in eta for signal jets
167 Double_t fBackgroundJetEtaWindow;// +- window in eta for background jets
168 Double_t fTrackEtaWindow; // +- window in eta for tracks
169 Double_t fMinTrackPt; // Min track pt to be accepted
170 Double_t fMinJetPt; // Min jet pt to be accepted
171 Double_t fMinJetArea; // Min jet area to be accepted
172 Double_t fMinBackgroundJetPt; // Min jet pt to be accepted as background jet
173 Double_t fMinDijetLeadingPt; // Min jet pt to be accepted as constituent of dijet
174 Int_t fNumberOfCentralityBins;// Number of centrality bins used for histograms
175 TString fCentralityType; // Used centrality estimate (V0A, V0C, V0M, ...)
177 // ########## EVENT PROPERTIES
178 AliEmcalJet* fFirstLeadingJet; //! leading jet in event
179 AliEmcalJet* fSecondLeadingJet; //! next to leading jet in event
180 Int_t fNumberSignalJets; //! Number of signal jets in event
181 AliEmcalJet* fSignalJets[1024]; //! memory for signal jet pointers
182 Double_t fCrossSection; //! value is filled, if pythia header is accessible
183 Double_t fTrials; //! value is filled, if pythia header is accessible
185 // ########## GENERAL VARS
186 TRandom3* fRandom; //! A random number
187 AliAnalysisUtils* fHelperClass; //! Vertex selection helper
188 Bool_t fInitialized; //! trigger if tracks/jets are loaded
189 Int_t fTaskInstanceCounter; // for naming reasons
190 TList* fHistList; // Histogram list
191 Int_t fHistCount; // Histogram count
192 Bool_t fIsDEBUG; // Debug trigger
193 ULong_t fEventCounter; // Internal event counter
194 AliAnalysisTaskChargedJetsPA(const AliAnalysisTaskChargedJetsPA&);
195 AliAnalysisTaskChargedJetsPA& operator=(const AliAnalysisTaskChargedJetsPA&);
197 ClassDef(AliAnalysisTaskChargedJetsPA, 2); // Charged jet analysis for pA