2 // Dijet analysis task.
6 #include <TClonesArray.h>
10 #include <THnSparse.h>
12 #include <TLorentzVector.h>
19 #include "AliVCluster.h"
20 #include "AliVTrack.h"
21 #include "AliEmcalJet.h"
22 #include "AliRhoParameter.h"
24 #include "AliAnalysisUtils.h"
25 #include "AliEmcalParticle.h"
26 #include "AliMCEvent.h"
27 #include "AliGenPythiaEventHeader.h"
28 #include "AliAODMCHeader.h"
29 #include "AliMCEvent.h"
30 #include "AliAnalysisManager.h"
31 #include "AliJetContainer.h"
32 #include "AliCentrality.h"
34 #include "AliAnalysisTaskEmcalDiJetAna.h"
36 ClassImp(AliAnalysisTaskEmcalDiJetAna)
38 //________________________________________________________________________
39 AliAnalysisTaskEmcalDiJetAna::AliAnalysisTaskEmcalDiJetAna() :
40 AliAnalysisTaskEmcalDiJetBase("AliAnalysisTaskEmcalDiJetAna"),
41 fDoMatchFullCharged(kTRUE),
44 fh3PtEtaPhiJetFull(0),
45 fh3PtEtaPhiJetCharged(0),
48 fhnDiJetVarsFullCharged(0),
49 fhnMatchingFullCharged(0),
50 fh3JetPtFullFractionDR(0)
52 // Default constructor.
54 for(Int_t i=0; i<4; i++) {
55 fh3DiJetKtNEFPtAssoc[i] = 0;
56 fCentCorrPtAssocCh[i] = 0;
57 fCentCorrPtAssocFuCh[i] = 0;
58 fAjPtAssocCentCh[i] = 0;
59 fAjPtAssocCentFuCh[i] = 0;
62 SetMakeGeneralHistograms(kTRUE);
65 //________________________________________________________________________
66 AliAnalysisTaskEmcalDiJetAna::AliAnalysisTaskEmcalDiJetAna(const char *name) :
67 AliAnalysisTaskEmcalDiJetBase(name),
68 fDoMatchFullCharged(kTRUE),
71 fh3PtEtaPhiJetFull(0),
72 fh3PtEtaPhiJetCharged(0),
75 fhnDiJetVarsFullCharged(0),
76 fhnMatchingFullCharged(0),
77 fh3JetPtFullFractionDR(0)
79 // Standard constructor.
81 for(Int_t i=0; i<4; i++) {
82 fh3DiJetKtNEFPtAssoc[i] = 0;
83 fCentCorrPtAssocCh[i] = 0;
84 fCentCorrPtAssocFuCh[i] = 0;
85 fAjPtAssocCentCh[i] = 0;
86 fAjPtAssocCentFuCh[i] = 0;
89 SetMakeGeneralHistograms(kTRUE);
92 //________________________________________________________________________
93 AliAnalysisTaskEmcalDiJetAna::~AliAnalysisTaskEmcalDiJetAna()
98 //________________________________________________________________________
99 Bool_t AliAnalysisTaskEmcalDiJetAna::RetrieveEventObjects() {
101 // retrieve event objects
104 if (!AliAnalysisTaskEmcalDiJetBase::RetrieveEventObjects())
110 //________________________________________________________________________
111 void AliAnalysisTaskEmcalDiJetAna::UserCreateOutputObjects()
113 // Create user output.
117 AliAnalysisTaskEmcalDiJetBase::UserCreateOutputObjects();
119 Bool_t oldStatus = TH1::AddDirectoryStatus();
120 TH1::AddDirectory(kFALSE);
122 const Int_t nBinsCent = 100;
123 Double_t minCent = 0.;
124 Double_t maxCent = 100.;
126 const Int_t nBinsRho = 200;
127 Double_t minRho = 0.;
128 Double_t maxRho = 20.;
129 fh2CentRhoCh = new TH2F("fh2CentRhoCh","fh2CentRhoCh;centrality;#rho_{ch}",nBinsCent,minCent,maxCent,nBinsRho,minRho,maxRho);
130 fOutput->Add(fh2CentRhoCh);
131 fh2CentRhoScaled = new TH2F("fh2CentRhoScaled","fh2CentRhoScaled;centrality;s_{EMC}#rho_{ch}",nBinsCent,minCent,maxCent,nBinsRho,minRho,maxRho);
132 fOutput->Add(fh2CentRhoScaled);
134 const Int_t nBinsPt = 150;
135 Double_t minPt = -20.;
136 Double_t maxPt = 130.;
137 const Int_t nBinsEta = 40;
138 Double_t minEta = -1.;
139 Double_t maxEta = 1.;
140 const Int_t nBinsPhi = 18*6;
141 Double_t minPhi = 0.;
142 Double_t maxPhi = TMath::TwoPi();
144 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
145 fOutput->Add(fh3PtEtaPhiJetFull);
147 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
148 fOutput->Add(fh3PtEtaPhiJetCharged);
150 const Int_t nBinsSparse0 = 7;
151 const Int_t nBinsPtW = 30;
152 const Int_t nBinsDPhi = 72;
153 const Int_t nBinsKt = 50;
154 const Int_t nBinsDiJetEta = 40;
155 const Int_t nBinsCentr = fNcentBins;
156 const Int_t nBinsAj = 50;
157 const Int_t nBins0[nBinsSparse0] = {nBinsPtW,nBinsPtW,nBinsDPhi,nBinsKt,nBinsDiJetEta,nBinsCentr,nBinsAj};
158 //pT1, pT2, deltaPhi, kT
159 const Double_t xmin0[nBinsSparse0] = { minPt, minPt, -0.5*TMath::Pi(), 0.,-1.,0. , 0.};
160 const Double_t xmax0[nBinsSparse0] = { maxPt, maxPt, 1.5*TMath::Pi(), 100., 1.,100., 1.};
161 const Double_t centArrayBins[8] = {0.,2.,5.,10.,20.,40.,60.,100.};
163 if(fDoChargedCharged) {
164 fhnDiJetVarsCh = new THnSparseF("fhnDiJetVarsCh",
165 "fhnDiJetVarsCh;#it{p}_{T,1} (GeV/#it{c});#it{p}_{T,2} (GeV/#it{c});#Delta#varphi;#it{k}_{T} = #it{p}_{T,1}sin(#Delta#varphi) (GeV/#it{c});(#eta_{1}+#eta_{2})/2);centrality;#it{A}_{j}",
166 nBinsSparse0,nBins0,xmin0,xmax0);
167 if(fNcentBins==7) fhnDiJetVarsCh->SetBinEdges(5,centArrayBins);
168 fOutput->Add(fhnDiJetVarsCh);
172 fhnDiJetVarsFullCharged = new THnSparseF("fhnDiJetVarsFullCharged",
173 "fhnDiJetVarsFullCharged;#it{p}_{T,1} (GeV/#it{c});#it{p}_{T,2} (GeV/#it{c});#Delta#varphi;#it{k}_{T} = #it{p}_{T,1}sin(#Delta#varphi) (GeV/#it{c});(#eta_{1}+#eta_{2})/2);centrality;#it{A}_{j}",
174 nBinsSparse0,nBins0,xmin0,xmax0);
175 if(fNcentBins==7) fhnDiJetVarsFullCharged->SetBinEdges(5,centArrayBins);
176 fOutput->Add(fhnDiJetVarsFullCharged);
180 fhnDiJetVarsFull = new THnSparseF("fhnDiJetVarsFull",
181 "fhnDiJetVarsFull;#it{p}_{T,1} (GeV/#it{c});#it{p}_{T,2} (GeV/#it{c});#Delta#varphi;#it{k}_{T} = #it{p}_{T,1}sin(#Delta#varphi) (GeV/#it{c});(#eta_{1}+#eta_{2})/2);centrality;#it{A}_{j}",
182 nBinsSparse0,nBins0,xmin0,xmax0);
183 fOutput->Add(fhnDiJetVarsFull);
186 for(Int_t i=0; i<4; i++) {
187 TString histoName = Form("fh3DiJetKtNEFPtAssoc_TrigBin%d",i);
188 fh3DiJetKtNEFPtAssoc[i] = new TH3F(histoName.Data(),histoName.Data(),nBinsKt,-100.,100.,100,0.,1.,nBinsPt,minPt,maxPt);
189 fOutput->Add(fh3DiJetKtNEFPtAssoc[i]);
191 histoName = Form("fCentCorrPtAssocCh_TrigBin%d",i);
192 fCentCorrPtAssocCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,100.,100,0.,100.,nBinsPt,minPt,maxPt);
193 fOutput->Add(fCentCorrPtAssocCh[i]);
195 histoName = Form("fCentCorrPtAssocFuCh_TrigBin%d",i);
196 fCentCorrPtAssocFuCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,100.,100,0.,100.,nBinsPt,minPt,maxPt);
197 fOutput->Add(fCentCorrPtAssocFuCh[i]);
199 histoName = Form("fAjPtAssocCentCh_TrigBin%d",i);
200 fAjPtAssocCentCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,1.,nBinsPt,minPt,maxPt,100,0.,100.);
201 fOutput->Add(fAjPtAssocCentCh[i]);
203 histoName = Form("fAjPtAssocCentFuCh_TrigBin%d",i);
204 fAjPtAssocCentFuCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,1.,nBinsPt,minPt,maxPt,100,0.,100.);
205 fOutput->Add(fAjPtAssocCentFuCh[i]);
210 const Int_t nBinsSparseMatch = 7;
211 const Int_t nBinsDPhiMatch = 80;
212 const Int_t nBinsDEtaMatch = 80;
213 const Int_t nBinsDR = 20;
214 const Int_t nBinsFraction = 21;
215 const Int_t nBinsType = 3;
216 const Int_t nBinsMatch[nBinsSparseMatch] = {nBinsPt,nBinsPt,nBinsDPhiMatch,nBinsDEtaMatch,nBinsDR,nBinsFraction,nBinsType};
217 //pTfull, pTch, deltaPhi, deltaEta, deltaR, fraction, jet type (leading,subleading,other)
218 const Double_t xminMatch[nBinsSparseMatch] = { minPt, minPt, -0.5,-0.5, 0.,0. ,0};
219 const Double_t xmaxMatch[nBinsSparseMatch] = { maxPt, maxPt, 0.5, 0.5, 0.5,1.05,3};
220 if(fDoMatchFullCharged) {
221 fhnMatchingFullCharged = new THnSparseF("fhnMatchingFullCharged","fhnMatchingFullCharged;#it{p}_{T,full} (GeV/#it{c});#it{p}_{T,ch} (GeV/#it{c});#Delta#varphi;#Delta#eta;#Delta R;f_{ch};type",
222 nBinsSparseMatch,nBinsMatch,xminMatch,xmaxMatch);
223 fOutput->Add(fhnMatchingFullCharged);
225 fh3JetPtFullFractionDR = new TH3F("fh3JetPtFullFractionDR","fh3JetPtFullFractionDR;#it{p}_{T,full} (GeV/#it{c}); #it{f}_{ch};#Delta R",nBinsPt,minPt,maxPt,nBinsFraction,0.,1.05,nBinsDR,0.,1.);
226 fOutput->Add(fh3JetPtFullFractionDR);
228 // =========== Switch on Sumw2 for all histos ===========
229 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
230 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
235 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
242 TH1::AddDirectory(oldStatus);
244 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
247 //________________________________________________________________________
248 Bool_t AliAnalysisTaskEmcalDiJetAna::FillHistograms()
252 fh2CentRhoCh->Fill(fCent,fRhoChVal);
253 fh2CentRhoScaled->Fill(fCent,fRhoFullVal);
256 Int_t nJetsFull = GetNJets(fContainerFull);
257 for(Int_t ij=0; ij<nJetsFull; ij++) {
258 AliEmcalJet *jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, fContainerFull));
259 if(!jet) continue; //jet not selected
261 Double_t jetPt = GetJetPt(jet,0);
262 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
266 Int_t nJetsCh = GetNJets(fContainerCharged);
267 for(Int_t ij=0; ij<nJetsCh; ij++) {
268 AliEmcalJet *jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, fContainerCharged));
269 if(!jet) continue; //jet not selected
271 Double_t jetPt = GetJetPt(jet,1);
272 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
280 //________________________________________________________________________
281 Bool_t AliAnalysisTaskEmcalDiJetAna::Run()
283 // Run analysis code here, if needed. It will be executed before FillHistograms().
285 //Check if event is selected (vertex & pile-up)
289 fHistTrialsSelEvents->Fill(fPtHardBin, fNTrials);
296 fRhoFullVal = GetRhoVal(fContainerFull);
297 fRhoChVal = GetRhoVal(fContainerCharged);
303 // MatchFullAndChargedJets();
304 if(fDoChargedCharged) CorrelateJets(1);
306 if(fDoMatchFullCharged) FillMatchFullChargedHistos(fContainerFull,fContainerCharged);
309 SetChargedFractionIndex();
313 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
316 //________________________________________________________________________
317 void AliAnalysisTaskEmcalDiJetAna::CorrelateJets(const Int_t type) {
319 // Correlate jets and fill histos
322 if( fJetCorrelationType==kCorrelateAll )
323 CorrelateAllJets(type);
324 else if( fJetCorrelationType==kCorrelateTwo )
325 CorrelateTwoJets(type);
326 else if( fJetCorrelationType==kCorrelateLS )
327 CorrelateLeadingSubleadingJets(type);
333 //________________________________________________________________________
334 void AliAnalysisTaskEmcalDiJetAna::CorrelateTwoJets(const Int_t type) {
336 // Correlate jets and fill histos
341 if(type==0) { //full-full
342 typet = fContainerFull;
343 typea = fContainerFull;
345 else if(type==1) { //charged-charged
346 typet = fContainerCharged;
347 typea = fContainerCharged;
349 else if(type==2) { //full-charged
350 typet = fContainerFull;
351 typea = fContainerCharged;
354 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
359 Int_t nJetsAssoc = 0;
361 nJetsTrig = GetNJets(fContainerFull);
362 nJetsAssoc = nJetsTrig;
365 nJetsTrig = GetNJets(fContainerCharged);
366 nJetsAssoc = nJetsTrig;
369 nJetsTrig = GetNJets(fContainerFull);
370 nJetsAssoc = GetNJets(fContainerCharged);
373 for(Int_t ijt=0; ijt<nJetsTrig; ijt++) {
375 AliEmcalJet *jetTrig = NULL;
377 jetTrig = static_cast<AliEmcalJet*>(GetJetFromArray(ijt, typet));
378 if(TMath::Abs(jetTrig->Eta())>0.5)
382 jetTrig = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ijt, typet));
386 continue; //jet not selected
388 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
390 if(jetTrigPt<fPtMinTriggerJet)
393 AliEmcalJet *jetAssoc = GetLeadingAssociatedJet(typea,jetTrig);
397 if(type==0 || type==1) {
398 if(GetJetPt(jetAssoc,typea)>jetTrigPt)
402 FillDiJetHistos(jetTrig,jetAssoc, type);
408 //________________________________________________________________________
409 AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetLeadingJet(const Int_t type) {
411 //Get associated jet which is the leading jet in the opposite hemisphere
414 if(type==0) //full-full
415 cont = fContainerFull;
416 else if(type==1) //charged-charged
417 cont = fContainerCharged;
418 else if(type==2) //full-charged
419 cont = fContainerFull;
421 Int_t nJets = GetNJets(cont);
422 Double_t ptLead = -999;
424 for(Int_t ij=0; ij<nJets; ij++) {
426 AliEmcalJet *jet = NULL;
428 jet = static_cast<AliEmcalJet*>(GetJetFromArray(ij, cont));
429 if(TMath::Abs(jet->Eta())>0.5)
433 jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, cont));
438 Double_t jetPt = GetJetPt(jet,cont);
447 AliEmcalJet *jetLead = static_cast<AliEmcalJet*>(GetJetFromArray(iJetLead, cont));
453 //________________________________________________________________________
454 AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetLeadingAssociatedJet(const Int_t type, AliEmcalJet *jetTrig) {
456 //Get associated jet which is the leading jet in the opposite hemisphere
459 if(type==0) //full-full
460 typea = fContainerFull;
461 else if(type==1) //charged-charged
462 typea = fContainerCharged;
463 else if(type==2) //full-charged
464 typea = fContainerCharged;
466 AliEmcalJet *jetAssocLead = GetLeadingJetOppositeHemisphere(type, typea, jetTrig);
472 //________________________________________________________________________
473 void AliAnalysisTaskEmcalDiJetAna::CorrelateAllJets(const Int_t type) {
475 // Correlate jets and fill histos
480 if(type==0) { //full-full
481 typet = fContainerFull;
482 typea = fContainerFull;
484 else if(type==1) { //charged-charged
485 typet = fContainerCharged;
486 typea = fContainerCharged;
488 else if(type==2) { //full-charged
489 typet = fContainerFull;
490 typea = fContainerCharged;
493 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
498 Int_t nJetsAssoc = 0;
500 nJetsTrig = GetNJets(fContainerFull);
501 nJetsAssoc = nJetsTrig;
504 nJetsTrig = GetNJets(fContainerCharged);
505 nJetsAssoc = nJetsTrig;
508 nJetsTrig = GetNJets(fContainerFull);
509 nJetsAssoc = GetNJets(fContainerCharged);
512 for(Int_t ijt=0; ijt<nJetsTrig; ijt++) {
514 AliEmcalJet *jetTrig = NULL;
516 jetTrig = static_cast<AliEmcalJet*>(GetJetFromArray(ijt, typet));
517 if(TMath::Abs(jetTrig->Eta())>0.5)
521 jetTrig = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ijt, typet));
525 continue; //jet not selected
527 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
529 if(jetTrigPt<fPtMinTriggerJet)
532 for(Int_t ija=0; ija<nJetsAssoc; ija++) {
533 if(IsSameJet(ijt,ija,type)) continue;
535 AliEmcalJet *jetAssoc = NULL;
537 jetAssoc = static_cast<AliEmcalJet*>(GetJetFromArray(ija, typea));
538 if(TMath::Abs(jetAssoc->Eta())>0.5)
542 jetAssoc = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ija, typea));
547 Double_t jetAssocPt = GetJetPt(jetAssoc,typea);
549 if(jetTrigPt>jetAssocPt)
550 FillDiJetHistos(jetTrig,jetAssoc, type);
552 } // associate jet loop
557 //________________________________________________________________________
558 void AliAnalysisTaskEmcalDiJetAna::CorrelateLeadingSubleadingJets(const Int_t type) {
560 // Correlate leading jet in event with leading jet in opposite hemisphere
565 if(type==0) { //full-full
566 typet = fContainerFull;
567 typea = fContainerFull;
569 else if(type==1) { //charged-charged
570 typet = fContainerCharged;
571 typea = fContainerCharged;
573 else if(type==2) { //full-charged
574 typet = fContainerFull;
575 typea = fContainerCharged;
578 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
582 AliEmcalJet *jetTrig = GetLeadingJet(type);
586 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
588 if(jetTrigPt<fPtMinTriggerJet)
591 AliEmcalJet *jetAssoc = GetLeadingAssociatedJet(typea,jetTrig);
596 FillDiJetHistos(jetTrig,jetAssoc, type);
601 //________________________________________________________________________
602 void AliAnalysisTaskEmcalDiJetAna::FillDiJetHistos(const AliEmcalJet *jet1, const AliEmcalJet *jet2, const Int_t mode) {
605 // mode: full vs full = 0
606 // charged vs charged = 1
607 // full vs charged = 2
625 AliWarning(Form("%s: mode %d of dijet correlation not defined!",GetName(),mode));
629 Double_t jetTrigPt = GetJetPt(jet1,typet);
630 Double_t jetAssocPt = GetJetPt(jet2,typea);
632 Double_t deltaPhi = GetDeltaPhi(jet1->Phi(),jet2->Phi());
633 if(fDebug>10) Printf("deltaPhi:%.2f",deltaPhi);
635 Double_t kT = TMath::Abs(jetTrigPt*TMath::Sin(deltaPhi));
637 Double_t dijetEta = (jet1->Eta()+jet2->Eta())/2.;
639 Double_t aj = (jetTrigPt-jetAssocPt)/(jetTrigPt+jetAssocPt);
641 Double_t diJetVars[7] = {jetTrigPt,jetAssocPt,deltaPhi,kT,dijetEta,fCent,aj};
644 fhnDiJetVarsFull->Fill(diJetVars);
646 fhnDiJetVarsCh->Fill(diJetVars);
648 fhnDiJetVarsFullCharged->Fill(diJetVars);
650 Double_t dPhiMin = TMath::Pi()-0.9;
651 Double_t dPhiMax = TMath::Pi()+0.9;
652 Int_t trigBin = GetPtTriggerBin(jetTrigPt);
654 if(trigBin>-1 && trigBin<4) {
655 if(deltaPhi>dPhiMin && deltaPhi<dPhiMax)
656 fh3DiJetKtNEFPtAssoc[trigBin]->Fill(kT, jet1->NEF(), jetAssocPt);
660 //Fill centrality correlation histos in case a dijet is present in acceptance
661 Double_t centZNA = -1.;
662 AliCentrality *aliCent = InputEvent()->GetCentrality();
664 centZNA = aliCent->GetCentralityPercentile("ZNA");
666 if(trigBin>-1 && trigBin<4) {
667 if(deltaPhi>dPhiMin && deltaPhi<dPhiMax) {
669 fCentCorrPtAssocCh[trigBin]->Fill(fCent,centZNA,jetAssocPt);
670 fAjPtAssocCentCh[trigBin]->Fill(aj,jetAssocPt,fCent);
673 fCentCorrPtAssocFuCh[trigBin]->Fill(fCent,centZNA,jetAssocPt);
674 fAjPtAssocCentFuCh[trigBin]->Fill(aj,jetAssocPt,fCent);
681 //________________________________________________________________________
682 Int_t AliAnalysisTaskEmcalDiJetAna::GetPtTriggerBin(Double_t pt) {
687 else if(pt>=40 && pt<60)
689 else if(pt>=60 && pt<80)
691 else if(pt>=80 && pt<100)
698 //________________________________________________________________________
699 void AliAnalysisTaskEmcalDiJetAna::FillMatchFullChargedHistos(Int_t cFull,Int_t cCharged) {
701 // Match full to charged jets and fill histo
704 Int_t match = MatchFullAndChargedJets(cFull,cCharged);
706 if(fDebug>1) AliWarning(Form("%s: matching failed",GetName()));
710 for(int ig = 0;ig < GetNJets(cFull);++ig){
711 AliEmcalJet *jetFull = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ig, cFull));
712 if(!jetFull) continue;
714 AliEmcalJet *jetCh = jetFull->ClosestJet();
717 Double_t shFraction = GetFractionSharedPt(jetFull,jetCh);
718 if(fDebug>10) Printf("shared charged pT:%.2f",shFraction);
719 Double_t matchVars[7] = {
722 GetDeltaPhi(jetFull->Phi(),jetCh->Phi()),
723 jetFull->Eta()-jetCh->Eta(),
724 GetDeltaR(jetFull,jetCh),
725 shFraction,TMath::Min((Float_t)ig+0.5,2.5)
727 fhnMatchingFullCharged->Fill(matchVars);
729 }//loop over full jets
734 //________________________________________________________________________
735 Int_t AliAnalysisTaskEmcalDiJetAna::MatchFullAndChargedJets(Int_t cFull, Int_t cCharged) {
737 // Match charged jets to full jets
740 if(GetNJets(cFull)<1) {
741 if(fDebug>1) AliInfo(Form("%s: no full jets: %d", GetName(),GetNJets(cFull)));
745 if(GetNJets(cCharged)<1) {
746 if(fDebug>1) AliInfo(Form("%s: no charged jets: %d", GetName(),GetNJets(cCharged)));
750 TClonesArray *cJetsFull = GetJetArray(cFull);
751 TClonesArray *cJetsCharged = GetJetArray(cCharged);
754 if(fDebug>1) AliInfo(Form("%s: no full jet array",GetName()));
759 if(fDebug>1) AliInfo(Form("%s: no charged jet array",GetName()));
765 MatchJetsGeo(cFull, cCharged, fDebug);
768 if(fDebug>1) AliInfo(Form("%s: Matching already done before",GetName()));
774 //_______________________________________________________________________
775 void AliAnalysisTaskEmcalDiJetAna::Terminate(Option_t *)
777 // Called once at the end of the analysis.