2 // Jet trigger QA analysis task.
6 #include <TClonesArray.h>
10 #include <THnSparse.h>
12 #include <TLorentzVector.h>
14 #include "AliVCluster.h"
15 #include "AliVTrack.h"
16 #include "AliEmcalJet.h"
17 #include "AliRhoParameter.h"
19 #include "AliAnalysisUtils.h"
20 #include "AliEmcalParticle.h"
21 #include "AliAODCaloTrigger.h"
22 #include "AliEMCALGeometry.h"
23 #include "AliVCaloCells.h"
26 #include "AliAnalysisTaskEmcalJetTriggerQA.h"
28 ClassImp(AliAnalysisTaskEmcalJetTriggerQA)
30 //________________________________________________________________________
31 AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA() :
32 AliAnalysisTaskEmcalJet("AliAnalysisTaskEmcalJetTriggerQA", kTRUE),
36 fJetsName2("Jet_AKTChargedR040_PicoTracks_pT0150_caloClustersCorr_ET0300"),
42 fMaxTrackPtJet2(100.),
53 fh3PtEtaPhiJetFull(0),
54 fh3PtEtaPhiJetCharged(0),
57 fh3PtEtaAreaJetFull(0),
58 fh3PtEtaAreaJetCharged(0),
59 fh2PtNConstituentsCharged(0),
60 fh2PtNConstituents(0),
61 fh2PtMeanPtConstituentsCharged(0),
62 fh2PtMeanPtConstituentsNeutral(0),
65 fh2PtLeadJet1VsLeadJet2(0),
67 fh3PtLeadJet1VsPatchEnergy(0),
68 fh3PtLeadJet2VsPatchEnergy(0),
69 fh3PatchEnergyEtaPhiCenter(0)
71 // Default constructor.
74 SetMakeGeneralHistograms(kTRUE);
77 //________________________________________________________________________
78 AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *name) :
79 AliAnalysisTaskEmcalJet(name, kTRUE),
83 fJetsName2("Jet_AKTChargedR040_PicoTracks_pT0150_caloClustersCorr_ET0300"),
89 fMaxTrackPtJet2(100.),
100 fh3PtEtaPhiJetFull(0),
101 fh3PtEtaPhiJetCharged(0),
103 fh2NJetsPtCharged(0),
104 fh3PtEtaAreaJetFull(0),
105 fh3PtEtaAreaJetCharged(0),
106 fh2PtNConstituentsCharged(0),
107 fh2PtNConstituents(0),
108 fh2PtMeanPtConstituentsCharged(0),
109 fh2PtMeanPtConstituentsNeutral(0),
112 fh2PtLeadJet1VsLeadJet2(0),
113 fh3EEtaPhiCluster(0),
114 fh3PtLeadJet1VsPatchEnergy(0),
115 fh3PtLeadJet2VsPatchEnergy(0),
116 fh3PatchEnergyEtaPhiCenter(0)
118 // Standard constructor.
120 SetMakeGeneralHistograms(kTRUE);
123 //________________________________________________________________________
124 AliAnalysisTaskEmcalJetTriggerQA::~AliAnalysisTaskEmcalJetTriggerQA()
129 //----------------------------------------------------------------------------------------------
130 void AliAnalysisTaskEmcalJetTriggerQA::InitOnce() {
132 // only initialize once
135 // Initialize analysis util class for vertex selection
137 fAnalysisUtils = new AliAnalysisUtils();
138 fAnalysisUtils->SetMinVtxContr(2);
139 fAnalysisUtils->SetMaxVtxZ(10.);
143 //________________________________________________________________________
144 Bool_t AliAnalysisTaskEmcalJetTriggerQA::SelectEvent() {
146 // Decide if event should be selected for analysis
149 fhNEvents->Fill(0.5);
152 if(!fAnalysisUtils->IsVertexSelected2013pA(InputEvent()))
155 fhNEvents->Fill(2.5);
157 if(fAnalysisUtils->IsPileUpEvent(InputEvent()))
162 AliError("fAnalysisUtils not initialized. Call AliAnalysisTaskEmcalJetTriggerQA::InitOnce()");
165 fhNEvents->Fill(3.5);
167 if(!fTriggerClass.IsNull()) {
168 //Check if requested trigger was fired
169 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
170 if(!firedTrigClass.Contains(fTriggerClass))
174 fhNEvents->Fill(1.5);
180 //________________________________________________________________________
181 void AliAnalysisTaskEmcalJetTriggerQA::FindTriggerPatch() {
183 //Code to get position of trigger
186 fGeom = AliEMCALGeometry::GetInstance();
189 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
191 AliAODCaloTrigger *trg = dynamic_cast<AliAODCaloTrigger*>(InputEvent()->GetCaloTrigger("EMCAL"));
194 int col, row; //FASTOR position
196 Int_t nPatchNotEmpty = 0; //counter number of patches which are not empty
197 fMaxPatchEnergy = 0.;
201 trg->GetPosition(col, row); //col (0 to 63), row (0 to 47)
203 if (col > -1 && row > -1)
205 Int_t id = -1; //FASTOR index
206 Int_t cellIndex[4] = {-1};
207 fGeom->GetAbsFastORIndexFromPositionInEMCAL(col,row,id); //phi is column, eta is row
210 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
213 trg->GetL1TimeSum(ts);
216 trg->GetAmplitude(ampTrg);
220 trg->GetTriggerBits(bit);
222 Bool_t bTrigJ = TestFilterBit(bit,fBitJ1|fBitJ2);
226 Bool_t bTrigJ1 = TestFilterBit(bit,fBitJ1);
227 Bool_t bTrigJ2 = TestFilterBit(bit,fBitJ2);
229 if(bTrigJ1) fTriggerType = 0;
230 if(bTrigJ2) fTriggerType = 1;
231 if(!bTrigJ1 && !bTrigJ2) fTriggerType = -1;
233 Double_t minPhiPatch = 10.;
234 Double_t maxPhiPatch = -10.;
235 Double_t minEtaPatch = 10.;
236 Double_t maxEtaPatch = -10.;
238 //Get energy in trigger patch 8x8 FASTOR
239 Double_t patchEnergy = 0.;
240 Double_t sumAmp = 0.;
241 // const Int_t nFastOR = 8;//16;
242 for(Int_t fastrow = 0; fastrow<fNFastOR; fastrow++) {
243 for(Int_t fastcol = 0; fastcol<fNFastOR; fastcol++) {
244 Int_t nrow = row+fastrow;
245 Int_t ncol = col+fastcol;
246 fGeom->GetAbsFastORIndexFromPositionInEMCAL(ncol,nrow,id);
249 AliWarning(Form("%s: id smaller than 0 %d",GetName(),id));
253 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
254 for(Int_t icell=0; icell<4; icell++) {
256 if(!fGeom->CheckAbsCellId(cellIndex[icell])) continue;
258 Double_t amp =0., time = 0., efrac = 0;
261 Int_t nSupMod = -1, nModule = -1, nIphi = -1, nIeta = -1;
263 fGeom->GetCellIndex(cellIndex[icell], nSupMod, nModule, nIphi, nIeta );
265 fCaloCells->GetCell(cellIndex[icell], absId, amp, time,mclabel,efrac);
268 fGeom->EtaPhiFromIndex(cellIndex[icell], eta, phi);
270 if(phi<minPhiPatch) minPhiPatch = phi;
271 if(phi>maxPhiPatch) maxPhiPatch = phi;
272 if(eta<minEtaPatch) minEtaPatch = eta;
273 if(eta>maxEtaPatch) maxEtaPatch = eta;
275 sumAmp+=fCaloCells->GetAmplitude(cellIndex[icell]);
278 }//cells in fastor loop
282 Double_t etaCent = minEtaPatch + 0.5*(maxEtaPatch-minEtaPatch);
283 Double_t phiCent = minPhiPatch + 0.5*(maxPhiPatch-minPhiPatch);
284 fh3PatchEnergyEtaPhiCenter->Fill(patchEnergy,etaCent,phiCent);
287 if(fDebug>2) AliInfo(Form("%s: patch edges eta: %f - %f phi: %f - %f ampTrg: %f patchEnergy: %f sumAmp: %f",GetName(),minEtaPatch,maxEtaPatch,minPhiPatch,maxPhiPatch,ampTrg,patchEnergy,sumAmp));
289 if(patchEnergy>0) nPatchNotEmpty++;
291 if(patchEnergy>fMaxPatchEnergy) fMaxPatchEnergy=patchEnergy;
298 //________________________________________________________________________
299 void AliAnalysisTaskEmcalJetTriggerQA::LoadExtraBranches() {
304 if (!fJetsName2.IsNull() && !fJets2) {
305 fJets2 = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName2.Data()));
307 AliError(Form("%s: Could not retrieve charged jets %s!", GetName(), fJetsName2.Data()));
310 else if (!fJets2->GetClass()->GetBaseClass("AliEmcalJet")) {
311 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetsName2.Data()));
318 if (!fRhoChName.IsNull() && !fRhoCh) {
319 fRhoCh = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoChName.Data()));
321 AliError(Form("%s: Could not retrieve charged rho %s!", GetName(), fRhoChName.Data()));
327 if (fRhoChName.IsNull() ) {
328 if(fDebug>10) AliInfo(Form("%s: fRhoChName empty %s",GetName(),fRhoChName.Data()));
331 else if(!fRhoChName.IsNull() && fRhoCh) //do not use rho if rhoType==0
332 fRhoChVal = fRhoCh->GetVal();
336 //________________________________________________________________________
337 Bool_t AliAnalysisTaskEmcalJetTriggerQA::AcceptJet2(const AliEmcalJet *jet) const {
339 // Accept jet in 2nd branch
341 Bool_t accept = kFALSE;
343 if(jet->Pt()<0.15) //reject ghost jets
347 if(jet->Area()<fJetAreaCut)
350 //Check if jet is within fiducial acceptance
351 Double_t eta = jet->Eta();
352 Double_t phi = jet->Phi();
354 if(eta<fEtaMinJet2 || eta>fEtaMaxJet2)
357 if(phi<fPhiMinJet2 || phi>fPhiMaxJet2)
360 if (jet->MaxTrackPt() > fMaxTrackPtJet2)
367 //________________________________________________________________________
368 void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
370 // Create user output.
374 AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
376 Bool_t oldStatus = TH1::AddDirectoryStatus();
377 TH1::AddDirectory(kFALSE);
379 fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
380 fOutput->Add(fhNEvents);
383 Double_t minPt = -20.;
384 Double_t maxPt = 100.;
386 Double_t minEta = -1.;
387 Double_t maxEta = 1.;
388 Int_t nBinsPhi = 18*6;
389 Double_t minPhi = 0.;
390 Double_t maxPhi = TMath::TwoPi();
391 Int_t nBinsArea = 100;
392 Double_t minArea = 0.;
393 Double_t maxArea = 1.;
395 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
396 fOutput->Add(fh3PtEtaPhiJetFull);
398 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
399 fOutput->Add(fh3PtEtaPhiJetCharged);
401 fh2NJetsPtFull = new TH2F("fh2NJetsPtFull","fh2NJetsPtFull;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
402 fOutput->Add(fh2NJetsPtFull);
404 fh2NJetsPtCharged = new TH2F("fh2NJetsPtCharged","fh2NJetsPtCharged;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
405 fOutput->Add(fh2NJetsPtCharged);
407 fh3PtEtaAreaJetFull = new TH3F("fh3PtEtaAreaJetFull","fh3PtEtaAreaJetFull;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
408 fOutput->Add(fh3PtEtaAreaJetFull);
410 fh3PtEtaAreaJetCharged = new TH3F("fh3PtEtaAreaJetCharged","fh3PtEtaAreaJetCharged;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
411 fOutput->Add(fh3PtEtaAreaJetCharged);
413 Int_t nBinsConst =100;
414 Double_t minConst = 0.;
415 Double_t maxConst = 100.;
417 Int_t nBinsMeanPt = 200;
418 Double_t minMeanPt = 0.;
419 Double_t maxMeanPt = 20.;
421 Int_t nBinsNEF = 101;
422 Double_t minNEF = 0.;
423 Double_t maxNEF = 1.01;
427 Double_t maxz = 1.01;
429 Int_t nBinsECluster =100;
430 Double_t minECluster = 0.;
431 Double_t maxECluster = 100.;
434 fh2PtNConstituentsCharged = new TH2F("fh2PtNConstituentsCharged","fh2PtNConstituentsCharged;#it{p}_{T}^{jet};N_{charged constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
435 fOutput->Add(fh2PtNConstituentsCharged);
437 fh2PtNConstituents = new TH2F("fh2PtNConstituents","fh2PtNConstituents;#it{p}_{T}^{jet};N_{constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
438 fOutput->Add(fh2PtNConstituents);
440 fh2PtMeanPtConstituentsCharged = new TH2F("fh2PtMeanPtConstituentsCharged","fh2PtMeanPtConstituentsCharged;#it{p}_{T}^{jet};charged #langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
441 fOutput->Add(fh2PtMeanPtConstituentsCharged);
443 fh2PtMeanPtConstituentsNeutral = new TH2F("fh2PtMeanPtConstituentsNeutral","fh2PtMeanPtConstituentsNeutral;#it{p}_{T}^{jet};neutral langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
444 fOutput->Add(fh2PtMeanPtConstituentsNeutral);
446 fh2PtNEF = new TH2F("fh2PtNEF","fh2PtNEF;#it{p}_{T}^{jet};NEF",nBinsPt,minPt,maxPt,nBinsNEF,minNEF,maxNEF);
447 fOutput->Add(fh2PtNEF);
449 fh2Ptz = new TH2F("fh2Ptz","fh2Ptz;#it{p}_{T}^{jet};z=p_{t,trk}^{proj}/p_{jet}",nBinsPt,minPt,maxPt,nBinsz,minz,maxz);
450 fOutput->Add(fh2Ptz);
452 fh2PtLeadJet1VsLeadJet2 = new TH2F("fh2PtLeadJet1VsLeadJet2","fh2PtLeadJet1VsLeadJet2;#it{p}_{T}^{jet 1};#it{p}_{T}^{jet 2}",nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt);
453 fOutput->Add(fh2PtLeadJet1VsLeadJet2);
455 fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta,#phi",nBinsECluster,minECluster,maxECluster,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
456 fOutput->Add(fh3EEtaPhiCluster);
458 fh3PtLeadJet1VsPatchEnergy = new TH3F("fh3PtLeadJet1VsPatchEnergy","fh3PtLeadJet1VsPatchEnergy;#it{p}_{T}^{jet 1};Amplitude_{patch};trig type",nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt,2,-0.5,1.5);
459 fOutput->Add(fh3PtLeadJet1VsPatchEnergy);
460 fh3PtLeadJet2VsPatchEnergy = new TH3F("fh3PtLeadJet2VsPatchEnergy","fh3PtLeadJet2VsPatchEnergy;#it{p}_{T}^{jet 1};Amplitude_{patch};trig type",nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt,2,-0.5,1.5);
461 fOutput->Add(fh3PtLeadJet2VsPatchEnergy);
463 fh3PatchEnergyEtaPhiCenter = new TH3F("fh3PatchEnergyEtaPhiCenter","fh3PatchEnergyEtaPhiCenter;E_{patch};#eta;#phi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
464 fOutput->Add(fh3PatchEnergyEtaPhiCenter);
467 // =========== Switch on Sumw2 for all histos ===========
468 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
469 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
474 TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
479 TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
484 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
488 TH1::AddDirectory(oldStatus);
490 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
493 //________________________________________________________________________
494 Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
500 const Int_t nclusters = fCaloClusters->GetEntriesFast();
502 for (Int_t ic = 0; ic < nclusters; ic++) {
503 AliVCluster *cluster = static_cast<AliVCluster*>(fCaloClusters->At(ic));
505 AliError(Form("Could not receive cluster %d", ic));
508 if (!cluster->IsEMCAL())
512 cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
514 //Fill eta,phi,E of clusters here
515 fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
519 Double_t ptLeadJet1 = 0.;
520 Double_t ptLeadJet2 = 0.;
522 TArrayI *nJetsArr = new TArrayI(fh2NJetsPtFull->GetNbinsY()+1);
524 nJetsArr->Set(fh2NJetsPtFull->GetNbinsY()+1);
527 const Int_t njets = fJets->GetEntriesFast();
528 for (Int_t ij = 0; ij < njets; ij++) {
530 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij));
532 AliError(Form("Could not receive jet %d", ij));
539 Double_t jetPt = jet->Pt();
540 if(jetPt>ptLeadJet1) ptLeadJet1=jetPt;
541 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
542 fh3PtEtaAreaJetFull->Fill(jetPt,jet->Eta(),jet->Area());
544 //count jets above certain pT threshold
545 Int_t ptbin = fh2NJetsPtFull->GetYaxis()->FindBin(jetPt);
546 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtFull->GetNbinsY(); iptbin++)
547 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
549 fh2PtNConstituentsCharged->Fill(jetPt,jet->GetNumberOfTracks());
550 fh2PtNConstituents->Fill(jetPt,jet->GetNumberOfConstituents());
552 fh2PtNEF->Fill(jetPt,jet->NEF());
555 Double_t sumPtCh = 0.;
556 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
557 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
559 fh2Ptz->Fill(jetPt,GetZ(vp,jet));
565 if(jet->GetNumberOfTracks()>0)
566 fh2PtMeanPtConstituentsCharged->Fill(jetPt,sumPtCh/(double)(jet->GetNumberOfTracks()) );
569 AliVCluster *vc = 0x0;
570 Double_t sumPtNe = 0.;
571 for(Int_t icc=0; icc<jet->GetNumberOfClusters(); icc++) {
572 vc = static_cast<AliVCluster*>(jet->ClusterAt(icc, fCaloClusters));
576 vc->GetMomentum(lp, const_cast<Double_t*>(fVertex));
582 if(jet->GetNumberOfClusters()>0)
583 fh2PtMeanPtConstituentsNeutral->Fill(jetPt,sumPtNe/(double)(jet->GetNumberOfClusters()) );
587 for(Int_t i=1; i<=fh2NJetsPtFull->GetNbinsY(); i++) {
588 Int_t nJetsInEvent = nJetsArr->At(i);
589 fh2NJetsPtFull->Fill(nJetsInEvent,fh2NJetsPtFull->GetYaxis()->GetBinCenter(i));
594 //Reset array to zero to also count charged jets
597 //Loop over charged jets
599 const Int_t njetsCh = fJets2->GetEntriesFast();
600 for (Int_t ij = 0; ij < njetsCh; ij++) {
602 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets2->At(ij));
604 AliError(Form("Could not receive charged jet %d", ij));
611 Double_t jetPt = jet->Pt();
612 if(jetPt>ptLeadJet2) ptLeadJet2=jetPt;
613 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
614 fh3PtEtaAreaJetCharged->Fill(jetPt,jet->Eta(),jet->Area());
616 //count jets above certain pT threshold
617 Int_t ptbin = fh2NJetsPtCharged->GetYaxis()->FindBin(jetPt);
618 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtCharged->GetNbinsY(); iptbin++)
619 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
622 for(Int_t i=1; i<=fh2NJetsPtCharged->GetNbinsY(); i++) {
623 Int_t nJetsInEvent = nJetsArr->At(i);
624 fh2NJetsPtCharged->Fill(nJetsInEvent,fh2NJetsPtCharged->GetYaxis()->GetBinCenter(i));
628 if(fJets && fJets2) {
629 fh2PtLeadJet1VsLeadJet2->Fill(ptLeadJet1,ptLeadJet2);
632 fh3PtLeadJet1VsPatchEnergy->Fill(ptLeadJet1,fMaxPatchEnergy,fTriggerType);
633 fh3PtLeadJet2VsPatchEnergy->Fill(ptLeadJet2,fMaxPatchEnergy,fTriggerType);
635 if(nJetsArr) delete nJetsArr;
640 //________________________________________________________________________
641 Bool_t AliAnalysisTaskEmcalJetTriggerQA::Run()
643 // Run analysis code here, if needed. It will be executed before FillHistograms().
645 //Check if event is selected (vertex & pile-up)
651 if(fRhoChName.IsNull())
654 fRhoChVal = fRhoCh->GetVal();
656 if(!fTriggerClass.IsNull())
659 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
662 //_______________________________________________________________________
663 void AliAnalysisTaskEmcalJetTriggerQA::Terminate(Option_t *)
665 // Called once at the end of the analysis.
667 //________________________________________________________________________
668 Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const AliVParticle *trk, const AliEmcalJet *jet) const
670 // Get Z of constituent trk
672 return GetZ(trk->Px(),trk->Py(),trk->Pz(),jet->Px(),jet->Py(),jet->Pz());
675 //________________________________________________________________________
676 Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz) const
679 // Get the z of a constituent inside of a jet
682 Double_t pJetSq = jetPx*jetPx+jetPy*jetPy+jetPz*jetPz;
685 return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/pJetSq;
687 AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq));