|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +// Author: Nima Zardoshti |
| 13 | + |
| 14 | +#include <TMath.h> |
| 15 | +#include <cmath> |
| 16 | +#include <string> |
| 17 | + |
| 18 | +#include "Framework/ASoA.h" |
| 19 | +#include "Framework/ASoAHelpers.h" |
| 20 | +#include "Framework/AnalysisDataModel.h" |
| 21 | +#include "Framework/AnalysisTask.h" |
| 22 | +#include "Framework/runDataProcessing.h" |
| 23 | +#include "ReconstructionDataFormats/Track.h" |
| 24 | + |
| 25 | +#include "Common/Core/TrackSelection.h" |
| 26 | +#include "Common/Core/TrackSelectionDefaults.h" |
| 27 | +#include "Common/DataModel/EventSelection.h" |
| 28 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 29 | + |
| 30 | +#include "PWGJE/Core/JetFinder.h" |
| 31 | +#include "PWGJE/Core/FastJetUtilities.h" |
| 32 | +#include "PWGJE/Core/JetBkgSubUtils.h" |
| 33 | +#include "PWGJE/DataModel/EMCALClusters.h" |
| 34 | +#include "PWGJE/DataModel/Jet.h" |
| 35 | + |
| 36 | +#include "../filterTables.h" |
| 37 | + |
| 38 | +#include "Framework/HistogramRegistry.h" |
| 39 | + |
| 40 | +using namespace o2; |
| 41 | +using namespace o2::framework; |
| 42 | +using namespace o2::framework::expressions; |
| 43 | + |
| 44 | +static const std::vector<std::string> highPtObjectsNames = {"JetD0ChLowPt", "JetD0ChHighPt", "JetLcChLowPt", "JetLcChHighPt"}; |
| 45 | + |
| 46 | +struct JetHFFilterTask { |
| 47 | + |
| 48 | + HistogramRegistry registry; |
| 49 | + |
| 50 | + enum { kJetD0ChLowPt = 0, |
| 51 | + kJetD0ChHighPt = 1, |
| 52 | + kJetLcChLowPt = 2, |
| 53 | + kJetLcChHighPt = 3, |
| 54 | + kAllObjects = 4 }; |
| 55 | + |
| 56 | + Produces<aod::JetHFFilters> tags; |
| 57 | + |
| 58 | + Configurable<float> jetD0ChLowPtThreshold{"jetD0ChLowPtThreshold", 0.0, "Threshold for charged D0 jet low pt trigger"}; |
| 59 | + Configurable<float> jetD0ChHighPtThreshold{"jetD0ChHighPtThreshold", 0.0, "Threshold for charged D0 jet high pt trigger"}; |
| 60 | + Configurable<float> jetD0ChR{"jetD0ChR", 0.6, "jet resolution parameter for charged D0 jet for low pt trigger"}; |
| 61 | + Configurable<float> jetLcChLowPtThreshold{"jetLcChLowPtThreshold", 0.0, "Threshold for charged Lc jet low pt trigger"}; |
| 62 | + Configurable<float> jetLcChHighPtThreshold{"jetLcChHighPtThreshold", 0.0, "Threshold for charged Lc jet high pt trigger"}; |
| 63 | + Configurable<float> jetLcChR{"jetLcChR", 0.6, "jet resolution parameter for charged Lc jet for low pt trigger"}; |
| 64 | + |
| 65 | + Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; |
| 66 | + Configurable<bool> fillTHns{"fillTHns", true, "fill THn histograms"}; |
| 67 | + |
| 68 | + Configurable<std::vector<double>> jetRadiiPlot{"jetRadiiPlot", std::vector<double>{0.2, 0.4, 0.6}, "jet resolution parameters"}; |
| 69 | + |
| 70 | + void init(o2::framework::InitContext&) |
| 71 | + { |
| 72 | + auto jetRadiiPlotBins = (std::vector<double>)jetRadiiPlot; |
| 73 | + if (jetRadiiPlotBins.size() > 1) { |
| 74 | + jetRadiiPlotBins.push_back(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] + (TMath::Abs(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] - jetRadiiPlotBins[jetRadiiPlotBins.size() - 2]))); |
| 75 | + } else { |
| 76 | + jetRadiiPlotBins.push_back(jetRadiiPlotBins[jetRadiiPlotBins.size() - 1] + 0.1); |
| 77 | + } |
| 78 | + |
| 79 | + registry.add("h_d0jet_pt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 80 | + registry.add("h_d0jet_pt_lowpt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 81 | + registry.add("h_d0jet_pt_highpt", "D^{0} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 82 | + |
| 83 | + registry.add("h_lcjet_pt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 84 | + registry.add("h_lcjet_pt_lowpt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 85 | + registry.add("h_lcjet_pt_highpt", "#Lambda^{+}_{c} - tagged jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); |
| 86 | + |
| 87 | + // these might end up being too big |
| 88 | + 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}}}); |
| 89 | + 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}}}); |
| 90 | + 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}}}); |
| 91 | + 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}}}); |
| 92 | + // radius, JetPt, JetEta, Jet Phi, Jet Ntracks, HF pT, HF Eta, HF Phi, HF Y, HF Mass |
| 93 | + } |
| 94 | + |
| 95 | + void processJets(soa::Join<JetCollisions, aod::EvSels>::iterator const& collision, soa::Join<o2::aod::D0ChargedJets, o2::aod::D0ChargedJetConstituents> const& d0Jets, CandidatesD0Data const& d0Candidates, soa::Join<o2::aod::LcChargedJets, o2::aod::LcChargedJetConstituents> const& lcJets, CandidatesLcData const& lcCandidates, JetTracks const& tracks) |
| 96 | + { |
| 97 | + bool keepEvent[kAllObjects]{false}; |
| 98 | + for (auto const& d0Jet : d0Jets) { |
| 99 | + if (fillTHns) { |
| 100 | + for (auto const& d0Candidate : d0Jet.hfcandidates_as<CandidatesD0Data>()) { |
| 101 | + 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()); |
| 102 | + if (collision.posZ() < vertexZCut && collision.sel8() && collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { |
| 103 | + 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()); |
| 104 | + } |
| 105 | + break; |
| 106 | + } |
| 107 | + } |
| 108 | + if (d0Jet.r() == round(jetD0ChR * 100.0f)) { |
| 109 | + registry.fill(HIST("h_d0jet_pt"), d0Jet.pt()); |
| 110 | + if (d0Jet.pt() >= jetD0ChLowPtThreshold) { |
| 111 | + keepEvent[kJetD0ChLowPt] = true; |
| 112 | + registry.fill(HIST("h_d0jet_pt_lowpt"), d0Jet.pt()); |
| 113 | + } |
| 114 | + if (d0Jet.pt() >= jetD0ChHighPtThreshold) { |
| 115 | + keepEvent[kJetD0ChHighPt] = true; |
| 116 | + registry.fill(HIST("h_d0jet_pt_highpt"), d0Jet.pt()); |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + for (auto const& lcJet : lcJets) { |
| 121 | + if (fillTHns) { |
| 122 | + for (auto const& lcCandidate : lcJet.hfcandidates_as<CandidatesLcData>()) { |
| 123 | + 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()); |
| 124 | + if (collision.posZ() < vertexZCut && collision.sel8() && collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { |
| 125 | + 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()); |
| 126 | + } |
| 127 | + break; |
| 128 | + } |
| 129 | + } |
| 130 | + if (lcJet.r() == round(jetLcChR * 100.0f)) { |
| 131 | + registry.fill(HIST("h_lcjet_pt"), lcJet.pt()); |
| 132 | + if (lcJet.pt() >= jetLcChLowPtThreshold) { |
| 133 | + keepEvent[kJetLcChLowPt] = true; |
| 134 | + registry.fill(HIST("h_lcjet_pt_lowpt"), lcJet.pt()); |
| 135 | + } |
| 136 | + if (lcJet.pt() >= jetLcChHighPtThreshold) { |
| 137 | + keepEvent[kJetLcChHighPt] = true; |
| 138 | + registry.fill(HIST("h_lcjet_pt_highpt"), lcJet.pt()); |
| 139 | + } |
| 140 | + } |
| 141 | + } |
| 142 | + tags(keepEvent[kJetD0ChLowPt], keepEvent[kJetD0ChHighPt], keepEvent[kJetLcChLowPt], keepEvent[kJetLcChHighPt]); |
| 143 | + } |
| 144 | + PROCESS_SWITCH(JetHFFilterTask, processJets, "Do HF charged jet triggering", true); |
| 145 | +}; |
| 146 | + |
| 147 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfg) |
| 148 | +{ |
| 149 | + return WorkflowSpec{adaptAnalysisTask<JetHFFilterTask>(cfg)}; |
| 150 | +} |
0 commit comments