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 "AliEmcalParticle.h"
25 #include "AliMCEvent.h"
26 #include "AliGenPythiaEventHeader.h"
27 #include "AliAODMCHeader.h"
28 #include "AliMCEvent.h"
29 #include "AliAnalysisManager.h"
30 #include "AliJetContainer.h"
31 #include "AliCentrality.h"
33 #include "AliAnalysisTaskEmcalDiJetAna.h"
35 ClassImp(AliAnalysisTaskEmcalDiJetAna)
37 //________________________________________________________________________
38 AliAnalysisTaskEmcalDiJetAna::AliAnalysisTaskEmcalDiJetAna() :
39 AliAnalysisTaskEmcalDiJetBase("AliAnalysisTaskEmcalDiJetAna"),
40 fDoMatchFullCharged(kTRUE),
43 fh3PtEtaPhiJetFull(0),
44 fh3PtEtaPhiJetCharged(0),
47 fhnDiJetVarsFullCharged(0),
48 fhnMatchingFullCharged(0),
49 fh3JetPtFullFractionDR(0),
51 fh3PtTrigKt1Kt2FuCh(0),
52 fh3PtTrigDPhi1DPhi2Ch(0),
53 fh3PtTrigDPhi1DPhi2FuCh(0)
55 // Default constructor.
57 for(Int_t i=0; i<4; i++) {
58 fh3DiJetKtNEFPtAssoc[i] = 0;
59 fCentCorrPtAssocCh[i] = 0;
60 fCentCorrPtAssocFuCh[i] = 0;
61 fAjPtAssocCentCh[i] = 0;
62 fAjPtAssocCentFuCh[i] = 0;
63 fh3PtAssoc1PtAssoc2DPhi23Ch[i] = 0;
64 fh3PtAssoc1PtAssoc2DPhi23FuCh[i] = 0;
67 SetMakeGeneralHistograms(kTRUE);
70 //________________________________________________________________________
71 AliAnalysisTaskEmcalDiJetAna::AliAnalysisTaskEmcalDiJetAna(const char *name) :
72 AliAnalysisTaskEmcalDiJetBase(name),
73 fDoMatchFullCharged(kTRUE),
76 fh3PtEtaPhiJetFull(0),
77 fh3PtEtaPhiJetCharged(0),
80 fhnDiJetVarsFullCharged(0),
81 fhnMatchingFullCharged(0),
82 fh3JetPtFullFractionDR(0),
84 fh3PtTrigKt1Kt2FuCh(0),
85 fh3PtTrigDPhi1DPhi2Ch(0),
86 fh3PtTrigDPhi1DPhi2FuCh(0)
88 // Standard constructor.
90 for(Int_t i=0; i<4; i++) {
91 fh3DiJetKtNEFPtAssoc[i] = 0;
92 fCentCorrPtAssocCh[i] = 0;
93 fCentCorrPtAssocFuCh[i] = 0;
94 fAjPtAssocCentCh[i] = 0;
95 fAjPtAssocCentFuCh[i] = 0;
96 fh3PtAssoc1PtAssoc2DPhi23Ch[i] = 0;
97 fh3PtAssoc1PtAssoc2DPhi23FuCh[i] = 0;
100 SetMakeGeneralHistograms(kTRUE);
103 //________________________________________________________________________
104 AliAnalysisTaskEmcalDiJetAna::~AliAnalysisTaskEmcalDiJetAna()
109 //________________________________________________________________________
110 Bool_t AliAnalysisTaskEmcalDiJetAna::RetrieveEventObjects() {
112 // retrieve event objects
115 if (!AliAnalysisTaskEmcalDiJetBase::RetrieveEventObjects())
121 //________________________________________________________________________
122 void AliAnalysisTaskEmcalDiJetAna::UserCreateOutputObjects()
124 // Create user output.
126 AliAnalysisTaskEmcalDiJetBase::UserCreateOutputObjects();
128 Bool_t oldStatus = TH1::AddDirectoryStatus();
129 TH1::AddDirectory(kFALSE);
131 const Int_t nBinsCent = 100;
132 Double_t minCent = 0.;
133 Double_t maxCent = 100.;
135 const Int_t nBinsRho = 200;
136 Double_t minRho = 0.;
137 Double_t maxRho = 20.;
138 fh2CentRhoCh = new TH2F("fh2CentRhoCh","fh2CentRhoCh;centrality;#rho_{ch}",nBinsCent,minCent,maxCent,nBinsRho,minRho,maxRho);
139 fOutput->Add(fh2CentRhoCh);
140 fh2CentRhoScaled = new TH2F("fh2CentRhoScaled","fh2CentRhoScaled;centrality;s_{EMC}#rho_{ch}",nBinsCent,minCent,maxCent,nBinsRho,minRho,maxRho);
141 fOutput->Add(fh2CentRhoScaled);
143 const Int_t nBinsPt = 150;
144 Double_t minPt = -20.;
145 Double_t maxPt = 130.;
146 const Int_t nBinsEta = 40;
147 Double_t minEta = -1.;
148 Double_t maxEta = 1.;
149 const Int_t nBinsPhi = 18*6;
150 Double_t minPhi = 0.;
151 Double_t maxPhi = TMath::TwoPi();
153 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
154 fOutput->Add(fh3PtEtaPhiJetFull);
156 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
157 fOutput->Add(fh3PtEtaPhiJetCharged);
159 const Int_t nBinsSparse0 = 7;
160 const Int_t nBinsPtW = 30;
161 const Int_t nBinsDPhi = 72;
162 const Int_t nBinsKt = 50;
163 const Int_t nBinsDiJetEta = 40;
164 const Int_t nBinsCentr = fNcentBins;
165 const Int_t nBinsAj = 50;
166 const Int_t nBins0[nBinsSparse0] = {nBinsPtW,nBinsPtW,nBinsDPhi,nBinsKt,nBinsDiJetEta,nBinsCentr,nBinsAj};
167 //pT1, pT2, deltaPhi, kT
168 const Double_t xmin0[nBinsSparse0] = { minPt, minPt, -0.5*TMath::Pi(), 0.,-1.,0. , 0.};
169 const Double_t xmax0[nBinsSparse0] = { maxPt, maxPt, 1.5*TMath::Pi(), 100., 1.,100., 1.};
170 const Double_t centArrayBins[8] = {0.,2.,5.,10.,20.,40.,60.,100.};
172 if(fDoChargedCharged) {
173 fhnDiJetVarsCh = new THnSparseF("fhnDiJetVarsCh",
174 "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}",
175 nBinsSparse0,nBins0,xmin0,xmax0);
176 if(fNcentBins==7) fhnDiJetVarsCh->SetBinEdges(5,centArrayBins);
177 fOutput->Add(fhnDiJetVarsCh);
181 fhnDiJetVarsFullCharged = new THnSparseF("fhnDiJetVarsFullCharged",
182 "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}",
183 nBinsSparse0,nBins0,xmin0,xmax0);
184 if(fNcentBins==7) fhnDiJetVarsFullCharged->SetBinEdges(5,centArrayBins);
185 fOutput->Add(fhnDiJetVarsFullCharged);
189 fhnDiJetVarsFull = new THnSparseF("fhnDiJetVarsFull",
190 "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}",
191 nBinsSparse0,nBins0,xmin0,xmax0);
192 fOutput->Add(fhnDiJetVarsFull);
195 fh3PtTrigKt1Kt2Ch = new TH3F("fh3PtTrigKt1Kt2Ch","fh3PtTrigKt1Kt2Ch;#it{p}_{T,1} (GeV/#it{c});#it{k}_{T,1};#it{k}_{T,2}",nBinsPt,minPt,maxPt,nBinsKt,-100.,100.,nBinsKt,-100.,100.);
196 fOutput->Add(fh3PtTrigKt1Kt2Ch);
198 fh3PtTrigKt1Kt2FuCh = new TH3F("fh3PtTrigKt1Kt2FuCh","fh3PtTrigKt1Kt2FuCh;#it{p}_{T,1} (GeV/#it{c});#it{k}_{T,1};#it{k}_{T,2}",nBinsPt,minPt,maxPt,nBinsKt,-100.,100.,nBinsKt,-100.,100.);
199 fOutput->Add(fh3PtTrigKt1Kt2FuCh);
201 fh3PtTrigDPhi1DPhi2Ch = new TH3F("fh3PtTrigDPhi1DPhi2Ch","fh3PtTrigDPhi1DPhi2Ch;#it{p}_{T,1} (GeV/#it{c});#it{k}_{T,1};#it{k}_{T,2}",nBinsPt,minPt,maxPt,nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi(),nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi());
202 fOutput->Add(fh3PtTrigDPhi1DPhi2Ch);
204 fh3PtTrigDPhi1DPhi2FuCh = new TH3F("fh3PtTrigDPhi1DPhi2FuCh","fh3PtTrigDPhi1DPhi2FuCh;#it{p}_{T,1} (GeV/#it{c});#it{k}_{T,1};#it{k}_{T,2}",nBinsPt,minPt,maxPt,nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi(),nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi());
205 fOutput->Add(fh3PtTrigDPhi1DPhi2FuCh);
208 for(Int_t i=0; i<4; i++) {
209 TString histoName = Form("fh3DiJetKtNEFPtAssoc_TrigBin%d",i);
210 fh3DiJetKtNEFPtAssoc[i] = new TH3F(histoName.Data(),histoName.Data(),nBinsKt,-100.,100.,50,0.,1.,nBinsPt,minPt,maxPt);
211 fOutput->Add(fh3DiJetKtNEFPtAssoc[i]);
213 histoName = Form("fCentCorrPtAssocCh_TrigBin%d",i);
214 fCentCorrPtAssocCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,100.,100,0.,100.,nBinsPt,minPt,maxPt);
215 fOutput->Add(fCentCorrPtAssocCh[i]);
217 histoName = Form("fCentCorrPtAssocFuCh_TrigBin%d",i);
218 fCentCorrPtAssocFuCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,100.,100,0.,100.,nBinsPt,minPt,maxPt);
219 fOutput->Add(fCentCorrPtAssocFuCh[i]);
221 histoName = Form("fAjPtAssocCentCh_TrigBin%d",i);
222 fAjPtAssocCentCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,1.,nBinsPt,minPt,maxPt,100,0.,100.);
223 fOutput->Add(fAjPtAssocCentCh[i]);
225 histoName = Form("fAjPtAssocCentFuCh_TrigBin%d",i);
226 fAjPtAssocCentFuCh[i] = new TH3F(histoName.Data(),histoName.Data(),100,0.,1.,nBinsPt,minPt,maxPt,100,0.,100.);
227 fOutput->Add(fAjPtAssocCentFuCh[i]);
229 histoName = Form("fh3PtAssoc1PtAssoc2DPhi23Ch_TrigBin%d",i);
230 fh3PtAssoc1PtAssoc2DPhi23Ch[i] = new TH3F(histoName.Data(),histoName.Data(),nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt,nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi());
231 fOutput->Add(fh3PtAssoc1PtAssoc2DPhi23Ch[i]);
233 histoName = Form("fh3PtAssoc1PtAssoc2DPhi23FuCh_TrigBin%d",i);
234 fh3PtAssoc1PtAssoc2DPhi23FuCh[i] = new TH3F(histoName.Data(),histoName.Data(),nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt,nBinsDPhi,-0.5*TMath::Pi(),1.5*TMath::Pi());
235 fOutput->Add(fh3PtAssoc1PtAssoc2DPhi23FuCh[i]);
238 const Int_t nBinsSparseMatch = 7;
239 const Int_t nBinsDPhiMatch = 80;
240 const Int_t nBinsDEtaMatch = 80;
241 const Int_t nBinsDR = 20;
242 const Int_t nBinsFraction = 21;
243 const Int_t nBinsType = 3;
244 const Int_t nBinsMatch[nBinsSparseMatch] = {nBinsPt,nBinsPt,nBinsDPhiMatch,nBinsDEtaMatch,nBinsDR,nBinsFraction,nBinsType};
245 //pTfull, pTch, deltaPhi, deltaEta, deltaR, fraction, jet type (leading,subleading,other)
246 const Double_t xminMatch[nBinsSparseMatch] = { minPt, minPt, -0.5,-0.5, 0.,0. ,0};
247 const Double_t xmaxMatch[nBinsSparseMatch] = { maxPt, maxPt, 0.5, 0.5, 0.5,1.05,3};
248 if(fDoMatchFullCharged) {
249 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",
250 nBinsSparseMatch,nBinsMatch,xminMatch,xmaxMatch);
251 fOutput->Add(fhnMatchingFullCharged);
253 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.);
254 fOutput->Add(fh3JetPtFullFractionDR);
256 // =========== Switch on Sumw2 for all histos ===========
257 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
258 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
263 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
270 TH1::AddDirectory(oldStatus);
272 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
275 //________________________________________________________________________
276 Bool_t AliAnalysisTaskEmcalDiJetAna::FillHistograms()
280 fh2CentRhoCh->Fill(fCent,fRhoChVal);
281 fh2CentRhoScaled->Fill(fCent,fRhoFullVal);
284 Int_t nJetsFull = GetNJets(fContainerFull);
285 for(Int_t ij=0; ij<nJetsFull; ij++) {
286 AliEmcalJet *jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, fContainerFull));
287 if(!jet) continue; //jet not selected
289 Double_t jetPt = GetJetPt(jet,0);
290 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
294 Int_t nJetsCh = GetNJets(fContainerCharged);
295 for(Int_t ij=0; ij<nJetsCh; ij++) {
296 AliEmcalJet *jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, fContainerCharged));
297 if(!jet) continue; //jet not selected
299 Double_t jetPt = GetJetPt(jet,1);
300 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
308 //________________________________________________________________________
309 Bool_t AliAnalysisTaskEmcalDiJetAna::Run()
311 // Run analysis code here, if needed. It will be executed before FillHistograms().
313 //Check if event is selected (vertex & pile-up)
322 fRhoFullVal = GetRhoVal(fContainerFull);
323 fRhoChVal = GetRhoVal(fContainerCharged);
329 // MatchFullAndChargedJets();
330 if(fDoChargedCharged) CorrelateJets(1);
332 if(fDoMatchFullCharged) FillMatchFullChargedHistos(fContainerFull,fContainerCharged);
335 SetChargedFractionIndex();
339 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
342 //________________________________________________________________________
343 void AliAnalysisTaskEmcalDiJetAna::CorrelateJets(const Int_t type) {
345 // Correlate jets and fill histos
348 if( fJetCorrelationType==kCorrelateAll )
349 CorrelateAllJets(type);
350 else if( fJetCorrelationType==kCorrelateTwo )
351 CorrelateTwoJets(type);
352 else if( fJetCorrelationType==kCorrelateLS )
353 CorrelateLeadingSubleadingJets(type);
359 //________________________________________________________________________
360 void AliAnalysisTaskEmcalDiJetAna::CorrelateTwoJets(const Int_t type) {
362 // Correlate jets and fill histos
367 if(type==0) { //full-full
368 typet = fContainerFull;
369 typea = fContainerFull;
371 else if(type==1) { //charged-charged
372 typet = fContainerCharged;
373 typea = fContainerCharged;
375 else if(type==2) { //full-charged
376 typet = fContainerFull;
377 typea = fContainerCharged;
380 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
386 nJetsTrig = GetNJets(fContainerFull);
389 nJetsTrig = GetNJets(fContainerCharged);
392 nJetsTrig = GetNJets(fContainerFull);
395 for(Int_t ijt=0; ijt<nJetsTrig; ijt++) {
397 AliEmcalJet *jetTrig = NULL;
399 jetTrig = static_cast<AliEmcalJet*>(GetJetFromArray(ijt, typet));
400 if(TMath::Abs(jetTrig->Eta())>0.5)
404 jetTrig = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ijt, typet));
408 continue; //jet not selected
410 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
412 if(jetTrigPt<fPtMinTriggerJet)
415 AliEmcalJet *jetAssoc = GetLeadingAssociatedJet(typea,jetTrig);
419 if(type==0 || type==1) {
420 if(GetJetPt(jetAssoc,typea)>jetTrigPt)
424 FillDiJetHistos(jetTrig,jetAssoc, type);
426 //Look for second jet on away side - 3-jet events
427 AliEmcalJet *jetAssoc2 = GetSecondLeadingAssociatedJet(typea,jetTrig);
429 FillThreeJetHistos(jetTrig,jetAssoc,jetAssoc2,type);
435 //________________________________________________________________________
436 AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetLeadingJet(const Int_t type) {
438 //Get associated jet which is the leading jet in the opposite hemisphere
441 if(type==0) //full-full
442 cont = fContainerFull;
443 else if(type==1) //charged-charged
444 cont = fContainerCharged;
445 else if(type==2) //full-charged
446 cont = fContainerFull;
448 Int_t nJets = GetNJets(cont);
449 Double_t ptLead = -999;
451 for(Int_t ij=0; ij<nJets; ij++) {
453 AliEmcalJet *jet = NULL;
455 jet = static_cast<AliEmcalJet*>(GetJetFromArray(ij, cont));
456 if(TMath::Abs(jet->Eta())>0.5)
460 jet = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ij, cont));
465 Double_t jetPt = GetJetPt(jet,cont);
474 AliEmcalJet *jetLead = static_cast<AliEmcalJet*>(GetJetFromArray(iJetLead, cont));
480 //________________________________________________________________________
481 AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetLeadingAssociatedJet(const Int_t type, AliEmcalJet *jetTrig) {
483 //Get associated jet which is the leading jet in the opposite hemisphere
486 if(type==0) //full-full
487 typea = fContainerFull;
488 else if(type==1) //charged-charged
489 typea = fContainerCharged;
490 else if(type==2) //full-charged
491 typea = fContainerCharged;
493 AliEmcalJet *jetAssocLead = GetLeadingJetOppositeHemisphere(type, typea, jetTrig);
499 //________________________________________________________________________
500 AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetSecondLeadingAssociatedJet(const Int_t type, AliEmcalJet *jetTrig) {
502 //Get associated jet which is the leading jet in the opposite hemisphere
505 if(type==0) //full-full
506 typea = fContainerFull;
507 else if(type==1) //charged-charged
508 typea = fContainerCharged;
509 else if(type==2) //full-charged
510 typea = fContainerCharged;
512 AliEmcalJet *jetAssocLead2 = GetSecondLeadingJetOppositeHemisphere(type, typea, jetTrig);
514 return jetAssocLead2;
518 //________________________________________________________________________
519 void AliAnalysisTaskEmcalDiJetAna::CorrelateAllJets(const Int_t type) {
521 // Correlate jets and fill histos
526 if(type==0) { //full-full
527 typet = fContainerFull;
528 typea = fContainerFull;
530 else if(type==1) { //charged-charged
531 typet = fContainerCharged;
532 typea = fContainerCharged;
534 else if(type==2) { //full-charged
535 typet = fContainerFull;
536 typea = fContainerCharged;
539 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
544 Int_t nJetsAssoc = 0;
546 nJetsTrig = GetNJets(fContainerFull);
547 nJetsAssoc = nJetsTrig;
550 nJetsTrig = GetNJets(fContainerCharged);
551 nJetsAssoc = nJetsTrig;
554 nJetsTrig = GetNJets(fContainerFull);
555 nJetsAssoc = GetNJets(fContainerCharged);
558 for(Int_t ijt=0; ijt<nJetsTrig; ijt++) {
560 AliEmcalJet *jetTrig = NULL;
562 jetTrig = static_cast<AliEmcalJet*>(GetJetFromArray(ijt, typet));
563 if(TMath::Abs(jetTrig->Eta())>0.5)
567 jetTrig = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ijt, typet));
571 continue; //jet not selected
573 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
575 if(jetTrigPt<fPtMinTriggerJet)
578 for(Int_t ija=0; ija<nJetsAssoc; ija++) {
579 if(IsSameJet(ijt,ija,type)) continue;
581 AliEmcalJet *jetAssoc = NULL;
583 jetAssoc = static_cast<AliEmcalJet*>(GetJetFromArray(ija, typea));
584 if(TMath::Abs(jetAssoc->Eta())>0.5)
588 jetAssoc = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ija, typea));
593 Double_t jetAssocPt = GetJetPt(jetAssoc,typea);
595 if(jetTrigPt>jetAssocPt)
596 FillDiJetHistos(jetTrig,jetAssoc, type);
598 } // associate jet loop
603 //________________________________________________________________________
604 void AliAnalysisTaskEmcalDiJetAna::CorrelateLeadingSubleadingJets(const Int_t type) {
606 // Correlate leading jet in event with leading jet in opposite hemisphere
611 if(type==0) { //full-full
612 typet = fContainerFull;
613 typea = fContainerFull;
615 else if(type==1) { //charged-charged
616 typet = fContainerCharged;
617 typea = fContainerCharged;
619 else if(type==2) { //full-charged
620 typet = fContainerFull;
621 typea = fContainerCharged;
624 AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
628 AliEmcalJet *jetTrig = GetLeadingJet(type);
632 Double_t jetTrigPt = GetJetPt(jetTrig,typet);
634 if(jetTrigPt<fPtMinTriggerJet)
637 AliEmcalJet *jetAssoc = GetLeadingAssociatedJet(typea,jetTrig);
642 FillDiJetHistos(jetTrig,jetAssoc, type);
647 //________________________________________________________________________
648 void AliAnalysisTaskEmcalDiJetAna::FillDiJetHistos(const AliEmcalJet *jet1, const AliEmcalJet *jet2, const Int_t mode) {
651 // mode: full vs full = 0
652 // charged vs charged = 1
653 // full vs charged = 2
671 AliWarning(Form("%s: mode %d of dijet correlation not defined!",GetName(),mode));
675 Double_t jetTrigPt = GetJetPt(jet1,typet);
676 Double_t jetAssocPt = GetJetPt(jet2,typea);
678 Double_t deltaPhi = GetDeltaPhi(jet1->Phi(),jet2->Phi());
679 if(fDebug>10) Printf("deltaPhi:%.2f",deltaPhi);
681 Double_t kT = TMath::Abs(jetTrigPt*TMath::Sin(deltaPhi));
683 Double_t dijetEta = (jet1->Eta()+jet2->Eta())/2.;
685 Double_t aj = (jetTrigPt-jetAssocPt)/(jetTrigPt+jetAssocPt);
687 Double_t diJetVars[7] = {jetTrigPt,jetAssocPt,deltaPhi,kT,dijetEta,fCent,aj};
690 fhnDiJetVarsFull->Fill(diJetVars);
692 fhnDiJetVarsCh->Fill(diJetVars);
694 fhnDiJetVarsFullCharged->Fill(diJetVars);
696 Double_t dPhiMin = TMath::Pi() - 1./3.*TMath::Pi();
697 Double_t dPhiMax = TMath::Pi() + 1./3.*TMath::Pi();
698 Int_t trigBin = GetPtTriggerBin(jetTrigPt);
700 if(trigBin>-1 && trigBin<4) {
701 if(deltaPhi>dPhiMin && deltaPhi<dPhiMax)
702 fh3DiJetKtNEFPtAssoc[trigBin]->Fill(kT, jet1->NEF(), jetAssocPt);
706 //Fill centrality correlation histos in case a dijet is present in acceptance
707 Double_t centZNA = -1.;
708 AliCentrality *aliCent = InputEvent()->GetCentrality();
710 centZNA = aliCent->GetCentralityPercentile("ZNA");
712 if(trigBin>-1 && trigBin<4) {
713 if(deltaPhi>dPhiMin && deltaPhi<dPhiMax) {
715 fCentCorrPtAssocCh[trigBin]->Fill(fCent,centZNA,jetAssocPt);
716 fAjPtAssocCentCh[trigBin]->Fill(aj,jetAssocPt,fCent);
719 fCentCorrPtAssocFuCh[trigBin]->Fill(fCent,centZNA,jetAssocPt);
720 fAjPtAssocCentFuCh[trigBin]->Fill(aj,jetAssocPt,fCent);
728 //________________________________________________________________________
729 void AliAnalysisTaskEmcalDiJetAna::FillThreeJetHistos(const AliEmcalJet *jet1, const AliEmcalJet *jet2, const AliEmcalJet *jet3, const Int_t mode) {
732 // mode: full vs full = 0
733 // charged vs charged = 1
734 // full vs charged = 2
752 AliWarning(Form("%s: mode %d of dijet correlation not defined!",GetName(),mode));
756 Double_t jetTrigPt = GetJetPt(jet1,typet);
757 Double_t jetAssoc2Pt = GetJetPt(jet2,typea);
758 Double_t jetAssoc3Pt = GetJetPt(jet3,typea);
760 Double_t deltaPhi12 = GetDeltaPhi(jet1->Phi(),jet2->Phi());
761 Double_t deltaPhi13 = GetDeltaPhi(jet1->Phi(),jet3->Phi());
762 Double_t deltaPhi23 = GetDeltaPhi(jet2->Phi(),jet3->Phi());
764 Double_t kT12 = TMath::Abs(jetTrigPt*TMath::Sin(deltaPhi12));
765 Double_t kT13 = TMath::Abs(jetTrigPt*TMath::Sin(deltaPhi13));
767 Double_t dPhiMin = TMath::Pi() - 1./3.*TMath::Pi();
768 Double_t dPhiMax = TMath::Pi() + 1./3.*TMath::Pi();
770 Int_t trigBin = GetPtTriggerBin(jetTrigPt);
772 if(jetAssoc2Pt>20. && jetAssoc3Pt>20.) {
774 fh3PtTrigDPhi1DPhi2Ch->Fill(jetTrigPt,deltaPhi12,deltaPhi13);
775 fh3PtAssoc1PtAssoc2DPhi23Ch[trigBin]->Fill(jetAssoc2Pt,jetAssoc3Pt,deltaPhi23);
778 fh3PtTrigDPhi1DPhi2FuCh->Fill(jetTrigPt,deltaPhi12,deltaPhi13);
779 fh3PtAssoc1PtAssoc2DPhi23FuCh[trigBin]->Fill(jetAssoc2Pt,jetAssoc3Pt,deltaPhi23);
782 if(deltaPhi12>dPhiMin && deltaPhi12<dPhiMax) {
784 fh3PtTrigKt1Kt2Ch->Fill(jetTrigPt,kT12,kT13);
786 fh3PtTrigKt1Kt2FuCh->Fill(jetTrigPt,kT12,kT13);
793 //________________________________________________________________________
794 Int_t AliAnalysisTaskEmcalDiJetAna::GetPtTriggerBin(Double_t pt) {
799 else if(pt>=40 && pt<60)
801 else if(pt>=60 && pt<80)
803 else if(pt>=80 && pt<100)
810 //________________________________________________________________________
811 void AliAnalysisTaskEmcalDiJetAna::FillMatchFullChargedHistos(Int_t cFull,Int_t cCharged) {
813 // Match full to charged jets and fill histo
816 Int_t match = MatchFullAndChargedJets(cFull,cCharged);
818 if(fDebug>1) AliWarning(Form("%s: matching failed",GetName()));
822 for(int ig = 0;ig < GetNJets(cFull);++ig){
823 AliEmcalJet *jetFull = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ig, cFull));
824 if(!jetFull) continue;
826 AliEmcalJet *jetCh = jetFull->ClosestJet();
829 Double_t shFraction = GetFractionSharedPt(jetFull,jetCh);
830 if(fDebug>10) Printf("shared charged pT:%.2f",shFraction);
831 Double_t matchVars[7] = {
834 GetDeltaPhi(jetFull->Phi(),jetCh->Phi()),
835 jetFull->Eta()-jetCh->Eta(),
836 GetDeltaR(jetFull,jetCh),
837 shFraction,TMath::Min((Float_t)ig+0.5,2.5)
839 fhnMatchingFullCharged->Fill(matchVars);
841 }//loop over full jets
846 //________________________________________________________________________
847 Int_t AliAnalysisTaskEmcalDiJetAna::MatchFullAndChargedJets(Int_t cFull, Int_t cCharged) {
849 // Match charged jets to full jets
852 if(GetNJets(cFull)<1) {
853 if(fDebug>1) AliInfo(Form("%s: no full jets: %d", GetName(),GetNJets(cFull)));
857 if(GetNJets(cCharged)<1) {
858 if(fDebug>1) AliInfo(Form("%s: no charged jets: %d", GetName(),GetNJets(cCharged)));
862 TClonesArray *cJetsFull = GetJetArray(cFull);
863 TClonesArray *cJetsCharged = GetJetArray(cCharged);
866 if(fDebug>1) AliInfo(Form("%s: no full jet array",GetName()));
871 if(fDebug>1) AliInfo(Form("%s: no charged jet array",GetName()));
877 MatchJetsGeo(cFull, cCharged, fDebug);
880 if(fDebug>1) AliInfo(Form("%s: Matching already done before",GetName()));
886 //_______________________________________________________________________
887 void AliAnalysisTaskEmcalDiJetAna::Terminate(Option_t *)
889 // Called once at the end of the analysis.