|
| 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 | +// jet tutorial task for hands on tutorial session (27/04/2023) |
| 13 | +// |
| 14 | +// Author: Nima Zardoshti |
| 15 | +// |
| 16 | + |
| 17 | +#include "Framework/ASoA.h" |
| 18 | +#include "Framework/AnalysisDataModel.h" |
| 19 | +#include "Framework/AnalysisTask.h" |
| 20 | +#include "Framework/HistogramRegistry.h" |
| 21 | + |
| 22 | +#include "Common/Core/TrackSelection.h" |
| 23 | +#include "Common/Core/TrackSelectionDefaults.h" |
| 24 | +#include "Common/DataModel/EventSelection.h" |
| 25 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 26 | + |
| 27 | +#include "Common/Core/RecoDecay.h" |
| 28 | + |
| 29 | +#include "PWGJE/Core/FastJetUtilities.h" |
| 30 | +#include "PWGJE/DataModel/Jet.h" |
| 31 | + |
| 32 | +using namespace o2; |
| 33 | +using namespace o2::framework; |
| 34 | +using namespace o2::framework::expressions; |
| 35 | + |
| 36 | +#include "Framework/runDataProcessing.h" |
| 37 | + |
| 38 | +struct JetTutorialSkeletonTask { |
| 39 | + HistogramRegistry registry{"registry", |
| 40 | + {{"h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 50.}}}}, |
| 41 | + {"h_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{30, -1.5, 1.5}}}}, |
| 42 | + {"h_jet_phi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{140, -7.0, 7.}}}}, |
| 43 | + {"h_part_jet_pt", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 50.}}}}, |
| 44 | + {"h_part_jet_eta", "particle level jet #eta;#eta_{jet part};entries", {HistType::kTH1F, {{30, -1.5, 1.5}}}}, |
| 45 | + {"h_part_jet_phi", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{140, -7.0, 7.}}}}, |
| 46 | + {"h_jet_ntracks", "jet N tracks;N_{jet tracks};entries", {HistType::kTH1F, {{40, -0.5, 39.5}}}}, |
| 47 | + {"h_jet_angularity", "jet angularity ;#lambda_{1};entries", {HistType::kTH1F, {{5, 0.0, 0.5}}}}, |
| 48 | + {"h_full_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 50.}}}}, |
| 49 | + {"h_full_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{30, -1.5, 1.5}}}}, |
| 50 | + {"h_full_jet_phi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{140, -7.0, 7.}}}}, |
| 51 | + {"h_full_jet_ntracks", "jet N tracks;N_{jet tracks};entries", {HistType::kTH1F, {{40, -0.5, 39.5}}}}, |
| 52 | + {"h_full_jet_nclusters", "jet N clusters;N_{jet clusters};entries", {HistType::kTH1F, {{40, -0.5, 39.5}}}}, |
| 53 | + {"h_full_jet_angularity", "jet angularity ;#lambda_{1};entries", {HistType::kTH1F, {{5, 0.0, 0.5}}}}, |
| 54 | + {"h_part_jet_angularity", "jet angularity ;#lambda_{1};entries", {HistType::kTH1F, {{5, 0.0, 0.5}}}}, |
| 55 | + {"h_recoil_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 50.}}}}, |
| 56 | + {"h_recoil_full_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{30, -1.5, 1.5}}}}, |
| 57 | + {"h_recoil_full_jet_phi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{140, -7.0, 7.}}}}, |
| 58 | + {"h_recoil_jet_dphi", "hadron-jet #Delta#phi;#Delta#phi_{jet,trigger hadron};entries", {HistType::kTH1F, {{40, -2.0, 2.0}}}}, |
| 59 | + {"h_matched_jets_pt", "#it{p}_{T,jet part}; #it{p}_{T,jet det}", {HistType::kTH2F, {{100, 0., 20.}, {100, 0., 20.0}}}}, |
| 60 | + {"h_matched_jets_eta", "#eta_{jet part}; #eta_{jet det}", {HistType::kTH2F, {{30, -1.5, 1.5}, {30, -1.5, 1.5}}}}, |
| 61 | + {"h_matched_jets_phi", "#phi_{jet part}; #phi_{jet det}", {HistType::kTH2F, {{140, -7.0, 7.}, {140, -7.0, 7.}}}}}}; |
| 62 | + |
| 63 | + Configurable<float> jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; |
| 64 | + Configurable<float> jetR{"jetR", 0.4, "jet resolution parameter"}; |
| 65 | + |
| 66 | + void init(InitContext const&) {} |
| 67 | + |
| 68 | + Filter jetCuts = aod::jet::pt > jetPtMin&& aod::jet::r == nround(jetR.node() * 100.0f); |
| 69 | + |
| 70 | + void processDataCharged(soa::Filtered<aod::ChargedJets>::iterator const& jet) |
| 71 | + { |
| 72 | + // registry.fill(HIST("h_jet_pt"), jet.pt()); |
| 73 | + } |
| 74 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processDataCharged, "jets data", true); |
| 75 | + |
| 76 | + void processMCDetectorLevelCharged(soa::Filtered<aod::ChargedMCDetectorLevelJets>::iterator const& jet) |
| 77 | + { |
| 78 | + } |
| 79 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCDetectorLevelCharged, "jets on detector level MC", false); |
| 80 | + |
| 81 | + void processMCParticleLevel(soa::Filtered<aod::ChargedMCParticleLevelJets>::iterator const& jet) |
| 82 | + { |
| 83 | + } |
| 84 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCParticleLevel, "jets on particle level MC", false); |
| 85 | + |
| 86 | + void processMCParticleLevelFull(soa::Filtered<aod::FullMCParticleLevelJets>::iterator const& jet) |
| 87 | + { |
| 88 | + } |
| 89 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCParticleLevelFull, "full jets on particle level MC", false); |
| 90 | + |
| 91 | + void processMCCharged(aod::Collisions const& collision, soa::Filtered<aod::ChargedMCDetectorLevelJets> const& MCDjets, soa::Filtered<aod::ChargedMCParticleLevelJets> const& MCPjets) |
| 92 | + { |
| 93 | + // for (auto& MCDjet : MCDjets) { |
| 94 | + // registry.fill(HIST("h_jet_pt"), MCDjet.pt()); |
| 95 | + // } |
| 96 | + } |
| 97 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCCharged, "jets on detector and particle level MC", false); |
| 98 | + |
| 99 | + void processDataChargedSubstructure(soa::Filtered<soa::Join<aod::ChargedJets, aod::ChargedJetConstituents>>::iterator const& jet, aod::Tracks const& tracks) |
| 100 | + { |
| 101 | + // for (auto& jetConstituent : jet.tracks_as<aod::Tracks>()) { |
| 102 | + // } |
| 103 | + } |
| 104 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processDataChargedSubstructure, "jet substructure charged jets", false); |
| 105 | + |
| 106 | + void processDataFullSubstructure(soa::Filtered<soa::Join<aod::FullJets, aod::FullJetConstituents>>::iterator const& jet, aod::Tracks const& tracks, aod::EMCALClusters const& clusters) |
| 107 | + { |
| 108 | + } |
| 109 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processDataFullSubstructure, "jet substructure full jets", false); |
| 110 | + |
| 111 | + void processMCParticleSubstructure(soa::Filtered<soa::Join<aod::FullMCParticleLevelJets, aod::FullMCParticleLevelJetConstituents>>::iterator const& jet, aod::McParticles const& particles) |
| 112 | + { |
| 113 | + } |
| 114 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCParticleSubstructure, "jet substructure particle level full jets", false); |
| 115 | + |
| 116 | + void processDataRecoil(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<aod::ChargedJets> const& jets, soa::Join<aod::Tracks, aod::TracksExtra> const& tracks) |
| 117 | + { |
| 118 | + // if (!collision.sel8()) { |
| 119 | + // return; |
| 120 | + //} |
| 121 | + } |
| 122 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processDataRecoil, "hadron-recoil jets", false); |
| 123 | + |
| 124 | + using MCDJetTable = soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets>>; |
| 125 | + using MCPJetTable = soa::Filtered<soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets>>; |
| 126 | + void processMCMatched(aod::Collision const& collision, MCDJetTable const& MCDjets, MCPJetTable const& MCPjets) |
| 127 | + { |
| 128 | + /* for (const auto& MCDjet : MCDjets) { |
| 129 | + if (MCDjet.has_matchedJetGeo() && MCDjet.matchedJetGeoId() >= 0) { |
| 130 | + const auto& MCPjet = MCDjet.matchedJetGeo_as<MCPJetTable>(); |
| 131 | + } |
| 132 | + }*/ |
| 133 | + } |
| 134 | + PROCESS_SWITCH(JetTutorialSkeletonTask, processMCMatched, "jets matched on detector and particle level MC", false); |
| 135 | +}; |
| 136 | + |
| 137 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<JetTutorialSkeletonTask>(cfgc, TaskName{"jet-tutorial"})}; } |
0 commit comments