]>
Commit | Line | Data |
---|---|---|
1705bab1 | 1 | // |
2 | // Jet mass analysis task for jets recoiling from high pT hadron | |
3 | // | |
4 | // Author: M.Verweij | |
5 | ||
6 | #include <TClonesArray.h> | |
7 | #include <TH1F.h> | |
8 | #include <TH2F.h> | |
9 | #include <TH3F.h> | |
10 | #include <THnSparse.h> | |
11 | #include <TList.h> | |
12 | #include <TLorentzVector.h> | |
13 | #include <TProfile.h> | |
14 | #include <TChain.h> | |
15 | #include <TSystem.h> | |
16 | #include <TFile.h> | |
17 | #include <TKey.h> | |
f887e746 | 18 | #include <TArrayI.h> |
19 | #include <TArrayF.h> | |
20 | #include <TRandom3.h> | |
1705bab1 | 21 | |
22 | #include "AliVCluster.h" | |
23 | #include "AliVTrack.h" | |
24 | #include "AliEmcalJet.h" | |
25 | #include "AliRhoParameter.h" | |
26 | #include "AliLog.h" | |
27 | #include "AliEmcalParticle.h" | |
28 | #include "AliAnalysisManager.h" | |
29 | #include "AliJetContainer.h" | |
30 | #include "AliParticleContainer.h" | |
31 | ||
32 | #include "AliAODEvent.h" | |
33 | ||
34 | #include "AliAnalysisTaskEmcalHJetMass.h" | |
35 | ||
f887e746 | 36 | ClassImp(EmcalHJetMassAnalysis::AliAnalysisTaskEmcalHJetMass) |
37 | ||
38 | namespace EmcalHJetMassAnalysis { | |
39 | ||
40 | //________________________________________________________________________ | |
41 | AliAnalysisTaskEmcalHJetMass::AliAnalysisTaskEmcalHJetMass() : | |
42 | AliAnalysisTaskEmcalJet("AliAnalysisTaskEmcalHJetMass", kTRUE), | |
43 | fContainerBase(0), | |
44 | fContainerUnsub(1), | |
45 | fMinFractionShared(0), | |
46 | fUseUnsubJet(0), | |
47 | fJetMassType(kRaw), | |
48 | fDPhiHJetMax(0.6), | |
49 | fTriggerTrackType(kInclusive), | |
50 | fPtTTMin(0), | |
51 | fPtTTMax(0), | |
52 | fRandom(0), | |
91f30f7e | 53 | fEmbConstSel(0), |
c5925446 | 54 | fMarkMCLabel(-1), |
f887e746 | 55 | fh1PtHadron(0), |
c5925446 | 56 | fh1PtHadronMatch(0), |
f887e746 | 57 | fh3PtHPtJDPhi(0), |
58 | fh3PtJet1VsMassVsHPtAllSel(0), | |
700200be | 59 | fh3PtJet1VsMassVsHPtAllSelMatch(0), |
f887e746 | 60 | fh3PtJet1VsMassVsHPtTagged(0), |
61 | fh3PtJet1VsMassVsHPtTaggedMatch(0), | |
62 | fh3PtJet1VsRatVsHPtAllSel(0), | |
700200be | 63 | fh3PtJet1VsRatVsHPtAllSelMatch(0), |
f887e746 | 64 | fh3PtJet1VsRatVsHPtTagged(0), |
65 | fh3PtJet1VsRatVsHPtTaggedMatch(0) | |
66 | { | |
67 | // Default constructor. | |
68 | ||
69 | fh1PtHadron = new TH1F*[fNcentBins]; | |
c5925446 | 70 | fh1PtHadronMatch = new TH1F*[fNcentBins]; |
f887e746 | 71 | fh3PtHPtJDPhi = new TH3F*[fNcentBins]; |
72 | fh3PtJet1VsMassVsHPtAllSel = new TH3F*[fNcentBins]; | |
700200be | 73 | fh3PtJet1VsMassVsHPtAllSelMatch = new TH3F*[fNcentBins]; |
f887e746 | 74 | fh3PtJet1VsMassVsHPtTagged = new TH3F*[fNcentBins]; |
75 | fh3PtJet1VsMassVsHPtTaggedMatch = new TH3F*[fNcentBins]; | |
76 | fh3PtJet1VsRatVsHPtAllSel = new TH3F*[fNcentBins]; | |
700200be | 77 | fh3PtJet1VsRatVsHPtAllSelMatch = new TH3F*[fNcentBins]; |
f887e746 | 78 | fh3PtJet1VsRatVsHPtTagged = new TH3F*[fNcentBins]; |
79 | fh3PtJet1VsRatVsHPtTaggedMatch = new TH3F*[fNcentBins]; | |
80 | ||
81 | for (Int_t i = 0; i < fNcentBins; i++) { | |
82 | fh1PtHadron[i] = 0; | |
c5925446 | 83 | fh1PtHadronMatch[i] = 0; |
f887e746 | 84 | fh3PtHPtJDPhi[i] = 0; |
85 | fh3PtJet1VsMassVsHPtAllSel[i] = 0; | |
700200be | 86 | fh3PtJet1VsMassVsHPtAllSelMatch[i] = 0; |
f887e746 | 87 | fh3PtJet1VsMassVsHPtTagged[i] = 0; |
88 | fh3PtJet1VsMassVsHPtTaggedMatch[i] = 0; | |
89 | fh3PtJet1VsRatVsHPtAllSel[i] = 0; | |
700200be | 90 | fh3PtJet1VsRatVsHPtAllSelMatch[i] = 0; |
f887e746 | 91 | fh3PtJet1VsRatVsHPtTagged[i] = 0; |
92 | fh3PtJet1VsRatVsHPtTaggedMatch[i] = 0; | |
93 | } | |
1705bab1 | 94 | |
f887e746 | 95 | fPtTTMin = new TArrayF(); |
96 | fPtTTMax = new TArrayF(); | |
1705bab1 | 97 | |
f887e746 | 98 | SetMakeGeneralHistograms(kTRUE); |
1705bab1 | 99 | } |
100 | ||
f887e746 | 101 | //________________________________________________________________________ |
102 | AliAnalysisTaskEmcalHJetMass::AliAnalysisTaskEmcalHJetMass(const char *name) : | |
103 | AliAnalysisTaskEmcalJet(name, kTRUE), | |
104 | fContainerBase(0), | |
105 | fContainerUnsub(1), | |
106 | fMinFractionShared(0), | |
107 | fUseUnsubJet(0), | |
108 | fJetMassType(kRaw), | |
109 | fDPhiHJetMax(0.6), | |
110 | fTriggerTrackType(kInclusive), | |
111 | fPtTTMin(0), | |
112 | fPtTTMax(0), | |
113 | fRandom(0), | |
91f30f7e | 114 | fEmbConstSel(0), |
c5925446 | 115 | fMarkMCLabel(-1), |
f887e746 | 116 | fh1PtHadron(0), |
c5925446 | 117 | fh1PtHadronMatch(0), |
f887e746 | 118 | fh3PtHPtJDPhi(0), |
119 | fh3PtJet1VsMassVsHPtAllSel(0), | |
700200be | 120 | fh3PtJet1VsMassVsHPtAllSelMatch(0), |
f887e746 | 121 | fh3PtJet1VsMassVsHPtTagged(0), |
122 | fh3PtJet1VsMassVsHPtTaggedMatch(0), | |
123 | fh3PtJet1VsRatVsHPtAllSel(0), | |
700200be | 124 | fh3PtJet1VsRatVsHPtAllSelMatch(0), |
f887e746 | 125 | fh3PtJet1VsRatVsHPtTagged(0), |
126 | fh3PtJet1VsRatVsHPtTaggedMatch(0) | |
127 | { | |
128 | // Standard constructor. | |
129 | ||
130 | fh1PtHadron = new TH1F*[fNcentBins]; | |
c5925446 | 131 | fh1PtHadronMatch = new TH1F*[fNcentBins]; |
f887e746 | 132 | fh3PtHPtJDPhi = new TH3F*[fNcentBins]; |
133 | fh3PtJet1VsMassVsHPtAllSel = new TH3F*[fNcentBins]; | |
700200be | 134 | fh3PtJet1VsMassVsHPtAllSelMatch = new TH3F*[fNcentBins]; |
f887e746 | 135 | fh3PtJet1VsMassVsHPtTagged = new TH3F*[fNcentBins]; |
136 | fh3PtJet1VsMassVsHPtTaggedMatch = new TH3F*[fNcentBins]; | |
137 | fh3PtJet1VsRatVsHPtAllSel = new TH3F*[fNcentBins]; | |
700200be | 138 | fh3PtJet1VsRatVsHPtAllSelMatch = new TH3F*[fNcentBins]; |
f887e746 | 139 | fh3PtJet1VsRatVsHPtTagged = new TH3F*[fNcentBins]; |
140 | fh3PtJet1VsRatVsHPtTaggedMatch = new TH3F*[fNcentBins]; | |
141 | ||
142 | for (Int_t i = 0; i < fNcentBins; i++) { | |
143 | fh1PtHadron[i] = 0; | |
c5925446 | 144 | fh1PtHadronMatch[i] = 0; |
f887e746 | 145 | fh3PtHPtJDPhi[i] = 0; |
146 | fh3PtJet1VsMassVsHPtAllSel[i] = 0; | |
700200be | 147 | fh3PtJet1VsMassVsHPtAllSelMatch[i] = 0; |
f887e746 | 148 | fh3PtJet1VsMassVsHPtTagged[i] = 0; |
149 | fh3PtJet1VsMassVsHPtTaggedMatch[i] = 0; | |
150 | fh3PtJet1VsRatVsHPtAllSel[i] = 0; | |
700200be | 151 | fh3PtJet1VsRatVsHPtAllSelMatch[i] = 0; |
f887e746 | 152 | fh3PtJet1VsRatVsHPtTagged[i] = 0; |
153 | fh3PtJet1VsRatVsHPtTaggedMatch[i] = 0; | |
154 | } | |
1705bab1 | 155 | |
f887e746 | 156 | fPtTTMin = new TArrayF(); |
157 | fPtTTMax = new TArrayF(); | |
1705bab1 | 158 | |
f887e746 | 159 | SetMakeGeneralHistograms(kTRUE); |
160 | } | |
ad3928e3 | 161 | |
f887e746 | 162 | //________________________________________________________________________ |
163 | AliAnalysisTaskEmcalHJetMass::~AliAnalysisTaskEmcalHJetMass() | |
164 | { | |
165 | // Destructor. | |
1705bab1 | 166 | |
f887e746 | 167 | if(fRandom) delete fRandom; |
168 | if(fPtTTMin) delete fPtTTMin; | |
169 | if(fPtTTMax) delete fPtTTMax; | |
170 | } | |
ad3928e3 | 171 | |
f887e746 | 172 | //________________________________________________________________________ |
173 | void AliAnalysisTaskEmcalHJetMass::UserCreateOutputObjects() | |
174 | { | |
175 | // Create user output. | |
176 | ||
177 | AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); | |
178 | ||
179 | Bool_t oldStatus = TH1::AddDirectoryStatus(); | |
180 | TH1::AddDirectory(kFALSE); | |
181 | ||
182 | const Int_t nBinsPt = 200; | |
183 | const Double_t minPt = -50.; | |
184 | const Double_t maxPt = 150.; | |
185 | ||
c5925446 | 186 | const Int_t nBinsM = 90; |
187 | const Double_t minM = -10.; | |
f887e746 | 188 | const Double_t maxM = 80.; |
189 | ||
190 | const Int_t nBinsR = 100; | |
191 | const Double_t minR = -0.2; | |
192 | const Double_t maxR = 0.8; | |
193 | ||
194 | const Int_t nBinsPtH = 100; | |
195 | const Double_t minPtH = 0.; | |
196 | const Double_t maxPtH = 100.; | |
197 | ||
198 | const Int_t nBinsPhi = 18*4; | |
199 | const Double_t minPhi = -0.5*TMath::Pi(); | |
200 | const Double_t maxPhi = 1.5*TMath::Pi(); | |
201 | ||
202 | TString histName = ""; | |
203 | TString histTitle = ""; | |
204 | for (Int_t i = 0; i < fNcentBins; i++) { | |
205 | histName = TString::Format("fh1PtHadron_%d",i); | |
206 | histTitle = TString::Format("%s;#it{p}_{T,h}",histName.Data()); | |
207 | fh1PtHadron[i] = new TH1F(histName.Data(),histTitle.Data(),200.,0.,200.); | |
208 | fOutput->Add(fh1PtHadron[i]); | |
209 | ||
c5925446 | 210 | histName = TString::Format("fh1PtHadronMatch_%d",i); |
211 | histTitle = TString::Format("%s;#it{p}_{T,h}",histName.Data()); | |
212 | fh1PtHadronMatch[i] = new TH1F(histName.Data(),histTitle.Data(),200.,0.,200.); | |
213 | fOutput->Add(fh1PtHadronMatch[i]); | |
214 | ||
f887e746 | 215 | histName = TString::Format("fh3PtHPtJDPhi_%d",i); |
216 | histTitle = TString::Format("%s;#it{p}_{T,h};#it{p}_{T,jet};#Delta#varphi_{h,jet}",histName.Data()); | |
217 | fh3PtHPtJDPhi[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPtH,minPtH,maxPtH,nBinsPt,minPt,maxPt,nBinsPhi,minPhi,maxPhi); | |
218 | fOutput->Add(fh3PtHPtJDPhi[i]); | |
219 | ||
220 | histName = TString::Format("fh3PtJet1VsMassVsHPtAllSel_%d",i); | |
221 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,h}",histName.Data()); | |
222 | fh3PtJet1VsMassVsHPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,nBinsPtH,minPtH,maxPtH); | |
223 | fOutput->Add(fh3PtJet1VsMassVsHPtAllSel[i]); | |
224 | ||
700200be | 225 | histName = TString::Format("fh3PtJet1VsMassVsHPtAllSelMatch_%d",i); |
226 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,h}",histName.Data()); | |
227 | fh3PtJet1VsMassVsHPtAllSelMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,nBinsPtH,minPtH,maxPtH); | |
228 | fOutput->Add(fh3PtJet1VsMassVsHPtAllSelMatch[i]); | |
229 | ||
f887e746 | 230 | histName = TString::Format("fh3PtJet1VsMassVsHPtTagged_%d",i); |
231 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,h}",histName.Data()); | |
232 | fh3PtJet1VsMassVsHPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,nBinsPtH,minPtH,maxPtH); | |
233 | fOutput->Add(fh3PtJet1VsMassVsHPtTagged[i]); | |
234 | ||
235 | histName = TString::Format("fh3PtJet1VsMassVsHPtTaggedMatch_%d",i); | |
236 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,h}",histName.Data()); | |
237 | fh3PtJet1VsMassVsHPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,nBinsPtH,minPtH,maxPtH); | |
238 | fOutput->Add(fh3PtJet1VsMassVsHPtTaggedMatch[i]); | |
239 | ||
240 | // | |
241 | histName = TString::Format("fh3PtJet1VsRatVsHPtAllSel_%d",i); | |
242 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,h}",histName.Data()); | |
243 | fh3PtJet1VsRatVsHPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,nBinsPtH,minPtH,maxPtH); | |
244 | fOutput->Add(fh3PtJet1VsRatVsHPtAllSel[i]); | |
245 | ||
700200be | 246 | histName = TString::Format("fh3PtJet1VsRatVsHPtAllSelMatch_%d",i); |
247 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,h}",histName.Data()); | |
248 | fh3PtJet1VsRatVsHPtAllSelMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,nBinsPtH,minPtH,maxPtH); | |
249 | fOutput->Add(fh3PtJet1VsRatVsHPtAllSelMatch[i]); | |
250 | ||
f887e746 | 251 | histName = TString::Format("fh3PtJet1VsRatVsHPtTagged_%d",i); |
252 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,h}",histName.Data()); | |
253 | fh3PtJet1VsRatVsHPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,nBinsPtH,minPtH,maxPtH); | |
254 | fOutput->Add(fh3PtJet1VsRatVsHPtTagged[i]); | |
255 | ||
256 | histName = TString::Format("fh3PtJet1VsRatVsHPtTaggedMatch_%d",i); | |
257 | histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,h}",histName.Data()); | |
258 | fh3PtJet1VsRatVsHPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,nBinsPtH,minPtH,maxPtH); | |
259 | fOutput->Add(fh3PtJet1VsRatVsHPtTaggedMatch[i]); | |
260 | } | |
1705bab1 | 261 | |
f887e746 | 262 | TH1::AddDirectory(oldStatus); |
1705bab1 | 263 | |
f887e746 | 264 | fRandom = new TRandom3(0); |
1705bab1 | 265 | |
f887e746 | 266 | PostData(1, fOutput); // Post data for ALL output slots > 0 here. |
1705bab1 | 267 | } |
268 | ||
f887e746 | 269 | //________________________________________________________________________ |
270 | Bool_t AliAnalysisTaskEmcalHJetMass::Run() | |
271 | { | |
272 | // Run analysis code here, if needed. It will be executed before FillHistograms(). | |
273 | ||
274 | AliParticleContainer *pCont = GetParticleContainer(0); | |
275 | AliJetContainer *jCont = GetJetContainer(fContainerBase); | |
276 | if(!pCont || !jCont) return kFALSE; | |
277 | ||
278 | AliVParticle *vp = NULL; | |
279 | ||
280 | if(fTriggerTrackType==kInclusive) { | |
281 | pCont->ResetCurrentID(); | |
282 | while((vp = pCont->GetNextAcceptParticle())) { | |
283 | fh1PtHadron[fCentBin]->Fill(vp->Pt()); //all hadrons | |
c5925446 | 284 | if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel ) |
285 | fh1PtHadronMatch[fCentBin]->Fill(vp->Pt()); //hadrons matched to MC | |
f887e746 | 286 | AliEmcalJet* jet = NULL; |
287 | if(jCont) { | |
288 | jCont->ResetCurrentID(); | |
289 | while((jet = jCont->GetNextAcceptJet())) { | |
290 | Double_t dphi = GetDeltaPhi(vp,jet)-TMath::Pi(); | |
291 | fh3PtHPtJDPhi[fCentBin]->Fill(vp->Pt(),jet->Pt() - GetRhoVal(fContainerBase)*jet->Area(),dphi); | |
292 | if(dphi>fDPhiHJetMax) continue; | |
91f30f7e | 293 | FillHJetHistograms(vp,jet); |
f887e746 | 294 | } |
295 | } | |
296 | } | |
297 | } | |
298 | else if(fTriggerTrackType==kSingleInclusive) { | |
700200be | 299 | for(Int_t it = 0; it<fPtTTMin->GetSize(); it++) { |
300 | vp = GetSingleInclusiveTT(pCont,fPtTTMin->At(it),fPtTTMax->At(it)); | |
301 | if(!vp) continue; | |
302 | fh1PtHadron[fCentBin]->Fill(vp->Pt()); //all trigger tracks | |
c5925446 | 303 | if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel ) |
304 | fh1PtHadronMatch[fCentBin]->Fill(vp->Pt()); //hadrons matched to MC | |
700200be | 305 | AliEmcalJet* jet = NULL; |
306 | jCont->ResetCurrentID(); | |
307 | while((jet = jCont->GetNextAcceptJet())) { | |
308 | Double_t dphi = GetDeltaPhi(vp,jet)-TMath::Pi(); | |
309 | fh3PtHPtJDPhi[fCentBin]->Fill(vp->Pt(),jet->Pt() - GetRhoVal(fContainerBase)*jet->Area(),dphi); | |
310 | if(dphi>fDPhiHJetMax) continue; | |
91f30f7e | 311 | FillHJetHistograms(vp,jet); |
700200be | 312 | } |
313 | }//trigger track types | |
1705bab1 | 314 | } |
f887e746 | 315 | return kTRUE; |
1705bab1 | 316 | } |
1705bab1 | 317 | |
700200be | 318 | //________________________________________________________________________ |
319 | AliVParticle* AliAnalysisTaskEmcalHJetMass::GetSingleInclusiveTT(AliParticleContainer *pCont, Double_t ptmin, Double_t ptmax) const { | |
320 | AliVParticle *vp; | |
321 | TArrayI arr; arr.Set(pCont->GetNParticles()); | |
322 | arr.Reset(); | |
323 | Int_t counter = -1; | |
324 | pCont->ResetCurrentID(); | |
325 | while((vp = pCont->GetNextAcceptParticle())) { | |
326 | if(vp->Pt()>=ptmin && vp->Pt()<ptmax ) { | |
327 | counter++; | |
328 | arr.SetAt(pCont->GetCurrentID(),counter); | |
329 | } | |
330 | } | |
331 | if(counter<0) return NULL; | |
332 | //select trigger track randomly | |
333 | fRandom->SetSeed(arr.At(0)); //random selection reproducible | |
334 | Double_t rnd = fRandom->Uniform() * counter; | |
335 | Int_t trigID = arr.At(TMath::FloorNint(rnd)); | |
336 | vp = pCont->GetParticle(trigID); | |
337 | return vp; | |
338 | } | |
339 | ||
f887e746 | 340 | //________________________________________________________________________ |
91f30f7e | 341 | Bool_t AliAnalysisTaskEmcalHJetMass::FillHJetHistograms(const AliVParticle *vp, const AliEmcalJet *jet) |
f887e746 | 342 | { |
343 | // Fill hadron-jet histograms. | |
91f30f7e | 344 | Double_t pt = vp->Pt(); |
f887e746 | 345 | Double_t ptJet = jet->Pt() - GetRhoVal(fContainerBase)*jet->Area(); |
346 | Double_t mJet = GetJetMass(jet); | |
347 | Double_t rat = -1.; | |
348 | if(ptJet<0. || ptJet>0.) rat = mJet/ptJet; | |
349 | ||
350 | fh3PtJet1VsMassVsHPtAllSel[fCentBin]->Fill(ptJet,mJet,pt); | |
351 | fh3PtJet1VsRatVsHPtAllSel[fCentBin]->Fill(ptJet,rat,pt); | |
352 | ||
f7eb9904 | 353 | Double_t fraction = 1.; |
f887e746 | 354 | if(fUseUnsubJet) { |
355 | AliEmcalJet *jetUS = NULL; | |
356 | AliJetContainer *jetContUS = GetJetContainer(fContainerUnsub); | |
357 | Int_t ifound = 0; | |
358 | Int_t ilab = -1; | |
359 | for(Int_t i = 0; i<jetContUS->GetNJets(); i++) { | |
360 | jetUS = jetContUS->GetJet(i); | |
361 | if(jetUS->GetLabel()==jet->GetLabel()) { | |
362 | ifound++; | |
363 | if(ifound==1) ilab = i; | |
364 | } | |
1705bab1 | 365 | } |
f887e746 | 366 | if(ifound>1) AliDebug(2,Form("Found %d partners",ifound)); |
367 | if(ifound==0) jetUS = 0x0; | |
368 | else jetUS = jetContUS->GetJet(ilab); | |
369 | fraction = jetContUS->GetFractionSharedPt(jetUS); | |
370 | } else { | |
371 | AliJetContainer *jetCont = GetJetContainer(fContainerBase); | |
372 | fraction = jetCont->GetFractionSharedPt(jet); | |
1705bab1 | 373 | } |
f7eb9904 | 374 | |
375 | Bool_t mcMatch = kFALSE; | |
376 | if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel ) mcMatch = kTRUE; | |
377 | if(fMinFractionShared>0. && fraction>fMinFractionShared) mcMatch = kTRUE; | |
378 | else mcMatch = kFALSE; | |
379 | ||
380 | if(mcMatch) { | |
91f30f7e | 381 | fh3PtJet1VsMassVsHPtAllSelMatch[fCentBin]->Fill(ptJet,mJet,pt); |
382 | fh3PtJet1VsRatVsHPtAllSelMatch[fCentBin]->Fill(ptJet,rat,pt); | |
700200be | 383 | } |
384 | ||
385 | if(jet->GetTagStatus()<1 || !jet->GetTaggedJet()) | |
386 | return kFALSE; | |
387 | ||
388 | fh3PtJet1VsMassVsHPtTagged[fCentBin]->Fill(ptJet,mJet,pt); | |
389 | fh3PtJet1VsRatVsHPtTagged[fCentBin]->Fill(ptJet,rat,pt); | |
390 | ||
f7eb9904 | 391 | if(mcMatch) { |
91f30f7e | 392 | fh3PtJet1VsMassVsHPtTaggedMatch[fCentBin]->Fill(ptJet,mJet,pt); |
393 | fh3PtJet1VsRatVsHPtTaggedMatch[fCentBin]->Fill(ptJet,rat,pt); | |
f887e746 | 394 | } |
395 | return kTRUE; | |
1705bab1 | 396 | } |
1705bab1 | 397 | |
f887e746 | 398 | //________________________________________________________________________ |
399 | Double_t AliAnalysisTaskEmcalHJetMass::GetJetMass(const AliEmcalJet *jet) const { | |
400 | //calc subtracted jet mass | |
401 | if(fJetMassType==kRaw) | |
402 | return jet->M(); | |
403 | else if(fJetMassType==kDeriv) | |
404 | return jet->GetSecondOrderSubtracted(); | |
1705bab1 | 405 | |
f887e746 | 406 | return 0; |
407 | } | |
1705bab1 | 408 | |
f887e746 | 409 | //________________________________________________________________________ |
410 | Double_t AliAnalysisTaskEmcalHJetMass::GetDeltaPhi(const AliVParticle *vp, const AliEmcalJet* jet) const { | |
411 | // Calculate azimuthal angle between particle and jet. range:[-0.5\pi,1.5\pi] | |
412 | return GetDeltaPhi(vp->Phi(),jet->Phi()); | |
413 | } | |
1705bab1 | 414 | |
f887e746 | 415 | //________________________________________________________________________ |
416 | Double_t AliAnalysisTaskEmcalHJetMass::GetDeltaPhi(Double_t phi1, Double_t phi2) const { | |
417 | // Calculate azimuthal angle between phi1 and phi2. range:[-0.5\pi,1.5\pi] | |
418 | Double_t dPhi = phi1-phi2; | |
419 | if(dPhi <-0.5*TMath::Pi()) dPhi += TMath::TwoPi(); | |
420 | if(dPhi > 1.5*TMath::Pi()) dPhi -= TMath::TwoPi(); | |
421 | return dPhi; | |
422 | } | |
1705bab1 | 423 | |
424 | ||
f887e746 | 425 | //________________________________________________________________________ |
426 | Bool_t AliAnalysisTaskEmcalHJetMass::RetrieveEventObjects() { | |
427 | // | |
428 | // retrieve event objects | |
429 | // | |
430 | if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) | |
431 | return kFALSE; | |
432 | ||
433 | return kTRUE; | |
434 | } | |
1705bab1 | 435 | |
f887e746 | 436 | //________________________________________________________________________ |
437 | void AliAnalysisTaskEmcalHJetMass::AddTriggerTrackPtCuts(Float_t min, Float_t max) { | |
438 | if(!fPtTTMin) fPtTTMin = new TArrayF(); | |
439 | if(!fPtTTMax) fPtTTMax = new TArrayF(); | |
440 | Int_t newSize = fPtTTMin->GetSize()+1; | |
441 | fPtTTMin->Set(newSize); | |
442 | fPtTTMax->Set(newSize); | |
443 | fPtTTMin->AddAt(min,newSize-1); | |
444 | fPtTTMax->AddAt(max,newSize-1); | |
445 | } | |
1705bab1 | 446 | |
f887e746 | 447 | //_______________________________________________________________________ |
448 | void AliAnalysisTaskEmcalHJetMass::Terminate(Option_t *) | |
449 | { | |
450 | // Called once at the end of the analysis. | |
451 | } | |
1705bab1 | 452 | } |
453 |