]>
Commit | Line | Data |
---|---|---|
12eb4ac1 | 1 | #ifndef ALIANALYSISTASKSE_H |
2 | #include <Riostream.h> | |
3 | #include <TROOT.h> | |
4 | #include <TFile.h> | |
271cbc5d | 5 | #include <TCint.h> |
12eb4ac1 | 6 | #include <TChain.h> |
7 | #include <TTree.h> | |
8 | #include <TKey.h> | |
9 | #include <TProfile.h> | |
b95d0245 | 10 | #include <TProfile2D.h> |
12eb4ac1 | 11 | #include <TH1F.h> |
12 | #include <TH2F.h> | |
13 | #include <TCanvas.h> | |
14 | #include <TList.h> | |
15 | #include <TClonesArray.h> | |
16 | #include <TObject.h> | |
17 | #include <TMath.h> | |
18 | #include <TSystem.h> | |
19 | #include <TInterpreter.h> | |
20 | #include <TH1.h> | |
21 | #include "AliAnalysisTask.h" | |
22 | #include "AliCentrality.h" | |
23 | #include "AliStack.h" | |
24 | #include "AliESDEvent.h" | |
25 | #include "AliESDInputHandler.h" | |
26 | #include "AliAODEvent.h" | |
27 | #include "AliAODHandler.h" | |
28 | #include "AliAnalysisManager.h" | |
29 | #include "AliAnalysisTaskSE.h" | |
30 | #endif | |
31 | ||
0cb49d99 | 32 | #include <time.h> |
12eb4ac1 | 33 | #include <TRandom3.h> |
34 | #include "AliGenPythiaEventHeader.h" | |
b95d0245 | 35 | #include "AliAODMCHeader.h" |
12eb4ac1 | 36 | #include "AliMCEvent.h" |
37 | #include "AliLog.h" | |
38 | #include <AliEmcalJet.h> | |
b95d0245 | 39 | #include <AliPicoTrack.h> |
12eb4ac1 | 40 | #include "AliVEventHandler.h" |
41 | #include "AliVParticle.h" | |
c2b0976c | 42 | #include "AliAODMCParticle.h" |
12eb4ac1 | 43 | #include "AliAnalysisUtils.h" |
06b41974 | 44 | #include "AliRhoParameter.h" |
ac9c07e9 | 45 | #include "TVector3.h" |
12eb4ac1 | 46 | |
8628b70c | 47 | #include "AliAnalysisTaskChargedJetsPA.h" |
dc3becdd | 48 | using std::min; |
c154ba90 | 49 | |
3fa9cde0 | 50 | //TODO: Not accessing the particles when using MC |
8628b70c | 51 | //TODO: FillHistogram can be done better with virtual TH1(?) |
52 | ClassImp(AliAnalysisTaskChargedJetsPA) | |
53 | ||
54 | // ######################################################################################## DEFINE HISTOGRAMS | |
55 | void AliAnalysisTaskChargedJetsPA::Init() | |
56 | { | |
57 | #ifdef DEBUGMODE | |
efb9b161 | 58 | AliInfo("Creating histograms."); |
8628b70c | 59 | #endif |
8628b70c | 60 | |
0cb49d99 | 61 | TH1D* tmpHisto = AddHistogram1D<TH1D>("hNumberEvents", "Number of events (0 = before cuts, 1 = after cuts)", "", 2, 0, 2, "stage","N^{Events}/cut"); |
62 | tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts"); | |
63 | tmpHisto->GetXaxis()->SetBinLabel(2, "After cuts"); | |
64 | ||
65 | tmpHisto = AddHistogram1D<TH1D>("hEventAcceptance", "Accepted events (0 = before cuts, 1 = after pile up, 2 = after vertex)", "", 3, 0, 3, "stage","N^{Events}/cut"); | |
66 | tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts"); | |
67 | tmpHisto->GetXaxis()->SetBinLabel(2, "After pile up"); | |
68 | tmpHisto->GetXaxis()->SetBinLabel(3, "After vertex"); | |
69 | ||
70 | tmpHisto = AddHistogram1D<TH1D>("hTrackAcceptance", "Accepted tracks (0 = before cuts, 1 = after eta, 2 = after pT)", "", 3, 0, 3, "stage","N^{Tracks}/cut"); | |
71 | tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts"); | |
72 | tmpHisto->GetXaxis()->SetBinLabel(2, "After eta"); | |
7e413f22 | 73 | tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}"); |
0cb49d99 | 74 | |
75 | tmpHisto = AddHistogram1D<TH1D>("hJetAcceptance", "Accepted jets (0 = before cuts, 1 = after eta, 2 = after pT, 3 = after area)", "", 4, 0, 4, "stage","N^{Jets}/cut"); | |
76 | tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts"); | |
77 | tmpHisto->GetXaxis()->SetBinLabel(2, "After eta"); | |
7e413f22 | 78 | tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}"); |
0cb49d99 | 79 | tmpHisto->GetXaxis()->SetBinLabel(4, "After area"); |
8628b70c | 80 | |
81 | // NOTE: Jet histograms | |
82 | if (fAnalyzeJets) | |
83 | { | |
84 | // ######## Jet spectra | |
c2b0976c | 85 | AddHistogram1D<TH1D>("hRawJetPt", "Raw jets p_{T} distribution (before cuts)", "", 500, 0., 250., "p_{T} (GeV/c)", "dN^{Jets}/dp_{T}"); |
b95d0245 | 86 | AddHistogram2D<TH2D>("hJetPt", "Jets p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); |
72aa6b04 | 87 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS", "Jets p_{T} distribution, KT background (Improved CMS) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); |
88 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS_Phi1", "Jets p_{T} distribution, KT background (Improved CMS) subtracted (1st part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
89 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS_Phi2", "Jets p_{T} distribution, KT background (Improved CMS) subtracted (2nd part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
90 | ||
ac9c07e9 | 91 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedPP", "Jets p_{T} distribution, pp background subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); |
271cbc5d | 92 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedExternal", "Jets p_{T} distribution, external bgrd. subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); |
ac9c07e9 CL |
93 | |
94 | ||
088fbc16 | 95 | |
c2b0976c | 96 | AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoKTImprovedCMS", "Mean subtracted KT (CMS w/o signal) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean"); |
72aa6b04 | 97 | AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoExternal", "Mean subtracted KT (External) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean"); |
98 | AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoPP", "Mean subtracted KT (pp from Michal) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean"); | |
c2b0976c | 99 | |
b95d0245 | 100 | if(fAnalyzeDeprecatedBackgrounds) |
101 | { | |
102 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedTR", "Jets p_{T} distribution, TR background (Cone R=0.6 around jets excluded) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
b95d0245 | 103 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTPbPb", "Jets p_{T} distribution, KT background (PbPb w/o ghosts) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); |
104 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTPbPbWithGhosts", "Jets p_{T} distribution, KT background (PbPb w/ ghosts) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
105 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTCMS", "Jets p_{T} distribution, KT background (CMS) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
106 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTMean", "Jets p_{T} distribution, KT background (Mean) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
107 | AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTTrackLike", "Jets p_{T} distribution, KT background (track-like) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}"); | |
108 | } | |
088fbc16 | 109 | |
2a82f637 | 110 | // ######## Jet profiles |
111 | if(fAnalyzeJetProfile) | |
112 | { | |
113 | AddHistogram2D<TH2D>("hJetProfile10GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 10 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
114 | AddHistogram2D<TH2D>("hJetProfile20GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 20 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
115 | AddHistogram2D<TH2D>("hJetProfile30GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 30 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
116 | AddHistogram2D<TH2D>("hJetProfile40GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 40 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
117 | AddHistogram2D<TH2D>("hJetProfile50GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 50 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
118 | AddHistogram2D<TH2D>("hJetProfile60GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 60 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
119 | AddHistogram2D<TH2D>("hJetProfile70GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 70 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio"); | |
120 | } | |
12eb4ac1 | 121 | // ######## Jet stuff |
392aa819 | 122 | AddHistogram2D<TH2D>("hJetConstituentPt", "Jet constituents p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}"); |
8628b70c | 123 | AddHistogram1D<TH1D>("hJetCountAll", "Number of Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}"); |
124 | AddHistogram1D<TH1D>("hJetCountAccepted", "Number of accepted Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}"); | |
0cb49d99 | 125 | AddHistogram2D<TH2D>("hJetCount", "Correlation jets/accepted jets", "", 200, 0., 200., 200, 0., 200., "N jets","N jets accepted", "d^{2}N^{Events}/dN^{Jets dN^{Jets, acc}}"); |
126 | AddHistogram1D<TH1D>("hLeadingJetPt", "Leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}"); | |
127 | AddHistogram1D<TH1D>("hSecondLeadingJetPt", "Second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}"); | |
128 | AddHistogram1D<TH1D>("hCorrectedLeadingJetPt", "Corrected leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}"); | |
129 | AddHistogram1D<TH1D>("hCorrectedSecondLeadingJetPt", "Corrected second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}"); | |
12eb4ac1 | 130 | AddHistogram1D<TH1D>("hJetDeltaPhi", "Jets combinatorial #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)"); |
131 | AddHistogram1D<TH1D>("hLeadingJetDeltaPhi", "1st and 2nd leading jet #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)"); | |
8628b70c | 132 | } |
12eb4ac1 | 133 | |
8628b70c | 134 | // NOTE: Jet background histograms |
135 | if (fAnalyzeBackground) | |
136 | { | |
b95d0245 | 137 | // ########## Default background estimates |
138 | AddHistogram2D<TH2D>("hKTBackgroundImprovedCMS", "KT background density (Improved CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
06b41974 | 139 | AddHistogram2D<TH2D>("hKTBackgroundImprovedCMSExternal", "KT background density (Improved CMS approach from external task)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); |
72aa6b04 | 140 | AddHistogram2D<TH2D>("hPPBackground", "PP background density (Michals approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); |
141 | ||
8bb0422a | 142 | AddHistogram2D<TH2D>("hDeltaPtExternalBgrd", "Background fluctuations #delta p_{T} (KT, External)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); |
b95d0245 | 143 | AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMS", "Background fluctuations #delta p_{T} (KT, Improved CMS-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); |
392aa819 | 144 | AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); |
c2b0976c | 145 | AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion_Signal", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion w/ 1/N_{sig} probability)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); |
146 | AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSFullExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, full leading jet exclusion)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
0cb49d99 | 147 | AddHistogram2D<TH2D>("hDeltaPtNoBackground", "Background fluctuations #delta p_{T} (No background)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); |
148 | AddHistogram2D<TH2D>("hDeltaPtNoBackgroundNoEmptyCones", "Background fluctuations #delta p_{T} (No background, no empty cones)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
b95d0245 | 149 | |
b95d0245 | 150 | AddHistogram1D<TProfile>("hKTMeanBackgroundImprovedCMS", "KT background mean (Improved CMS approach)", "", 100, 0, 100, "Centrality", "#rho mean"); |
151 | ||
b95d0245 | 152 | if(fAnalyzeDeprecatedBackgrounds) |
153 | { | |
154 | // ########## Different background estimates | |
b95d0245 | 155 | AddHistogram2D<TH2D>("hKTBackgroundPbPb", "KT background density (PbPb approach, no ghosts)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); |
156 | AddHistogram2D<TH2D>("hKTBackgroundPbPbWithGhosts", "KT background density (PbPb approach w/ ghosts)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
157 | AddHistogram2D<TH2D>("hKTBackgroundCMS", "KT background density (CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
158 | AddHistogram2D<TH2D>("hKTBackgroundMean", "KT background density (Mean approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
159 | AddHistogram2D<TH2D>("hKTBackgroundTrackLike", "KT background density (Track-like approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
160 | ||
161 | AddHistogram2D<TH2D>("hTRBackgroundNoExcl", "TR background density (No signal excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
162 | AddHistogram2D<TH2D>("hTRBackgroundCone02", "TR background density (Cones R=0.2 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
163 | AddHistogram2D<TH2D>("hTRBackgroundCone04", "TR background density (Cones R=0.4 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
164 | AddHistogram2D<TH2D>("hTRBackgroundCone06", "TR background density (Cones R=0.6 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
165 | AddHistogram2D<TH2D>("hTRBackgroundCone08", "TR background density (Cones R=0.8 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
166 | AddHistogram2D<TH2D>("hTRBackgroundExact", "TR background density (signal jets exactly excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho"); | |
167 | ||
168 | // ########## Delta Pt | |
169 | AddHistogram2D<TH2D>("hDeltaPtKTPbPb", "Background fluctuations #delta p_{T} (KT, PbPb w/o ghosts)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
170 | AddHistogram2D<TH2D>("hDeltaPtKTPbPbWithGhosts", "Background fluctuations #delta p_{T} (KT, PbPb w/ ghosts)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
171 | AddHistogram2D<TH2D>("hDeltaPtKTCMS", "Background fluctuations #delta p_{T} (KT, CMS-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
172 | AddHistogram2D<TH2D>("hDeltaPtKTMean", "Background fluctuations #delta p_{T} (KT, Mean)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
173 | AddHistogram2D<TH2D>("hDeltaPtKTTrackLike", "Background fluctuations #delta p_{T} (KT, track-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
174 | AddHistogram2D<TH2D>("hDeltaPtTR", "Background fluctuations #delta p_{T} (TR, cone R=0.6)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}"); | |
b95d0245 | 175 | |
176 | // ########## Profiles for background means vs. centrality | |
392aa819 | 177 | AddHistogram1D<TProfile>("hKTMeanBackgroundPbPb", "KT background mean (PbPb approach w/o ghosts)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); |
178 | AddHistogram1D<TProfile>("hKTMeanBackgroundPbPbWithGhosts", "KT background mean (PbPb approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); | |
179 | AddHistogram1D<TProfile>("hKTMeanBackgroundCMS", "KT background mean (CMS approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); | |
180 | AddHistogram1D<TProfile>("hKTMeanBackgroundMean", "KT background mean (Mean approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); | |
181 | AddHistogram1D<TProfile>("hKTMeanBackgroundTPC", "KT background mean (Track-like approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); | |
182 | AddHistogram1D<TProfile>("hTRMeanBackground", "TR background mean", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean"); | |
b95d0245 | 183 | } |
12eb4ac1 | 184 | } |
2a82f637 | 185 | // NOTE: Jet constituent correlations |
186 | if(fAnalyzeMassCorrelation) | |
187 | { | |
188 | AddHistogram1D<TH1D>("hJetMassFromConstituents", "Jet mass by mass of charged constituents", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}"); | |
189 | AddHistogram1D<TH1D>("hJetMass", "Jet mass from fastjet", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}"); | |
190 | ||
191 | AddHistogram2D<TH2D>("hJetPtVsMass", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
192 | AddHistogram2D<TH2D>("hJetPtVsJetMass", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
193 | ||
194 | AddHistogram2D<TH2D>("hJetPtVsProtonCount", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Proton percentage", "d^{2}N}/dN^{p_{T}dPercentage"); | |
195 | AddHistogram2D<TH2D>("hJetPtVsPionCount", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Pion percentage", "d^{2}N}/dN^{p_{T}dPercentage"); | |
196 | AddHistogram2D<TH2D>("hJetPtVsKaonCount", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Kaon percentage", "d^{2}N}/dN^{p_{T}dPercentage"); | |
197 | AddHistogram2D<TH2D>("hJetPtVsElectronCount", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Electron percentage", "d^{2}N}/dN^{p_{T}dPercentage"); | |
198 | AddHistogram2D<TH2D>("hJetPtVsOthersCount", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Others percentage", "d^{2}N}/dN^{p_{T}dPercentage"); | |
199 | AddHistogram1D<TH1D>("hJetConstituentProtonCount", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}"); | |
200 | AddHistogram1D<TH1D>("hJetConstituentPionCount", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}"); | |
201 | AddHistogram1D<TH1D>("hJetConstituentKaonCount", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}"); | |
202 | AddHistogram1D<TH1D>("hJetConstituentElectronCount", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}"); | |
203 | AddHistogram1D<TH1D>("hJetConstituentOthersCount", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}"); | |
204 | ||
205 | AddHistogram2D<TH2D>("hJetPtVsMass_6_14", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
206 | AddHistogram2D<TH2D>("hJetPtVsJetMass_6_14", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
207 | AddHistogram2D<TH2D>("hJetPtVsProtonCount_6_14", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN"); | |
208 | AddHistogram2D<TH2D>("hJetPtVsPionCount_6_14", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN"); | |
209 | AddHistogram2D<TH2D>("hJetPtVsKaonCount_6_14", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN"); | |
210 | AddHistogram2D<TH2D>("hJetPtVsElectronCount_6_14", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN"); | |
211 | AddHistogram2D<TH2D>("hJetPtVsOthersCount_6_14", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN"); | |
212 | AddHistogram1D<TH1D>("hJetConstituentProtonCount_6_14", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}"); | |
213 | AddHistogram1D<TH1D>("hJetConstituentPionCount_6_14", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}"); | |
214 | AddHistogram1D<TH1D>("hJetConstituentKaonCount_6_14", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}"); | |
215 | AddHistogram1D<TH1D>("hJetConstituentElectronCount_6_14", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}"); | |
216 | AddHistogram1D<TH1D>("hJetConstituentOthersCount_6_14", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}"); | |
217 | ||
218 | AddHistogram2D<TH2D>("hJetPtVsMass_2_X", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
219 | AddHistogram2D<TH2D>("hJetPtVsJetMass_2_X", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
220 | AddHistogram2D<TH2D>("hJetPtVsProtonCount_2_X", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN"); | |
221 | AddHistogram2D<TH2D>("hJetPtVsPionCount_2_X", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN"); | |
222 | AddHistogram2D<TH2D>("hJetPtVsKaonCount_2_X", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN"); | |
223 | AddHistogram2D<TH2D>("hJetPtVsElectronCount_2_X", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN"); | |
224 | AddHistogram2D<TH2D>("hJetPtVsOthersCount_2_X", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN"); | |
225 | AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_X", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}"); | |
226 | AddHistogram1D<TH1D>("hJetConstituentPionCount_2_X", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}"); | |
227 | AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_X", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}"); | |
228 | AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_X", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}"); | |
229 | AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_X", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}"); | |
230 | ||
231 | AddHistogram2D<TH2D>("hJetPtVsMass_2_7", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
232 | AddHistogram2D<TH2D>("hJetPtVsJetMass_2_7", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM"); | |
233 | AddHistogram2D<TH2D>("hJetPtVsProtonCount_2_7", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN"); | |
234 | AddHistogram2D<TH2D>("hJetPtVsPionCount_2_7", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN"); | |
235 | AddHistogram2D<TH2D>("hJetPtVsKaonCount_2_7", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN"); | |
236 | AddHistogram2D<TH2D>("hJetPtVsElectronCount_2_7", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN"); | |
237 | AddHistogram2D<TH2D>("hJetPtVsOthersCount_2_7", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN"); | |
238 | AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_7", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}"); | |
239 | AddHistogram1D<TH1D>("hJetConstituentPionCount_2_7", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}"); | |
240 | AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_7", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}"); | |
241 | AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_7", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}"); | |
242 | AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_7", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}"); | |
8628b70c | 243 | |
2a82f637 | 244 | } |
b95d0245 | 245 | |
246 | // NOTE: Track & Cluster & QA histograms | |
247 | if (fAnalyzeQA) | |
248 | { | |
b95d0245 | 249 | AddHistogram1D<TH1D>("hVertexX", "X distribution of the vertex", "", 2000, -1., 1., "#Delta x(cm)","dN^{Events}/dx"); |
250 | AddHistogram1D<TH1D>("hVertexY", "Y distribution of the vertex", "", 2000, -1., 1., "#Delta y(cm)","dN^{Events}/dy"); | |
251 | AddHistogram2D<TH2D>("hVertexXY", "XY distribution of the vertex", "COLZ", 500, -1., 1., 500, -1., 1.,"#Delta x(cm)", "#Delta y(cm)","dN^{Events}/dxdy"); | |
2a82f637 | 252 | AddHistogram1D<TH1D>("hVertexZBeforeVertexCut", "Z distribution of the vertex (before std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz"); |
253 | AddHistogram1D<TH1D>("hVertexZAfterVertexCut", "Z distribution of the vertex (after std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz"); | |
b95d0245 | 254 | AddHistogram1D<TH1D>("hVertexR", "R distribution of the vertex", "", 100, 0., 1., "#Delta r(cm)","dN^{Events}/dr"); |
392aa819 | 255 | AddHistogram1D<TH1D>("hCentralityV0M", "Centrality distribution V0M", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}"); |
256 | AddHistogram1D<TH1D>("hCentralityV0A", "Centrality distribution V0A", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}"); | |
257 | AddHistogram1D<TH1D>("hCentralityV0C", "Centrality distribution V0C", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}"); | |
271cbc5d | 258 | AddHistogram1D<TH1D>("hCentralityZNA", "Centrality distribution ZNA", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}"); |
7e413f22 | 259 | AddHistogram1D<TH1D>("hCentrality", Form("Centrality distribution %s", fCentralityType.Data()), "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}"); |
260 | ||
392aa819 | 261 | |
262 | AddHistogram2D<TH2D>("hTrackCountAcc", "Number of tracks in acceptance vs. centrality", "LEGO2", 750, 0., 750., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}"); | |
263 | AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}"); | |
264 | AddHistogram2D<TH2D>("hTrackPtNegEta", "Tracks p_{T} distribution (negative #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}"); | |
265 | AddHistogram2D<TH2D>("hTrackPtPosEta", "Tracks p_{T} distribution (positive #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}"); | |
b95d0245 | 266 | AddHistogram1D<TH1D>("hTrackCharge", "Charge", "", 11, -5, 5, "Charge (e)","dN^{Tracks}/dq"); |
267 | AddHistogram1D<TH1D>("hTrackPhi", "Track #phi distribution", "", 360, 0, TMath::TwoPi(), "#phi","dN^{Tracks}/d#phi"); | |
268 | AddHistogram2D<TH2D>("hTrackPhiEta", "Track angular distribution", "LEGO2", 100, 0., 2*TMath::Pi(),100, -2.5, 2.5, "#phi","#eta","dN^{Tracks}/(d#phi d#eta)"); | |
269 | ||
392aa819 | 270 | AddHistogram2D<TH2D>("hTrackPhiPtCut", "Track #phi distribution for different pT cuts", "LEGO2", 360, 0, TMath::TwoPi(), 20, 0, 20, "#phi", "p_{T} lower cut", "dN^{Tracks}/d#phi dp_{T}"); |
0cb49d99 | 271 | AddHistogram2D<TH2D>("hTrackPhiTrackType", "Track #phi distribution for different track types", "LEGO2", 360, 0, TMath::TwoPi(), 3, 0, 3, "#phi", "Label", "dN^{Tracks}/d#phi"); |
7e413f22 | 272 | AddHistogram2D<TH2D>("hTrackEta", "Track #eta distribution", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Tracks}/d#eta"); |
b95d0245 | 273 | if (fAnalyzeJets) |
274 | { | |
275 | // ######## Jet QA | |
0cb49d99 | 276 | AddHistogram1D<TH1D>("hRawJetArea", "Jets area distribution w/o area cut", "", 200, 0., 2., "Area","dN^{Jets}/dA"); |
72aa6b04 | 277 | AddHistogram2D<TH2D>("hJetArea", "Jets area distribution", "COLZ", 200, 0., 2., 150, 0.,150., "Area","Jet p_{T}","dN^{Jets}/dA"); |
0cb49d99 | 278 | AddHistogram2D<TH2D>("hRawJetPhiEta", "Raw Jets angular distribution w/o #eta cut", "LEGO2", 360, 0., 2*TMath::Pi(),100, -1.0, 1.0, "#phi","#eta","dN^{Jets}/(d#phi d#eta)"); |
7e413f22 | 279 | AddHistogram2D<TH2D>("hJetEta", "Jets #eta distribution", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta"); |
2a82f637 | 280 | AddHistogram2D<TH2D>("hJetEta2GeVTracks", "Jets #eta distribution, track p_{T} > 2 GeV", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta"); |
281 | AddHistogram2D<TH2D>("hJetEta4GeVTracks", "Jets #eta distribution, track p_{T} > 4 GeV", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta"); | |
0cb49d99 | 282 | AddHistogram2D<TH2D>("hJetPhiEta", "Jets angular distribution", "LEGO2", 360, 0., 2*TMath::Pi(),100, -1.0, 1.0, "#phi","#eta","dN^{Jets}/(d#phi d#eta)"); |
b95d0245 | 283 | AddHistogram2D<TH2D>("hJetPtVsConstituentCount", "Jets number of constituents vs. jet p_{T}", "COLZ", 400, 0., 200., 100, 0., 100., "p_{T}","N^{Tracks}","dN^{Jets}/(dp_{T} dN^{tracks})"); |
284 | } | |
285 | } | |
286 | ||
8628b70c | 287 | // register Histograms |
288 | for (Int_t i = 0; i < fHistCount; i++) | |
289 | { | |
290 | fOutputList->Add(fHistList->At(i)); | |
291 | } | |
292 | ||
293 | PostData(1,fOutputList); // important for merging | |
294 | ||
295 | } | |
296 | ||
12eb4ac1 | 297 | //________________________________________________________________________ |
4bb1bca6 | 298 | AliAnalysisTaskChargedJetsPA::AliAnalysisTaskChargedJetsPA(const char *name, const char* trackArrayName, const char* jetArrayName, const char* backgroundJetArrayName) : AliAnalysisTaskSE(name), 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), fNoExternalBackground(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) |
8628b70c | 299 | { |
300 | #ifdef DEBUGMODE | |
efb9b161 | 301 | AliInfo("Calling constructor."); |
8628b70c | 302 | #endif |
303 | ||
8628b70c | 304 | // Every instance of this task gets his own number |
305 | static Int_t instance = 0; | |
306 | fTaskInstanceCounter = instance; | |
307 | instance++; | |
308 | ||
309 | fTrackArrayName = new TString(trackArrayName); | |
4856f9c9 | 310 | if (fTrackArrayName->Contains("MCParticles") || fTrackArrayName->Contains("mcparticles")) |
06b41974 | 311 | fIsKinematics = kTRUE; |
8628b70c | 312 | |
313 | fJetArrayName = new TString(jetArrayName); | |
314 | if (strcmp(fJetArrayName->Data(),"") == 0) | |
2a82f637 | 315 | { |
8628b70c | 316 | fAnalyzeJets = kFALSE; |
2a82f637 | 317 | fAnalyzeJetProfile = kFALSE; |
318 | } | |
8628b70c | 319 | else |
320 | fAnalyzeJets = kTRUE; | |
321 | ||
322 | fBackgroundJetArrayName = new TString(backgroundJetArrayName); | |
323 | if (strcmp(fBackgroundJetArrayName->Data(),"") == 0) | |
324 | fAnalyzeBackground = kFALSE; | |
325 | else | |
326 | fAnalyzeBackground = kTRUE; | |
327 | ||
328 | DefineOutput(1, TList::Class()); | |
329 | ||
330 | fHistList = new TList(); | |
331 | ||
b95d0245 | 332 | for(Int_t i=0;i<1024;i++) |
333 | fSignalJets[i] = NULL; | |
334 | ||
392aa819 | 335 | |
8628b70c | 336 | #ifdef DEBUGMODE |
efb9b161 | 337 | AliInfo("Constructor done."); |
8628b70c | 338 | #endif |
339 | ||
340 | } | |
341 | ||
342 | //________________________________________________________________________ | |
343 | inline Double_t AliAnalysisTaskChargedJetsPA::GetConePt(Double_t eta, Double_t phi, Double_t radius) | |
344 | { | |
345 | Double_t tmpConePt = 0.0; | |
346 | ||
347 | for (Int_t i = 0; i < fTrackArray->GetEntries(); i++) | |
348 | { | |
349 | AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
350 | if (IsTrackInAcceptance(tmpTrack)) | |
351 | if(IsTrackInCone(tmpTrack, eta, phi, radius)) | |
352 | tmpConePt = tmpConePt + tmpTrack->Pt(); | |
353 | } | |
354 | return tmpConePt; | |
355 | } | |
356 | ||
271cbc5d | 357 | //________________________________________________________________________ |
358 | inline Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background) | |
359 | { | |
360 | Double_t tmpConePt = 0.0; | |
361 | ||
362 | for (Int_t i = 0; i < fTrackArray->GetEntries(); i++) | |
363 | { | |
364 | AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
365 | if (IsTrackInAcceptance(tmpTrack)) | |
366 | if(IsTrackInCone(tmpTrack, eta, phi, radius)) | |
367 | tmpConePt = tmpConePt + tmpTrack->Pt(); | |
368 | } | |
3fde52ac | 369 | Double_t realConeArea = (2.0*fTrackEtaWindow) * TMath::TwoPi() * MCGetOverlapCircleRectancle(eta, phi, radius, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi()); |
370 | tmpConePt -= background * realConeArea; // subtract background | |
371 | ||
271cbc5d | 372 | return tmpConePt; |
373 | } | |
374 | ||
12eb4ac1 | 375 | |
8628b70c | 376 | //________________________________________________________________________ |
377 | inline Double_t AliAnalysisTaskChargedJetsPA::GetPtHard() | |
378 | { | |
392aa819 | 379 | #ifdef DEBUGMODE |
380 | AliInfo("Starting GetPtHard."); | |
381 | #endif | |
382 | AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader()); | |
383 | if (MCEvent()) | |
384 | if (!pythiaHeader) | |
385 | { | |
386 | // Check if AOD | |
387 | AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName())); | |
8628b70c | 388 | |
392aa819 | 389 | if (aodMCH) |
390 | { | |
391 | for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) | |
392 | { | |
393 | pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i)); | |
394 | if (pythiaHeader) break; | |
395 | } | |
396 | } | |
397 | } | |
398 | ||
399 | #ifdef DEBUGMODE | |
400 | AliInfo("Ending GetPtHard."); | |
401 | #endif | |
402 | if (pythiaHeader) | |
403 | return pythiaHeader->GetPtHard(); | |
404 | ||
405 | AliWarning(Form("In task %s: GetPtHard() failed!", GetName())); | |
406 | return -1.0; | |
407 | } | |
408 | ||
409 | ||
410 | //________________________________________________________________________ | |
411 | inline Double_t AliAnalysisTaskChargedJetsPA::GetPythiaTrials() | |
412 | { | |
413 | #ifdef DEBUGMODE | |
414 | AliInfo("Starting GetPythiaTrials."); | |
415 | #endif | |
416 | AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader()); | |
417 | if (MCEvent()) | |
8628b70c | 418 | if (!pythiaHeader) |
b95d0245 | 419 | { |
420 | // Check if AOD | |
421 | AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName())); | |
422 | ||
392aa819 | 423 | if (aodMCH) |
b95d0245 | 424 | { |
392aa819 | 425 | for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) |
426 | { | |
427 | pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i)); | |
428 | if (pythiaHeader) break; | |
429 | } | |
b95d0245 | 430 | } |
b95d0245 | 431 | } |
392aa819 | 432 | |
433 | #ifdef DEBUGMODE | |
434 | AliInfo("Ending GetPythiaTrials."); | |
435 | #endif | |
436 | if (pythiaHeader) | |
437 | return pythiaHeader->Trials(); | |
438 | ||
439 | AliWarning(Form("In task %s: GetPythiaTrials() failed!", GetName())); | |
440 | return -1.0; | |
8628b70c | 441 | } |
442 | ||
12eb4ac1 | 443 | |
392aa819 | 444 | |
8628b70c | 445 | //________________________________________________________________________ |
446 | inline Int_t AliAnalysisTaskChargedJetsPA::GetPtHardBin() | |
447 | { | |
392aa819 | 448 | #ifdef DEBUGMODE |
449 | AliInfo("Starting GetPtHardBin."); | |
450 | #endif | |
8628b70c | 451 | // ########## PT HARD BIN EDGES |
12eb4ac1 | 452 | const Int_t kPtHardLowerEdges[] = { 0, 5,11,21,36,57, 84,117,152,191,234}; |
453 | const Int_t kPtHardHigherEdges[] = { 5,11,21,36,57,84,117,152,191,234,1000000}; | |
8628b70c | 454 | |
455 | Int_t tmpPtHardBin = 0; | |
456 | Double_t tmpPtHard = GetPtHard(); | |
457 | ||
458 | for (tmpPtHardBin = 0; tmpPtHardBin <= fNumPtHardBins; tmpPtHardBin++) | |
12eb4ac1 | 459 | if (tmpPtHard >= kPtHardLowerEdges[tmpPtHardBin] && tmpPtHard < kPtHardHigherEdges[tmpPtHardBin]) |
8628b70c | 460 | break; |
461 | ||
392aa819 | 462 | #ifdef DEBUGMODE |
463 | AliInfo("Ending GetPtHardBin."); | |
464 | #endif | |
8628b70c | 465 | return tmpPtHardBin; |
466 | } | |
467 | ||
06b41974 | 468 | //________________________________________________________________________ |
469 | Double_t AliAnalysisTaskChargedJetsPA::GetExternalRho() | |
470 | { | |
471 | // Get rho from event. | |
472 | AliRhoParameter *rho = 0; | |
473 | if (!fRhoTaskName.IsNull()) { | |
474 | rho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoTaskName.Data())); | |
475 | if (!rho) { | |
476 | AliWarning(Form("%s: Could not retrieve rho with name %s!", GetName(), fRhoTaskName.Data())); | |
477 | return 0; | |
478 | } | |
479 | } | |
480 | else | |
481 | return 0; | |
482 | ||
483 | return (rho->GetVal()); | |
484 | } | |
485 | ||
8628b70c | 486 | |
487 | //________________________________________________________________________ | |
488 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius) | |
489 | { | |
490 | // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi) | |
491 | Double_t trackPhi = 0.0; | |
492 | if (track->Phi() > (TMath::TwoPi() - (radius-phi))) | |
493 | trackPhi = track->Phi() - TMath::TwoPi(); | |
494 | else if (track->Phi() < (phi+radius - TMath::TwoPi())) | |
495 | trackPhi = track->Phi() + TMath::TwoPi(); | |
496 | else | |
497 | trackPhi = track->Phi(); | |
498 | ||
499 | if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius) | |
500 | return kTRUE; | |
501 | ||
502 | return kFALSE; | |
503 | } | |
504 | ||
b95d0245 | 505 | //________________________________________________________________________ |
506 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex) | |
507 | { | |
508 | for (Int_t i = 0; i < jet->GetNumberOfTracks(); ++i) | |
509 | { | |
510 | Int_t jetTrack = jet->TrackAt(i); | |
511 | if (jetTrack == trackIndex) | |
512 | return kTRUE; | |
513 | } | |
514 | return kFALSE; | |
515 | } | |
516 | ||
517 | //________________________________________________________________________ | |
518 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2) | |
519 | { | |
520 | for (Int_t i = 0; i < jet1->GetNumberOfTracks(); ++i) | |
521 | { | |
522 | Int_t jet1Track = jet1->TrackAt(i); | |
523 | for (Int_t j = 0; j < jet2->GetNumberOfTracks(); ++j) | |
524 | { | |
525 | Int_t jet2Track = jet2->TrackAt(j); | |
526 | if (jet1Track == jet2Track) | |
527 | return kTRUE; | |
528 | } | |
529 | } | |
530 | return kFALSE; | |
531 | } | |
532 | ||
0cb49d99 | 533 | //________________________________________________________________________ |
534 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsEventInAcceptance(AliVEvent* event) | |
535 | { | |
536 | if (!event) | |
537 | return kFALSE; | |
538 | ||
539 | FillHistogram("hEventAcceptance", 0.5); // number of events before manual cuts | |
c2b0976c | 540 | if(fUsePileUpCut) |
541 | if(fHelperClass->IsPileUpEvent(event)) | |
542 | return kFALSE; | |
0cb49d99 | 543 | |
c2b0976c | 544 | FillHistogram("hEventAcceptance", 1.5); // number of events after pileup cuts |
0cb49d99 | 545 | |
c2b0976c | 546 | if(fAnalyzeQA) |
2a82f637 | 547 | FillHistogram("hVertexZBeforeVertexCut",event->GetPrimaryVertex()->GetZ()); |
0cb49d99 | 548 | |
2a82f637 | 549 | if(fUseDefaultVertexCut) |
550 | { | |
c2b0976c | 551 | if(!fHelperClass->IsVertexSelected2013pA(event)) |
552 | return kFALSE; | |
2a82f637 | 553 | } |
554 | else // Failsafe vertex cut | |
555 | { | |
556 | if(TMath::Abs(event->GetPrimaryVertex()->GetZ()) > 10.0) | |
557 | return kFALSE; | |
558 | } | |
559 | ||
560 | if(fAnalyzeQA) | |
561 | FillHistogram("hVertexZAfterVertexCut",event->GetPrimaryVertex()->GetZ()); | |
562 | ||
c2b0976c | 563 | FillHistogram("hEventAcceptance", 2.5); // number of events after vertex cut |
0cb49d99 | 564 | |
565 | return kTRUE; | |
566 | } | |
567 | ||
568 | //________________________________________________________________________ | |
569 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInAcceptance(AliVParticle* track) | |
570 | { | |
571 | FillHistogram("hTrackAcceptance", 0.5); | |
572 | if (track != 0) | |
c2b0976c | 573 | { |
574 | if(fIsKinematics) | |
575 | { | |
576 | // TODO: Only working for AOD MC | |
577 | if((!track->Charge()) || (!(static_cast<AliAODMCParticle*>(track))->IsPhysicalPrimary()) ) | |
578 | return kFALSE; | |
579 | } | |
0cb49d99 | 580 | if (TMath::Abs(track->Eta()) <= fTrackEtaWindow) |
581 | { | |
582 | FillHistogram("hTrackAcceptance", 1.5); | |
583 | if (track->Pt() >= fMinTrackPt) | |
584 | { | |
585 | FillHistogram("hTrackAcceptance", 2.5); | |
586 | return kTRUE; | |
587 | } | |
588 | } | |
c2b0976c | 589 | } |
0cb49d99 | 590 | return kFALSE; |
591 | } | |
b95d0245 | 592 | |
8628b70c | 593 | //________________________________________________________________________ |
594 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsBackgroundJetInAcceptance(AliEmcalJet *jet) | |
595 | { | |
596 | if (jet != 0) | |
597 | if (TMath::Abs(jet->Eta()) <= fBackgroundJetEtaWindow) | |
598 | if (jet->Pt() >= fMinBackgroundJetPt) | |
599 | return kTRUE; | |
600 | ||
601 | return kFALSE; | |
602 | } | |
603 | ||
604 | //________________________________________________________________________ | |
605 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsSignalJetInAcceptance(AliEmcalJet *jet) | |
606 | { | |
0cb49d99 | 607 | FillHistogram("hJetAcceptance", 0.5); |
8628b70c | 608 | if (jet != 0) |
609 | if (TMath::Abs(jet->Eta()) <= fSignalJetEtaWindow) | |
0cb49d99 | 610 | { |
611 | FillHistogram("hJetAcceptance", 1.5); | |
8628b70c | 612 | if (jet->Pt() >= fMinJetPt) |
0cb49d99 | 613 | { |
614 | FillHistogram("hJetAcceptance", 2.5); | |
8628b70c | 615 | if (jet->Area() >= fMinJetArea) |
0cb49d99 | 616 | { |
617 | FillHistogram("hJetAcceptance", 3.5); | |
8628b70c | 618 | return kTRUE; |
0cb49d99 | 619 | } |
620 | } | |
621 | } | |
8628b70c | 622 | return kFALSE; |
623 | } | |
624 | ||
625 | //________________________________________________________________________ | |
626 | inline Bool_t AliAnalysisTaskChargedJetsPA::IsDijet(AliEmcalJet *jet1, AliEmcalJet *jet2) | |
627 | { | |
628 | // Output from GetDeltaPhi is < pi in any case | |
629 | if ((jet1 != 0) && (jet2 != 0)) | |
630 | if((TMath::Pi() - GetDeltaPhi(jet1->Phi(),jet2->Phi())) < fDijetMaxAngleDeviation) | |
631 | if ((jet1->Pt() > fMinDijetLeadingPt) && (jet2->Pt() > fMinDijetLeadingPt)) //TODO: Introduce recoil jet? | |
632 | return kTRUE; | |
633 | ||
634 | return kFALSE; | |
635 | } | |
636 | ||
637 | //________________________________________________________________________ | |
638 | void AliAnalysisTaskChargedJetsPA::ExecOnce() | |
639 | { | |
640 | #ifdef DEBUGMODE | |
efb9b161 | 641 | AliInfo("Starting ExecOnce."); |
8628b70c | 642 | #endif |
643 | fInitialized = kTRUE; | |
644 | ||
645 | // Check for track array | |
646 | if (strcmp(fTrackArrayName->Data(), "") != 0) | |
647 | { | |
648 | fTrackArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrackArrayName->Data())); | |
649 | fHasTracks = kTRUE; | |
650 | if (!fTrackArray) | |
651 | { | |
0983dd5b | 652 | AliWarning(Form("%s: Could not retrieve tracks %s! This is OK, if tracks are not demanded.", GetName(), fTrackArrayName->Data())); |
8628b70c | 653 | fHasTracks = kFALSE; |
654 | } | |
655 | else | |
656 | { | |
657 | TClass *cl = fTrackArray->GetClass(); | |
658 | if (!cl->GetBaseClass("AliVParticle")) | |
659 | { | |
660 | AliError(Form("%s: Collection %s does not contain AliVParticle objects!", GetName(), fTrackArrayName->Data())); | |
661 | fTrackArray = 0; | |
662 | fHasTracks = kFALSE; | |
663 | } | |
664 | } | |
665 | } | |
8628b70c | 666 | |
667 | // Check for jet array | |
668 | if (strcmp(fJetArrayName->Data(), "") != 0) | |
669 | { | |
670 | fJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetArrayName->Data())); | |
671 | fHasJets = kTRUE; | |
672 | ||
673 | if (!fJetArray) | |
674 | { | |
0983dd5b | 675 | AliWarning(Form("%s: Could not retrieve jets %s! This is OK, if jets are not demanded.", GetName(), fJetArrayName->Data())); |
8628b70c | 676 | fHasJets = kFALSE; |
677 | } | |
678 | else | |
679 | { | |
680 | if (!fJetArray->GetClass()->GetBaseClass("AliEmcalJet")) | |
681 | { | |
682 | AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetArrayName->Data())); | |
683 | fJetArray = 0; | |
684 | fHasJets = kFALSE; | |
685 | } | |
686 | } | |
687 | } | |
688 | ||
689 | // Check for background object | |
690 | if (strcmp(fBackgroundJetArrayName->Data(), "") != 0) | |
691 | { | |
692 | fBackgroundJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fBackgroundJetArrayName->Data())); | |
693 | fHasBackgroundJets = kTRUE; | |
694 | if (!fBackgroundJetArray) | |
695 | { | |
696 | AliInfo(Form("%s: Could not retrieve background jets %s! This is OK, if background is not demanded.", GetName(), fBackgroundJetArrayName->Data())); | |
697 | fHasBackgroundJets = kFALSE; | |
698 | } | |
699 | } | |
700 | ||
701 | // Look, if initialization is OK | |
12eb4ac1 | 702 | if (!fHasTracks && fAnalyzeBackground) |
8628b70c | 703 | { |
12eb4ac1 | 704 | AliError(Form("%s: Tracks NOT successfully casted although demanded! Deactivating background analysis",GetName())); |
8628b70c | 705 | fAnalyzeBackground = kFALSE; |
706 | } | |
707 | if ((!fHasJets && fAnalyzeJets) || (!fHasJets && fAnalyzeBackground)) | |
708 | { | |
709 | AliError(Form("%s: Jets NOT successfully casted although demanded! Deactivating jet- and background analysis",GetName())); | |
710 | fAnalyzeJets = kFALSE; | |
711 | fAnalyzeBackground = kFALSE; | |
712 | } | |
713 | if (!fHasBackgroundJets && fAnalyzeBackground) | |
714 | { | |
715 | AliError(Form("%s: Background NOT successfully casted although demanded! Deactivating background analysis",GetName())); | |
716 | fAnalyzeBackground = kFALSE; | |
717 | } | |
718 | ||
06b41974 | 719 | // Initialize helper class (for vertex selection & pile up correction) |
3fa9cde0 | 720 | fHelperClass = new AliAnalysisUtils(); |
06b41974 | 721 | fHelperClass->SetCutOnZVertexSPD(kFALSE); |
8628b70c | 722 | // Histogram init |
723 | Init(); | |
724 | ||
725 | #ifdef DEBUGMODE | |
efb9b161 | 726 | AliInfo("ExecOnce done."); |
8628b70c | 727 | #endif |
728 | ||
729 | } | |
730 | ||
731 | //________________________________________________________________________ | |
732 | void AliAnalysisTaskChargedJetsPA::GetSignalJets() | |
733 | { | |
734 | // Reset vars | |
735 | fFirstLeadingJet = NULL; | |
736 | fSecondLeadingJet = NULL; | |
737 | fNumberSignalJets = 0; | |
738 | ||
b95d0245 | 739 | TList tmpJets; |
740 | for (Int_t i = 0; i < fJetArray->GetEntries(); i++) | |
8628b70c | 741 | { |
742 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJetArray->At(i)); | |
743 | if (!jet) | |
744 | { | |
745 | AliError(Form("%s: Could not receive jet %d", GetName(), i)); | |
746 | continue; | |
747 | } | |
b95d0245 | 748 | if (!IsSignalJetInAcceptance(jet)) |
749 | continue; | |
8628b70c | 750 | |
b95d0245 | 751 | for (Int_t j = 0; j <= tmpJets.GetEntries(); j++) |
8628b70c | 752 | { |
b95d0245 | 753 | if (j>tmpJets.GetEntries()-1) // When passed last item add the jet at the end |
754 | { | |
755 | tmpJets.Add(jet); | |
756 | break; | |
757 | } | |
758 | ||
759 | AliEmcalJet* listJet = static_cast<AliEmcalJet*>(tmpJets.At(j)); | |
760 | ||
761 | if(jet->Pt() < listJet->Pt()) // Insert jet before that one in list if pt smaller | |
762 | { | |
763 | tmpJets.AddAt(jet, j); | |
764 | break; | |
765 | } | |
8628b70c | 766 | } |
b95d0245 | 767 | } |
768 | ||
769 | for (Int_t i = 0; i < tmpJets.GetEntries(); i++) | |
770 | { | |
771 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(tmpJets.At(i)); | |
8628b70c | 772 | fSignalJets[fNumberSignalJets] = jet; |
773 | fNumberSignalJets++; | |
774 | } | |
775 | ||
776 | if (fNumberSignalJets > 0) | |
b95d0245 | 777 | fFirstLeadingJet = static_cast<AliEmcalJet*>(tmpJets.At(0)); |
8628b70c | 778 | if (fNumberSignalJets > 1) |
b95d0245 | 779 | fSecondLeadingJet = static_cast<AliEmcalJet*>(tmpJets.At(1)); |
8628b70c | 780 | |
781 | } | |
782 | ||
783 | //________________________________________________________________________ | |
784 | Int_t AliAnalysisTaskChargedJetsPA::GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets) | |
785 | { | |
786 | // Writes first two leading jets into already registered array jetIDArray | |
787 | ||
788 | if (!jetArray) | |
789 | { | |
790 | AliError("Could not get the jet array to get leading jets from it!"); | |
791 | return 0; | |
792 | } | |
793 | ||
794 | Float_t maxJetPts[] = {0, 0}; | |
795 | jetIDArray[0] = -1; | |
796 | jetIDArray[1] = -1; | |
797 | ||
798 | Int_t jetCount = jetArray->GetEntries(); | |
799 | Int_t jetCountAccepted = 0; | |
800 | ||
801 | for (Int_t i = 0; i < jetCount; i++) | |
802 | { | |
803 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(jetArray->At(i)); | |
804 | if (!jet) | |
805 | { | |
806 | AliError(Form("%s: Could not receive jet %d", GetName(), i)); | |
807 | continue; | |
808 | } | |
809 | ||
810 | if(isSignalJets) | |
811 | { | |
812 | if (!IsSignalJetInAcceptance(jet)) continue; | |
813 | } | |
814 | else | |
815 | { | |
816 | if (!IsBackgroundJetInAcceptance(jet)) continue; | |
817 | } | |
818 | ||
819 | if (jet->Pt() > maxJetPts[0]) | |
820 | { | |
821 | maxJetPts[1] = maxJetPts[0]; | |
822 | jetIDArray[1] = jetIDArray[0]; | |
823 | maxJetPts[0] = jet->Pt(); | |
824 | jetIDArray[0] = i; | |
825 | } | |
826 | else if (jet->Pt() > maxJetPts[1]) | |
827 | { | |
828 | maxJetPts[1] = jet->Pt(); | |
829 | jetIDArray[1] = i; | |
830 | } | |
831 | jetCountAccepted++; | |
832 | } | |
833 | return jetCountAccepted; | |
834 | } | |
12eb4ac1 | 835 | |
12eb4ac1 | 836 | |
837 | //________________________________________________________________________ | |
e8df4140 | 838 | Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedJetPt(AliEmcalJet* jet, Double_t background) |
8628b70c | 839 | { |
840 | #ifdef DEBUGMODE | |
efb9b161 | 841 | AliInfo("Getting corrected jet spectra."); |
8628b70c | 842 | #endif |
843 | ||
844 | if(!jet) | |
845 | { | |
392aa819 | 846 | AliError("Jet pointer passed to GetCorrectedJetPt() not valid!"); |
8628b70c | 847 | return -1.0; |
848 | } | |
849 | ||
850 | Double_t correctedPt = -1.0; | |
851 | ||
0983dd5b | 852 | // if the passed background is not valid, do not subtract it |
853 | if(background < 0) | |
854 | background = 0; | |
8628b70c | 855 | |
8628b70c | 856 | // Subtract background |
e8df4140 | 857 | correctedPt = jet->Pt() - background * jet->Area(); |
8628b70c | 858 | |
859 | #ifdef DEBUGMODE | |
efb9b161 | 860 | AliInfo("Got corrected jet spectra."); |
8628b70c | 861 | #endif |
862 | ||
863 | return correctedPt; | |
864 | } | |
865 | ||
866 | ||
12eb4ac1 | 867 | |
8628b70c | 868 | //________________________________________________________________________ |
c2b0976c | 869 | Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability) |
8628b70c | 870 | { |
871 | #ifdef DEBUGMODE | |
efb9b161 | 872 | AliInfo("Getting Delta Pt."); |
8628b70c | 873 | #endif |
874 | ||
12eb4ac1 | 875 | // Define an invalid delta pt |
0cb49d99 | 876 | Double_t deltaPt = -10000.0; |
8628b70c | 877 | |
12eb4ac1 | 878 | // Define eta range |
8628b70c | 879 | Double_t etaMin, etaMax; |
12eb4ac1 | 880 | etaMin = -(fTrackEtaWindow-fRandConeRadius); |
881 | etaMax = +(fTrackEtaWindow-fRandConeRadius); | |
8628b70c | 882 | |
12eb4ac1 | 883 | // Define random cone |
884 | Bool_t coneValid = kTRUE; | |
0983dd5b | 885 | Double_t tmpRandConeEta = etaMin + fRandom->Rndm()*(etaMax-etaMin); |
886 | Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi(); | |
8628b70c | 887 | |
12eb4ac1 | 888 | // if there is a jet, check for overlap if demanded |
c2b0976c | 889 | if(leadingJetExclusionProbability) |
8628b70c | 890 | { |
392aa819 | 891 | AliEmcalJet* tmpLeading = dynamic_cast<AliEmcalJet*>(fJetArray->At(0)); |
892 | // Get leading jet (regardless of pT) | |
893 | for (Int_t i = 1; i<fJetArray->GetEntries(); i++) | |
8628b70c | 894 | { |
392aa819 | 895 | AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i)); |
896 | // if jet is in acceptance and higher, take as new leading | |
897 | if (tmpJet) | |
898 | if ((TMath::Abs(tmpJet->Eta()) <= fSignalJetEtaWindow) && (tmpJet->Area() >= fMinJetArea)) | |
899 | if((!tmpLeading) || (tmpJet->Pt() > tmpLeading->Pt())) | |
900 | tmpLeading = tmpJet; | |
901 | } | |
0cb49d99 | 902 | if(tmpLeading) |
392aa819 | 903 | { |
0cb49d99 | 904 | Double_t excludedJetPhi = tmpLeading->Phi(); |
905 | Double_t excludedJetEta = tmpLeading->Eta(); | |
906 | Double_t tmpDeltaPhi = GetDeltaPhi(tmpRandConePhi, excludedJetPhi); | |
e8df4140 | 907 | |
0cb49d99 | 908 | // Check, if cone has overlap with jet |
909 | if ( tmpDeltaPhi*tmpDeltaPhi + TMath::Abs(tmpRandConeEta-excludedJetEta)*TMath::Abs(tmpRandConeEta-excludedJetEta) <= fRandConeRadius*fRandConeRadius) | |
910 | { | |
911 | // Define probability to exclude the RC | |
c2b0976c | 912 | Double_t probability = leadingJetExclusionProbability; |
0cb49d99 | 913 | |
914 | // Only exclude cone with a given probability | |
915 | if (fRandom->Rndm()<=probability) | |
916 | coneValid = kFALSE; | |
917 | } | |
8628b70c | 918 | } |
919 | } | |
920 | ||
392aa819 | 921 | |
8628b70c | 922 | // Get the cones' pt and calculate delta pt |
923 | if (coneValid) | |
924 | deltaPt = GetConePt(tmpRandConeEta,tmpRandConePhi,fRandConeRadius) - (rho*fRandConeRadius*fRandConeRadius*TMath::Pi()); | |
12eb4ac1 | 925 | |
0cb49d99 | 926 | return deltaPt; |
8628b70c | 927 | #ifdef DEBUGMODE |
efb9b161 | 928 | AliInfo("Got Delta Pt."); |
8628b70c | 929 | #endif |
930 | } | |
931 | ||
932 | //________________________________________________________________________ | |
0cb49d99 | 933 | void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike) |
8628b70c | 934 | { |
935 | #ifdef DEBUGMODE | |
0cb49d99 | 936 | AliInfo("Getting ALL KT background density."); |
8628b70c | 937 | #endif |
938 | ||
b95d0245 | 939 | static Double_t tmpRhoPbPb[1024]; |
940 | static Double_t tmpRhoPbPbWithGhosts[1024]; | |
941 | static Double_t tmpRhoMean[1024]; | |
942 | static Double_t tmpRhoCMS[1024]; | |
943 | static Double_t tmpRhoImprovedCMS[1024]; | |
944 | Double_t tmpCoveredArea = 0.0; | |
945 | Double_t tmpSummedArea = 0.0; | |
946 | Double_t tmpPtTrackLike = 0.0; | |
947 | Double_t tmpAreaTrackLike = 0.0; | |
8628b70c | 948 | |
949 | // Setting invalid values | |
b95d0245 | 950 | rhoPbPb = 0.0; |
951 | rhoPbPbWithGhosts = 0.0; | |
952 | rhoCMS = 0.0; | |
953 | rhoImprovedCMS = 0.0; | |
954 | rhoMean = 0.0; | |
955 | rhoTrackLike = 0.0; | |
8628b70c | 956 | |
b95d0245 | 957 | Int_t rhoPbPbJetCount = 0; |
958 | Int_t rhoPbPbWithGhostsJetCount = 0; | |
959 | Int_t rhoCMSJetCount = 0; | |
960 | Int_t rhoImprovedCMSJetCount = 0; | |
961 | Int_t rhoMeanJetCount = 0; | |
e8df4140 | 962 | |
e8df4140 | 963 | |
b95d0245 | 964 | // Find 2 leading KT jets for the original PbPb approach |
965 | Int_t leadingKTJets[] = {-1, -1}; | |
966 | GetLeadingJets(fBackgroundJetArray, &leadingKTJets[0], kFALSE); | |
967 | ||
968 | // Exclude UP TO numberExcludeLeadingJets | |
969 | if(numberExcludeLeadingJets==-1) | |
970 | numberExcludeLeadingJets = fNumberSignalJets; | |
971 | if (fNumberSignalJets < numberExcludeLeadingJets) | |
972 | numberExcludeLeadingJets = fNumberSignalJets; | |
8628b70c | 973 | |
e8df4140 | 974 | for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++) |
8628b70c | 975 | { |
e8df4140 | 976 | AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i)); |
b95d0245 | 977 | |
e8df4140 | 978 | if (!backgroundJet) |
8628b70c | 979 | { |
980 | AliError(Form("%s: Could not receive jet %d", GetName(), i)); | |
981 | continue; | |
982 | } | |
983 | ||
271cbc5d | 984 | tmpSummedArea += backgroundJet->Area(); |
985 | if(backgroundJet->Pt() > 0.150) | |
986 | tmpCoveredArea += backgroundJet->Area(); | |
987 | ||
2a82f637 | 988 | if (!IsBackgroundJetInAcceptance(backgroundJet)) |
989 | continue; | |
990 | ||
b95d0245 | 991 | // Search for overlap with signal jets |
992 | Bool_t isOverlapping = kFALSE; | |
993 | for(Int_t j=0;j<numberExcludeLeadingJets;j++) | |
e8df4140 | 994 | { |
b95d0245 | 995 | AliEmcalJet* signalJet = fSignalJets[j]; |
996 | ||
f800ea4e CL |
997 | if(signalJet->Pt() >= 5.0) |
998 | if(IsJetOverlapping(signalJet, backgroundJet)) | |
999 | { | |
1000 | isOverlapping = kTRUE; | |
1001 | break; | |
1002 | } | |
b95d0245 | 1003 | } |
e8df4140 | 1004 | |
c2b0976c | 1005 | Double_t tmpRho = 0.0; |
1006 | if(backgroundJet->Area()) | |
1007 | tmpRho = backgroundJet->Pt() / backgroundJet->Area(); | |
1008 | ||
b95d0245 | 1009 | // PbPb approach (take ghosts into account) |
1010 | if ((i != leadingKTJets[0]) && (i != leadingKTJets[1])) | |
1011 | { | |
0cb49d99 | 1012 | tmpRhoPbPbWithGhosts[rhoPbPbWithGhostsJetCount] = tmpRho; |
b95d0245 | 1013 | rhoPbPbWithGhostsJetCount++; |
e8df4140 | 1014 | } |
b95d0245 | 1015 | |
1016 | if(backgroundJet->Pt() > 0.150) | |
e8df4140 | 1017 | { |
b95d0245 | 1018 | // CMS approach: don't take ghosts into acount |
0cb49d99 | 1019 | tmpRhoCMS[rhoCMSJetCount] = tmpRho; |
b95d0245 | 1020 | rhoCMSJetCount++; |
e8df4140 | 1021 | |
b95d0245 | 1022 | // Improved CMS approach: like CMS but excluding signal |
1023 | if(!isOverlapping) | |
1024 | { | |
0cb49d99 | 1025 | tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho; |
b95d0245 | 1026 | rhoImprovedCMSJetCount++; |
1027 | } | |
8628b70c | 1028 | |
b95d0245 | 1029 | // PbPb w/o ghosts approach (just neglect ghosts) |
1030 | if ((i != leadingKTJets[0]) && (i != leadingKTJets[1])) | |
1031 | { | |
0cb49d99 | 1032 | tmpRhoPbPb[rhoPbPbJetCount] = tmpRho; |
b95d0245 | 1033 | rhoPbPbJetCount++; |
1034 | } | |
1035 | } | |
1036 | ||
1037 | // (no overlap with signal jets) | |
1038 | if(!isOverlapping) | |
1039 | { | |
1040 | // Mean approach | |
0cb49d99 | 1041 | tmpRhoMean[rhoMeanJetCount] = tmpRho; |
b95d0245 | 1042 | rhoMeanJetCount++; |
1043 | ||
1044 | // Track like approach approach | |
1045 | tmpPtTrackLike += backgroundJet->Pt(); | |
1046 | tmpAreaTrackLike += backgroundJet->Area(); | |
1047 | } | |
8628b70c | 1048 | |
8628b70c | 1049 | } |
b95d0245 | 1050 | |
1051 | if (tmpAreaTrackLike > 0) | |
1052 | rhoTrackLike = tmpPtTrackLike/tmpAreaTrackLike; | |
1053 | if (rhoPbPbJetCount > 0) | |
1054 | rhoPbPb = TMath::Median(rhoPbPbJetCount, tmpRhoPbPb); | |
1055 | if (rhoPbPbWithGhostsJetCount > 0) | |
1056 | rhoPbPbWithGhosts = TMath::Median(rhoPbPbWithGhostsJetCount, tmpRhoPbPbWithGhosts); | |
1057 | if (rhoCMSJetCount > 0) | |
1058 | rhoCMS = TMath::Median(rhoCMSJetCount, tmpRhoCMS) * tmpCoveredArea/tmpSummedArea; | |
1059 | if (rhoImprovedCMSJetCount > 0) | |
c154ba90 | 1060 | { |
b95d0245 | 1061 | rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea; |
c154ba90 | 1062 | } |
b95d0245 | 1063 | if (rhoMeanJetCount > 0) |
1064 | rhoMean = TMath::Mean(rhoMeanJetCount, tmpRhoMean); | |
1065 | ||
0cb49d99 | 1066 | #ifdef DEBUGMODE |
1067 | AliInfo("Got ALL KT background density."); | |
1068 | #endif | |
1069 | } | |
1070 | ||
1071 | //________________________________________________________________________ | |
1072 | void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS) | |
1073 | { | |
1074 | #ifdef DEBUGMODE | |
1075 | AliInfo("Getting KT background density."); | |
1076 | #endif | |
1077 | ||
1078 | static Double_t tmpRhoImprovedCMS[1024]; | |
1079 | Double_t tmpCoveredArea = 0.0; | |
1080 | Double_t tmpSummedArea = 0.0; | |
1081 | ||
1082 | // Setting invalid values | |
1083 | rhoImprovedCMS = 0.0; | |
1084 | ||
1085 | Int_t rhoImprovedCMSJetCount = 0; | |
1086 | ||
1087 | // Exclude UP TO numberExcludeLeadingJets | |
1088 | if(numberExcludeLeadingJets==-1) | |
1089 | numberExcludeLeadingJets = fNumberSignalJets; | |
1090 | if (fNumberSignalJets < numberExcludeLeadingJets) | |
1091 | numberExcludeLeadingJets = fNumberSignalJets; | |
1092 | ||
1093 | for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++) | |
1094 | { | |
1095 | AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i)); | |
1096 | ||
1097 | if (!backgroundJet) | |
1098 | { | |
1099 | AliError(Form("%s: Could not receive jet %d", GetName(), i)); | |
1100 | continue; | |
1101 | } | |
1102 | ||
1103 | // Search for overlap with signal jets | |
1104 | Bool_t isOverlapping = kFALSE; | |
1105 | for(Int_t j=0;j<numberExcludeLeadingJets;j++) | |
1106 | { | |
1107 | AliEmcalJet* signalJet = fSignalJets[j]; | |
f800ea4e CL |
1108 | if(signalJet->Pt() >= 5.0) |
1109 | if(IsJetOverlapping(signalJet, backgroundJet)) | |
1110 | { | |
1111 | isOverlapping = kTRUE; | |
1112 | break; | |
1113 | } | |
0cb49d99 | 1114 | } |
1115 | ||
1116 | tmpSummedArea += backgroundJet->Area(); | |
1117 | if(backgroundJet->Pt() > 0.150) | |
1118 | tmpCoveredArea += backgroundJet->Area(); | |
1119 | ||
1120 | if (!IsBackgroundJetInAcceptance(backgroundJet)) | |
1121 | continue; | |
1122 | ||
1123 | Double_t tmpRho = backgroundJet->Pt() / backgroundJet->Area(); | |
1124 | ||
1125 | if(backgroundJet->Pt() > 0.150) | |
1126 | if(!isOverlapping) | |
1127 | { | |
1128 | tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho; | |
1129 | rhoImprovedCMSJetCount++; | |
1130 | } | |
1131 | } | |
1132 | ||
1133 | if (rhoImprovedCMSJetCount > 0) | |
1134 | { | |
c154ba90 | 1135 | rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea; |
0cb49d99 | 1136 | } |
8628b70c | 1137 | #ifdef DEBUGMODE |
efb9b161 | 1138 | AliInfo("Got KT background density."); |
8628b70c | 1139 | #endif |
1140 | } | |
1141 | ||
8628b70c | 1142 | |
8628b70c | 1143 | //________________________________________________________________________ |
b95d0245 | 1144 | void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion) |
8628b70c | 1145 | { |
1146 | #ifdef DEBUGMODE | |
12eb4ac1 | 1147 | AliInfo("Getting TR background density."); |
8628b70c | 1148 | #endif |
1149 | ||
b95d0245 | 1150 | Double_t summedTracksPtCone04 = 0.0; |
4856f9c9 | 1151 | Double_t summedTracksPtCone02 = 0.0; |
b95d0245 | 1152 | Double_t summedTracksPtCone06 = 0.0; |
1153 | Double_t summedTracksPtCone08 = 0.0; | |
1154 | Double_t summedTracksPtWithinJets = 0.0; | |
8628b70c | 1155 | Double_t summedTracksPt = 0.0; |
b95d0245 | 1156 | |
8628b70c | 1157 | // Setting invalid values |
b95d0245 | 1158 | rhoNoExclusion = 0.0; |
1159 | rhoConeExclusion02 = 0.0; | |
1160 | rhoConeExclusion04 = 0.0; | |
1161 | rhoConeExclusion06 = 0.0; | |
1162 | rhoConeExclusion08 = 0.0; | |
1163 | rhoExactExclusion = 0.0; | |
1164 | ||
8628b70c | 1165 | // Exclude UP TO numberExcludeLeadingJets |
b95d0245 | 1166 | if(numberExcludeLeadingJets==-1) |
1167 | numberExcludeLeadingJets = fNumberSignalJets; | |
1168 | if (fNumberSignalJets < numberExcludeLeadingJets) | |
8628b70c | 1169 | numberExcludeLeadingJets = fNumberSignalJets; |
1170 | ||
f800ea4e CL |
1171 | Int_t fSignalJetCount5GeV = 0; |
1172 | for(Int_t j=0;j<numberExcludeLeadingJets;j++) | |
1173 | { | |
1174 | AliEmcalJet* signalJet = fSignalJets[j]; | |
1175 | if(signalJet->Pt() < 5.0) | |
1176 | continue; | |
1177 | fSignalJetCount5GeV++; | |
1178 | } | |
1179 | ||
b95d0245 | 1180 | for (Int_t i = 0; i < fTrackArray->GetEntries(); i++) |
8628b70c | 1181 | { |
8628b70c | 1182 | AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i)); |
b95d0245 | 1183 | Bool_t trackWithinJet = kFALSE; Bool_t trackWithin02Cone = kFALSE; Bool_t trackWithin04Cone = kFALSE; Bool_t trackWithin06Cone = kFALSE; Bool_t trackWithin08Cone = kFALSE; |
1184 | ||
8628b70c | 1185 | if (IsTrackInAcceptance(tmpTrack)) |
b95d0245 | 1186 | { |
1187 | // Check if tracks overlaps with jet | |
1188 | for(Int_t j=0;j<numberExcludeLeadingJets;j++) | |
8628b70c | 1189 | { |
b95d0245 | 1190 | AliEmcalJet* signalJet = fSignalJets[j]; |
1191 | ||
f800ea4e CL |
1192 | if(signalJet->Pt() < 5.0) |
1193 | continue; | |
1194 | ||
b95d0245 | 1195 | // Exact jet exclusion |
1196 | if (IsTrackInJet(signalJet, i)) | |
1197 | trackWithinJet = kTRUE; | |
1198 | ||
1199 | // Cone exclusions | |
1200 | if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.2)) | |
8628b70c | 1201 | { |
b95d0245 | 1202 | trackWithin02Cone = kTRUE; |
1203 | trackWithin04Cone = kTRUE; | |
1204 | trackWithin06Cone = kTRUE; | |
1205 | trackWithin08Cone = kTRUE; | |
1206 | break; | |
1207 | } | |
1208 | else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.4)) | |
1209 | { | |
1210 | trackWithin04Cone = kTRUE; | |
1211 | trackWithin06Cone = kTRUE; | |
1212 | trackWithin08Cone = kTRUE; | |
8628b70c | 1213 | } |
b95d0245 | 1214 | else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.6)) |
8628b70c | 1215 | { |
b95d0245 | 1216 | trackWithin06Cone = kTRUE; |
1217 | trackWithin08Cone = kTRUE; | |
1218 | } | |
1219 | else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.8)) | |
1220 | { | |
1221 | trackWithin08Cone = kTRUE; | |
8628b70c | 1222 | } |
1223 | } | |
b95d0245 | 1224 | |
1225 | if(!trackWithin08Cone) | |
1226 | { | |
1227 | summedTracksPtCone08 += tmpTrack->Pt(); | |
1228 | } | |
1229 | if(!trackWithin06Cone) | |
1230 | { | |
1231 | summedTracksPtCone06 += tmpTrack->Pt(); | |
1232 | } | |
1233 | if(!trackWithin04Cone) | |
1234 | { | |
1235 | summedTracksPtCone04 += tmpTrack->Pt(); | |
1236 | } | |
1237 | if(!trackWithin02Cone) | |
1238 | { | |
1239 | summedTracksPtCone02 += tmpTrack->Pt(); | |
1240 | } | |
1241 | if(!trackWithinJet) | |
1242 | { | |
1243 | summedTracksPtWithinJets += tmpTrack->Pt(); | |
1244 | } | |
1245 | summedTracksPt += tmpTrack->Pt(); | |
1246 | ||
1247 | } | |
8628b70c | 1248 | } |
1249 | ||
b95d0245 | 1250 | // Calculate the correct area where the tracks were taking from |
8628b70c | 1251 | |
b95d0245 | 1252 | Double_t tmpFullTPCArea = (2.0*fTrackEtaWindow) * TMath::TwoPi(); |
1253 | Double_t tmpAreaCone02 = tmpFullTPCArea; | |
1254 | Double_t tmpAreaCone04 = tmpFullTPCArea; | |
1255 | Double_t tmpAreaCone06 = tmpFullTPCArea; | |
1256 | Double_t tmpAreaCone08 = tmpFullTPCArea; | |
1257 | Double_t tmpAreaWithinJets = tmpFullTPCArea; | |
f800ea4e CL |
1258 | std::vector<Double_t> tmpEtas(fSignalJetCount5GeV); |
1259 | std::vector<Double_t> tmpPhis(fSignalJetCount5GeV); | |
b95d0245 | 1260 | |
f800ea4e | 1261 | Int_t iSignal = 0; |
b95d0245 | 1262 | for(Int_t i=0;i<numberExcludeLeadingJets;i++) |
1263 | { | |
1264 | AliEmcalJet* tmpJet = fSignalJets[i]; | |
f800ea4e CL |
1265 | |
1266 | if(tmpJet->Pt() < 5.0) | |
1267 | continue; | |
1268 | ||
1269 | tmpEtas[iSignal] = tmpJet->Eta(); | |
1270 | tmpPhis[iSignal] = tmpJet->Phi(); | |
b95d0245 | 1271 | tmpAreaWithinJets -= tmpJet->Area(); |
f800ea4e CL |
1272 | |
1273 | iSignal++; | |
8628b70c | 1274 | } |
1275 | ||
f800ea4e CL |
1276 | tmpAreaCone02 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.2, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi()); |
1277 | tmpAreaCone04 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.4, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi()); | |
1278 | tmpAreaCone06 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.6, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi()); | |
1279 | tmpAreaCone08 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.8, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi()); | |
b95d0245 | 1280 | |
1281 | rhoConeExclusion02 = summedTracksPtCone02/tmpAreaCone02; | |
1282 | rhoConeExclusion04 = summedTracksPtCone04/tmpAreaCone04; | |
1283 | rhoConeExclusion06 = summedTracksPtCone06/tmpAreaCone06; | |
1284 | rhoConeExclusion08 = summedTracksPtCone08/tmpAreaCone08; | |
1285 | rhoExactExclusion = summedTracksPtWithinJets/tmpAreaWithinJets; | |
1286 | rhoNoExclusion = summedTracksPt/tmpFullTPCArea; | |
1287 | ||
1288 | ||
8628b70c | 1289 | #ifdef DEBUGMODE |
12eb4ac1 | 1290 | AliInfo("Got TR background density."); |
8628b70c | 1291 | #endif |
1292 | } | |
1293 | ||
1294 | //________________________________________________________________________ | |
12eb4ac1 | 1295 | void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular) |
8628b70c | 1296 | { |
1297 | #ifdef DEBUGMODE | |
12eb4ac1 | 1298 | AliInfo("Getting TR background density."); |
8628b70c | 1299 | #endif |
1300 | ||
1301 | // Setting invalid values | |
1302 | Double_t summedTracksPt = 0.0; | |
b95d0245 | 1303 | rhoMean = 0.0; |
8628b70c | 1304 | area = -1.0; |
1305 | ||
1306 | Double_t tmpRadius = 0.0; | |
1307 | if (doSearchPerpendicular) | |
b95d0245 | 1308 | tmpRadius = 0.4*TMath::Pi(); // exclude 90 degrees around jets |
8628b70c | 1309 | else |
b95d0245 | 1310 | tmpRadius = 0.8; |
8628b70c | 1311 | |
1312 | numberExcludeLeadingJets = 2; // dijet is excluded here in any case | |
1313 | ||
1314 | ||
1315 | ||
1316 | if (!fTrackArray || !fJetArray) | |
1317 | { | |
1318 | AliError("Could not get the track/jet array to calculate track rho!"); | |
1319 | return; | |
1320 | } | |
1321 | ||
1322 | Int_t trackCount = fTrackArray->GetEntries(); | |
1323 | Int_t trackCountAccepted = 0; | |
1324 | for (Int_t i = 0; i < trackCount; i++) | |
1325 | { | |
1326 | AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
1327 | if (IsTrackInAcceptance(tmpTrack)) | |
1328 | { | |
1329 | if (IsTrackInCone(tmpTrack, excludeJet1->Eta(), excludeJet1->Phi(), tmpRadius)) | |
1330 | continue; | |
1331 | ||
1332 | if (numberExcludeLeadingJets > 1) | |
1333 | if (IsTrackInCone(tmpTrack, excludeJet2->Eta(), excludeJet2->Phi(), tmpRadius)) | |
1334 | continue; | |
1335 | ||
1336 | // Add track pt to array | |
1337 | summedTracksPt = summedTracksPt + tmpTrack->Pt(); | |
1338 | trackCountAccepted++; | |
1339 | } | |
1340 | } | |
1341 | ||
1342 | if (trackCountAccepted > 0) | |
1343 | { | |
1344 | Double_t tmpArea = 2.0*fTrackEtaWindow*TMath::TwoPi() - 2*(tmpRadius*tmpRadius * TMath::Pi()); //TPC area - excluding jet area | |
1345 | rhoMean = summedTracksPt/tmpArea; | |
1346 | area = tmpArea; | |
1347 | } | |
1348 | ||
1349 | #ifdef DEBUGMODE | |
12eb4ac1 | 1350 | AliInfo("Got TR background density."); |
8628b70c | 1351 | #endif |
1352 | } | |
1353 | ||
ac9c07e9 CL |
1354 | //________________________________________________________________________ |
1355 | void AliAnalysisTaskChargedJetsPA::GetPPBackgroundDensity(Double_t& background, AliEmcalJet* jet) | |
1356 | { | |
1357 | // This is the background that was used for the pp 7 TeV ALICE paper | |
1358 | Double_t jetMom[3] = { jet->Px(), jet->Py(), jet->Pz() }; | |
1359 | TVector3 jet3mom1(jetMom); | |
1360 | TVector3 jet3mom2(jetMom); | |
1361 | background = 0; | |
1362 | ||
1363 | jet3mom1.RotateZ(TMath::Pi()); | |
1364 | jet3mom2.RotateZ(-TMath::Pi()); | |
1365 | ||
1366 | for (int i = 0; i < fTrackArray->GetEntries(); i++) | |
1367 | { | |
1368 | AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
72aa6b04 | 1369 | if (!IsTrackInAcceptance(track)) |
1370 | continue; | |
ac9c07e9 CL |
1371 | |
1372 | Double_t trackMom[3] = { track->Px(), track->Py(), track->Pz() }; | |
1373 | TVector3 track3mom(trackMom); | |
1374 | ||
1375 | Double_t dR1 = jet3mom1.DeltaR(track3mom); | |
1376 | Double_t dR2 = jet3mom2.DeltaR(track3mom); | |
1377 | ||
1378 | if (dR1 <= fSignalJetRadius || dR2 <= fSignalJetRadius) | |
1379 | background += track3mom.Pt(); | |
1380 | } | |
1381 | ||
1382 | background /= (2 * TMath::Pi() * fSignalJetRadius * fSignalJetRadius); | |
1383 | } | |
1384 | ||
8628b70c | 1385 | //________________________________________________________________________ |
1386 | void AliAnalysisTaskChargedJetsPA::Calculate(AliVEvent* event) | |
1387 | { | |
1388 | #ifdef DEBUGMODE | |
efb9b161 | 1389 | AliInfo("Starting Calculate()."); |
8628b70c | 1390 | #endif |
1391 | ////////////////////// NOTE: initialization & casting | |
1392 | ||
c2b0976c | 1393 | fEventCounter++; |
1394 | ||
b95d0245 | 1395 | // Check, if analysis should be done in pt hard bins |
1396 | if(fUsePtHardBin != -1) | |
1397 | if(GetPtHardBin() != fUsePtHardBin) | |
1398 | return; | |
1399 | ||
c2b0976c | 1400 | // This is to take only every Nth event |
1401 | if((fEventCounter+fPartialAnalysisIndex) % fPartialAnalysisNParts != 0) | |
1402 | return; | |
1403 | ||
0cb49d99 | 1404 | FillHistogram("hNumberEvents",0.5); |
b95d0245 | 1405 | |
0cb49d99 | 1406 | if(!IsEventInAcceptance(event)) |
1407 | return; | |
8628b70c | 1408 | |
0cb49d99 | 1409 | FillHistogram("hNumberEvents",1.5); |
8628b70c | 1410 | |
1411 | #ifdef DEBUGMODE | |
efb9b161 | 1412 | AliInfo("Calculate()::Init done."); |
8628b70c | 1413 | #endif |
1414 | ||
1415 | ////////////////////// NOTE: Get Centrality, (Leading)Signal jets and Background | |
1416 | ||
12eb4ac1 | 1417 | // Get centrality |
8628b70c | 1418 | AliCentrality* tmpCentrality = NULL; |
1419 | tmpCentrality = event->GetCentrality(); | |
4856f9c9 | 1420 | Double_t centralityPercentile = -1.0; |
b95d0245 | 1421 | Double_t centralityPercentileV0A = 0.0; |
1422 | Double_t centralityPercentileV0C = 0.0; | |
1423 | Double_t centralityPercentileV0M = 0.0; | |
271cbc5d | 1424 | Double_t centralityPercentileZNA = 0.0; |
8628b70c | 1425 | if (tmpCentrality != NULL) |
b95d0245 | 1426 | { |
12eb4ac1 | 1427 | centralityPercentile = tmpCentrality->GetCentralityPercentile(fCentralityType.Data()); |
b95d0245 | 1428 | centralityPercentileV0A = tmpCentrality->GetCentralityPercentile("V0A"); |
1429 | centralityPercentileV0C = tmpCentrality->GetCentralityPercentile("V0C"); | |
1430 | centralityPercentileV0M = tmpCentrality->GetCentralityPercentile("V0M"); | |
271cbc5d | 1431 | centralityPercentileZNA = tmpCentrality->GetCentralityPercentile("ZNA"); |
b95d0245 | 1432 | } |
8628b70c | 1433 | |
b95d0245 | 1434 | if((centralityPercentile < 0.0) || (centralityPercentile > 100.0)) |
9f1e4f53 | 1435 | AliWarning(Form("Centrality value not valid (c=%E)",centralityPercentile)); |
1436 | ||
1437 | if(fSetCentralityToOne) | |
b95d0245 | 1438 | centralityPercentile = 1.0; |
9f1e4f53 | 1439 | |
8628b70c | 1440 | // Get jets |
1441 | if (fAnalyzeBackground || fAnalyzeJets) | |
1442 | GetSignalJets(); | |
1443 | ||
12eb4ac1 | 1444 | // Get background estimates |
b95d0245 | 1445 | Double_t backgroundKTImprovedCMS = -1.0; |
06b41974 | 1446 | Double_t backgroundKTImprovedCMSExternal = -1.0; |
b95d0245 | 1447 | Double_t backgroundKTPbPb = -1.0; |
1448 | Double_t backgroundKTPbPbWithGhosts = -1.0; | |
1449 | Double_t backgroundKTCMS = -1.0; | |
1450 | Double_t backgroundKTMean = -1.0; | |
1451 | Double_t backgroundKTTrackLike = -1.0; | |
1452 | Double_t backgroundTRNoExcl = -1.0; | |
1453 | Double_t backgroundTRCone02 = -1.0; | |
1454 | Double_t backgroundTRCone04 = -1.0; | |
1455 | Double_t backgroundTRCone06 = -1.0; | |
1456 | Double_t backgroundTRCone08 = -1.0; | |
1457 | Double_t backgroundTRExact = -1.0; | |
ac9c07e9 | 1458 | Double_t backgroundPP = -1.0; |
088fbc16 | 1459 | // Calculate background for different jet exclusions |
12eb4ac1 | 1460 | |
8628b70c | 1461 | if (fAnalyzeBackground) |
1462 | { | |
b95d0245 | 1463 | |
0cb49d99 | 1464 | if(fAnalyzeDeprecatedBackgrounds) |
1465 | GetKTBackgroundDensityAll (fNumberExcludedJets, backgroundKTPbPb, backgroundKTPbPbWithGhosts, backgroundKTCMS, backgroundKTImprovedCMS, backgroundKTMean, backgroundKTTrackLike); | |
1466 | else | |
1467 | GetKTBackgroundDensity (fNumberExcludedJets, backgroundKTImprovedCMS); | |
1468 | ||
1469 | if(fAnalyzeDeprecatedBackgrounds) | |
1470 | GetTRBackgroundDensity (fNumberExcludedJets, backgroundTRNoExcl, backgroundTRCone02, backgroundTRCone04, backgroundTRCone06, backgroundTRCone08, backgroundTRExact); | |
06b41974 | 1471 | |
1472 | backgroundKTImprovedCMSExternal = GetExternalRho(); | |
4bb1bca6 | 1473 | if(fNoExternalBackground) |
1474 | backgroundKTImprovedCMSExternal = 0; | |
1475 | ||
8628b70c | 1476 | } |
1477 | ||
1478 | #ifdef DEBUGMODE | |
efb9b161 | 1479 | AliInfo("Calculate()::Centrality&SignalJets&Background-Calculation done."); |
8628b70c | 1480 | #endif |
8628b70c | 1481 | |
b95d0245 | 1482 | if (fAnalyzeQA) |
1483 | { | |
1484 | FillHistogram("hVertexX",event->GetPrimaryVertex()->GetX()); | |
1485 | FillHistogram("hVertexY",event->GetPrimaryVertex()->GetY()); | |
1486 | FillHistogram("hVertexXY",event->GetPrimaryVertex()->GetX(), event->GetPrimaryVertex()->GetY()); | |
b95d0245 | 1487 | FillHistogram("hVertexR",TMath::Sqrt(event->GetPrimaryVertex()->GetX()*event->GetPrimaryVertex()->GetX() + event->GetPrimaryVertex()->GetY()*event->GetPrimaryVertex()->GetY())); |
1488 | FillHistogram("hCentralityV0M",centralityPercentileV0M); | |
1489 | FillHistogram("hCentralityV0A",centralityPercentileV0A); | |
1490 | FillHistogram("hCentralityV0C",centralityPercentileV0C); | |
271cbc5d | 1491 | FillHistogram("hCentralityZNA",centralityPercentileZNA); |
7e413f22 | 1492 | FillHistogram("hCentrality",centralityPercentile); |
b95d0245 | 1493 | |
1494 | Int_t trackCountAcc = 0; | |
1495 | Int_t nTracks = fTrackArray->GetEntries(); | |
1496 | for (Int_t i = 0; i < nTracks; i++) | |
1497 | { | |
1498 | AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
0cb49d99 | 1499 | |
1500 | if (track != 0) | |
1501 | if (track->Pt() >= fMinTrackPt) | |
1502 | FillHistogram("hTrackPhiEta", track->Phi(),track->Eta(), 1); | |
1503 | ||
b95d0245 | 1504 | if (IsTrackInAcceptance(track)) |
1505 | { | |
392aa819 | 1506 | FillHistogram("hTrackPt", track->Pt(), centralityPercentile); |
b95d0245 | 1507 | if(track->Eta() >= 0) |
392aa819 | 1508 | FillHistogram("hTrackPtPosEta", track->Pt(), centralityPercentile); |
b95d0245 | 1509 | else |
392aa819 | 1510 | FillHistogram("hTrackPtNegEta", track->Pt(), centralityPercentile); |
b95d0245 | 1511 | |
7e413f22 | 1512 | FillHistogram("hTrackEta", track->Eta(), centralityPercentile); |
b95d0245 | 1513 | FillHistogram("hTrackPhi", track->Phi()); |
c2b0976c | 1514 | |
4856f9c9 | 1515 | if(static_cast<AliPicoTrack*>(track)) |
0cb49d99 | 1516 | FillHistogram("hTrackPhiTrackType", track->Phi(), (static_cast<AliPicoTrack*>(track))->GetTrackType()); |
271cbc5d | 1517 | |
b95d0245 | 1518 | for(Int_t j=0;j<20;j++) |
1519 | if(track->Pt() > j) | |
1520 | FillHistogram("hTrackPhiPtCut", track->Phi(), track->Pt()); | |
1521 | ||
1522 | FillHistogram("hTrackCharge", track->Charge()); | |
1523 | trackCountAcc++; | |
1524 | } | |
1525 | } | |
4856f9c9 | 1526 | FillHistogram("hTrackCountAcc", trackCountAcc, centralityPercentile); |
b95d0245 | 1527 | |
2a82f637 | 1528 | |
1529 | /* | |
1530 | // This is code that is run locally to get some special events | |
1531 | TFile* fileOutput = new TFile("SpecialEvents.root", "UPDATE"); | |
1532 | if(fSecondLeadingJet&&(fSecondLeadingJet->Pt()>10.)) | |
1533 | { | |
1534 | cout << "Event found\n"; | |
1535 | TH2D* tmpEvent = new TH2D(Form("Event%lu", fEventCounter), "", 40, -0.9, 0.9, 40, 0., TMath::TwoPi()); | |
1536 | tmpEvent->GetXaxis()->SetTitle("#eta"); | |
1537 | tmpEvent->GetYaxis()->SetTitle("#phi"); | |
1538 | tmpEvent->SetOption("LEGO2"); | |
1539 | tmpEvent->Sumw2(); | |
1540 | ||
1541 | for (Int_t i = 0; i < nTracks; i++) | |
1542 | { | |
1543 | AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i)); | |
1544 | ||
1545 | if (IsTrackInAcceptance(track)) | |
1546 | { | |
1547 | tmpEvent->Fill(track->Eta(), track->Phi(), track->Pt()); | |
1548 | } | |
1549 | } | |
1550 | tmpEvent->Write(0, kOverwrite); | |
1551 | } | |
1552 | fileOutput->Close(); | |
1553 | */ | |
b95d0245 | 1554 | } |
1555 | #ifdef DEBUGMODE | |
1556 | AliInfo("Calculate()::QA done."); | |
1557 | #endif | |
1558 | ||
12eb4ac1 | 1559 | ////////////////////// NOTE: Jet analysis and calculations |
8628b70c | 1560 | |
12eb4ac1 | 1561 | if (fAnalyzeJets) |
8628b70c | 1562 | { |
0cb49d99 | 1563 | for (Int_t i = 0; i<fJetArray->GetEntries(); i++) |
8628b70c | 1564 | { |
0cb49d99 | 1565 | AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i)); |
1566 | if (!tmpJet) | |
1567 | continue; | |
1568 | ||
c2b0976c | 1569 | FillHistogram("hRawJetPt", tmpJet->Pt()); |
2a82f637 | 1570 | if (tmpJet->Pt() >= 5.0) |
e8df4140 | 1571 | { |
0cb49d99 | 1572 | // ### RAW JET ANALYSIS |
1573 | if (tmpJet->Area() >= fMinJetArea) | |
1574 | FillHistogram("hRawJetPhiEta", tmpJet->Phi(), tmpJet->Eta()); | |
1575 | if (TMath::Abs(tmpJet->Eta()) <= fSignalJetEtaWindow) | |
1576 | FillHistogram("hRawJetArea", tmpJet->Area()); | |
e8df4140 | 1577 | } |
c2b0976c | 1578 | |
0cb49d99 | 1579 | if(IsSignalJetInAcceptance(tmpJet)) |
1580 | { | |
1581 | // ### SIGNAL JET ANALYSIS | |
1582 | // Jet spectra | |
1583 | FillHistogram("hJetPt", tmpJet->Pt(), centralityPercentile); | |
1584 | FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile); | |
72aa6b04 | 1585 | if(tmpJet->Phi() >= TMath::Pi()) |
1586 | FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS_Phi2", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile); | |
1587 | else | |
1588 | FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS_Phi1", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile); | |
271cbc5d | 1589 | |
ac9c07e9 CL |
1590 | // pp background |
1591 | GetPPBackgroundDensity(backgroundPP, tmpJet); | |
1592 | FillHistogram("hJetPtBgrdSubtractedPP", GetCorrectedJetPt(tmpJet, backgroundPP), centralityPercentile); | |
1593 | ||
72aa6b04 | 1594 | FillHistogram("hJetPtBgrdSubtractedExternal", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile); |
1595 | FillHistogram("hJetPtSubtractedRhoKTImprovedCMS", tmpJet->Pt(), centralityPercentile, backgroundKTImprovedCMS); | |
1596 | FillHistogram("hJetPtSubtractedRhoExternal", tmpJet->Pt(), centralityPercentile, backgroundKTImprovedCMSExternal); | |
1597 | FillHistogram("hJetPtSubtractedRhoPP", tmpJet->Pt(), centralityPercentile, backgroundPP); | |
1598 | ||
1599 | ||
0cb49d99 | 1600 | if(fAnalyzeDeprecatedBackgrounds) |
1601 | { | |
1602 | FillHistogram("hJetPtBgrdSubtractedTR", GetCorrectedJetPt(tmpJet, backgroundTRCone06), centralityPercentile); | |
1603 | FillHistogram("hJetPtBgrdSubtractedKTPbPb", GetCorrectedJetPt(tmpJet, backgroundKTPbPb), centralityPercentile); | |
1604 | FillHistogram("hJetPtBgrdSubtractedKTPbPbWithGhosts", GetCorrectedJetPt(tmpJet, backgroundKTPbPbWithGhosts), centralityPercentile); | |
1605 | FillHistogram("hJetPtBgrdSubtractedKTCMS", GetCorrectedJetPt(tmpJet, backgroundKTCMS), centralityPercentile); | |
1606 | FillHistogram("hJetPtBgrdSubtractedKTMean", GetCorrectedJetPt(tmpJet, backgroundKTMean), centralityPercentile); | |
1607 | FillHistogram("hJetPtBgrdSubtractedKTTrackLike", GetCorrectedJetPt(tmpJet, backgroundKTTrackLike), centralityPercentile); | |
1608 | } | |
e8df4140 | 1609 | |
2a82f637 | 1610 | // Jet profile analysis |
1611 | if(TMath::Abs(tmpJet->Eta()) <= 0.3) | |
1612 | { | |
1613 | if(tmpJet->Pt()>=70.0) | |
1614 | { | |
271cbc5d | 1615 | FillHistogram("hJetProfile70GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1616 | FillHistogram("hJetProfile70GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1617 | FillHistogram("hJetProfile70GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1618 | FillHistogram("hJetProfile70GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1619 | FillHistogram("hJetProfile70GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1620 | FillHistogram("hJetProfile70GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1621 | FillHistogram("hJetProfile70GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1622 | FillHistogram("hJetProfile70GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1623 | FillHistogram("hJetProfile70GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1624 | FillHistogram("hJetProfile70GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1625 | FillHistogram("hJetProfile70GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1626 | FillHistogram("hJetProfile70GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1627 | } |
271cbc5d | 1628 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=60.0) |
2a82f637 | 1629 | { |
271cbc5d | 1630 | FillHistogram("hJetProfile60GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1631 | FillHistogram("hJetProfile60GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1632 | FillHistogram("hJetProfile60GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1633 | FillHistogram("hJetProfile60GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1634 | FillHistogram("hJetProfile60GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1635 | FillHistogram("hJetProfile60GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1636 | FillHistogram("hJetProfile60GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1637 | FillHistogram("hJetProfile60GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1638 | FillHistogram("hJetProfile60GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1639 | FillHistogram("hJetProfile60GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1640 | FillHistogram("hJetProfile60GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1641 | FillHistogram("hJetProfile60GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1642 | } |
271cbc5d | 1643 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=50.0) |
2a82f637 | 1644 | { |
271cbc5d | 1645 | FillHistogram("hJetProfile50GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1646 | FillHistogram("hJetProfile50GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1647 | FillHistogram("hJetProfile50GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1648 | FillHistogram("hJetProfile50GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1649 | FillHistogram("hJetProfile50GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1650 | FillHistogram("hJetProfile50GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1651 | FillHistogram("hJetProfile50GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1652 | FillHistogram("hJetProfile50GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1653 | FillHistogram("hJetProfile50GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1654 | FillHistogram("hJetProfile50GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1655 | FillHistogram("hJetProfile50GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1656 | FillHistogram("hJetProfile50GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1657 | } |
271cbc5d | 1658 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=40.0) |
2a82f637 | 1659 | { |
271cbc5d | 1660 | FillHistogram("hJetProfile40GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1661 | FillHistogram("hJetProfile40GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1662 | FillHistogram("hJetProfile40GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1663 | FillHistogram("hJetProfile40GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1664 | FillHistogram("hJetProfile40GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1665 | FillHistogram("hJetProfile40GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1666 | FillHistogram("hJetProfile40GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1667 | FillHistogram("hJetProfile40GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1668 | FillHistogram("hJetProfile40GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1669 | FillHistogram("hJetProfile40GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1670 | FillHistogram("hJetProfile40GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1671 | FillHistogram("hJetProfile40GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1672 | } |
271cbc5d | 1673 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=30.0) |
2a82f637 | 1674 | { |
271cbc5d | 1675 | FillHistogram("hJetProfile30GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1676 | FillHistogram("hJetProfile30GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1677 | FillHistogram("hJetProfile30GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1678 | FillHistogram("hJetProfile30GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1679 | FillHistogram("hJetProfile30GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1680 | FillHistogram("hJetProfile30GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1681 | FillHistogram("hJetProfile30GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1682 | FillHistogram("hJetProfile30GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1683 | FillHistogram("hJetProfile30GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1684 | FillHistogram("hJetProfile30GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1685 | FillHistogram("hJetProfile30GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1686 | FillHistogram("hJetProfile30GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1687 | } |
271cbc5d | 1688 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=20.0) |
2a82f637 | 1689 | { |
271cbc5d | 1690 | FillHistogram("hJetProfile20GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1691 | FillHistogram("hJetProfile20GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1692 | FillHistogram("hJetProfile20GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1693 | FillHistogram("hJetProfile20GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1694 | FillHistogram("hJetProfile20GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1695 | FillHistogram("hJetProfile20GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1696 | FillHistogram("hJetProfile20GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1697 | FillHistogram("hJetProfile20GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1698 | FillHistogram("hJetProfile20GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1699 | FillHistogram("hJetProfile20GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1700 | FillHistogram("hJetProfile20GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1701 | FillHistogram("hJetProfile20GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1702 | } |
271cbc5d | 1703 | else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=10.0) |
2a82f637 | 1704 | { |
271cbc5d | 1705 | FillHistogram("hJetProfile10GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); |
1706 | FillHistogram("hJetProfile10GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1707 | FillHistogram("hJetProfile10GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1708 | FillHistogram("hJetProfile10GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1709 | FillHistogram("hJetProfile10GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1710 | FillHistogram("hJetProfile10GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1711 | FillHistogram("hJetProfile10GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1712 | FillHistogram("hJetProfile10GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1713 | FillHistogram("hJetProfile10GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1714 | FillHistogram("hJetProfile10GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1715 | FillHistogram("hJetProfile10GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
1716 | FillHistogram("hJetProfile10GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)); | |
2a82f637 | 1717 | } |
1718 | } | |
f800ea4e | 1719 | FillHistogram("hJetPtVsConstituentCount", tmpJet->Pt(),tmpJet->GetNumberOfTracks()); |
392aa819 | 1720 | |
2a82f637 | 1721 | if((fAnalyzeQA) && (tmpJet->Pt() >= 5.0)) |
0cb49d99 | 1722 | { |
2a82f637 | 1723 | Double_t lowestTrackPt = 1e99; |
1724 | Double_t highestTrackPt = 0.0; | |
1725 | for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++) | |
1726 | { | |
1727 | FillHistogram("hJetConstituentPt", tmpJet->TrackAt(j, fTrackArray)->Pt(), centralityPercentile); | |
1728 | // Find the lowest pT of a track in the jet | |
1729 | if (tmpJet->TrackAt(j, fTrackArray)->Pt() < lowestTrackPt) | |
1730 | lowestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt(); | |
1731 | if (tmpJet->TrackAt(j, fTrackArray)->Pt() > highestTrackPt) | |
1732 | highestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt(); | |
1733 | } | |
72aa6b04 | 1734 | FillHistogram("hJetArea", tmpJet->Area(), tmpJet->Pt()); |
2a82f637 | 1735 | // Signal jet vs. signal jet - "Combinatorial" |
1736 | for (Int_t j = i+1; j<fNumberSignalJets; j++) | |
1737 | FillHistogram("hJetDeltaPhi", GetDeltaPhi(tmpJet->Phi(), fSignalJets[j]->Phi())); | |
1738 | ||
0cb49d99 | 1739 | FillHistogram("hJetPhiEta", tmpJet->Phi(),tmpJet->Eta()); |
7e413f22 | 1740 | FillHistogram("hJetEta", tmpJet->Eta(), centralityPercentile); |
2a82f637 | 1741 | |
1742 | if(lowestTrackPt>=2.0) | |
1743 | FillHistogram("hJetEta2GeVTracks", tmpJet->Eta(), centralityPercentile); | |
1744 | if(lowestTrackPt>=4.0) | |
1745 | FillHistogram("hJetEta4GeVTracks", tmpJet->Eta(), centralityPercentile); | |
1746 | } | |
1747 | ||
1748 | ||
1749 | // Jet constituent mass analyses (for PYTHIA) | |
1750 | if (fAnalyzeMassCorrelation) | |
1751 | { | |
1752 | Double_t jetMass = 0.0; | |
1753 | Int_t constituentCount = tmpJet->GetNumberOfTracks(); | |
1754 | Int_t electronCount = 0; | |
1755 | Int_t pionCount = 0; | |
1756 | Int_t protonCount = 0; | |
1757 | Int_t kaonCount = 0; | |
1758 | Int_t othersCount = 0; | |
1759 | ||
1760 | for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++) | |
1761 | { | |
1762 | AliVParticle* tmpParticle = tmpJet->TrackAt(j, fTrackArray); | |
1763 | ||
1764 | jetMass += tmpParticle->M(); | |
1765 | if(TMath::Abs(tmpParticle->PdgCode()) == 11) // electron, positron | |
1766 | electronCount++; | |
1767 | else if(TMath::Abs(tmpParticle->PdgCode()) == 211) // p-, p+ | |
1768 | pionCount++; | |
1769 | else if(TMath::Abs(tmpParticle->PdgCode()) == 2212) // p, pbar | |
1770 | protonCount++; | |
1771 | else if(TMath::Abs(tmpParticle->PdgCode()) == 321) // kaon+,kaon- | |
1772 | kaonCount++; | |
1773 | else | |
1774 | othersCount++; | |
1775 | } | |
1776 | ||
1777 | FillHistogram("hJetMassFromConstituents", jetMass); | |
1778 | FillHistogram("hJetMass", tmpJet->M()); | |
1779 | ||
1780 | FillHistogram("hJetPtVsMass", tmpJet->Pt(), jetMass); | |
1781 | FillHistogram("hJetPtVsJetMass", tmpJet->Pt(), tmpJet->M()); | |
1782 | ||
1783 | FillHistogram("hJetPtVsProtonCount", tmpJet->Pt(), protonCount/(static_cast<Double_t>(constituentCount))); | |
1784 | FillHistogram("hJetPtVsPionCount", tmpJet->Pt(), pionCount/(static_cast<Double_t>(constituentCount))); | |
1785 | FillHistogram("hJetPtVsKaonCount", tmpJet->Pt(), kaonCount/(static_cast<Double_t>(constituentCount))); | |
1786 | FillHistogram("hJetPtVsElectronCount", tmpJet->Pt(), electronCount/(static_cast<Double_t>(constituentCount))); | |
1787 | FillHistogram("hJetPtVsOthersCount", tmpJet->Pt(), othersCount/(static_cast<Double_t>(constituentCount))); | |
1788 | FillHistogram("hJetConstituentProtonCount", protonCount); | |
1789 | FillHistogram("hJetConstituentPionCount", pionCount); | |
1790 | FillHistogram("hJetConstituentKaonCount", kaonCount); | |
1791 | FillHistogram("hJetConstituentElectronCount", electronCount); | |
1792 | FillHistogram("hJetConstituentOthersCount", othersCount); | |
1793 | ||
1794 | // Results for the "normal" jet (avoiding single particle jets) | |
1795 | if((constituentCount>=6) && (constituentCount<=14)) | |
1796 | { | |
1797 | FillHistogram("hJetPtVsMass_6_14", tmpJet->Pt(), jetMass); | |
1798 | FillHistogram("hJetPtVsJetMass_6_14", tmpJet->Pt(), tmpJet->M()); | |
1799 | ||
1800 | FillHistogram("hJetPtVsProtonCount_6_14", tmpJet->Pt(), protonCount); | |
1801 | FillHistogram("hJetPtVsPionCount_6_14", tmpJet->Pt(), pionCount); | |
1802 | FillHistogram("hJetPtVsKaonCount_6_14", tmpJet->Pt(), kaonCount); | |
1803 | FillHistogram("hJetPtVsElectronCount_6_14", tmpJet->Pt(), electronCount); | |
1804 | FillHistogram("hJetPtVsOthersCount_6_14", tmpJet->Pt(), othersCount); | |
1805 | FillHistogram("hJetConstituentProtonCount_6_14", protonCount); | |
1806 | FillHistogram("hJetConstituentPionCount_6_14", pionCount); | |
1807 | FillHistogram("hJetConstituentKaonCount_6_14", kaonCount); | |
1808 | FillHistogram("hJetConstituentElectronCount_6_14", electronCount); | |
1809 | FillHistogram("hJetConstituentOthersCount_6_14", othersCount); | |
1810 | } | |
1811 | if((constituentCount>=2)) | |
1812 | { | |
1813 | FillHistogram("hJetPtVsMass_2_X", tmpJet->Pt(), jetMass); | |
1814 | FillHistogram("hJetPtVsJetMass_2_X", tmpJet->Pt(), tmpJet->M()); | |
1815 | ||
1816 | FillHistogram("hJetPtVsProtonCount_2_X", tmpJet->Pt(), protonCount); | |
1817 | FillHistogram("hJetPtVsPionCount_2_X", tmpJet->Pt(), pionCount); | |
1818 | FillHistogram("hJetPtVsKaonCount_2_X", tmpJet->Pt(), kaonCount); | |
1819 | FillHistogram("hJetPtVsElectronCount_2_X", tmpJet->Pt(), electronCount); | |
1820 | FillHistogram("hJetPtVsOthersCount_2_X", tmpJet->Pt(), othersCount); | |
1821 | FillHistogram("hJetConstituentProtonCount_2_X", protonCount); | |
1822 | FillHistogram("hJetConstituentPionCount_2_X", pionCount); | |
1823 | FillHistogram("hJetConstituentKaonCount_2_X", kaonCount); | |
1824 | FillHistogram("hJetConstituentElectronCount_2_X", electronCount); | |
1825 | FillHistogram("hJetConstituentOthersCount_2_X", othersCount); | |
1826 | } | |
1827 | if((constituentCount>=2) && (constituentCount<=7)) | |
1828 | { | |
1829 | FillHistogram("hJetPtVsMass_2_7", tmpJet->Pt(), jetMass); | |
1830 | FillHistogram("hJetPtVsJetMass_2_7", tmpJet->Pt(), tmpJet->M()); | |
1831 | ||
1832 | FillHistogram("hJetPtVsProtonCount_2_7", tmpJet->Pt(), protonCount); | |
1833 | FillHistogram("hJetPtVsPionCount_2_7", tmpJet->Pt(), pionCount); | |
1834 | FillHistogram("hJetPtVsKaonCount_2_7", tmpJet->Pt(), kaonCount); | |
1835 | FillHistogram("hJetPtVsElectronCount_2_7", tmpJet->Pt(), electronCount); | |
1836 | FillHistogram("hJetPtVsOthersCount_2_7", tmpJet->Pt(), othersCount); | |
1837 | FillHistogram("hJetConstituentProtonCount_2_7", protonCount); | |
1838 | FillHistogram("hJetConstituentPionCount_2_7", pionCount); | |
1839 | FillHistogram("hJetConstituentKaonCount_2_7", kaonCount); | |
1840 | FillHistogram("hJetConstituentElectronCount_2_7", electronCount); | |
1841 | FillHistogram("hJetConstituentOthersCount_2_7", othersCount); | |
1842 | } | |
0cb49d99 | 1843 | } |
088fbc16 | 1844 | } |
12eb4ac1 | 1845 | } |
8628b70c | 1846 | |
12eb4ac1 | 1847 | // ### SOME JET PLOTS |
1848 | FillHistogram("hJetCountAll", fJetArray->GetEntries()); | |
1849 | FillHistogram("hJetCountAccepted", fNumberSignalJets); | |
0cb49d99 | 1850 | FillHistogram("hJetCount", fJetArray->GetEntries(), fNumberSignalJets); |
12eb4ac1 | 1851 | if (fFirstLeadingJet) |
0cb49d99 | 1852 | { |
12eb4ac1 | 1853 | FillHistogram("hLeadingJetPt", fFirstLeadingJet->Pt()); |
0cb49d99 | 1854 | FillHistogram("hCorrectedLeadingJetPt", GetCorrectedJetPt(fFirstLeadingJet,backgroundKTImprovedCMS)); |
1855 | } | |
12eb4ac1 | 1856 | if (fSecondLeadingJet) |
0cb49d99 | 1857 | { |
12eb4ac1 | 1858 | FillHistogram("hSecondLeadingJetPt", fSecondLeadingJet->Pt()); |
0cb49d99 | 1859 | FillHistogram("hCorrectedSecondLeadingJetPt", GetCorrectedJetPt(fSecondLeadingJet,backgroundKTImprovedCMS)); |
1860 | } | |
8628b70c | 1861 | } //endif AnalyzeJets |
1862 | ||
1863 | #ifdef DEBUGMODE | |
efb9b161 | 1864 | AliInfo("Calculate()::Jets done."); |
8628b70c | 1865 | #endif |
1866 | ////////////////////// NOTE: Background analysis | |
1867 | ||
1868 | if (fAnalyzeBackground) | |
1869 | { | |
088fbc16 | 1870 | // Calculate background in centrality classes |
b95d0245 | 1871 | FillHistogram("hKTBackgroundImprovedCMS", backgroundKTImprovedCMS, centralityPercentile); |
06b41974 | 1872 | FillHistogram("hKTBackgroundImprovedCMSExternal", backgroundKTImprovedCMSExternal, centralityPercentile); |
72aa6b04 | 1873 | FillHistogram("hPPBackground", backgroundPP, centralityPercentile); |
b95d0245 | 1874 | FillHistogram("hKTMeanBackgroundImprovedCMS", centralityPercentile, backgroundKTImprovedCMS); |
8628b70c | 1875 | |
b95d0245 | 1876 | if(fAnalyzeDeprecatedBackgrounds) |
1877 | { | |
1878 | FillHistogram("hKTBackgroundPbPb", backgroundKTPbPb, centralityPercentile); | |
1879 | FillHistogram("hKTBackgroundPbPbWithGhosts", backgroundKTPbPbWithGhosts, centralityPercentile); | |
1880 | FillHistogram("hKTBackgroundCMS", backgroundKTCMS, centralityPercentile); | |
1881 | FillHistogram("hKTBackgroundMean", backgroundKTMean, centralityPercentile); | |
1882 | FillHistogram("hKTBackgroundTrackLike", backgroundKTTrackLike, centralityPercentile); | |
1883 | ||
1884 | FillHistogram("hTRBackgroundNoExcl", backgroundTRNoExcl, centralityPercentile); | |
1885 | FillHistogram("hTRBackgroundCone02", backgroundTRCone02, centralityPercentile); | |
1886 | FillHistogram("hTRBackgroundCone04", backgroundTRCone04, centralityPercentile); | |
1887 | FillHistogram("hTRBackgroundCone06", backgroundTRCone06, centralityPercentile); | |
1888 | FillHistogram("hTRBackgroundCone08", backgroundTRCone08, centralityPercentile); | |
1889 | FillHistogram("hTRBackgroundExact", backgroundTRExact, centralityPercentile); | |
1890 | ||
b95d0245 | 1891 | // Calculate background profiles in terms of centrality |
1892 | FillHistogram("hKTMeanBackgroundPbPb", centralityPercentile, backgroundKTPbPb); | |
1893 | FillHistogram("hKTMeanBackgroundPbPbWithGhosts", centralityPercentile, backgroundKTPbPbWithGhosts); | |
1894 | FillHistogram("hKTMeanBackgroundCMS", centralityPercentile, backgroundKTCMS); | |
1895 | FillHistogram("hKTMeanBackgroundMean", centralityPercentile, backgroundKTMean); | |
1896 | FillHistogram("hKTMeanBackgroundTPC", centralityPercentile, backgroundKTTrackLike); | |
1897 | FillHistogram("hTRMeanBackground", centralityPercentile, backgroundTRCone06); | |
1898 | } | |
12eb4ac1 | 1899 | |
1900 | ||
1901 | // Calculate the delta pt | |
0cb49d99 | 1902 | Double_t tmpDeltaPtNoBackground = GetDeltaPt(0.0); |
1903 | Double_t tmpDeltaPtKTImprovedCMS = GetDeltaPt(backgroundKTImprovedCMS); | |
8bb0422a | 1904 | Double_t tmpDeltaPtExternalBgrd = GetDeltaPt(backgroundKTImprovedCMSExternal); |
1905 | ||
c2b0976c | 1906 | |
1907 | Double_t tmpDeltaPtKTImprovedCMSPartialExclusion = 0.0; | |
1908 | if(fNcoll) | |
1909 | tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNcoll); | |
1910 | else | |
1911 | tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0); | |
1912 | ||
1913 | Double_t tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = 0.0; | |
1914 | if(fNumberSignalJets) | |
1915 | tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNumberSignalJets); | |
1916 | else | |
1917 | tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0); | |
1918 | ||
1919 | Double_t tmpDeltaPtKTImprovedCMSFullExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0); | |
1920 | ||
0cb49d99 | 1921 | Double_t tmpDeltaPtKTPbPb = 0; |
1922 | Double_t tmpDeltaPtKTPbPbWithGhosts = 0; | |
1923 | Double_t tmpDeltaPtKTCMS = 0; | |
1924 | Double_t tmpDeltaPtKTMean = 0; | |
1925 | Double_t tmpDeltaPtKTTrackLike = 0; | |
1926 | Double_t tmpDeltaPtTR = 0; | |
088fbc16 | 1927 | |
0cb49d99 | 1928 | if(fAnalyzeDeprecatedBackgrounds) |
1929 | { | |
1930 | tmpDeltaPtKTPbPb = GetDeltaPt(backgroundKTPbPb); | |
1931 | tmpDeltaPtKTPbPbWithGhosts = GetDeltaPt(backgroundKTPbPbWithGhosts); | |
1932 | tmpDeltaPtKTCMS = GetDeltaPt(backgroundKTCMS); | |
1933 | tmpDeltaPtKTMean = GetDeltaPt(backgroundKTMean); | |
1934 | tmpDeltaPtKTTrackLike = GetDeltaPt(backgroundKTTrackLike); | |
1935 | tmpDeltaPtTR = GetDeltaPt(backgroundTRCone06); | |
1936 | } | |
12eb4ac1 | 1937 | |
1938 | // If valid, fill the delta pt histograms | |
b95d0245 | 1939 | |
8bb0422a | 1940 | if(tmpDeltaPtExternalBgrd > -10000.0) |
1941 | FillHistogram("hDeltaPtExternalBgrd", tmpDeltaPtExternalBgrd, centralityPercentile); | |
b95d0245 | 1942 | if(tmpDeltaPtKTImprovedCMS > -10000.0) |
1943 | FillHistogram("hDeltaPtKTImprovedCMS", tmpDeltaPtKTImprovedCMS, centralityPercentile); | |
392aa819 | 1944 | if(tmpDeltaPtKTImprovedCMSPartialExclusion > -10000.0) |
1945 | FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion", tmpDeltaPtKTImprovedCMSPartialExclusion, centralityPercentile); | |
c2b0976c | 1946 | if(tmpDeltaPtKTImprovedCMSPartialExclusion_Signal > -10000.0) |
1947 | FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion_Signal", tmpDeltaPtKTImprovedCMSPartialExclusion_Signal, centralityPercentile); | |
1948 | if(tmpDeltaPtKTImprovedCMSFullExclusion > -10000.0) | |
1949 | FillHistogram("hDeltaPtKTImprovedCMSFullExclusion", tmpDeltaPtKTImprovedCMSFullExclusion, centralityPercentile); | |
392aa819 | 1950 | |
0cb49d99 | 1951 | if(tmpDeltaPtNoBackground > 0.000001) |
1952 | FillHistogram("hDeltaPtNoBackgroundNoEmptyCones", tmpDeltaPtNoBackground, centralityPercentile); | |
1953 | else if(tmpDeltaPtNoBackground > -10000.0) | |
1954 | FillHistogram("hDeltaPtNoBackground", tmpDeltaPtNoBackground, centralityPercentile); | |
1955 | ||
8628b70c | 1956 | |
b95d0245 | 1957 | if(fAnalyzeDeprecatedBackgrounds) |
1958 | { | |
1959 | if(tmpDeltaPtKTPbPb > -10000.0) | |
1960 | FillHistogram("hDeltaPtKTPbPb", tmpDeltaPtKTPbPb, centralityPercentile); | |
1961 | if(tmpDeltaPtKTPbPbWithGhosts > -10000.0) | |
1962 | FillHistogram("hDeltaPtKTPbPbWithGhosts", tmpDeltaPtKTPbPbWithGhosts, centralityPercentile); | |
1963 | if(tmpDeltaPtKTCMS > -10000.0) | |
1964 | FillHistogram("hDeltaPtKTCMS", tmpDeltaPtKTCMS, centralityPercentile); | |
1965 | if(tmpDeltaPtKTMean > -10000.0) | |
1966 | FillHistogram("hDeltaPtKTMean", tmpDeltaPtKTMean, centralityPercentile); | |
1967 | if(tmpDeltaPtKTTrackLike > -10000.0) | |
1968 | FillHistogram("hDeltaPtKTTrackLike", tmpDeltaPtKTTrackLike, centralityPercentile); | |
b95d0245 | 1969 | if(tmpDeltaPtTR > -10000.0) |
1970 | FillHistogram("hDeltaPtTR", tmpDeltaPtTR, centralityPercentile); | |
1971 | } | |
8628b70c | 1972 | } |
1973 | ||
1974 | #ifdef DEBUGMODE | |
efb9b161 | 1975 | AliInfo("Calculate()::Background done."); |
8628b70c | 1976 | #endif |
12eb4ac1 | 1977 | |
0983dd5b | 1978 | #ifdef DEBUGMODE |
1979 | AliInfo("Calculate() done."); | |
1980 | #endif | |
12eb4ac1 | 1981 | } |
8628b70c | 1982 | |
1983 | //________________________________________________________________________ | |
392aa819 | 1984 | Bool_t AliAnalysisTaskChargedJetsPA::UserNotify() |
8628b70c | 1985 | { |
1986 | // Implemented Notify() to read the cross sections | |
1987 | // and number of trials from pyxsec.root | |
1988 | // | |
1989 | #ifdef DEBUGMODE | |
392aa819 | 1990 | AliInfo("UserNotify started."); |
8628b70c | 1991 | #endif |
1992 | ||
1993 | if(fAnalyzePythia) | |
1994 | { | |
1995 | TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree(); | |
1996 | TFile *currFile = tree->GetCurrentFile(); | |
1997 | ||
1998 | TString file(currFile->GetName()); | |
1999 | ||
2000 | if(file.Contains("root_archive.zip#")){ | |
2001 | Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact); | |
2002 | Ssiz_t pos = file.Index("#",1,pos1,TString::kExact); | |
2003 | file.Replace(pos+1,20,""); | |
2004 | } | |
2005 | else { | |
2006 | // not an archive take the basename.... | |
2007 | file.ReplaceAll(gSystem->BaseName(file.Data()),""); | |
2008 | } | |
8628b70c | 2009 | |
2010 | TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root | |
2011 | if(!fxsec){ | |
2012 | // next trial fetch the histgram file | |
2013 | fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root")); | |
2014 | if(!fxsec){ | |
2015 | // not a severe condition but inciate that we have no information | |
2016 | return kFALSE; | |
2017 | } | |
2018 | else{ | |
2019 | // find the tlist we want to be independtent of the name so use the Tkey | |
2020 | TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0); | |
2021 | if(!key){ | |
2022 | fxsec->Close(); | |
2023 | return kFALSE; | |
2024 | } | |
2025 | TList *list = dynamic_cast<TList*>(key->ReadObj()); | |
2026 | if(!list){ | |
2027 | fxsec->Close(); | |
2028 | return kFALSE; | |
2029 | } | |
2030 | fCrossSection = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1); | |
2031 | fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1); | |
2032 | fxsec->Close(); | |
2033 | } | |
2034 | } // no tree pyxsec.root | |
2035 | else { | |
2036 | TTree *xtree = (TTree*)fxsec->Get("Xsection"); | |
2037 | if(!xtree){ | |
2038 | fxsec->Close(); | |
2039 | return kFALSE; | |
2040 | } | |
2041 | UInt_t ntrials = 0; | |
2042 | Double_t xsection = 0; | |
2043 | xtree->SetBranchAddress("xsection",&xsection); | |
2044 | xtree->SetBranchAddress("ntrials",&ntrials); | |
2045 | xtree->GetEntry(0); | |
2046 | fTrials = ntrials; | |
2047 | fCrossSection = xsection; | |
2048 | fxsec->Close(); | |
2049 | } | |
8628b70c | 2050 | } |
0cb49d99 | 2051 | #ifdef DEBUGMODE |
2052 | AliInfo("UserNotify ended."); | |
2053 | #endif | |
8628b70c | 2054 | return kTRUE; |
2055 | } | |
2056 | ||
392aa819 | 2057 | |
12eb4ac1 | 2058 | //________________________________________________________________________ |
2059 | inline Double_t AliAnalysisTaskChargedJetsPA::EtaToTheta(Double_t arg) | |
2060 | {return 2.*atan(exp(-arg));} | |
2061 | //________________________________________________________________________ | |
2062 | inline Double_t AliAnalysisTaskChargedJetsPA::ThetaToEta(Double_t arg) | |
2063 | { | |
2064 | if ((arg > TMath::Pi()) || (arg < 0.0)) | |
2065 | { | |
2066 | AliError(Form("ThetaToEta got wrong input! (%f)", arg)); | |
2067 | return 0.0; | |
2068 | } | |
2069 | return -log(tan(arg/2.)); | |
2070 | } | |
2071 | //________________________________________________________________________ | |
2072 | inline Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPhi(Double_t phi1, Double_t phi2) | |
2073 | {return min(TMath::Abs(phi1-phi2),TMath::TwoPi() - TMath::Abs(phi1-phi2));} | |
2074 | ||
2075 | //________________________________________________________________________ | |
2076 | Double_t AliAnalysisTaskChargedJetsPA::MCGetOverlapCircleRectancle(Double_t cPosX, Double_t cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax) | |
2077 | { | |
2078 | const Int_t kTests = 1000; | |
2079 | Int_t hits = 0; | |
2080 | TRandom3 randomGen(0); | |
2081 | ||
2082 | // Loop over kTests-many tests | |
2083 | for (Int_t i=0; i<kTests; i++) | |
2084 | { | |
2085 | //Choose random position in rectangle for the tester | |
2086 | Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax); | |
2087 | Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax); | |
2088 | ||
2089 | //Check, if tester is in circle. If yes, increment circle counter. | |
2090 | Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX)*(tmpTestX - cPosX) + (tmpTestY - cPosY)*(tmpTestY - cPosY) ); | |
2091 | if(tmpDistance < cRadius) | |
2092 | hits++; | |
2093 | } | |
2094 | ||
2095 | // return ratio | |
2096 | return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests)); | |
2097 | } | |
2098 | ||
b95d0245 | 2099 | //________________________________________________________________________ |
2100 | Double_t AliAnalysisTaskChargedJetsPA::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) | |
2101 | { | |
2102 | ||
2103 | const Int_t kTests = 1000; | |
2104 | Int_t hits = 0; | |
2105 | TRandom3 randomGen(0); | |
2106 | ||
2107 | // Loop over kTests-many tests | |
2108 | for (Int_t i=0; i<kTests; i++) | |
2109 | { | |
2110 | //Choose random position in rectangle for the tester | |
2111 | Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax); | |
2112 | Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax); | |
2113 | ||
2114 | //Check, if tester is in one of the circles. If yes, increment circle counter. | |
2115 | for(Int_t j=0; j<numCircles; j++) | |
2116 | { | |
2117 | Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX[j])*(tmpTestX - cPosX[j]) + (tmpTestY - cPosY[j])*(tmpTestY - cPosY[j]) ); | |
2118 | if(tmpDistance < cRadius) | |
2119 | { | |
2120 | hits++; | |
2121 | break; | |
2122 | } | |
2123 | } | |
2124 | } | |
2125 | ||
2126 | // return ratio | |
2127 | return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests)); | |
2128 | ||
2129 | } | |
2130 | ||
8628b70c | 2131 | //________________________________________________________________________ |
2132 | inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x) | |
2133 | { | |
2134 | TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key))); | |
2135 | if(!tmpHist) | |
2136 | { | |
392aa819 | 2137 | AliError(Form("Cannot find histogram <%s> ",key)) ; |
8628b70c | 2138 | return; |
2139 | } | |
2140 | ||
2141 | tmpHist->Fill(x); | |
2142 | } | |
2143 | ||
2144 | //________________________________________________________________________ | |
2145 | inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y) | |
2146 | { | |
2147 | TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key))); | |
2148 | if(!tmpHist) | |
2149 | { | |
392aa819 | 2150 | AliError(Form("Cannot find histogram <%s> ",key)); |
8628b70c | 2151 | return; |
2152 | } | |
2153 | ||
2154 | if (tmpHist->IsA()->GetBaseClass("TH1")) | |
2155 | static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y | |
2156 | else if (tmpHist->IsA()->GetBaseClass("TH2")) | |
2157 | static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1 | |
2158 | } | |
2159 | ||
2160 | //________________________________________________________________________ | |
2161 | inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y, Double_t add) | |
2162 | { | |
2163 | TH2* tmpHist = static_cast<TH2*>(fOutputList->FindObject(GetHistoName(key))); | |
2164 | if(!tmpHist) | |
2165 | { | |
392aa819 | 2166 | AliError(Form("Cannot find histogram <%s> ",key)); |
8628b70c | 2167 | return; |
2168 | } | |
2169 | ||
2170 | tmpHist->Fill(x,y,add); | |
2171 | } | |
2172 | //________________________________________________________________________ | |
2173 | template <class T> T* AliAnalysisTaskChargedJetsPA::AddHistogram1D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, const char* xTitle, const char* yTitle) | |
2174 | { | |
2175 | T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax); | |
2176 | ||
2177 | tmpHist->GetXaxis()->SetTitle(xTitle); | |
2178 | tmpHist->GetYaxis()->SetTitle(yTitle); | |
2179 | tmpHist->SetOption(options); | |
2180 | tmpHist->SetMarkerStyle(kFullCircle); | |
2181 | tmpHist->Sumw2(); | |
2182 | ||
2183 | fHistList->Add(tmpHist); | |
2184 | fHistCount++; | |
2185 | ||
2186 | return tmpHist; | |
2187 | } | |
2188 | ||
2189 | //________________________________________________________________________ | |
2190 | template <class T> T* AliAnalysisTaskChargedJetsPA::AddHistogram2D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, const char* xTitle, const char* yTitle, const char* zTitle) | |
2191 | { | |
2192 | T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax, yBins, yMin, yMax); | |
2193 | tmpHist->GetXaxis()->SetTitle(xTitle); | |
2194 | tmpHist->GetYaxis()->SetTitle(yTitle); | |
2195 | tmpHist->GetZaxis()->SetTitle(zTitle); | |
2196 | tmpHist->SetOption(options); | |
2197 | tmpHist->SetMarkerStyle(kFullCircle); | |
2198 | tmpHist->Sumw2(); | |
2199 | ||
2200 | fHistList->Add(tmpHist); | |
2201 | fHistCount++; | |
2202 | ||
2203 | return tmpHist; | |
2204 | } | |
2205 | ||
2206 | //________________________________________________________________________ | |
2207 | void AliAnalysisTaskChargedJetsPA::Terminate(Option_t *) | |
2208 | { | |
2209 | PostData(1, fOutputList); | |
2210 | ||
2211 | // Mandatory | |
2212 | fOutputList = dynamic_cast<TList*> (GetOutputData(1)); // '1' refers to the output slot | |
2213 | if (!fOutputList) { | |
2214 | printf("ERROR: Output list not available\n"); | |
2215 | return; | |
2216 | } | |
2217 | } | |
2218 | ||
2219 | //________________________________________________________________________ | |
2220 | AliAnalysisTaskChargedJetsPA::~AliAnalysisTaskChargedJetsPA() | |
2221 | { | |
2222 | // Destructor. Clean-up the output list, but not the histograms that are put inside | |
2223 | // (the list is owner and will clean-up these histograms). Protect in PROOF case. | |
2224 | if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) { | |
2225 | delete fOutputList; | |
2226 | } | |
2227 | } | |
2228 | ||
2229 | //________________________________________________________________________ | |
2230 | void AliAnalysisTaskChargedJetsPA::UserCreateOutputObjects() | |
2231 | { | |
2232 | // called once to create user defined output objects like histograms, plots etc. | |
2233 | // and to put it on the output list. | |
2234 | // Note: Saving to file with e.g. OpenFile(0) is must be before creating other objects. | |
2235 | ||
2236 | fRandom = new TRandom3(0); | |
392aa819 | 2237 | |
2238 | ||
8628b70c | 2239 | fOutputList = new TList(); |
2240 | fOutputList->SetOwner(); // otherwise it produces leaks in merging | |
2241 | ||
2242 | PostData(1, fOutputList); | |
2243 | } | |
2244 | ||
2245 | //________________________________________________________________________ | |
2246 | void AliAnalysisTaskChargedJetsPA::UserExec(Option_t *) | |
2247 | { | |
2248 | #ifdef DEBUGMODE | |
efb9b161 | 2249 | AliInfo("UserExec() started."); |
8628b70c | 2250 | #endif |
2251 | ||
12eb4ac1 | 2252 | if (!InputEvent()) |
2253 | { | |
2254 | AliError("??? Event pointer == 0 ???"); | |
2255 | return; | |
2256 | } | |
2257 | ||
2258 | if (!fInitialized) | |
2259 | ExecOnce(); // Get tracks, jets, background from arrays if not already given + Init Histos | |
2260 | ||
8628b70c | 2261 | Calculate(InputEvent()); |
2262 | ||
2263 | PostData(1, fOutputList); | |
2264 | } |