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),
70 fh2CellEnergyVsTime(0)
72 // Default constructor.
75 SetMakeGeneralHistograms(kTRUE);
78 //________________________________________________________________________
79 AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *name) :
80 AliAnalysisTaskEmcalJet(name, kTRUE),
84 fJetsName2("Jet_AKTChargedR040_PicoTracks_pT0150_caloClustersCorr_ET0300"),
90 fMaxTrackPtJet2(100.),
101 fh3PtEtaPhiJetFull(0),
102 fh3PtEtaPhiJetCharged(0),
104 fh2NJetsPtCharged(0),
105 fh3PtEtaAreaJetFull(0),
106 fh3PtEtaAreaJetCharged(0),
107 fh2PtNConstituentsCharged(0),
108 fh2PtNConstituents(0),
109 fh2PtMeanPtConstituentsCharged(0),
110 fh2PtMeanPtConstituentsNeutral(0),
113 fh2PtLeadJet1VsLeadJet2(0),
114 fh3EEtaPhiCluster(0),
115 fh3PtLeadJet1VsPatchEnergy(0),
116 fh3PtLeadJet2VsPatchEnergy(0),
117 fh3PatchEnergyEtaPhiCenter(0),
118 fh2CellEnergyVsTime(0)
120 // Standard constructor.
122 SetMakeGeneralHistograms(kTRUE);
125 //________________________________________________________________________
126 AliAnalysisTaskEmcalJetTriggerQA::~AliAnalysisTaskEmcalJetTriggerQA()
131 //----------------------------------------------------------------------------------------------
132 void AliAnalysisTaskEmcalJetTriggerQA::InitOnce() {
134 // only initialize once
137 // Initialize analysis util class for vertex selection
139 fAnalysisUtils = new AliAnalysisUtils();
140 fAnalysisUtils->SetMinVtxContr(2);
141 fAnalysisUtils->SetMaxVtxZ(10.);
145 //________________________________________________________________________
146 Bool_t AliAnalysisTaskEmcalJetTriggerQA::SelectEvent() {
148 // Decide if event should be selected for analysis
151 fhNEvents->Fill(0.5);
154 if(!fAnalysisUtils->IsVertexSelected2013pA(InputEvent()))
157 fhNEvents->Fill(2.5);
159 if(fAnalysisUtils->IsPileUpEvent(InputEvent()))
164 AliError("fAnalysisUtils not initialized. Call AliAnalysisTaskEmcalJetTriggerQA::InitOnce()");
167 fhNEvents->Fill(3.5);
169 if(!fTriggerClass.IsNull()) {
170 //Check if requested trigger was fired
171 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
172 if(!firedTrigClass.Contains(fTriggerClass))
176 fhNEvents->Fill(1.5);
182 //________________________________________________________________________
183 void AliAnalysisTaskEmcalJetTriggerQA::FindTriggerPatch() {
185 //Code to get position of trigger
188 fGeom = AliEMCALGeometry::GetInstance();
191 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
193 AliAODCaloTrigger *trg = dynamic_cast<AliAODCaloTrigger*>(InputEvent()->GetCaloTrigger("EMCAL"));
196 int col, row; //FASTOR position
198 Int_t nPatchNotEmpty = 0; //counter number of patches which are not empty
199 fMaxPatchEnergy = 0.;
203 trg->GetPosition(col, row); //col (0 to 63), row (0 to 47)
205 if (col > -1 && row > -1)
207 Int_t id = -1; //FASTOR index
208 Int_t cellIndex[4] = {-1};
209 fGeom->GetAbsFastORIndexFromPositionInEMCAL(col,row,id); //phi is column, eta is row
212 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
215 trg->GetL1TimeSum(ts);
218 trg->GetAmplitude(ampTrg);
222 trg->GetTriggerBits(bit);
224 Bool_t bTrigJ = TestFilterBit(bit,fBitJ1|fBitJ2);
228 Bool_t bTrigJ1 = TestFilterBit(bit,fBitJ1);
229 Bool_t bTrigJ2 = TestFilterBit(bit,fBitJ2);
231 if(bTrigJ1) fTriggerType = 0;
232 if(bTrigJ2) fTriggerType = 1;
233 if(!bTrigJ1 && !bTrigJ2) fTriggerType = -1;
235 Double_t minPhiPatch = 10.;
236 Double_t maxPhiPatch = -10.;
237 Double_t minEtaPatch = 10.;
238 Double_t maxEtaPatch = -10.;
240 //Get energy in trigger patch 8x8 FASTOR
241 Double_t patchEnergy = 0.;
242 Double_t sumAmp = 0.;
243 // const Int_t nFastOR = 8;//16;
244 for(Int_t fastrow = 0; fastrow<fNFastOR; fastrow++) {
245 for(Int_t fastcol = 0; fastcol<fNFastOR; fastcol++) {
246 Int_t nrow = row+fastrow;
247 Int_t ncol = col+fastcol;
248 fGeom->GetAbsFastORIndexFromPositionInEMCAL(ncol,nrow,id);
251 AliWarning(Form("%s: id smaller than 0 %d",GetName(),id));
255 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
256 for(Int_t icell=0; icell<4; icell++) {
258 if(!fGeom->CheckAbsCellId(cellIndex[icell])) continue;
260 Double_t amp =0., time = 0., efrac = 0;
263 Int_t nSupMod = -1, nModule = -1, nIphi = -1, nIeta = -1;
265 fGeom->GetCellIndex(cellIndex[icell], nSupMod, nModule, nIphi, nIeta );
267 fCaloCells->GetCell(cellIndex[icell], absId, amp, time,mclabel,efrac);
270 fGeom->EtaPhiFromIndex(cellIndex[icell], eta, phi);
272 if(phi<minPhiPatch) minPhiPatch = phi;
273 if(phi>maxPhiPatch) maxPhiPatch = phi;
274 if(eta<minEtaPatch) minEtaPatch = eta;
275 if(eta>maxEtaPatch) maxEtaPatch = eta;
277 sumAmp+=fCaloCells->GetAmplitude(cellIndex[icell]);
280 }//cells in fastor loop
284 Double_t etaCent = minEtaPatch + 0.5*(maxEtaPatch-minEtaPatch);
285 Double_t phiCent = minPhiPatch + 0.5*(maxPhiPatch-minPhiPatch);
286 fh3PatchEnergyEtaPhiCenter->Fill(patchEnergy,etaCent,phiCent);
289 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));
291 if(patchEnergy>0) nPatchNotEmpty++;
293 if(patchEnergy>fMaxPatchEnergy) fMaxPatchEnergy=patchEnergy;
300 //________________________________________________________________________
301 void AliAnalysisTaskEmcalJetTriggerQA::LoadExtraBranches() {
306 if (!fJetsName2.IsNull() && !fJets2) {
307 fJets2 = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName2.Data()));
309 AliError(Form("%s: Could not retrieve charged jets %s!", GetName(), fJetsName2.Data()));
312 else if (!fJets2->GetClass()->GetBaseClass("AliEmcalJet")) {
313 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetsName2.Data()));
320 if (!fRhoChName.IsNull() && !fRhoCh) {
321 fRhoCh = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoChName.Data()));
323 AliError(Form("%s: Could not retrieve charged rho %s!", GetName(), fRhoChName.Data()));
329 if (fRhoChName.IsNull() ) {
330 if(fDebug>10) AliInfo(Form("%s: fRhoChName empty %s",GetName(),fRhoChName.Data()));
333 else if(!fRhoChName.IsNull() && fRhoCh) //do not use rho if rhoType==0
334 fRhoChVal = fRhoCh->GetVal();
338 //________________________________________________________________________
339 Bool_t AliAnalysisTaskEmcalJetTriggerQA::AcceptJet2(const AliEmcalJet *jet) const {
341 // Accept jet in 2nd branch
343 Bool_t accept = kFALSE;
345 if(jet->Pt()<0.15) //reject ghost jets
349 if(jet->Area()<fJetAreaCut)
352 //Check if jet is within fiducial acceptance
353 Double_t eta = jet->Eta();
354 Double_t phi = jet->Phi();
356 if(eta<fEtaMinJet2 || eta>fEtaMaxJet2)
359 if(phi<fPhiMinJet2 || phi>fPhiMaxJet2)
362 if (jet->MaxTrackPt() > fMaxTrackPtJet2)
369 //________________________________________________________________________
370 void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
372 // Create user output.
376 AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
378 Bool_t oldStatus = TH1::AddDirectoryStatus();
379 TH1::AddDirectory(kFALSE);
381 fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
382 fOutput->Add(fhNEvents);
385 Double_t minPt = -20.;
386 Double_t maxPt = 100.;
388 Double_t minEta = -1.;
389 Double_t maxEta = 1.;
390 Int_t nBinsPhi = 18*6;
391 Double_t minPhi = 0.;
392 Double_t maxPhi = TMath::TwoPi();
393 Int_t nBinsArea = 100;
394 Double_t minArea = 0.;
395 Double_t maxArea = 1.;
397 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
398 fOutput->Add(fh3PtEtaPhiJetFull);
400 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
401 fOutput->Add(fh3PtEtaPhiJetCharged);
403 fh2NJetsPtFull = new TH2F("fh2NJetsPtFull","fh2NJetsPtFull;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
404 fOutput->Add(fh2NJetsPtFull);
406 fh2NJetsPtCharged = new TH2F("fh2NJetsPtCharged","fh2NJetsPtCharged;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
407 fOutput->Add(fh2NJetsPtCharged);
409 fh3PtEtaAreaJetFull = new TH3F("fh3PtEtaAreaJetFull","fh3PtEtaAreaJetFull;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
410 fOutput->Add(fh3PtEtaAreaJetFull);
412 fh3PtEtaAreaJetCharged = new TH3F("fh3PtEtaAreaJetCharged","fh3PtEtaAreaJetCharged;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
413 fOutput->Add(fh3PtEtaAreaJetCharged);
415 Int_t nBinsConst =100;
416 Double_t minConst = 0.;
417 Double_t maxConst = 100.;
419 Int_t nBinsMeanPt = 200;
420 Double_t minMeanPt = 0.;
421 Double_t maxMeanPt = 20.;
423 Int_t nBinsNEF = 101;
424 Double_t minNEF = 0.;
425 Double_t maxNEF = 1.01;
429 Double_t maxz = 1.01;
431 Int_t nBinsECluster =100;
432 Double_t minECluster = 0.;
433 Double_t maxECluster = 100.;
436 fh2PtNConstituentsCharged = new TH2F("fh2PtNConstituentsCharged","fh2PtNConstituentsCharged;#it{p}_{T}^{jet};N_{charged constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
437 fOutput->Add(fh2PtNConstituentsCharged);
439 fh2PtNConstituents = new TH2F("fh2PtNConstituents","fh2PtNConstituents;#it{p}_{T}^{jet};N_{constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
440 fOutput->Add(fh2PtNConstituents);
442 fh2PtMeanPtConstituentsCharged = new TH2F("fh2PtMeanPtConstituentsCharged","fh2PtMeanPtConstituentsCharged;#it{p}_{T}^{jet};charged #langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
443 fOutput->Add(fh2PtMeanPtConstituentsCharged);
445 fh2PtMeanPtConstituentsNeutral = new TH2F("fh2PtMeanPtConstituentsNeutral","fh2PtMeanPtConstituentsNeutral;#it{p}_{T}^{jet};neutral langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
446 fOutput->Add(fh2PtMeanPtConstituentsNeutral);
448 fh2PtNEF = new TH2F("fh2PtNEF","fh2PtNEF;#it{p}_{T}^{jet};NEF",nBinsPt,minPt,maxPt,nBinsNEF,minNEF,maxNEF);
449 fOutput->Add(fh2PtNEF);
451 fh2Ptz = new TH2F("fh2Ptz","fh2Ptz;#it{p}_{T}^{jet};z=p_{t,trk}^{proj}/p_{jet}",nBinsPt,minPt,maxPt,nBinsz,minz,maxz);
452 fOutput->Add(fh2Ptz);
454 fh2PtLeadJet1VsLeadJet2 = new TH2F("fh2PtLeadJet1VsLeadJet2","fh2PtLeadJet1VsLeadJet2;#it{p}_{T}^{jet 1};#it{p}_{T}^{jet 2}",nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt);
455 fOutput->Add(fh2PtLeadJet1VsLeadJet2);
457 fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta;#phi",nBinsECluster,minECluster,maxECluster,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
458 fOutput->Add(fh3EEtaPhiCluster);
460 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);
461 fOutput->Add(fh3PtLeadJet1VsPatchEnergy);
462 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);
463 fOutput->Add(fh3PtLeadJet2VsPatchEnergy);
465 fh3PatchEnergyEtaPhiCenter = new TH3F("fh3PatchEnergyEtaPhiCenter","fh3PatchEnergyEtaPhiCenter;E_{patch};#eta;#phi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
466 fOutput->Add(fh3PatchEnergyEtaPhiCenter);
468 fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",100,0.,100.,700,-400,1000);
469 fOutput->Add(fh2CellEnergyVsTime);
472 // =========== Switch on Sumw2 for all histos ===========
473 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
474 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
479 TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
484 TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
489 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
493 TH1::AddDirectory(oldStatus);
495 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
498 //________________________________________________________________________
499 Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
505 const Int_t nclusters = fCaloClusters->GetEntriesFast();
507 for (Int_t ic = 0; ic < nclusters; ic++) {
508 AliVCluster *cluster = static_cast<AliVCluster*>(fCaloClusters->At(ic));
510 AliError(Form("Could not receive cluster %d", ic));
513 if (!cluster->IsEMCAL())
517 cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
519 //Fill eta,phi,E of clusters here
520 fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
525 const Short_t nCells = fCaloCells->GetNumberOfCells();
527 for(Int_t iCell=0; iCell<nCells; ++iCell) {
528 Short_t cellId = fCaloCells->GetCellNumber(iCell);
529 Double_t cellE = fCaloCells->GetCellAmplitude(cellId);
530 Double_t cellT = fCaloCells->GetCellTime(cellId);
532 AliDebug(2,Form("cell energy = %f time = %f",cellE,cellT*1e9));
533 fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
539 Double_t ptLeadJet1 = 0.;
540 Double_t ptLeadJet2 = 0.;
542 TArrayI *nJetsArr = new TArrayI(fh2NJetsPtFull->GetNbinsY()+1);
544 nJetsArr->Set(fh2NJetsPtFull->GetNbinsY()+1);
547 const Int_t njets = fJets->GetEntriesFast();
548 for (Int_t ij = 0; ij < njets; ij++) {
550 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij));
552 AliError(Form("Could not receive jet %d", ij));
559 Double_t jetPt = jet->Pt();
560 if(jetPt>ptLeadJet1) ptLeadJet1=jetPt;
561 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
562 fh3PtEtaAreaJetFull->Fill(jetPt,jet->Eta(),jet->Area());
564 //count jets above certain pT threshold
565 Int_t ptbin = fh2NJetsPtFull->GetYaxis()->FindBin(jetPt);
566 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtFull->GetNbinsY(); iptbin++)
567 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
569 fh2PtNConstituentsCharged->Fill(jetPt,jet->GetNumberOfTracks());
570 fh2PtNConstituents->Fill(jetPt,jet->GetNumberOfConstituents());
572 fh2PtNEF->Fill(jetPt,jet->NEF());
575 Double_t sumPtCh = 0.;
576 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
577 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
579 fh2Ptz->Fill(jetPt,GetZ(vp,jet));
585 if(jet->GetNumberOfTracks()>0)
586 fh2PtMeanPtConstituentsCharged->Fill(jetPt,sumPtCh/(double)(jet->GetNumberOfTracks()) );
589 AliVCluster *vc = 0x0;
590 Double_t sumPtNe = 0.;
591 for(Int_t icc=0; icc<jet->GetNumberOfClusters(); icc++) {
592 vc = static_cast<AliVCluster*>(jet->ClusterAt(icc, fCaloClusters));
596 vc->GetMomentum(lp, const_cast<Double_t*>(fVertex));
602 if(jet->GetNumberOfClusters()>0)
603 fh2PtMeanPtConstituentsNeutral->Fill(jetPt,sumPtNe/(double)(jet->GetNumberOfClusters()) );
607 for(Int_t i=1; i<=fh2NJetsPtFull->GetNbinsY(); i++) {
608 Int_t nJetsInEvent = nJetsArr->At(i);
609 fh2NJetsPtFull->Fill(nJetsInEvent,fh2NJetsPtFull->GetYaxis()->GetBinCenter(i));
614 //Reset array to zero to also count charged jets
617 //Loop over charged jets
619 const Int_t njetsCh = fJets2->GetEntriesFast();
620 for (Int_t ij = 0; ij < njetsCh; ij++) {
622 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets2->At(ij));
624 AliError(Form("Could not receive charged jet %d", ij));
631 Double_t jetPt = jet->Pt();
632 if(jetPt>ptLeadJet2) ptLeadJet2=jetPt;
633 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
634 fh3PtEtaAreaJetCharged->Fill(jetPt,jet->Eta(),jet->Area());
636 //count jets above certain pT threshold
637 Int_t ptbin = fh2NJetsPtCharged->GetYaxis()->FindBin(jetPt);
638 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtCharged->GetNbinsY(); iptbin++)
639 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
642 for(Int_t i=1; i<=fh2NJetsPtCharged->GetNbinsY(); i++) {
643 Int_t nJetsInEvent = nJetsArr->At(i);
644 fh2NJetsPtCharged->Fill(nJetsInEvent,fh2NJetsPtCharged->GetYaxis()->GetBinCenter(i));
648 if(fJets && fJets2) {
649 fh2PtLeadJet1VsLeadJet2->Fill(ptLeadJet1,ptLeadJet2);
652 fh3PtLeadJet1VsPatchEnergy->Fill(ptLeadJet1,fMaxPatchEnergy,fTriggerType);
653 fh3PtLeadJet2VsPatchEnergy->Fill(ptLeadJet2,fMaxPatchEnergy,fTriggerType);
655 if(nJetsArr) delete nJetsArr;
660 //________________________________________________________________________
661 Bool_t AliAnalysisTaskEmcalJetTriggerQA::Run()
663 // Run analysis code here, if needed. It will be executed before FillHistograms().
665 //Check if event is selected (vertex & pile-up)
671 if(fRhoChName.IsNull())
674 fRhoChVal = fRhoCh->GetVal();
676 if(!fTriggerClass.IsNull())
679 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
682 //_______________________________________________________________________
683 void AliAnalysisTaskEmcalJetTriggerQA::Terminate(Option_t *)
685 // Called once at the end of the analysis.
687 //________________________________________________________________________
688 Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const AliVParticle *trk, const AliEmcalJet *jet) const
690 // Get Z of constituent trk
692 return GetZ(trk->Px(),trk->Py(),trk->Pz(),jet->Px(),jet->Py(),jet->Pz());
695 //________________________________________________________________________
696 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
699 // Get the z of a constituent inside of a jet
702 Double_t pJetSq = jetPx*jetPx+jetPy*jetPy+jetPz*jetPz;
705 return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/pJetSq;
707 AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq));