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"
24 #include "AliJetContainer.h"
25 #include "AliClusterContainer.h"
27 #include "AliAnalysisTaskEmcalJetTriggerQA.h"
29 ClassImp(AliAnalysisTaskEmcalJetTriggerQA)
31 //________________________________________________________________________
32 AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA() :
33 AliAnalysisTaskEmcalJetDev("AliAnalysisTaskEmcalJetTriggerQA", kTRUE),
46 fh3PtEtaPhiJetFull(0),
47 fh3PtEtaPhiJetCharged(0),
50 fh3PtEtaAreaJetFull(0),
51 fh3PtEtaAreaJetCharged(0),
52 fh2PtNConstituentsCharged(0),
53 fh2PtNConstituents(0),
54 fh2PtMeanPtConstituentsCharged(0),
55 fh2PtMeanPtConstituentsNeutral(0),
58 fh2NEFNConstituentsCharged(0),
59 fh2NEFNConstituentsNeutral(0),
62 fh2PtLeadJet1VsLeadJet2(0),
64 fh3PtLeadJet1VsPatchEnergy(0),
65 fh3PtLeadJet2VsPatchEnergy(0),
66 fh3PatchEnergyEtaPhiCenter(0),
67 fh2CellEnergyVsTime(0)
69 // Default constructor.
72 SetMakeGeneralHistograms(kTRUE);
75 //________________________________________________________________________
76 AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *name) :
77 AliAnalysisTaskEmcalJetDev(name, kTRUE),
90 fh3PtEtaPhiJetFull(0),
91 fh3PtEtaPhiJetCharged(0),
94 fh3PtEtaAreaJetFull(0),
95 fh3PtEtaAreaJetCharged(0),
96 fh2PtNConstituentsCharged(0),
97 fh2PtNConstituents(0),
98 fh2PtMeanPtConstituentsCharged(0),
99 fh2PtMeanPtConstituentsNeutral(0),
102 fh2NEFNConstituentsCharged(0),
103 fh2NEFNConstituentsNeutral(0),
106 fh2PtLeadJet1VsLeadJet2(0),
107 fh3EEtaPhiCluster(0),
108 fh3PtLeadJet1VsPatchEnergy(0),
109 fh3PtLeadJet2VsPatchEnergy(0),
110 fh3PatchEnergyEtaPhiCenter(0),
111 fh2CellEnergyVsTime(0)
113 // Standard constructor.
115 SetMakeGeneralHistograms(kTRUE);
118 //________________________________________________________________________
119 AliAnalysisTaskEmcalJetTriggerQA::~AliAnalysisTaskEmcalJetTriggerQA()
124 //----------------------------------------------------------------------------------------------
125 void AliAnalysisTaskEmcalJetTriggerQA::InitOnce() {
127 // only initialize once
130 // Initialize analysis util class for vertex selection
132 fAnalysisUtils = new AliAnalysisUtils();
133 fAnalysisUtils->SetMinVtxContr(2);
134 fAnalysisUtils->SetMaxVtxZ(10.);
138 //________________________________________________________________________
139 Bool_t AliAnalysisTaskEmcalJetTriggerQA::SelectEvent() {
141 // Decide if event should be selected for analysis
144 fhNEvents->Fill(0.5);
147 if(!fAnalysisUtils->IsVertexSelected2013pA(InputEvent()))
150 fhNEvents->Fill(2.5);
152 if(fAnalysisUtils->IsPileUpEvent(InputEvent()))
157 AliError("fAnalysisUtils not initialized. Call AliAnalysisTaskEmcalJetTriggerQA::InitOnce()");
160 fhNEvents->Fill(3.5);
162 if(!fTriggerClass.IsNull()) {
163 //Check if requested trigger was fired
164 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
165 if(!firedTrigClass.Contains(fTriggerClass))
169 fhNEvents->Fill(1.5);
175 //________________________________________________________________________
176 void AliAnalysisTaskEmcalJetTriggerQA::FindTriggerPatch() {
178 //Code to get position of trigger
181 fGeom = AliEMCALGeometry::GetInstance();
184 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
186 AliAODCaloTrigger *trg = dynamic_cast<AliAODCaloTrigger*>(InputEvent()->GetCaloTrigger("EMCAL"));
189 int col, row; //FASTOR position
191 Int_t nPatchNotEmpty = 0; //counter number of patches which are not empty
192 fMaxPatchEnergy = 0.;
196 trg->GetPosition(col, row); //col (0 to 63), row (0 to 47)
198 if (col > -1 && row > -1)
200 Int_t id = -1; //FASTOR index
201 Int_t cellIndex[4] = {-1};
202 fGeom->GetAbsFastORIndexFromPositionInEMCAL(col,row,id); //phi is column, eta is row
205 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
208 trg->GetL1TimeSum(ts);
211 trg->GetAmplitude(ampTrg);
215 trg->GetTriggerBits(bit);
217 Bool_t bTrigJ = TestFilterBit(bit,fBitJ1|fBitJ2);
221 Bool_t bTrigJ1 = TestFilterBit(bit,fBitJ1);
222 Bool_t bTrigJ2 = TestFilterBit(bit,fBitJ2);
224 if(bTrigJ1) fTriggerType = 0;
225 if(bTrigJ2) fTriggerType = 1;
226 if(!bTrigJ1 && !bTrigJ2) fTriggerType = -1;
228 Double_t minPhiPatch = 10.;
229 Double_t maxPhiPatch = -10.;
230 Double_t minEtaPatch = 10.;
231 Double_t maxEtaPatch = -10.;
233 //Get energy in trigger patch 8x8 FASTOR
234 Double_t patchEnergy = 0.;
235 Double_t sumAmp = 0.;
236 // const Int_t nFastOR = 8;//16;
237 for(Int_t fastrow = 0; fastrow<fNFastOR; fastrow++) {
238 for(Int_t fastcol = 0; fastcol<fNFastOR; fastcol++) {
239 Int_t nrow = row+fastrow;
240 Int_t ncol = col+fastcol;
241 fGeom->GetAbsFastORIndexFromPositionInEMCAL(ncol,nrow,id);
244 AliWarning(Form("%s: id smaller than 0 %d",GetName(),id));
248 fGeom->GetCellIndexFromFastORIndex(id,cellIndex);
249 for(Int_t icell=0; icell<4; icell++) {
251 if(!fGeom->CheckAbsCellId(cellIndex[icell])) continue;
253 Double_t amp =0., time = 0., efrac = 0;
256 Int_t nSupMod = -1, nModule = -1, nIphi = -1, nIeta = -1;
258 fGeom->GetCellIndex(cellIndex[icell], nSupMod, nModule, nIphi, nIeta );
260 fCaloCells->GetCell(cellIndex[icell], absId, amp, time,mclabel,efrac);
263 fGeom->EtaPhiFromIndex(cellIndex[icell], eta, phi);
265 if(phi<minPhiPatch) minPhiPatch = phi;
266 if(phi>maxPhiPatch) maxPhiPatch = phi;
267 if(eta<minEtaPatch) minEtaPatch = eta;
268 if(eta>maxEtaPatch) maxEtaPatch = eta;
270 sumAmp+=fCaloCells->GetAmplitude(cellIndex[icell]);
273 }//cells in fastor loop
277 Double_t etaCent = minEtaPatch + 0.5*(maxEtaPatch-minEtaPatch);
278 Double_t phiCent = minPhiPatch + 0.5*(maxPhiPatch-minPhiPatch);
279 fh3PatchEnergyEtaPhiCenter->Fill(patchEnergy,etaCent,phiCent);
282 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));
284 if(patchEnergy>0) nPatchNotEmpty++;
286 if(patchEnergy>fMaxPatchEnergy) fMaxPatchEnergy=patchEnergy;
293 //________________________________________________________________________
294 void AliAnalysisTaskEmcalJetTriggerQA::LoadExtraBranches() {
296 // load extra brances
301 //________________________________________________________________________
302 void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
304 // Create user output.
308 AliAnalysisTaskEmcalJetDev::UserCreateOutputObjects();
310 Bool_t oldStatus = TH1::AddDirectoryStatus();
311 TH1::AddDirectory(kFALSE);
313 fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
314 fOutput->Add(fhNEvents);
317 Double_t minPt = -20.;
318 Double_t maxPt = 100.;
320 Double_t minEta = -1.;
321 Double_t maxEta = 1.;
322 Int_t nBinsPhi = 18*6;
323 Double_t minPhi = 0.;
324 Double_t maxPhi = TMath::TwoPi();
325 Int_t nBinsArea = 100;
326 Double_t minArea = 0.;
327 Double_t maxArea = 1.;
329 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
330 fOutput->Add(fh3PtEtaPhiJetFull);
332 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
333 fOutput->Add(fh3PtEtaPhiJetCharged);
335 fh2NJetsPtFull = new TH2F("fh2NJetsPtFull","fh2NJetsPtFull;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
336 fOutput->Add(fh2NJetsPtFull);
338 fh2NJetsPtCharged = new TH2F("fh2NJetsPtCharged","fh2NJetsPtCharged;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,nBinsPt,minPt,maxPt);
339 fOutput->Add(fh2NJetsPtCharged);
341 fh3PtEtaAreaJetFull = new TH3F("fh3PtEtaAreaJetFull","fh3PtEtaAreaJetFull;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
342 fOutput->Add(fh3PtEtaAreaJetFull);
344 fh3PtEtaAreaJetCharged = new TH3F("fh3PtEtaAreaJetCharged","fh3PtEtaAreaJetCharged;#it{p}_{T}^{jet};#eta;A",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsArea,minArea,maxArea);
345 fOutput->Add(fh3PtEtaAreaJetCharged);
347 Int_t nBinsConst =100;
348 Double_t minConst = 0.;
349 Double_t maxConst = 100.;
351 Int_t nBinsMeanPt = 200;
352 Double_t minMeanPt = 0.;
353 Double_t maxMeanPt = 20.;
355 Int_t nBinsNEF = 101;
356 Double_t minNEF = 0.;
357 Double_t maxNEF = 1.01;
361 Double_t maxz = 1.01;
363 Int_t nBinsECluster =100;
364 Double_t minECluster = 0.;
365 Double_t maxECluster = 100.;
368 fh2PtNConstituentsCharged = new TH2F("fh2PtNConstituentsCharged","fh2PtNConstituentsCharged;#it{p}_{T}^{jet};N_{charged constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
369 fOutput->Add(fh2PtNConstituentsCharged);
371 fh2PtNConstituents = new TH2F("fh2PtNConstituents","fh2PtNConstituents;#it{p}_{T}^{jet};N_{constituents}",nBinsPt,minPt,maxPt,nBinsConst,minConst,maxConst);
372 fOutput->Add(fh2PtNConstituents);
374 fh2PtMeanPtConstituentsCharged = new TH2F("fh2PtMeanPtConstituentsCharged","fh2PtMeanPtConstituentsCharged;#it{p}_{T}^{jet};charged #langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
375 fOutput->Add(fh2PtMeanPtConstituentsCharged);
377 fh2PtMeanPtConstituentsNeutral = new TH2F("fh2PtMeanPtConstituentsNeutral","fh2PtMeanPtConstituentsNeutral;#it{p}_{T}^{jet};neutral langle #it{p}_{T} #rangle",nBinsPt,minPt,maxPt,nBinsMeanPt,minMeanPt,maxMeanPt);
378 fOutput->Add(fh2PtMeanPtConstituentsNeutral);
380 fh2PtNEF = new TH2F("fh2PtNEF","fh2PtNEF;#it{p}_{T}^{jet};NEF",nBinsPt,minPt,maxPt,nBinsNEF,minNEF,maxNEF);
381 fOutput->Add(fh2PtNEF);
383 fh3NEFEtaPhi = new TH3F("fh3NEFEtaPhi","fh3NEFEtaPhi;NEF;#eta;#varphi",nBinsNEF,minNEF,maxNEF,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
384 fOutput->Add(fh3NEFEtaPhi);
386 fh2NEFNConstituentsCharged = new TH2F("fh2NEFNConstituentsCharged","fh2NEFNConstituentsCharged;NEF;N_{charged constituents}",nBinsNEF,minNEF,maxNEF,nBinsConst,minConst,maxConst);
387 fOutput->Add(fh2NEFNConstituentsCharged);
389 fh2NEFNConstituentsNeutral = new TH2F("fh2NEFNConstituentsNeutral","fh2NEFNConstituentsNeutral;NEF;N_{clusters}",nBinsNEF,minNEF,maxNEF,nBinsConst,minConst,maxConst);
390 fOutput->Add(fh2NEFNConstituentsNeutral);
392 fh2Ptz = new TH2F("fh2Ptz","fh2Ptz;#it{p}_{T}^{jet};z=p_{t,trk}^{proj}/p_{jet}",nBinsPt,minPt,maxPt,nBinsz,minz,maxz);
393 fOutput->Add(fh2Ptz);
395 fh2PtzCharged = new TH2F("fh2PtzCharged","fh2Ptz;#it{p}_{T}^{ch jet};z=p_{t,trk}^{proj}/p_{ch jet}",nBinsPt,minPt,maxPt,nBinsz,minz,maxz);
396 fOutput->Add(fh2PtzCharged);
398 fh2PtLeadJet1VsLeadJet2 = new TH2F("fh2PtLeadJet1VsLeadJet2","fh2PtLeadJet1VsLeadJet2;#it{p}_{T}^{jet 1};#it{p}_{T}^{jet 2}",nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt);
399 fOutput->Add(fh2PtLeadJet1VsLeadJet2);
401 fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta;#phi",nBinsECluster,minECluster,maxECluster,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
402 fOutput->Add(fh3EEtaPhiCluster);
404 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);
405 fOutput->Add(fh3PtLeadJet1VsPatchEnergy);
406 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);
407 fOutput->Add(fh3PtLeadJet2VsPatchEnergy);
409 fh3PatchEnergyEtaPhiCenter = new TH3F("fh3PatchEnergyEtaPhiCenter","fh3PatchEnergyEtaPhiCenter;E_{patch};#eta;#phi",nBinsPt,minPt,maxPt,nBinsEta,minEta,maxEta,nBinsPhi,minPhi,maxPhi);
410 fOutput->Add(fh3PatchEnergyEtaPhiCenter);
412 fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",100,0.,100.,700,-400,1000);
413 fOutput->Add(fh2CellEnergyVsTime);
416 // =========== Switch on Sumw2 for all histos ===========
417 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
418 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
423 TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
428 TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
433 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
437 TH1::AddDirectory(oldStatus);
439 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
442 //________________________________________________________________________
443 Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
447 AliClusterContainer *clusCont = GetClusterContainer(0);
450 Int_t nclusters = clusCont->GetNClusters();
451 for (Int_t ic = 0; ic < nclusters; ic++) {
452 AliVCluster *cluster = static_cast<AliVCluster*>(clusCont->GetCluster(ic));
454 AliError(Form("Could not receive cluster %d", ic));
457 if (!cluster->IsEMCAL()) {
458 AliDebug(11,Form("%s: Cluster is not emcal",GetName()));
463 cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
465 //Fill eta,phi,E of clusters here
466 fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
471 const Short_t nCells = fCaloCells->GetNumberOfCells();
473 for(Int_t iCell=0; iCell<nCells; ++iCell) {
474 Short_t cellId = fCaloCells->GetCellNumber(iCell);
475 Double_t cellE = fCaloCells->GetCellAmplitude(cellId);
476 Double_t cellT = fCaloCells->GetCellTime(cellId);
478 AliDebug(2,Form("cell energy = %f time = %f",cellE,cellT*1e9));
479 fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
485 Double_t ptLeadJet1 = 0.;
486 Double_t ptLeadJet2 = 0.;
488 TArrayI *nJetsArr = new TArrayI(fh2NJetsPtFull->GetNbinsY()+1);
490 nJetsArr->Set(fh2NJetsPtFull->GetNbinsY()+1);
492 if (GetJetContainer(fContainerFull)) {
493 const Int_t njets = GetNJets(fContainerFull);
494 for (Int_t ij = 0; ij < njets; ij++) {
496 AliEmcalJet* jet = GetAcceptJetFromArray(ij,fContainerFull);
498 continue; //jet not selected
500 Double_t jetPt = jet->Pt();
501 if(jetPt>ptLeadJet1) ptLeadJet1=jetPt;
502 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
503 fh3PtEtaAreaJetFull->Fill(jetPt,jet->Eta(),jet->Area());
505 //count jets above certain pT threshold
506 Int_t ptbin = fh2NJetsPtFull->GetYaxis()->FindBin(jetPt);
507 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtFull->GetNbinsY(); iptbin++)
508 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
510 fh2PtNConstituentsCharged->Fill(jetPt,jet->GetNumberOfTracks());
511 fh2PtNConstituents->Fill(jetPt,jet->GetNumberOfConstituents());
513 fh2PtNEF->Fill(jetPt,jet->NEF());
514 fh3NEFEtaPhi->Fill(jet->NEF(),jet->Eta(),jet->Phi());
515 fh2NEFNConstituentsCharged->Fill(jet->NEF(),jet->GetNumberOfTracks());
516 fh2NEFNConstituentsNeutral->Fill(jet->NEF(),jet->GetNumberOfClusters());
519 Double_t sumPtCh = 0.;
520 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
521 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
523 fh2Ptz->Fill(jetPt,GetZ(vp,jet));
527 if(jet->GetNumberOfTracks()>0)
528 fh2PtMeanPtConstituentsCharged->Fill(jetPt,sumPtCh/(double)(jet->GetNumberOfTracks()) );
531 AliVCluster *vc = 0x0;
532 Double_t sumPtNe = 0.;
534 for(Int_t icc=0; icc<jet->GetNumberOfClusters(); icc++) {
535 vc = static_cast<AliVCluster*>(clusCont->GetCluster(icc));
539 vc->GetMomentum(lp, const_cast<Double_t*>(fVertex));
544 if(jet->GetNumberOfClusters()>0)
545 fh2PtMeanPtConstituentsNeutral->Fill(jetPt,sumPtNe/(double)(jet->GetNumberOfClusters()) );
549 for(Int_t i=1; i<=fh2NJetsPtFull->GetNbinsY(); i++) {
550 Int_t nJetsInEvent = nJetsArr->At(i);
551 fh2NJetsPtFull->Fill(nJetsInEvent,fh2NJetsPtFull->GetYaxis()->GetBinCenter(i));
556 //Reset array to zero to also count charged jets
559 //Loop over charged jets
560 if (GetJetContainer(fContainerCharged)) {
561 const Int_t njets = GetNJets(fContainerCharged);
562 for (Int_t ij = 0; ij < njets; ij++) {
564 AliEmcalJet* jet = GetAcceptJetFromArray(ij,fContainerCharged);
566 continue; //jet not selected
568 Double_t jetPt = jet->Pt();
569 if(jetPt>ptLeadJet2) ptLeadJet2=jetPt;
570 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
571 fh3PtEtaAreaJetCharged->Fill(jetPt,jet->Eta(),jet->Area());
574 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
575 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
577 fh2PtzCharged->Fill(jetPt,GetZ(vp,jet));
580 //count jets above certain pT threshold
581 Int_t ptbin = fh2NJetsPtCharged->GetYaxis()->FindBin(jetPt);
582 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtCharged->GetNbinsY(); iptbin++)
583 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
586 for(Int_t i=1; i<=fh2NJetsPtCharged->GetNbinsY(); i++) {
587 Int_t nJetsInEvent = nJetsArr->At(i);
588 fh2NJetsPtCharged->Fill(nJetsInEvent,fh2NJetsPtCharged->GetYaxis()->GetBinCenter(i));
592 if(GetJetContainer(fContainerFull) && GetJetContainer(fContainerCharged)) {
593 fh2PtLeadJet1VsLeadJet2->Fill(ptLeadJet1,ptLeadJet2);
596 fh3PtLeadJet1VsPatchEnergy->Fill(ptLeadJet1,fMaxPatchEnergy,fTriggerType);
597 fh3PtLeadJet2VsPatchEnergy->Fill(ptLeadJet2,fMaxPatchEnergy,fTriggerType);
599 if(nJetsArr) delete nJetsArr;
604 //________________________________________________________________________
605 Bool_t AliAnalysisTaskEmcalJetTriggerQA::Run()
607 // Run analysis code here, if needed. It will be executed before FillHistograms().
609 //Check if event is selected (vertex & pile-up)
615 if(!fTriggerClass.IsNull())
618 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
621 //_______________________________________________________________________
622 void AliAnalysisTaskEmcalJetTriggerQA::Terminate(Option_t *)
624 // Called once at the end of the analysis.
626 //________________________________________________________________________
627 Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const AliVParticle *trk, const AliEmcalJet *jet) const
629 // Get Z of constituent trk
631 return GetZ(trk->Px(),trk->Py(),trk->Pz(),jet->Px(),jet->Py(),jet->Pz());
634 //________________________________________________________________________
635 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
638 // Get the z of a constituent inside of a jet
641 Double_t pJetSq = jetPx*jetPx+jetPy*jetPy+jetPz*jetPz;
644 return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/pJetSq;
646 AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq));