From c8eb9b081efe16c795ad4767565fd488be86c1c5 Mon Sep 17 00:00:00 2001 From: Nima Zardoshti Date: Tue, 26 Mar 2024 15:15:10 +0100 Subject: [PATCH 1/2] EventFiltering : Adding D0 and Lc tagged jet triggers --- EventFiltering/CMakeLists.txt | 5 + EventFiltering/PWGJE/jetHFFilter.cxx | 150 +++++++++++++++ EventFiltering/filterTables.h | 14 ++ PWGJE/Core/JetDerivedDataUtilities.h | 54 ++++++ PWGJE/DataModel/JetReducedData.h | 8 + .../jetderiveddatatriggerproducer.cxx | 13 ++ PWGJE/TableProducer/jetderiveddatawriter.cxx | 7 +- PWGJE/Tasks/jetfinderhfQA.cxx | 176 ++++++++++++++++++ 8 files changed, 425 insertions(+), 2 deletions(-) create mode 100644 EventFiltering/PWGJE/jetHFFilter.cxx diff --git a/EventFiltering/CMakeLists.txt b/EventFiltering/CMakeLists.txt index 4a3e3074816..8ad0d0c4061 100644 --- a/EventFiltering/CMakeLists.txt +++ b/EventFiltering/CMakeLists.txt @@ -67,6 +67,11 @@ o2physics_add_dpl_workflow(je-filter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGJECore FastJet::FastJet FastJet::Contrib COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(je-hf-filter + SOURCES PWGJE/jetHFFilter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGJECore FastJet::FastJet FastJet::Contrib + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(fje-filter SOURCES PWGJE/fullJetFilter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGJECore FastJet::FastJet FastJet::Contrib Boost::system diff --git a/EventFiltering/PWGJE/jetHFFilter.cxx b/EventFiltering/PWGJE/jetHFFilter.cxx new file mode 100644 index 00000000000..53a90ae006c --- /dev/null +++ b/EventFiltering/PWGJE/jetHFFilter.cxx @@ -0,0 +1,150 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// Author: Nima Zardoshti + +#include +#include +#include + +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetBkgSubUtils.h" +#include "PWGJE/DataModel/EMCALClusters.h" +#include "PWGJE/DataModel/Jet.h" + +#include "../filterTables.h" + +#include "Framework/HistogramRegistry.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +static const std::vector highPtObjectsNames = {"JetD0ChLowPt", "JetD0ChHighPt", "JetLcChLowPt", "JetLcChHighPt"}; + +struct JetHFFilterTask { + + HistogramRegistry registry; + + enum { kJetD0ChLowPt = 0, + kJetD0ChHighPt = 1, + kJetLcChLowPt = 2, + kJetLcChHighPt = 3, + kAllObjects = 4 }; + + Produces tags; + + Configurable jetD0ChLowPtThreshold{"jetD0ChLowPtThreshold", 0.0, "Threshold for charged D0 jet low pt trigger"}; + Configurable jetD0ChHighPtThreshold{"jetD0ChHighPtThreshold", 0.0, "Threshold for charged D0 jet high pt trigger"}; + Configurable jetD0ChR{"jetD0ChR", 0.6, "jet resolution parameter for charged D0 jet for low pt trigger"}; + Configurable jetLcChLowPtThreshold{"jetLcChLowPtThreshold", 0.0, "Threshold for charged Lc jet low pt trigger"}; + Configurable jetLcChHighPtThreshold{"jetLcChHighPtThreshold", 0.0, "Threshold for charged Lc jet high pt trigger"}; + Configurable jetLcChR{"jetLcChR", 0.6, "jet resolution parameter for charged Lc jet for low pt trigger"}; + + Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + Configurable fillTHns{"fillTHns", true, "fill THn histograms"}; + + Configurable> jetRadiiPlot{"jetRadiiPlot", std::vector{0.2, 0.4, 0.6}, "jet resolution parameters"}; + + void init(o2::framework::InitContext&) + { + auto jetRadiiPlotBins = (std::vector)jetRadiiPlot; + if (jetRadiiPlotBins.size() > 1) { + jetRadiiPlotBins.push_back(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] + (TMath::Abs(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] - jetRadiiPlotBins[jetRadiiPlotBins.size() - 2]))); + } else { + jetRadiiPlotBins.push_back(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] + 0.1); + } + + registry.add("h_d0jet_pt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_d0jet_pt_lowpt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_d0jet_pt_highpt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + + registry.add("h_lcjet_pt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_lcjet_pt_lowpt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_lcjet_pt_highpt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); + + // these might end up being too big + registry.add("d0Thn", "Thn for D^{0}-tagged jets", {HistType::kTHnC, {{jetRadiiPlotBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {200, 0., 200.}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {100, -1.0, 1.0}, {1700, 1.3, 3.0}}}); + registry.add("d0Thn_witheventcuts", "Thn for D^{0}-tagged jets with event cuts", {HistType::kTHnC, {{jetRadiiPlotBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {200, 0., 200.}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {100, -1.0, 1.0}, {1700, 1.3, 3.0}}}); + registry.add("lcThn", "Thn for #Lambda^{+}_{c}-tagged jets", {HistType::kTHnC, {{jetRadiiPlotBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {200, 0., 200.}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {100, -1.0, 1.0}, {1700, 1.3, 3.0}}}); + registry.add("lcThn_witheventcuts", "Thn for #Lambda^{+}_{c}-tagged jets with event cuts", {HistType::kTHnC, {{jetRadiiPlotBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {200, 0., 200.}, {200, 0., 200.}, {100, -1.0, 1.0}, {160, -1.0, 7.}, {100, -1.0, 1.0}, {1700, 1.3, 3.0}}}); + // radius, JetPt, JetEta, Jet Phi, Jet Ntracks, HF pT, HF Eta, HF Phi, HF Y, HF Mass + } + + void processJets(soa::Join::iterator const& collision, soa::Join const& d0Jets, CandidatesD0Data const& d0Candidates, soa::Join const& lcJets, CandidatesLcData const& lcCandidates, JetTracks const& tracks) + { + bool keepEvent[kAllObjects]{false}; + for (auto const& d0Jet : d0Jets) { + if (fillTHns) { + for (auto const& d0Candidate : d0Jet.hfcandidates_as()) { + registry.fill(HIST("d0Thn"), d0Jet.r() / 100.0, d0Jet.pt(), d0Jet.eta(), d0Jet.phi(), d0Jet.tracksIds().size() + d0Jet.hfcandidatesIds().size(), d0Candidate.pt(), d0Candidate.eta(), d0Candidate.phi(), d0Candidate.y(), d0Candidate.m()); + if (collision.posZ() < vertexZCut && collision.sel8() && collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + registry.fill(HIST("d0Thn_witheventcuts"), d0Jet.r() / 100.0, d0Jet.pt(), d0Jet.eta(), d0Jet.phi(), d0Jet.tracksIds().size() + d0Jet.hfcandidatesIds().size(), d0Candidate.pt(), d0Candidate.eta(), d0Candidate.phi(), d0Candidate.y(), d0Candidate.m()); + } + break; + } + } + if (d0Jet.r() == round(jetD0ChR * 100.0f)) { + registry.fill(HIST("h_d0jet_pt"), d0Jet.pt()); + if (d0Jet.pt() >= jetD0ChLowPtThreshold) { + keepEvent[kJetD0ChLowPt] = true; + registry.fill(HIST("h_d0jet_pt_lowpt"), d0Jet.pt()); + } + if (d0Jet.pt() >= jetD0ChHighPtThreshold) { + keepEvent[kJetD0ChHighPt] = true; + registry.fill(HIST("h_d0jet_pt_highpt"), d0Jet.pt()); + } + } + } + for (auto const& lcJet : lcJets) { + if (fillTHns) { + for (auto const& lcCandidate : lcJet.hfcandidates_as()) { + registry.fill(HIST("lcThn"), lcJet.r() / 100.0, lcJet.pt(), lcJet.eta(), lcJet.phi(), lcJet.tracksIds().size() + lcJet.hfcandidatesIds().size(), lcCandidate.pt(), lcCandidate.eta(), lcCandidate.phi(), lcCandidate.y(), lcCandidate.m()); + if (collision.posZ() < vertexZCut && collision.sel8() && collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + registry.fill(HIST("lcThn_witheventcuts"), lcJet.r() / 100.0, lcJet.pt(), lcJet.eta(), lcJet.phi(), lcJet.tracksIds().size() + lcJet.hfcandidatesIds().size(), lcCandidate.pt(), lcCandidate.eta(), lcCandidate.phi(), lcCandidate.y(), lcCandidate.m()); + } + break; + } + } + if (lcJet.r() == round(jetLcChR * 100.0f)) { + registry.fill(HIST("h_lcjet_pt"), lcJet.pt()); + if (lcJet.pt() >= jetLcChLowPtThreshold) { + keepEvent[kJetLcChLowPt] = true; + registry.fill(HIST("h_lcjet_pt_lowpt"), lcJet.pt()); + } + if (lcJet.pt() >= jetLcChHighPtThreshold) { + keepEvent[kJetLcChHighPt] = true; + registry.fill(HIST("h_lcjet_pt_highpt"), lcJet.pt()); + } + } + } + tags(keepEvent[kJetD0ChLowPt], keepEvent[kJetD0ChHighPt], keepEvent[kJetLcChLowPt], keepEvent[kJetLcChHighPt]); + } + PROCESS_SWITCH(JetHFFilterTask, processJets, "Do HF charged jet triggering", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfg) +{ + return WorkflowSpec{adaptAnalysisTask(cfg)}; +} diff --git a/EventFiltering/filterTables.h b/EventFiltering/filterTables.h index 742e5499816..8e0d85b62a7 100644 --- a/EventFiltering/filterTables.h +++ b/EventFiltering/filterTables.h @@ -67,6 +67,12 @@ DECLARE_SOA_COLUMN(LLL, hasLLL, bool); //! has L-L-L tripletD DECLARE_SOA_COLUMN(JetChLowPt, hasJetChLowPt, bool); //! low-pT charged jet DECLARE_SOA_COLUMN(JetChHighPt, hasJetChHighPt, bool); //! high-pT charged jet +// hf-jets +DECLARE_SOA_COLUMN(JetD0ChLowPt, hasJetD0ChLowPt, bool); //! low-pT charged D0 jet +DECLARE_SOA_COLUMN(JetD0ChHighPt, hasJetD0ChHighPt, bool); //! high-pT charged D0 jet +DECLARE_SOA_COLUMN(JetLcChLowPt, hasJetLcChLowPt, bool); //! low-pT charged Lc jet +DECLARE_SOA_COLUMN(JetLcChHighPt, hasJetLcChHighPt, bool); //! high-pT charged Lc jet + // full jets DECLARE_SOA_COLUMN(EMCALReadout, hasEMCALinReadout, bool); //! EMCAL readout DECLARE_SOA_COLUMN(JetFullHighPt, hasJetFullHighPt, bool); //! high-pT full jet @@ -175,6 +181,14 @@ DECLARE_SOA_TABLE(JetFilters, "AOD", "JetFilters", //! using JetFilter = JetFilters::iterator; +DECLARE_SOA_TABLE(JetHFFilters, "AOD", "JetHFFilters", //! + filtering::JetD0ChLowPt, + filtering::JetD0ChHighPt, + filtering::JetLcChLowPt, + filtering::JetLcChHighPt); + +using JetHFFilter = JetHFFilters::iterator; + DECLARE_SOA_TABLE(FullJetFilters, "AOD", "FullJetFilters", //! filtering::EMCALReadout, filtering::JetFullHighPt, filtering::JetFullLowPt, filtering::JetNeutralHighPt, filtering::JetNeutralLowPt, filtering::GammaVeryHighPtEMCAL, filtering::GammaVeryHighPtDCAL, filtering::GammaHighPtEMCAL, filtering::GammaHighPtDCAL, filtering::GammaLowPtEMCAL, filtering::GammaLowPtDCAL, filtering::GammaVeryLowPtEMCAL, filtering::GammaVeryLowPtDCAL); diff --git a/PWGJE/Core/JetDerivedDataUtilities.h b/PWGJE/Core/JetDerivedDataUtilities.h index 46270431321..cabcc458453 100644 --- a/PWGJE/Core/JetDerivedDataUtilities.h +++ b/PWGJE/Core/JetDerivedDataUtilities.h @@ -238,6 +238,60 @@ uint32_t setFullTriggerSelectionBit(T const& collision) return bit; } +enum JTrigSelChHF { + noChargedHFTigger = 0, + chargedD0Low = 1, + chargedD0High = 2, + chargedLcLow = 3, + chargedLcHigh = 4 +}; + +template +bool selectChargedHFTrigger(T const& collision, int triggerSelection) +{ + if (triggerSelection == -1) { + return true; + } + return (collision.chargedHFTriggerSel() & (1 << triggerSelection)); +} + +int initialiseChargedHFTriggerSelection(std::string triggerSelection) +{ + if (triggerSelection == "chargedD0Low") { + return JTrigSelChHF::chargedD0Low; + } + if (triggerSelection == "chargedD0High") { + return JTrigSelChHF::chargedD0High; + } + if (triggerSelection == "chargedLcLow") { + return JTrigSelChHF::chargedLcLow; + } + if (triggerSelection == "chargedLcHigh") { + return JTrigSelChHF::chargedLcHigh; + } + return -1; +} + +template +uint8_t setChargedHFTriggerSelectionBit(T const& collision) +{ + + uint8_t bit = 0; + if (collision.hasJetD0ChLowPt()) { + SETBIT(bit, JTrigSelChHF::chargedD0Low); + } + if (collision.hasJetD0ChHighPt()) { + SETBIT(bit, JTrigSelChHF::chargedD0High); + } + if (collision.hasJetLcChLowPt()) { + SETBIT(bit, JTrigSelChHF::chargedLcLow); + } + if (collision.hasJetLcChHighPt()) { + SETBIT(bit, JTrigSelChHF::chargedLcHigh); + } + return bit; +} + enum JTrackSel { trackSign = 0, // warning : this number is hardcoded in the sign coloumn in the JTracks table so should not be changed without changing it there too globalTrack = 1, diff --git a/PWGJE/DataModel/JetReducedData.h b/PWGJE/DataModel/JetReducedData.h index 78da7bea3c4..0fcbc8576f8 100644 --- a/PWGJE/DataModel/JetReducedData.h +++ b/PWGJE/DataModel/JetReducedData.h @@ -70,6 +70,7 @@ DECLARE_SOA_COLUMN(EventSel, eventSel, uint16_t); DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32); DECLARE_SOA_COLUMN(ChargedTriggerSel, chargedTriggerSel, uint8_t); DECLARE_SOA_COLUMN(FullTriggerSel, fullTriggerSel, uint32_t); +DECLARE_SOA_COLUMN(ChargedHFTriggerSel, chargedHFTriggerSel, uint8_t); } // namespace jcollision DECLARE_SOA_TABLE(JCollisions, "AOD", "JCOLLISION", @@ -118,6 +119,13 @@ DECLARE_SOA_TABLE(StoredJFullTrigSels, "AOD1", "JFULLTRIGSEL", jcollision::FullTriggerSel, o2::soa::Marker<1>); +DECLARE_SOA_TABLE(JChHFTrigSels, "AOD", "JCHHFTRIGSEL", + jcollision::ChargedHFTriggerSel); + +DECLARE_SOA_TABLE(StoredJChHFTrigSels, "AOD1", "JCHHFTRIGSEL", + jcollision::ChargedHFTriggerSel, + o2::soa::Marker<1>); + DECLARE_SOA_TABLE(JCollisionBCs, "AOD", "JCOLLISIONBC", jcollision::JBCId); diff --git a/PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx b/PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx index 3471a8950b2..5a3ab4bce10 100644 --- a/PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx +++ b/PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx @@ -35,6 +35,7 @@ using namespace o2::framework::expressions; struct JetDerivedDataTriggerProducerTask { Produces jChargedTriggerSelsTable; Produces jFullTriggerSelsTable; + Produces jChargedHFTriggerSelsTable; void init(InitContext const&) { @@ -63,6 +64,18 @@ struct JetDerivedDataTriggerProducerTask { jFullTriggerSelsTable(jetderiveddatautilities::JTrigSelFull::noFullTrigger); } PROCESS_SWITCH(JetDerivedDataTriggerProducerTask, processNoFullJetTriggers, "produces derived full trigger table table when sample is not triggered", true); + + void processChargedHFJetTriggers(soa::Join::iterator const& collision) + { + jChargedHFTriggerSelsTable(jetderiveddatautilities::setChargedHFTriggerSelectionBit(collision)); + } + PROCESS_SWITCH(JetDerivedDataTriggerProducerTask, processChargedHFJetTriggers, "produces derived charged hf trigger table", false); + + void processNoChargedHFJetTriggers(aod::Collision const& collision) + { + jChargedHFTriggerSelsTable(jetderiveddatautilities::JTrigSelChHF::noChargedHFTigger); + } + PROCESS_SWITCH(JetDerivedDataTriggerProducerTask, processNoChargedHFJetTriggers, "produces derived charged hf trigger table when sample is not triggered", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGJE/TableProducer/jetderiveddatawriter.cxx b/PWGJE/TableProducer/jetderiveddatawriter.cxx index 952eed1c680..352efc25fb6 100644 --- a/PWGJE/TableProducer/jetderiveddatawriter.cxx +++ b/PWGJE/TableProducer/jetderiveddatawriter.cxx @@ -58,6 +58,7 @@ struct JetDerivedDataWriter { Produces storedJCollisionsBunchCrossingIndexTable; Produces storedJChargedTriggerSelsTable; Produces storedJFullTriggerSelsTable; + Produces storedJChargedHFTriggerSelsTable; Produces storedJMcCollisionsLabelTable; Produces storedJMcCollisionsTable; Produces storedJMcCollisionsParentIndexTable; @@ -182,7 +183,7 @@ struct JetDerivedDataWriter { } PROCESS_SWITCH(JetDerivedDataWriter, processDummyTable, "write out dummy output table", true); - void processData(soa::Join::iterator const& collision, soa::Join const& bcs, soa::Join const& tracks, soa::Join const& clusters, aod::HfD0CollBases const& D0Collisions, CandidatesD0Data const& D0s, aod::Hf3PCollBases const& LcCollisions, CandidatesLcData const& Lcs) + void processData(soa::Join::iterator const& collision, soa::Join const& bcs, soa::Join const& tracks, soa::Join const& clusters, aod::HfD0CollBases const& D0Collisions, CandidatesD0Data const& D0s, aod::Hf3PCollBases const& LcCollisions, CandidatesLcData const& Lcs) { std::map bcMapping; std::map trackMapping; @@ -210,6 +211,7 @@ struct JetDerivedDataWriter { } storedJChargedTriggerSelsTable(collision.chargedTriggerSel()); storedJFullTriggerSelsTable(collision.fullTriggerSel()); + storedJChargedHFTriggerSelsTable(collision.chargedHFTriggerSel()); for (const auto& track : tracks) { if (performTrackSelection && !(track.trackSel() & ~(1 << jetderiveddatautilities::JTrackSel::trackSign))) { // skips tracks that pass no selections. This might cause a problem with tracks matched with clusters. We should generate a track selection purely for cluster matched tracks so that they are kept @@ -299,7 +301,7 @@ struct JetDerivedDataWriter { // to run after all jet selections PROCESS_SWITCH(JetDerivedDataWriter, processData, "write out data output tables", false); - void processMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& bcs, soa::Join const& tracks, soa::Join const& clusters, soa::Join const& particles, aod::HfD0CollBases const& D0Collisions, CandidatesD0MCD const& D0s, CandidatesD0MCP const& D0Particles, aod::Hf3PCollBases const& LcCollisions, CandidatesLcMCD const& Lcs, CandidatesLcMCP const& LcParticles) + void processMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& bcs, soa::Join const& tracks, soa::Join const& clusters, soa::Join const& particles, aod::HfD0CollBases const& D0Collisions, CandidatesD0MCD const& D0s, CandidatesD0MCP const& D0Particles, aod::Hf3PCollBases const& LcCollisions, CandidatesLcMCD const& Lcs, CandidatesLcMCP const& LcParticles) { std::map bcMapping; std::map paticleMapping; @@ -425,6 +427,7 @@ struct JetDerivedDataWriter { } storedJChargedTriggerSelsTable(collision.chargedTriggerSel()); storedJFullTriggerSelsTable(collision.fullTriggerSel()); + storedJChargedHFTriggerSelsTable(collision.chargedHFTriggerSel()); const auto tracksPerCollision = tracks.sliceBy(TracksPerCollision, collision.globalIndex()); for (const auto& track : tracksPerCollision) { diff --git a/PWGJE/Tasks/jetfinderhfQA.cxx b/PWGJE/Tasks/jetfinderhfQA.cxx index ac033cb5a10..39f20bbbc05 100644 --- a/PWGJE/Tasks/jetfinderhfQA.cxx +++ b/PWGJE/Tasks/jetfinderhfQA.cxx @@ -73,6 +73,9 @@ struct JetFinderHFQATask { std::vector filledJetR_Both; std::vector filledJetR_Low; std::vector filledJetR_High; + std::vector filledJetHFR_All; + std::vector filledJetHFR_Low; + std::vector filledJetHFR_High; std::vector jetRadiiValues; int eventSelection = -1; @@ -89,6 +92,9 @@ struct JetFinderHFQATask { filledJetR_Both.push_back(0.0); filledJetR_Low.push_back(0.0); filledJetR_High.push_back(0.0); + filledJetHFR_All.push_back(0.0); + filledJetHFR_Low.push_back(0.0); + filledJetHFR_High.push_back(0.0); } auto jetRadiiBins = (std::vector)jetRadii; if (jetRadiiBins.size() > 1) { @@ -354,6 +360,47 @@ struct JetFinderHFQATask { registry.add("h3_jet_r_jet_pt_candidate_y_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); } + if (doprocessHFTriggeredData) { + registry.add("h_collision_hftrigger_events", "event status;event status;entries", {HistType::kTH1F, {{115, 0.0, 15.0}}}); + + registry.add("h_track_pt_all", "track pT for MB events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); + registry.add("h_track_eta_all", "track #eta for MB events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("h_track_phi_all", "track #varphi for MB events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); + registry.add("h_track_pt_triggered_HFlow", "track pT for low #it{p}_{T} HF Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); + registry.add("h_track_eta_triggered_HFlow", "track #eta for low #it{p}_{T} HF Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("h_track_phi_triggered_HFlow", "track #varphi for low #it{p}_{T} HF Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); + registry.add("h_track_pt_triggered_HFhigh", "track pT for high #it{p}_{T} HF Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); + registry.add("h_track_eta_triggered_HFhigh", "track #eta for high #it{p}_{T} HF Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("h_track_phi_triggered_HFhigh", "track #varphi for high #it{p}_{T} HF Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); + + registry.add("h2_jet_r_jet_pT_triggered_all", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_pT_triggered_HFlow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_pT_triggered_HFhigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_pT_triggered_Lcall", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_pT_triggered_Lclow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_pT_triggered_Lchigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); + registry.add("h2_jet_r_jet_eta_triggered_HFall", "#it{R}_{jet};#eta_{jet}", {HistType::kTH2F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}}}); + registry.add("h2_jet_r_jet_eta_triggered_HFlow", "#it{R}_{jet};#eta_{jet}", {HistType::kTH2F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}}}); + registry.add("h2_jet_r_jet_eta_triggered_HFhigh", "#it{R}_{jet};#eta_{jet}", {HistType::kTH2F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}}}); + + registry.add("h3_hfjet_r_jet_pt_collision", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {4, -0.5, 3.5}}}); + registry.add("h3_hfjet_r_jet_eta_collision", "#it{R}_{jet};#eta_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {4, -0.5, 3.5}}}); + registry.add("h3_hfjet_r_jet_phi_collision", "#it{R}_{jet};#varphi_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {160, -1.0, 7.}, {4, -0.5, 3.5}}}); + + registry.add("h3_jet_r_jet_pt_candidate_pt_all", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); + registry.add("h3_jet_r_jet_pt_candidate_eta_all", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_all", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_y_all", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + registry.add("h3_jet_r_jet_pt_candidate_pt_triggered_HFlow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); + registry.add("h3_jet_r_jet_pt_candidate_eta_triggered_HFlow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_triggered_HFlow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_y_triggered_HFlow", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + registry.add("h3_jet_r_jet_pt_candidate_pt_triggered_HFhigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); + registry.add("h3_jet_r_jet_pt_candidate_eta_triggered_HFhigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_triggered_HFhigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_y_triggered_HFhigh", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); + } + if (doprocessTracks || doprocessTracksWeighted) { registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h2_centrality_collisions", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {{1200, -10.0, 110.0}, {4, 0.0, 4.0}}}); @@ -1187,6 +1234,135 @@ struct JetFinderHFQATask { PROCESS_SWITCH(JetFinderHFQATask, processTriggeredData, "QA for charged jet trigger", false); + void processHFTriggeredData(soa::Join::iterator const& collision, + JetTableDataJoined const& jets, + CandidateTableData const& candidates, + soa::Filtered const& tracks) + { + + int hfLowTrigger = -2; + int hfHighTrigger = -2; + if constexpr (jethfutilities::isD0Table()) { + hfLowTrigger = jetderiveddatautilities::JTrigSelChHF::chargedD0Low; + hfHighTrigger = jetderiveddatautilities::JTrigSelChHF::chargedD0High; + } + if constexpr (jethfutilities::isLcTable()) { + hfLowTrigger = jetderiveddatautilities::JTrigSelChHF::chargedLcLow; + hfHighTrigger = jetderiveddatautilities::JTrigSelChHF::chargedLcHigh; + } + + registry.fill(HIST("h_collision_hftrigger_events"), 0.5); // all events + if (collision.posZ() > vertexZCut) { + return; + } + registry.fill(HIST("h_collision_hftrigger_events"), 1.5); // all events with z vertex cut + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + registry.fill(HIST("h_collision_hftrigger_events"), 2.5); // events with sel8() + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0Low)) { + registry.fill(HIST("h_collision_hftrigger_events"), 3.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0High)) { + registry.fill(HIST("h_collision_hftrigger_events"), 4.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0Low) && jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0High)) { + registry.fill(HIST("h_collision_hftrigger_events"), 5.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcLow)) { + registry.fill(HIST("h_collision_hftrigger_events"), 6.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcHigh)) { + registry.fill(HIST("h_collision_hftrigger_events"), 7.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcLow) && jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcHigh)) { + registry.fill(HIST("h_collision_hftrigger_events"), 8.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0Low) && jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcLow)) { + registry.fill(HIST("h_collision_hftrigger_events"), 9.5); // events with high pT triggered jets + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedD0High) && jetderiveddatautilities::selectChargedHFTrigger(collision, jetderiveddatautilities::JTrigSelChHF::chargedLcHigh)) { + registry.fill(HIST("h_collision_hftrigger_events"), 10.5); // events with high pT triggered jets + } + + for (std::size_t iJetRadius = 0; iJetRadius < jetRadiiValues.size(); iJetRadius++) { + filledJetHFR_All[iJetRadius] = false; + filledJetHFR_Low[iJetRadius] = false; + filledJetHFR_High[iJetRadius] = false; + } + for (auto& jet : jets) { + for (std::size_t iJetRadius = 0; iJetRadius < jetRadiiValues.size(); iJetRadius++) { + if (jet.r() == round(jetRadiiValues[iJetRadius] * 100.0f)) { + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfLowTrigger) && !filledJetHFR_Low[iJetRadius]) { + filledJetHFR_Low[iJetRadius] = true; + for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { + registry.fill(HIST("h2_jet_r_jet_pT_triggered_HFlow"), jet.r() / 100.0, pt); + } + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfHighTrigger) && !filledJetHFR_High[iJetRadius]) { + filledJetHFR_High[iJetRadius] = true; + for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { + registry.fill(HIST("h2_jet_r_jet_pT_triggered_HFhigh"), jet.r() / 100.0, pt); + } + } + if (!filledJetHFR_High[iJetRadius]) { + filledJetHFR_All[iJetRadius] = true; + for (double pt = 0.0; pt <= jet.pt(); pt += 1.0) { + registry.fill(HIST("h2_jet_r_jet_pT_triggered_all"), jet.r() / 100.0, pt); + } + } + } + } + + if ((jet.eta() < (trackEtaMin + jet.r() / 100.0)) || (jet.eta() > (trackEtaMax - jet.r() / 100.0))) { + continue; + } + + registry.fill(HIST("h3_hfjet_r_jet_pt_collision"), jet.r() / 100.0, jet.pt(), 0.0); + registry.fill(HIST("h3_hfjet_r_jet_eta_collision"), jet.r() / 100.0, jet.eta(), 0.0); + registry.fill(HIST("h3_hfjet_r_jet_phi_collision"), jet.r() / 100.0, jet.phi(), 0.0); + + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfLowTrigger)) { + registry.fill(HIST("h3_hfjet_r_jet_pt_collision"), jet.r() / 100.0, jet.pt(), 1.0); + registry.fill(HIST("h3_hfjet_r_jet_eta_collision"), jet.r() / 100.0, jet.eta(), 1.0); + registry.fill(HIST("h3_hfjet_r_jet_phi_collision"), jet.r() / 100.0, jet.phi(), 1.0); + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfHighTrigger)) { + registry.fill(HIST("h3_hfjet_r_jet_pt_collision"), jet.r() / 100.0, jet.pt(), 2.0); + registry.fill(HIST("h3_hfjet_r_jet_eta_collision"), jet.r() / 100.0, jet.eta(), 2.0); + registry.fill(HIST("h3_hfjet_r_jet_phi_collision"), jet.r() / 100.0, jet.phi(), 2.0); + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfLowTrigger) && jetderiveddatautilities::selectChargedHFTrigger(collision, hfHighTrigger)) { + registry.fill(HIST("h3_hfjet_r_jet_pt_collision"), jet.r() / 100.0, jet.pt(), 3.0); + registry.fill(HIST("h3_hfjet_r_jet_eta_collision"), jet.r() / 100.0, jet.eta(), 3.0); + registry.fill(HIST("h3_hfjet_r_jet_phi_collision"), jet.r() / 100.0, jet.phi(), 3.0); + } + + for (auto& hfcandidate : jet.template hfcandidates_as()) { + + registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt_all"), jet.r() / 100.0, jet.pt(), hfcandidate.pt()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta_all"), jet.r() / 100.0, jet.pt(), hfcandidate.eta()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi_all"), jet.r() / 100.0, jet.pt(), hfcandidate.phi()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_all"), jet.r() / 100.0, jet.pt(), hfcandidate.y()); + + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfLowTrigger)) { + registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt_triggered_HFlow"), jet.r() / 100.0, jet.pt(), hfcandidate.pt()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta_triggered_HFlow"), jet.r() / 100.0, jet.pt(), hfcandidate.eta()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi_triggered_HFlow"), jet.r() / 100.0, jet.pt(), hfcandidate.phi()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_triggered_HFlow"), jet.r() / 100.0, jet.pt(), hfcandidate.y()); + } + if (jetderiveddatautilities::selectChargedHFTrigger(collision, hfHighTrigger)) { + registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt_triggered_HFhigh"), jet.r() / 100.0, jet.pt(), hfcandidate.pt()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta_triggered_HFhigh"), jet.r() / 100.0, jet.pt(), hfcandidate.eta()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi_triggered_HFhigh"), jet.r() / 100.0, jet.pt(), hfcandidate.phi()); + registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_triggered_HFhigh"), jet.r() / 100.0, jet.pt(), hfcandidate.y()); + } + } + } + } + + PROCESS_SWITCH(JetFinderHFQATask, processHFTriggeredData, "QA for charged hf jet trigger", false); + void processTracks(soa::Filtered::iterator const& collision, soa::Filtered const& tracks) { From 41efe72efe9b59292bc376e92f6b49e385c5b240 Mon Sep 17 00:00:00 2001 From: Nima Zardoshti Date: Wed, 27 Mar 2024 11:51:18 +0100 Subject: [PATCH 2/2] adding to list of filters --- EventFiltering/filterTables.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EventFiltering/filterTables.h b/EventFiltering/filterTables.h index 8e0d85b62a7..7909683605c 100644 --- a/EventFiltering/filterTables.h +++ b/EventFiltering/filterTables.h @@ -228,11 +228,11 @@ DECLARE_SOA_TABLE(BCRanges, "AOD", "BCRanges", //! using BCRange = BCRanges::iterator; /// List of the available filters, the description of their tables and the name of the tasks -constexpr int NumberOfFilters{11}; -constexpr std::array AvailableFilters{"NucleiFilters", "DiffractionFilters", "DqFilters", "HfFilters", "CFFilters", "JetFilters", "FullJetFilters", "StrangenessFilters", "MultFilters", "PhotonFilters", "F1ProtonFilters"}; -constexpr std::array FilterDescriptions{"NucleiFilters", "DiffFilters", "DqFilters", "HfFilters", "CFFilters", "JetFilters", "FullJetFilters", "LFStrgFilters", "MultFilters", "PhotonFilters", "F1ProtonFilters"}; -constexpr std::array FilteringTaskNames{"o2-analysis-nuclei-filter", "o2-analysis-diffraction-filter", "o2-analysis-dq-filter-pp-with-association", "o2-analysis-hf-filter", "o2-analysis-cf-filter", "o2-analysis-je-filter", "o2-analysis-fje-filter", "o2-analysis-lf-strangeness-filter", "o2-analysis-mult-filter", "o2-analysis-em-photon-filter", "o2-analysis-lf-f1proton-filter"}; -constexpr o2::framework::pack FiltersPack; +constexpr int NumberOfFilters{12}; +constexpr std::array AvailableFilters{"NucleiFilters", "DiffractionFilters", "DqFilters", "HfFilters", "CFFilters", "JetFilters", "JetHFFilters", "FullJetFilters", "StrangenessFilters", "MultFilters", "PhotonFilters", "F1ProtonFilters"}; +constexpr std::array FilterDescriptions{"NucleiFilters", "DiffFilters", "DqFilters", "HfFilters", "CFFilters", "JetFilters", "JetHFFilters", "FullJetFilters", "LFStrgFilters", "MultFilters", "PhotonFilters", "F1ProtonFilters"}; +constexpr std::array FilteringTaskNames{"o2-analysis-nuclei-filter", "o2-analysis-diffraction-filter", "o2-analysis-dq-filter-pp-with-association", "o2-analysis-hf-filter", "o2-analysis-cf-filter", "o2-analysis-je-filter", "o2-analysis-je-hf-filter", "o2-analysis-fje-filter", "o2-analysis-lf-strangeness-filter", "o2-analysis-mult-filter", "o2-analysis-em-photon-filter", "o2-analysis-lf-f1proton-filter"}; +constexpr o2::framework::pack FiltersPack; static_assert(o2::framework::pack_size(FiltersPack) == NumberOfFilters); template