diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index c23fb136b19..676e309cea1 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -28,83 +28,6 @@ #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" -// Defines the jet table definition -#define JET_TABLE_DEF(_collision_name_, _jet_type_, _name_, _description_) \ - namespace _name_##util \ - { \ - DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_##s, dummy##_jet_type##s, \ - []() -> int { return 0; }); \ - } \ - DECLARE_SOA_TABLE(_jet_type_##s, "AOD", _description_, \ - o2::soa::Index<>, \ - jet::_collision_name_##Id, \ - jet::Pt, \ - jet::Eta, \ - jet::Phi, \ - jet::Energy, \ - jet::Mass, \ - jet::Area, \ - jet::R, \ - jet::Px, \ - jet::Py, \ - jet::Pz, \ - jet::P, \ - _name_##util::Dummy##_jet_type_##s<>); \ - namespace _name_##matching \ - { \ - DECLARE_SOA_INDEX_COLUMN(_jet_type_, jet); \ - DECLARE_SOA_COLUMN(MatchedJetIndex, matchedJetIndex, int); \ - } \ - DECLARE_SOA_TABLE(Matched##_jet_type_##s, "AOD", _description_ "MATCH", \ - _name_##matching::_jet_type_##Id, \ - _name_##matching::MatchedJetIndex); - -// Defines the jet constituent table -#define JET_CONSTITUENTS_TABLE_DEF(_jet_type_, _name_, _Description_, _track_type_) \ - namespace _name_##constituents \ - { \ - DECLARE_SOA_INDEX_COLUMN(_jet_type_, jet); \ - DECLARE_SOA_INDEX_COLUMN(_track_type_, track); \ - DECLARE_SOA_INDEX_COLUMN(EMCALCluster, cluster); \ - } \ - DECLARE_SOA_TABLE(_jet_type_##TrackConstituents, "AOD", _Description_ "TRKCONSTS", \ - _name_##constituents::_jet_type_##Id, \ - _name_##constituents::_track_type_##Id); \ - DECLARE_SOA_TABLE(_jet_type_##ClusterConstituents, "AOD", _Description_ "CLSCONSTS", \ - _name_##constituents::_jet_type_##Id, \ - _name_##constituents::EMCALClusterId); - -#define JET_CONSTITUENTS_ARRAY_TABLE_DEF(_jet_type_, _name_, _Description_, _track_type_, _cand_type_) \ - namespace _name_##constituents \ - { \ - DECLARE_SOA_INDEX_COLUMN(_jet_type_, jet); \ - DECLARE_SOA_ARRAY_INDEX_COLUMN(_track_type_, tracks); \ - DECLARE_SOA_ARRAY_INDEX_COLUMN(EMCALCluster, clusters); \ - DECLARE_SOA_ARRAY_INDEX_COLUMN_FULL(HfCandidates, hfcandidates, int32_t, _cand_type_, "_hfcand"); \ - } \ - DECLARE_SOA_TABLE(_jet_type_##Constituents, "AOD", _Description_ "CONSTS", \ - _name_##constituents::_jet_type_##Id, \ - _name_##constituents::_track_type_##Ids, \ - _name_##constituents::EMCALClusterIds, \ - _name_##constituents::HfCandidatesIds); - -// Defines the jet constituent sub table -// NOTE: This relies on eth jet index column being defined in the constiteunts namespace. -// Since these are always paired together, there's no point in redefining them. -#define JET_CONSTITUENTS_SUB_TABLE_DEF(_jet_type_, _name_, _Description_) \ - DECLARE_SOA_TABLE(_jet_type_##ConstituentsSub, "AOD", _Description_ "CONSTSUB", \ - _name_##constituents::_jet_type_##Id, \ - constituentssub::Pt, \ - constituentssub::Eta, \ - constituentssub::Phi, \ - constituentssub::Energy, \ - constituentssub::Mass, \ - constituentssub::Source, \ - constituentssub::Px, \ - constituentssub::Py, \ - constituentssub::Pz, \ - constituentssub::P); - namespace o2::aod { namespace jet @@ -128,8 +51,6 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! absolute p [](float pt, float eta) -> float { return pt * std::cosh(eta); }); } // namespace jet -// The standard constituents table is more simply defined fully via macros. - // Constituent sub namespace constituentssub { @@ -149,188 +70,111 @@ DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); }); } // namespace constituentssub +} // namespace o2::aod -// Data jets -// As an example, the expanded macros which are used to define the table is shown below. -// It represents that state of the table as of June 2021. -// -//DECLARE_SOA_TABLE(Jets, "AOD", "JET", //! -// o2::soa::Index<>, -// jet::CollisionId, -// jet::Pt, -// jet::Eta, -// jet::Phi, -// jet::Energy, -// jet::Mass, -// jet::Area, -// jet::Px, -// jet::Py, -// jet::Pz, -// jet::P); -// -//DECLARE_SOA_EXTENDED_TABLE(JetsMatched, Jets, "JETMATCHED", //! -// jet::MatchedJetIndex); -// -//using Jet = Jets::iterator; -//using JetMatched = JetsMatched::iterator; - -// And for the constituents table: -// TODO: absorb in jet table when list of references available -// -//namespace constituents -//{ -//DECLARE_SOA_INDEX_COLUMN(Jet, jet); //! -//DECLARE_SOA_INDEX_COLUMN(Track, track); //! -//DECLARE_SOA_INDEX_COLUMN(EMCALCluster, cluster); //! -//} // namespace constituents -//DECLARE_SOA_TABLE(JetTrackConstituents, "AOD", "TRKCONSTITS", //! -// constituents::JetId, -// constituents::TrackId); -//DECLARE_SOA_TABLE(JetClusterConstituents, "AOD", "CLSCONSTITS", //! -// constituents::JetId, -// constituents::EMCALClusterId); -//using JetTrackConstituent = JetTrackConstituents::iterator; -//using JetClusterConstituent = JetClusterConstituents::iterator; - -// And finally, the consitutent sub table -// -//namespace constituentssub -//{ -//DECLARE_SOA_INDEX_COLUMN(Jet, jet); //! -//DECLARE_SOA_COLUMN(Pt, pt, float); //! -//DECLARE_SOA_COLUMN(Eta, eta, float); //! -//DECLARE_SOA_COLUMN(Phi, phi, float); //! -//DECLARE_SOA_COLUMN(Energy, energy, float); //! -//DECLARE_SOA_COLUMN(Mass, mass, float); //! -//DECLARE_SOA_COLUMN(Source, source, int); //! -//DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! -// [](float pt, float phi) -> float { return pt * std::cos(phi); }); -//DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! -// [](float pt, float phi) -> float { return pt * std::sin(phi); }); -//DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! -// [](float pt, float eta) -> float { return pt * std::sinh(eta); }); -//DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! absolute p -// [](float pt, float eta) -> float { return pt * std::cosh(eta); }); -//} //namespace constituentssub -// -//DECLARE_SOA_TABLE(JetConstituentsSub, "AOD", "CONSTITUENTSSUB", //! -// constituentssub::JetId, -// constituentssub::Pt, -// constituentssub::Eta, -// constituentssub::Phi, -// constituentssub::Energy, -// constituentssub::Mass, -// constituentssub::Source, -// constituentssub::Px, -// constituentssub::Py, -// constituentssub::Pz, -// constituentssub::P); -//using JetConstituentSub = JetConstituentsSub::iterator; - -// Defining the tables via the macors. -// The using statements are kept separate for visbility. - -// Data jets charged -JET_TABLE_DEF(Collision, Jet, jet, "JET"); -using Jet = Jets::iterator; -using MatchedJet = MatchedJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(Jet, jet, "JET", Track, HfCand2Prong); -using JetConstituent = JetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(Jet, jet, "JET"); -using JetConstituentSub = JetConstituentsSub::iterator; - -// Data jets full -JET_TABLE_DEF(Collision, FullJet, fulljet, "JETF"); -using FullJet = FullJets::iterator; -using MatchedFullJet = MatchedFullJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(FullJet, fulljet, "JETF", Track, HfCand2Prong); -using FullJetConstituent = FullJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(FullJet, fulljet, "JETF"); -using FullJetConstituentSub = FullJetConstituentsSub::iterator; - -// Data jets neutral -JET_TABLE_DEF(Collision, NeutralJet, neutraljet, "JETN"); -using NeutralJet = NeutralJets::iterator; -using MatchedNeutralJet = MatchedNeutralJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(NeutralJet, neutraljet, "JETN", Track, HfCand2Prong); -using NeutralJetConstituent = NeutralJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(NeutralJet, neutraljet, "JETN"); -using NeutralJetConstituentSub = NeutralJetConstituentsSub::iterator; - -// MC Detector Level charged Jets -// NOTE: The same condition as describe for particle leve jets also applies here -// to subtracted constituents. - -JET_TABLE_DEF(Collision, MCDetectorLevelJet, mcdetectorleveljet, "JETMCDET"); -using MCDetectorLevelJet = MCDetectorLevelJets::iterator; -using MatchedMCDetectorLevelJet = MatchedMCDetectorLevelJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelJet, mcdetectorleveljet, "MCD", Track, HfCand2Prong); -using MCDetectorLevelJetConstituent = MCDetectorLevelJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelJet, mcdetectorleveljet, "MCD"); -using MCDetectorLevelJetConstituentSub = MCDetectorLevelJetConstituentsSub::iterator; - -// MC Detector Level full Jets -JET_TABLE_DEF(Collision, MCDetectorLevelFullJet, mcdetectorlevelfulljet, "JETFMCDET"); -using MCDetectorLevelFullJet = MCDetectorLevelFullJets::iterator; -using MatchedMCDetectorLevelFullJet = MatchedMCDetectorLevelFullJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelFullJet, mcdetectorlevelfulljet, "MCDF", Track, HfCand2Prong); -using MCDetectorLevelFullJetConstituent = MCDetectorLevelFullJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelFullJet, mcdetectorlevelfulljet, "MCDF"); -using MCDetectorLevelFullJetConstituentSub = MCDetectorLevelFullJetConstituentsSub::iterator; - -// MC Detector Level neutral Jets -JET_TABLE_DEF(Collision, MCDetectorLevelNeutralJet, mcdetectorlevelneutraljet, "JETNMCDET"); -using MCDetectorLevelNeutralJet = MCDetectorLevelNeutralJets::iterator; -using MatchedMCDetectorLevelNeutralJet = MatchedMCDetectorLevelNeutralJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelNeutralJet, mcdetectorlevelneutraljet, "MCDN", Track, HfCand2Prong); -using MCDetectorLevelNeutralJetConstituent = MCDetectorLevelNeutralJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelNeutralJet, mcdetectorlevelneutraljet, "MCDN"); -using MCDetectorLevelNeutralJetConstituentSub = MCDetectorLevelNeutralJetConstituentsSub::iterator; +// Defines the jet table definition +#define DECLARE_JET_TABLE(_collision_name_, _jet_type_, _name_, _description_) \ + namespace _name_##util \ + { \ + DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_##s, dummy##_jet_type##s, \ + []() -> int { return 0; }); \ + } \ + DECLARE_SOA_TABLE(_jet_type_##s, "AOD", _description_, \ + o2::soa::Index<>, \ + jet::_collision_name_##Id, \ + jet::Pt, \ + jet::Eta, \ + jet::Phi, \ + jet::Energy, \ + jet::Mass, \ + jet::Area, \ + jet::R, \ + jet::Px, \ + jet::Py, \ + jet::Pz, \ + jet::P, \ + _name_##util::Dummy##_jet_type_##s<>); \ + namespace _name_##matchingGeo \ + { \ + DECLARE_SOA_INDEX_COLUMN(_jet_type_, matchedJetGeo); \ + } \ + namespace _name_##matchingCand \ + { \ + DECLARE_SOA_INDEX_COLUMN(_jet_type_, matchedJetCand); \ + } + +#define DECLARE_CONSTITUENTS_TABLE(_jet_type_, _name_, _Description_, _track_type_, _cand_type_) \ + namespace _name_##constituents \ + { \ + DECLARE_SOA_INDEX_COLUMN(_jet_type_, jet); \ + DECLARE_SOA_ARRAY_INDEX_COLUMN(_track_type_, tracks); \ + DECLARE_SOA_ARRAY_INDEX_COLUMN(EMCALCluster, clusters); \ + DECLARE_SOA_ARRAY_INDEX_COLUMN_FULL(HfCandidates, hfcandidates, int32_t, _cand_type_, "_hfcand"); \ + } \ + DECLARE_SOA_TABLE(_jet_type_##Constituents, "AOD", _Description_ "CONSTS", \ + _name_##constituents::_jet_type_##Id, \ + _name_##constituents::_track_type_##Ids, \ + _name_##constituents::EMCALClusterIds, \ + _name_##constituents::HfCandidatesIds); -// MC Particle Level Jets -// NOTE: Cluster constituents aren't really meaningful for particle level. -// However, it's a convenient construction, as it allows everything else -// to work as it would otherwise, and it won't be filled (because there -// are no clusters and nothing that would be identified as clusters), so -// it causes no harm. Perhaps better would be making this std::optional, -// but for now, we keep it simple. -// NOTE: The same condition applies to subtracted constituents. -// MC Particle Level charged Jets -JET_TABLE_DEF(McCollision, MCParticleLevelJet, mcparticleleveljet, "JETMCPART"); -using MCParticleLevelJet = MCParticleLevelJets::iterator; -using MatchedMCParticleLevelJet = MatchedMCParticleLevelJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelJet, mcparticleleveljet, "MCP", McParticle, McParticles); -using MCParticleLevelJetConstituent = MCParticleLevelJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelJet, mcparticleleveljet, "MCP"); -using MCParticleLevelJetConstituentSub = MCParticleLevelJetConstituentsSub::iterator; +// Defines the jet constituent sub table +// NOTE: This relies on the jet index column being defined in the constituents namespace. +// Since these are always paired together, there's no point in redefining them. +#define DECLARE_CONSTITUENTS_SUB_TABLE(_jet_type_, _name_, _Description_) \ + DECLARE_SOA_TABLE(_jet_type_##ConstituentsSub, "AOD", _Description_ "CONSTSUB", \ + _name_##constituents::_jet_type_##Id, \ + constituentssub::Pt, \ + constituentssub::Eta, \ + constituentssub::Phi, \ + constituentssub::Energy, \ + constituentssub::Mass, \ + constituentssub::Source, \ + constituentssub::Px, \ + constituentssub::Py, \ + constituentssub::Pz, \ + constituentssub::P); -// MC Particle Level full -JET_TABLE_DEF(McCollision, MCParticleLevelFullJet, mcparticlelevelfulljet, "JETFMCPART"); -using MCParticleLevelFullJet = MCParticleLevelFullJets::iterator; -using MatchedMCParticleLevelFullJet = MatchedMCParticleLevelFullJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelFullJet, mcparticlelevelfulljet, "MCPF", McParticle, McParticles); -using MCParticleLevelFullJetConstituent = MCParticleLevelFullJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelFullJet, mcparticlelevelfulljet, "MCPF"); -using MCParticleLevelFullJetConstituentSub = MCParticleLevelFullJetConstituentsSub::iterator; +// combine definition of tables for jets, constituents, and substructure +#define DECLARE_JET_TABLES(_collision_name_, _jet_type_, _const_type_, _hfcand_type_, _description_) \ + DECLARE_JET_TABLE(_collision_name_, _jet_type_##Jet, _jet_type_##jet, _description_); \ + using _jet_type_##Jet = _jet_type_##Jet##s::iterator; \ + DECLARE_CONSTITUENTS_TABLE(_jet_type_##Jet, _jet_type_##jet, _description_, _const_type_, _hfcand_type_); \ + using _jet_type_##Jet##Constituent = _jet_type_##Jet##Constituents::iterator; \ + DECLARE_CONSTITUENTS_SUB_TABLE(_jet_type_##Jet, _jet_type_##jet, _description_); \ + using _jet_type_##Jet##ConstituentSub = _jet_type_##Jet##ConstituentsSub::iterator; + +#define DECLARE_JETMATCHING_TABLE(_jet_type_base_, _jet_type_tag_, _description_) \ + DECLARE_SOA_TABLE(_jet_type_base_##JetsMatchedTo##_jet_type_tag_##Jets, "AOD", _description_, \ + _jet_type_tag_##jetmatchingGeo::_jet_type_tag_##JetId, \ + _jet_type_tag_##jetmatchingCand::_jet_type_tag_##JetId); \ + using _jet_type_base_##JetsMatchedTo##_jet_type_tag_##Jet = _jet_type_base_##JetsMatchedTo##_jet_type_tag_##Jets::iterator; + +// generate tables for data-, detector- and particle-level jets +#define DECLARE_JET_TABLES_LEVELS(_jet_type_, _hfcand_type_, _shortname_) \ + DECLARE_JET_TABLES(Collision, _jet_type_, Track, _hfcand_type_, _shortname_ "JET"); \ + DECLARE_JET_TABLES(Collision, _jet_type_##MCDetectorLevel, Track, _hfcand_type_, _shortname_ "DJET"); \ + DECLARE_JET_TABLES(McCollision, _jet_type_##MCParticleLevel, McParticle, McParticles, _shortname_ "PJET"); \ + DECLARE_JETMATCHING_TABLE(_jet_type_##MCParticleLevel, _jet_type_##MCDetectorLevel, _shortname_ "JETMP2D") \ + DECLARE_JETMATCHING_TABLE(_jet_type_##MCDetectorLevel, _jet_type_##MCParticleLevel, _shortname_ "JETMD2P") + +#define DECLARE_JET_TABLES_LEVELS2(_jet_type_, _hfcand_type_, _shortname_) \ + DECLARE_JET_TABLES(Collision, _jet_type_, Track, _hfcand_type_, _shortname_ "JET"); \ + DECLARE_JET_TABLES(Collision, _jet_type_##MCD, Track, _hfcand_type_, _shortname_ "DJET"); \ + DECLARE_JET_TABLES(McCollision, _jet_type_##MCP, McParticle, McParticles, _shortname_ "PJET"); \ + DECLARE_JETMATCHING_TABLE(_jet_type_##MCP, _jet_type_##MCD, _shortname_ "JETMP2D") \ + DECLARE_JETMATCHING_TABLE(_jet_type_##MCD, _jet_type_##MCP, _shortname_ "JETMD2P") -// MC Particle Level neutral Jets -JET_TABLE_DEF(McCollision, MCParticleLevelNeutralJet, mcparticlelevelneutraljet, "JETNMCPART"); -using MCParticleLevelNeutralJet = MCParticleLevelNeutralJets::iterator; -using MatchedMCParticleLevelNeutralJet = MatchedMCParticleLevelNeutralJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelNeutralJet, mcparticlelevelneutraljet, "MCPN", McParticle, McParticles); -using MCParticleLevelNeutralJetConstituent = MCParticleLevelNeutralJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelNeutralJet, mcparticlelevelneutraljet, "MCPN"); -using MCParticleLevelNeutralJetConstituentSub = MCParticleLevelNeutralJetConstituentsSub::iterator; +namespace o2::aod +{ +DECLARE_JET_TABLES_LEVELS(, HfCand2Prong, ""); +DECLARE_JET_TABLES_LEVELS(Full, HfCand2Prong, "F"); +DECLARE_JET_TABLES_LEVELS(Neutral, HfCand2Prong, "N"); +DECLARE_JET_TABLES_LEVELS2(D0, HfCand2Prong, "D0"); +DECLARE_JET_TABLES_LEVELS2(Lc, HfCand3Prong, "Lc"); +DECLARE_JET_TABLES_LEVELS2(BPl, HfCandBplus, "BPl"); // Hybrid intermediate -JET_TABLE_DEF(Collision, HybridIntermediateJet, hybridintermediatejet, "JETHYBINT"); -using HybridIntermediateJet = HybridIntermediateJets::iterator; -using MatchedHybridIntermediateJet = MatchedHybridIntermediateJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(HybridIntermediateJet, hybridintermediate, "HYBINT", Track, HfCand2Prong); -using HybridIntermediateJetConstituent = HybridIntermediateJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(HybridIntermediateJet, hybridintermediate, "HYBINT"); -using HybridIntermediateJetConstituentSub = HybridIntermediateJetConstituentsSub::iterator; - +DECLARE_JET_TABLES(Collision, HybridIntermediate, Track, HfCand2Prong, "JEHYIN"); } // namespace o2::aod #endif // PWGJE_DATAMODEL_JET_H_ diff --git a/PWGJE/DataModel/JetHF.h b/PWGJE/DataModel/JetHF.h deleted file mode 100644 index ce9dd873c23..00000000000 --- a/PWGJE/DataModel/JetHF.h +++ /dev/null @@ -1,126 +0,0 @@ -// 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. - -/// -/// \brief Table definitions for jets -/// -/// Since the JE framework requires a set of nearly identical tables, most the tables are -/// generated via macros. Usually this would be avoided, but maintaining a collection of -/// (nearly) identical tables was judged to be more the larger maintenance burden. -/// -/// \author Nima Zardoshti - -#ifndef PWGJE_DATAMODEL_JETHF_H_ -#define PWGJE_DATAMODEL_JETHF_H_ - -#include "PWGJE/DataModel/Jet.h" - -namespace o2::aod -{ - -// HF jets -// D0 tagged jets -JET_TABLE_DEF(Collision, D0Jet, D0jet, "D0JET"); -using D0Jet = D0Jets::iterator; -using MatchedD0Jet = MatchedD0Jets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(D0Jet, D0jet, "D0", Track, HfCand2Prong); -using D0JetConstituent = D0JetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(D0Jet, D0jet, "D0"); -using D0JetConstituentSub = D0JetConstituentsSub::iterator; - -// Lc tagged jets -JET_TABLE_DEF(Collision, LcJet, Lcjet, "LcJET"); -using LcJet = LcJets::iterator; -using MatchedLcJet = MatchedLcJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(LcJet, Lcjet, "Lc", Track, HfCand3Prong); -using LcJetConstituent = LcJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(LcJet, Lcjet, "Lc"); -using LcJetConstituentSub = LcJetConstituentsSub::iterator; - -// B+ tagged jets -JET_TABLE_DEF(Collision, BPlusJet, BPlusjet, "BPlJET"); -using BPlusJet = BPlusJets::iterator; -using MatchedBPlusJet = MatchedBPlusJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(BPlusJet, BPlusjet, "BPl", Track, HfCandBplus); -using BPlusJetConstituent = BPlusJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(BPlusJet, BPlusjet, "BPl"); -using BPlusJetConstituentSub = BPlusJetConstituentsSub::iterator; - -// HF jets (MC detector level) -// D0 tagged jets -JET_TABLE_DEF(Collision, MCDetectorLevelD0Jet, mcdetectorlevelD0jet, "D0JETMCD"); -using MCDetectorLevelD0Jet = MCDetectorLevelD0Jets::iterator; -using MatchedMCDetectorLevelD0Jet = MatchedMCDetectorLevelD0Jets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelD0Jet, mcdetectorlevelD0jet, "D0MCD", Track, HfCand2Prong); -using MCDetectorLevelD0JetConstituent = MCDetectorLevelD0JetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelD0Jet, mcdetectorlevelD0jet, "D0MCD"); -using MCDetectorLevelD0JetConstituentSub = MCDetectorLevelD0JetConstituentsSub::iterator; - -// Lc tagged jets -JET_TABLE_DEF(Collision, MCDetectorLevelLcJet, mcdetectorlevelLcjet, "LcJETMCD"); -using MCDetectorLevelLcJet = MCDetectorLevelLcJets::iterator; -using MatchedMCDetectorLevelLcJet = MatchedMCDetectorLevelLcJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelLcJet, mcdetectorlevelLcjet, "LcMCD", Track, HfCand3Prong); -using MCDetectorLevelLcJetConstituent = MCDetectorLevelLcJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelLcJet, mcdetectorlevelLcjet, "LcMCD"); -using MCDetectorLevelLcJetConstituentSub = MCDetectorLevelLcJetConstituentsSub::iterator; - -// B+ tagged jets -JET_TABLE_DEF(Collision, MCDetectorLevelBPlusJet, mcdetectorlevelBPlusjet, "BPlJETMCD"); -using MCDetectorLevelBPlusJet = MCDetectorLevelBPlusJets::iterator; -using MatchedMCDetectorLevelBPlusJet = MatchedMCDetectorLevelBPlusJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCDetectorLevelBPlusJet, mcdetectorlevelBPlusjet, "BPlMCD", Track, HfCandBplus); -using MCDetectorLevelBPlusJetConstituent = MCDetectorLevelBPlusJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCDetectorLevelBPlusJet, mcdetectorlevelBPlusjet, "BPlMCD"); -using MCDetectorLevelBPlusJetConstituentSub = MCDetectorLevelBPlusJetConstituentsSub::iterator; - -// HF jets (MC particle level) -// D0 tagged jets -JET_TABLE_DEF(McCollision, MCParticleLevelD0Jet, mcparticlelevelD0jet, "D0JETMCP"); -using MCParticleLevelD0Jet = MCParticleLevelD0Jets::iterator; -using MatchedMCParticleLevelD0Jet = MatchedMCParticleLevelD0Jets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelD0Jet, mcparticlelevelD0jet, "D0MCP", McParticle, McParticles); -using MCParticleLevelD0JetConstituent = MCParticleLevelD0JetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelD0Jet, mcparticlelevelD0jet, "D0MCP"); -using MCParticleLevelD0JetConstituentSub = MCParticleLevelD0JetConstituentsSub::iterator; - -// Lc tagged jets -JET_TABLE_DEF(McCollision, MCParticleLevelLcJet, mcparticlelevelLcjet, "LcJETMCP"); -using MCParticleLevelLcJet = MCParticleLevelLcJets::iterator; -using MatchedMCParticleLevelLcJet = MatchedMCParticleLevelLcJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelLcJet, mcparticlelevelLcjet, "LcMCP", McParticle, McParticles); -using MCParticleLevelLcJetConstituent = MCParticleLevelLcJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelLcJet, mcparticlelevelLcjet, "LcMCP"); -using MCParticleLevelLcJetConstituentSub = MCParticleLevelLcJetConstituentsSub::iterator; - -// B+ tagged jets -JET_TABLE_DEF(McCollision, MCParticleLevelBPlusJet, mcparticlelevelBPlusjet, "BPlJETMCP"); -using MCParticleLevelBPlusJet = MCParticleLevelBPlusJets::iterator; -using MatchedMCParticleLevelBPlusJet = MatchedMCParticleLevelBPlusJets::iterator; -JET_CONSTITUENTS_ARRAY_TABLE_DEF(MCParticleLevelBPlusJet, mcparticlelevelBPlusjet, "BPlMCP", McParticle, McParticles); -using MCParticleLevelBPlusJetConstituent = MCParticleLevelBPlusJetConstituents::iterator; -JET_CONSTITUENTS_SUB_TABLE_DEF(MCParticleLevelBPlusJet, mcparticlelevelBPlusjet, "BPlMCP"); -using MCParticleLevelBPlusJetConstituentSub = MCParticleLevelBPlusJetConstituentsSub::iterator; - -namespace mcdetectorlevelD0jetmatching2 -{ -DECLARE_SOA_INDEX_COLUMN(MCDetectorLevelD0Jet, matchedJet); -} -namespace mcparticlelevelD0jetmatching2 -{ -DECLARE_SOA_INDEX_COLUMN(MCParticleLevelD0Jet, matchedJet); -} -DECLARE_SOA_TABLE(MatchedMCParticleDetectorLevelD0Jets, "AOD", "D0JETMCPDMATCH", mcdetectorlevelD0jetmatching2::MCDetectorLevelD0JetId); -DECLARE_SOA_TABLE(MatchedMCDetectorParticleLevelD0Jets, "AOD", "D0JETMCDPMATCH", mcparticlelevelD0jetmatching2::MCParticleLevelD0JetId); - -} // namespace o2::aod - -#endif // PWGJE_DATAMODEL_JETHF_H_ diff --git a/PWGJE/DataModel/JetSubstructure.h b/PWGJE/DataModel/JetSubstructure.h index 7da9d301d6b..3d0a118418a 100644 --- a/PWGJE/DataModel/JetSubstructure.h +++ b/PWGJE/DataModel/JetSubstructure.h @@ -22,7 +22,6 @@ #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetHF.h" using namespace o2::analysis; @@ -103,29 +102,29 @@ JETSUBSTRUCTUREOUTPUT_TABLE_DEF(MCParticleLevelJet, mcparticleleveljet, "JETMCPA JETSUBSTRUCTURE_TABLE_DEF(D0Jet, D0jet, "D0JETSS"); JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(D0Jet, D0jet, "D0JETSSO"); -JETSUBSTRUCTURE_TABLE_DEF(MCDetectorLevelD0Jet, mcdetectorlevelD0jet, "D0JETMCDETSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCDetectorLevelD0Jet, mcdetectorlevelD0jet, "D0JETMCDETSSO"); +JETSUBSTRUCTURE_TABLE_DEF(D0MCDJet, D0mcdjet, "D0JETMCDETSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(D0MCDJet, D0mcdjet, "D0JETMCDETSSO"); -JETSUBSTRUCTURE_TABLE_DEF(MCParticleLevelD0Jet, mcparticlelevelD0jet, "D0JETMCPARTSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCParticleLevelD0Jet, mcparticlelevelD0jet, "D0JETMCPARTSSO"); +JETSUBSTRUCTURE_TABLE_DEF(D0MCPJet, D0mcpjet, "D0JETMCPARTSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(D0MCPJet, D0mcpjet, "D0JETMCPARTSSO"); JETSUBSTRUCTURE_TABLE_DEF(LcJet, Lcjet, "LcJETSS"); JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(LcJet, Lcjet, "LcJETSSO"); -JETSUBSTRUCTURE_TABLE_DEF(MCDetectorLevelLcJet, mcdetectorlevelLcjet, "LcJETMCDETSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCDetectorLevelLcJet, mcdetectorlevelLcjet, "LcJETMCDETSSO"); +JETSUBSTRUCTURE_TABLE_DEF(LcMCDJet, Lcmcdjet, "LcJETMCDETSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(LcMCDJet, Lcmcdjet, "LcJETMCDETSSO"); -JETSUBSTRUCTURE_TABLE_DEF(MCParticleLevelLcJet, mcparticlelevelLcjet, "LcJETMCPARTSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCParticleLevelLcJet, mcparticlelevelLcjet, "LcJETMCPARTSSO"); +JETSUBSTRUCTURE_TABLE_DEF(LcMCPJet, Lcmcpjet, "LcJETMCPARTSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(LcMCPJet, Lcmcpjet, "LcJETMCPARTSSO"); -JETSUBSTRUCTURE_TABLE_DEF(BPlusJet, BPlusjet, "BPLJETSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(BPlusJet, BPlusjet, "BPLJETOut"); +JETSUBSTRUCTURE_TABLE_DEF(BPlJet, BPljet, "BPLJETSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(BPlJet, BPljet, "BPLJETOut"); -JETSUBSTRUCTURE_TABLE_DEF(MCDetectorLevelBPlusJet, mcdetectorlevelBPlusjet, "BPLJETMCDETSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCDetectorLevelBPlusJet, mcdetectorlevelBPlusjet, "BPLJETMCDETSSO"); +JETSUBSTRUCTURE_TABLE_DEF(BPlMCDJet, BPlMCDjet, "BPLJETMCDETSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(BPlMCDJet, BPlmcdjet, "BPLJETMCDETSSO"); -JETSUBSTRUCTURE_TABLE_DEF(MCParticleLevelBPlusJet, mcparticlelevelBPlusjet, "BPLJETMCPARTSS"); -JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(MCParticleLevelBPlusJet, mcparticlelevelBPlusjet, "BPLJETMCPARTSSO"); +JETSUBSTRUCTURE_TABLE_DEF(BPlMCPJet, BPlmcpjet, "BPLJETMCPARTSS"); +JETSUBSTRUCTUREOUTPUTHF_TABLE_DEF(BPlMCPJet, BPlmcpjet, "BPLJETMCPARTSSO"); } // namespace o2::aod diff --git a/PWGJE/TableProducer/CMakeLists.txt b/PWGJE/TableProducer/CMakeLists.txt index d928806bd88..60ea2f654a6 100644 --- a/PWGJE/TableProducer/CMakeLists.txt +++ b/PWGJE/TableProducer/CMakeLists.txt @@ -35,13 +35,9 @@ o2physics_add_dpl_workflow(jet-matching SOURCES jetmatching.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(jet-matching-hf - SOURCES jetmatchinghf.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) endif() + o2physics_add_dpl_workflow(emcal-correction-task SOURCES emcalCorrectionTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction diff --git a/PWGJE/TableProducer/jetfinder.cxx b/PWGJE/TableProducer/jetfinder.cxx index 83d82bc466f..24c33ef0b5b 100644 --- a/PWGJE/TableProducer/jetfinder.cxx +++ b/PWGJE/TableProducer/jetfinder.cxx @@ -298,11 +298,11 @@ using JetFinderData = JetFinderTask; using JetFinderDataNeutral = JetFinderTask; using JetFinderMCDetectorLevel = JetFinderTask; -using JetFinderMCDetectorLevelFull = JetFinderTask; -using JetFinderMCDetectorLevelNeutral = JetFinderTask; +using JetFinderMCDetectorLevelFull = JetFinderTask; +using JetFinderMCDetectorLevelNeutral = JetFinderTask; using JetFinderMCParticleLevel = JetFinderTask; -using JetFinderMCParticleLevelFull = JetFinderTask; -using JetFinderMCParticleLevelNeutral = JetFinderTask; +using JetFinderMCParticleLevelFull = JetFinderTask; +using JetFinderMCParticleLevelNeutral = JetFinderTask; using JetFinderHybridIntermediate = JetFinderTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGJE/TableProducer/jetfinderhf.cxx b/PWGJE/TableProducer/jetfinderhf.cxx index 1d278c0fe6d..e8d99acf5b7 100644 --- a/PWGJE/TableProducer/jetfinderhf.cxx +++ b/PWGJE/TableProducer/jetfinderhf.cxx @@ -30,7 +30,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGJE/DataModel/JetHF.h" +#include "PWGJE/DataModel/Jet.h" #include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/FastJetUtilities.h" @@ -608,20 +608,21 @@ struct JetFinderHFTask { { processHFGenBPlus(collision, particles); } - PROCESS_SWITCH(JetFinderHFTask, processBPlusMCP, "B+ HF jet finding on MC particle level", false); + // PROCESS_SWITCH(JetFinderHFTask, processBPlusMCP, "B+ HF jet finding on MC particle level", false); + PROCESS_SWITCH(JetFinderHFTask, processBPlusMCP, "B+ HF jet finding on MC particle level", (std::is_same::value ? true : false)); }; using JetFinderD0 = JetFinderHFTask; -using MCDetectorLevelJetFinderD0 = JetFinderHFTask; -using MCParticleLevelJetFinderD0 = JetFinderHFTask; +using MCDetectorLevelJetFinderD0 = JetFinderHFTask; +using MCParticleLevelJetFinderD0 = JetFinderHFTask; -using JetFinderBPlus = JetFinderHFTask; -using MCDetectorLevelJetFinderBPlus = JetFinderHFTask; -using MCParticleLevelJetFinderBPlus = JetFinderHFTask; +using JetFinderBPlus = JetFinderHFTask; +using MCDetectorLevelJetFinderBPlus = JetFinderHFTask; +using MCParticleLevelJetFinderBPlus = JetFinderHFTask; using JetFinderLc = JetFinderHFTask; -using MCDetectorLevelJetFinderLc = JetFinderHFTask; -using MCParticleLevelJetFinderLc = JetFinderHFTask; +using MCDetectorLevelJetFinderLc = JetFinderHFTask; +using MCParticleLevelJetFinderLc = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/TableProducer/jetmatching.cxx b/PWGJE/TableProducer/jetmatching.cxx index e0604c9af11..43181efefea 100644 --- a/PWGJE/TableProducer/jetmatching.cxx +++ b/PWGJE/TableProducer/jetmatching.cxx @@ -10,124 +10,176 @@ // or submit itself to any jurisdiction. /// \file jetmatching.cxx -/// \brief Matching jets between different jet tables +/// \brief Unified implementation of jet matching based on different criteria +/// expanding on previously separate implementations of geometric matching +/// (by Raymond Ehlers) and heavy-flavour matching /// /// \author Raymond Ehlers , ORNL +/// \author Jochen Klein #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" +#include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/Core/JetUtilities.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -void customize(std::vector& workflowOptions) -{ - ConfigParamSpec jetMatching = {"jet-matching", - VariantType::String, - // NOTE: Even though this may not be the most sensible default, one - // must be set to avoid a segfault during compilation due to an empty workflow. - "MCDetectorLevel-MCParticleLevel", - {"Jet collections to match, separated by commas. Example: \"MCDetectorLevel-MCParticleLevel\". Possible components: MCParticleLevel, MCDetectorLevel, HybridIntermediate, Hybrid"}}; - workflowOptions.push_back(jetMatching); -} +template +struct JetMatchingHF { + Configurable maxMatchingDistance{"maxMatchingDistance", 0.4f, "Max matching distance"}; -#include "Framework/runDataProcessing.h" + Produces jetsBaseToTag; + Produces jetsTagToBase; -template -struct JetMatching { - Configurable maxMatchingDistance{"maxMatchingDistance", 0.4f, "Max matching distance"}; - Produces jetsBaseMatching; - Produces jetsTagMatching; + // preslicing jet collections, only for MC-based collection + + Preslice baseJetsPerCollision = [] { if constexpr (o2::soa::relatedByIndex()) return aod::jet::mcCollisionId; else return aod::jet::collisionId; }(); + Preslice tagJetsPerCollision = [] { if constexpr (o2::soa::relatedByIndex()) return aod::jet::mcCollisionId; else return aod::jet::collisionId; }(); + + using Collisions = soa::Join; + using Tracks = soa::Join; + using McParticles = soa::Join; void init(InitContext const&) { } - void process( - //soa::Filtered::iterator const& collision, - CollisionType const& collision, - //aod::Collision const& collision, - BaseJetCollection const& jetsBase, - TagJetCollection const& jetsTag) + void process(Collisions::iterator const& collision, aod::McCollisions const& mcCollisions, + BaseJetCollection const& jetsBase, TagJetCollection const& jetsTag, + Tracks const& tracks, McParticles const& particlesMC, + HfCandidates const& hfcandidates) { + constexpr bool jetsBaseIsMC = o2::soa::relatedByIndex(); + constexpr bool jetsTagIsMC = o2::soa::relatedByIndex(); + + // slicing jets if MC collection + // decltype(jetsTag.sliceBy(tagJetsPerCollision, collision.mcCollisionId())) jetsTagPerColl; + // std::remove_const::type jetsTagPerColl; + // const auto jetsTagPerColl = jetsTag; + // auto jetsTagPerColl = [&] -> TagJetCollection const& { if (jetsTagIsMC) return jetsTag.sliceBy(tagJetsPerCollision, collision.mcCollisionId()); else return jetsTag; }(); + // if (jetsTagIsMC) jetsTagPerColl = jetsTag.sliceBy(tagJetsPerCollision, collision.mcCollisionId()); + // const auto jetsTagPerColl = jetsTagIsMC ? const jetsTag.sliceBy(tagJetsPerCollision, collision.mcCollisionId()) : jetsTag; + + const auto jetsBasePerColl = jetsBase.sliceBy(baseJetsPerCollision, jetsBaseIsMC ? collision.mcCollisionId() : collision.globalIndex()); + const auto jetsTagPerColl = jetsTag.sliceBy(tagJetsPerCollision, jetsTagIsMC ? collision.mcCollisionId() : collision.globalIndex()); + + // geometric matching std::vector jetsBasePhi(jetsBase.size()); std::vector jetsBaseEta(jetsBase.size()); - for (auto jet : jetsBase) { + for (auto jet : jetsBasePerColl) { jetsBasePhi.emplace_back(jet.phi()); jetsBaseEta.emplace_back(jet.eta()); } std::vector jetsTagPhi(jetsTag.size()); std::vector jetsTagEta(jetsTag.size()); - for (auto& jet : jetsTag) { + for (auto& jet : jetsTagPerColl) { jetsTagPhi.emplace_back(jet.phi()); jetsTagEta.emplace_back(jet.eta()); } auto&& [baseToTagIndexMap, tagToBaseIndexMap] = JetUtilities::MatchJetsGeometrically(jetsBasePhi, jetsBaseEta, jetsTagPhi, jetsTagEta, maxMatchingDistance); - unsigned int i = 0; - for (auto& jet : jetsBase) { - // Store results - jetsBaseMatching(jet.globalIndex(), baseToTagIndexMap[i]); - ++i; + // forward matching + for (const auto& jet : jetsBasePerColl) { + LOGF(info, "jet index: %d (coll %d, pt %g, phi %g) with %d tracks, %d HF candidates", + jet.index(), jet.collisionId(), jet.pt(), jet.phi(), jet.tracks().size(), jet.hfcandidates().size()); + + const auto& cands = jet.template hfcandidates_as(); + int matchedIdx = -1; + if ((cands.front().flagMcMatchRec() & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) != 0) { + for (const auto& cand : cands) { + const auto& daughter0 = cand.template prong0_as(); + const auto& daughter1 = cand.template prong1_as(); + if (!daughter0.has_mcParticle() || !daughter1.has_mcParticle()) { + LOGF(warning, "Encountered candidate daughter (%d or %d) without MC particle", daughter0.globalIndex(), daughter1.globalIndex()); + continue; + } + const auto mother0Id = daughter0.template mcParticle_as().template mothers_as().front().globalIndex(); + const auto mother1Id = daughter1.template mcParticle_as().template mothers_as().front().globalIndex(); + LOGF(debug, "MC candidate %d with prongs: %d (MC %d), %d (MC %d)", cand.globalIndex(), + daughter0.globalIndex(), daughter0.template mcParticle_as().globalIndex(), + daughter1.globalIndex(), daughter1.template mcParticle_as().globalIndex()); + LOGF(info, "MC ids of mothers: %d - %d", mother0Id, mother1Id); + if ((mother0Id == mother1Id) && + std::abs(daughter0.template mcParticle_as().template mothers_as().front().flagMcMatchGen()) & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + LOGF(info, "D0 - looking for jet"); + for (const auto& pjet : jetsTagPerColl) { + for (const auto& cand : pjet.template hfcandidates_as()) { + if (mother0Id == cand.globalIndex()) { + matchedIdx = pjet.globalIndex(); + LOGF(info, "Found match det to part: %d (pt %g) -> %d (pt %g)", + jet.globalIndex(), jet.pt(), matchedIdx, pjet.pt()); + } + } + } + } + } + } + jetsBaseToTag(matchedIdx, baseToTagIndexMap[jet.index()]); // TODO: check usage of index } - i = 0; - for (auto& jet : jetsTag) { - // Store results - jetsTagMatching(jet.globalIndex(), tagToBaseIndexMap[i]); - ++i; + + // backward matching + for (const auto& jet : jetsTagPerColl) { + LOGF(info, "MC jet index: %d (coll %d) with %d tracks, %d HF candidates", + jet.index(), jet.mcCollisionId(), jet.tracks().size(), jet.hfcandidates().size()); + + int matchedIdx = -1; + for (const auto& cand : jet.template hfcandidates_as()) { + const auto& daughters = cand.template daughters_as(); + LOGF(info, "MC candidate %d with daughters %d, %d", cand.globalIndex(), daughters.iteratorAt(0).globalIndex(), daughters.iteratorAt(1).globalIndex()); + int index0 = -1, index1 = -1; + for (const auto& track : tracks) { + if (!track.has_mcParticle()) + continue; + if (track.mcParticle_as().globalIndex() == daughters.iteratorAt(0).globalIndex() && + index0 < 0) { + index0 = track.globalIndex(); + LOGF(info, "Found track for daughter 0: %d", index0); + } + if (track.mcParticle_as().globalIndex() == daughters.iteratorAt(1).globalIndex() && + index1 < 0) { + index1 = track.globalIndex(); + LOGF(info, "Found track for daughter 1: %d", index1); + } + } + if (index0 < 0 || index1 < 0) + continue; + int candIdx = 0; + for (const auto& prong : hfcandidates) { + LOGF(info, "checking prong %d with daughters %d-%d, %d-%d", + prong.globalIndex(), prong.prong0Id(), prong.template prong0_as().globalIndex(), prong.prong1Id(), prong.template prong1_as().globalIndex()); + if ((prong.template prong0_as().globalIndex() == index0 && prong.template prong1_as().globalIndex() == index1) || + (prong.prong0Id() == index1 && prong.prong1Id() == index0)) { + candIdx = prong.globalIndex(); + LOGF(info, "Found matching 2prong candidate: %d", candIdx); + } + } + for (const auto& djet : jetsBasePerColl) { + if (djet.template hfcandidates_as().front().globalIndex() == candIdx) { + matchedIdx = djet.globalIndex(); + LOGF(info, "Found match part to det: %d -> %d", jet.globalIndex(), matchedIdx); + } + } + } + jetsTagToBase(matchedIdx, tagToBaseIndexMap[jet.index()]); // TODO: check usage of index } } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - // TODO: Is there a better way to do this? - // TODO: String validation and normalization. There's too much room for error with enumerations. - auto jetMatching = cfgc.options().get("jet-matching"); - // Tokenize using stringstream - std::vector matchingOptions; - std::stringstream ss; - ss << jetMatching; - while (ss.good()) { - std::string substring; - getline(ss, substring, ','); - matchingOptions.push_back(substring); - } - std::vector tasks; - // NOTE: soa::Filtered must be applied here. It would have been nicer to apply in process, but it doesn't - // appear to get recognized as a type in that case (reason is unclear). - for (auto opt : matchingOptions) { - // If there is a hybrid subtracted jet collection. - if (opt == "Hybrid-HybridIntermediate") { - tasks.emplace_back( - adaptAnalysisTask::iterator, o2::aod::Jets, o2::aod::MatchedJets, - o2::aod::HybridIntermediateJets, o2::aod::MatchedHybridIntermediateJets>>( - cfgc, TaskName{"jet-matching-hybrid-sub-to-hybrid-intermedaite"})); - } - // If there are two classes of hybrid jets, this will match from the second class to the detector level - if (opt == "HybridIntermediate-MCDetectorLevel") { - tasks.emplace_back( - adaptAnalysisTask::iterator, o2::aod::HybridIntermediateJets, o2::aod::MatchedHybridIntermediateJets, - o2::aod::MCDetectorLevelJets, o2::aod::MatchedMCDetectorLevelJets>>(cfgc, TaskName{"jet-matching-hybrid-intermediate-to-MC-detector-level"})); - } - // If there is just a single standard hybrid jet collection, it can be matched directly to MC detector level. - if (opt == "Hybrid-MCDetectorLevel") { - tasks.emplace_back( - adaptAnalysisTask::iterator, o2::aod::Jets, - o2::aod::MatchedJets, o2::aod::MCDetectorLevelJets, o2::aod::MatchedMCDetectorLevelJets>>(cfgc, TaskName{"jet-matching-hybrid-to-MC-detector-level"})); - } - // Finally, match MC detector level to MC particle level. - if (opt == "MCDetectorLevel-MCParticleLevel") { - tasks.emplace_back( - adaptAnalysisTask>::iterator, - o2::aod::MCDetectorLevelJets, o2::aod::MatchedMCDetectorLevelJets, o2::aod::MCParticleLevelJets, o2::aod::MatchedMCParticleLevelJets>>(cfgc, TaskName{"jet-matching-MC-detector-level-to-MC-particle-level"})); - } - } - return WorkflowSpec{tasks}; + return WorkflowSpec{ + adaptAnalysisTask, + soa::Join, + aod::D0MCDJetsMatchedToD0MCPJets, aod::D0MCPJetsMatchedToD0MCDJets, + soa::Join>>(cfgc, TaskName{"jet-matching-hf"})}; } diff --git a/PWGJE/TableProducer/jetmatchinghf.cxx b/PWGJE/TableProducer/jetmatchinghf.cxx deleted file mode 100644 index c4d5b4c7044..00000000000 --- a/PWGJE/TableProducer/jetmatchinghf.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// 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. - -/// \file jetmatchinghf.cxx -/// \brief Match jets containing the same D0s -/// -/// \author Jochen Klein - -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "PWGJE/DataModel/JetHF.h" -#include "PWGJE/Core/JetUtilities.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -struct JetMatchingHF { - using Collisions = soa::Join; - using Tracks = soa::Join; - using HfCandidates = soa::Join; - using McParticles = soa::Join; - using DetectorLevelJets = soa::Join; - using ParticleLevelJets = soa::Join; - - Produces jetsPartToDetMatching; - Produces jetsDetToPartMatching; - - Preslice ParticleLevelJetsPerMcCollision = aod::jet::mcCollisionId; - - void init(InitContext const&) - { - } - - void process(Collisions::iterator const& collision, aod::McCollisions const& mcCollisions, - ParticleLevelJets const& jetsMC, DetectorLevelJets const& jetsRec, - HfCandidates const& hfcandidates, Tracks const& tracks, - McParticles const& particlesMC) - { - const auto jetsPL = jetsMC.sliceBy(ParticleLevelJetsPerMcCollision, collision.mcCollisionId()); - - // match rec to MC - for (const auto& jet : jetsRec) { - LOGF(info, "jet index: %d (coll %d, pt %g, phi %g) with %d tracks, %d HF candidates", - jet.index(), jet.collisionId(), jet.pt(), jet.phi(), jet.tracks().size(), jet.hfcandidates().size()); - - const auto& cands = jet.hfcandidates_as(); - int matchedIdx = -1; - if ((cands.front().flagMcMatchRec() & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) == 0) { - jetsDetToPartMatching(matchedIdx); - continue; - } - for (const auto& cand : cands) { - const auto& daughter0 = cand.prong0_as(); - const auto& daughter1 = cand.prong1_as(); - if (!daughter0.has_mcParticle() || !daughter1.has_mcParticle()) { - LOGF(warning, "Encountered candidate daughter (%d or %d) without MC particle", daughter0.globalIndex(), daughter1.globalIndex()); - continue; - } - const auto mother0Id = daughter0.mcParticle_as().mothers_as().front().globalIndex(); - const auto mother1Id = daughter1.mcParticle_as().mothers_as().front().globalIndex(); - LOGF(debug, "MC candidate %d with prongs: %d (MC %d), %d (MC %d)", cand.globalIndex(), - daughter0.globalIndex(), daughter0.mcParticle_as().globalIndex(), - daughter1.globalIndex(), daughter1.mcParticle_as().globalIndex()); - LOGF(info, "MC ids of mothers: %d - %d", mother0Id, mother1Id); - if ((mother0Id == mother1Id) && - std::abs(daughter0.mcParticle_as().mothers_as().front().flagMcMatchGen()) & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - LOGF(info, "D0 - looking for jet"); - for (const auto& pjet : jetsPL) { - for (const auto& cand : pjet.hfcandidates_as()) { - if (mother0Id == cand.globalIndex()) { - matchedIdx = pjet.globalIndex(); - LOGF(info, "Found match det to part: %d (pt %g) -> %d (pt %g)", - jet.globalIndex(), jet.pt(), matchedIdx, pjet.pt()); - } - } - } - } - } - jetsDetToPartMatching(matchedIdx); - } - - // match MC to rec - for (const auto& jet : jetsPL) { - LOGF(info, "MC jet index: %d (coll %d) with %d tracks, %d HF candidates", - jet.index(), jet.mcCollisionId(), jet.tracks().size(), jet.hfcandidates().size()); - - int matchedIdx = -1; - for (const auto& cand : jet.hfcandidates_as()) { - const auto& daughters = cand.daughters_as(); - LOGF(info, "MC candidate %d with daughters %d, %d", cand.globalIndex(), daughters.iteratorAt(0).globalIndex(), daughters.iteratorAt(1).globalIndex()); - int index0 = -1, index1 = -1; - for (const auto& track : tracks) { - if (!track.has_mcParticle()) - continue; - if (track.mcParticle_as().globalIndex() == daughters.iteratorAt(0).globalIndex() && - index0 < 0) { - index0 = track.globalIndex(); - LOGF(info, "Found track for daughter 0: %d", index0); - } - if (track.mcParticle_as().globalIndex() == daughters.iteratorAt(1).globalIndex() && - index1 < 0) { - index1 = track.globalIndex(); - LOGF(info, "Found track for daughter 1: %d", index1); - } - } - if (index0 < 0 || index1 < 0) - continue; - int candIdx = 0; - for (const auto& prong : hfcandidates) { - LOGF(info, "checking prong %d with daughters %d-%d, %d-%d", - prong.globalIndex(), prong.prong0Id(), prong.prong0_as().globalIndex(), prong.prong1Id(), prong.prong1_as().globalIndex()); - if ((prong.prong0_as().globalIndex() == index0 && prong.prong1_as().globalIndex() == index1) || - (prong.prong0Id() == index1 && prong.prong1Id() == index0)) { - candIdx = prong.globalIndex(); - LOGF(info, "Found matching 2prong candidate: %d", candIdx); - } - } - for (const auto& djet : jetsRec) { - if (djet.hfcandidates_as().front().globalIndex() == candIdx) { - matchedIdx = djet.globalIndex(); - LOGF(info, "Found match part to det: %d -> %d", jet.globalIndex(), matchedIdx); - } - } - } - jetsPartToDetMatching(matchedIdx); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"jet-matching-hf"})}; -} diff --git a/PWGJE/Tasks/jetmatchinghfqa.cxx b/PWGJE/Tasks/jetmatchinghfqa.cxx index a42dad45e1b..5b624c043cb 100644 --- a/PWGJE/Tasks/jetmatchinghfqa.cxx +++ b/PWGJE/Tasks/jetmatchinghfqa.cxx @@ -20,15 +20,15 @@ #include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "PWGJE/DataModel/JetHF.h" +#include "PWGJE/DataModel/Jet.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; struct JetMatchingHFQA { - using DetectorLevelJets = soa::Join; - using ParticleLevelJets = soa::Join; + using DetectorLevelJets = soa::Join; + using ParticleLevelJets = soa::Join; OutputObj hJetPt{"h_jet_pt"}; OutputObj hJetDetaDphi{"h_jet_deta_dphi"}; @@ -61,10 +61,10 @@ struct JetMatchingHFQA { DetectorLevelJets const& djets, ParticleLevelJets const& pjets) { for (const auto& djet : djets) { - if (djet.has_matchedJet() && djet.matchedJetId() >= 0) { - const auto& pjet = djet.matchedJet_as(); + if (djet.has_matchedJetCand() && djet.matchedJetCandId() >= 0) { + const auto& pjet = djet.matchedJetCand_as(); LOGF(info, "djet %d (pt of %g GeV/c) is matched to %d (pt of %g GeV/c)", - djet.globalIndex(), djet.pt(), djet.matchedJetId(), pjet.pt()); + djet.globalIndex(), djet.pt(), djet.matchedJetCandId(), pjet.pt()); hJetPt->Fill(pjet.pt(), djet.pt()); hJetDetPt->Fill(djet.pt()); hJetDetPhi->Fill(djet.phi()); @@ -81,10 +81,10 @@ struct JetMatchingHFQA { { LOGF(info, "analysing MC collision %d", collision.globalIndex()); for (const auto& pjet : pjets) { - if (pjet.has_matchedJet() && pjet.matchedJetId() >= 0) { - const auto& djet = pjet.matchedJet_as(); + if (pjet.has_matchedJetCand() && pjet.matchedJetCandId() >= 0) { + const auto& djet = pjet.matchedJetCand_as(); LOGF(info, "pjet %d (pt of %g GeV/c) is matched to %d (pt of %g GeV/c)", - pjet.globalIndex(), pjet.pt(), pjet.matchedJetId(), djet.pt()); + pjet.globalIndex(), pjet.pt(), pjet.matchedJetCandId(), djet.pt()); hJetGenPt->Fill(pjet.pt()); hJetGenPhi->Fill(pjet.phi()); hJetGenEta->Fill(pjet.eta()); diff --git a/PWGJE/Tasks/jetsubstructurehf.cxx b/PWGJE/Tasks/jetsubstructurehf.cxx index ab3b2d6998f..1a4b46b27ad 100644 --- a/PWGJE/Tasks/jetsubstructurehf.cxx +++ b/PWGJE/Tasks/jetsubstructurehf.cxx @@ -31,7 +31,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGJE/DataModel/JetHF.h" +#include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetSubstructure.h" #include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/FastJetUtilities.h" @@ -177,7 +177,7 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processD0Data, "D0 jet substructure on data", false); - void processD0MCD(soa::Join::iterator const& jet, + void processD0MCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -189,7 +189,7 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processD0MCD, "D0 jet substructure on MC detector level", false); - void processD0MCP(soa::Join::iterator const& jet, + void processD0MCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { processGenLevel(jet); @@ -208,7 +208,7 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processLcData, "Lc jet substructure on data", false); - void processLcMCD(soa::Join::iterator const& jet, + void processLcMCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -220,14 +220,14 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processLcMCD, "Lc jet substructure on MC detector level", false); - void processLcMCP(soa::Join::iterator const& jet, + void processLcMCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { processGenLevel(jet); } PROCESS_SWITCH(JetSubstructureHFTask, processLcMCP, "Lc jet substructure on MC particle level", false); - void processBPlusData(soa::Join::iterator const& jet, + void processBPlusData(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -239,7 +239,7 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processBPlusData, "BPlus jet substructure on data", false); - void processBPlusMCD(soa::Join::iterator const& jet, + void processBPlusMCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -251,7 +251,7 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processBPlusMCD, "BPlus jet substructure on MC detector level", false); - void processBPlusMCP(soa::Join::iterator const& jet, + void processBPlusMCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { processGenLevel(jet); @@ -259,14 +259,14 @@ struct JetSubstructureHFTask { PROCESS_SWITCH(JetSubstructureHFTask, processBPlusMCP, "BPlus jet substructure on MC particle level", false); }; using JetSubstructureD0 = JetSubstructureHFTask; -using MCDetectorLevelJetSubstructureD0 = JetSubstructureHFTask; -using MCParticleLevelJetSubstructureD0 = JetSubstructureHFTask; +using MCDetectorLevelJetSubstructureD0 = JetSubstructureHFTask; +using MCParticleLevelJetSubstructureD0 = JetSubstructureHFTask; using JetSubstructureLc = JetSubstructureHFTask; -using MCDetectorLevelJetSubstructureLc = JetSubstructureHFTask; -using MCParticleLevelJetSubstructureLc = JetSubstructureHFTask; -using JetSubstructureBPlus = JetSubstructureHFTask; -using MCDetectorLevelJetSubstructureBPlus = JetSubstructureHFTask; -using MCParticleLevelJetSubstructureBPlus = JetSubstructureHFTask; +using MCDetectorLevelJetSubstructureLc = JetSubstructureHFTask; +using MCParticleLevelJetSubstructureLc = JetSubstructureHFTask; +using JetSubstructureBPlus = JetSubstructureHFTask; +using MCDetectorLevelJetSubstructureBPlus = JetSubstructureHFTask; +using MCParticleLevelJetSubstructureBPlus = JetSubstructureHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/jetsubstructurehfoutput.cxx b/PWGJE/Tasks/jetsubstructurehfoutput.cxx index e032e775a08..f6ef87c5bf6 100644 --- a/PWGJE/Tasks/jetsubstructurehfoutput.cxx +++ b/PWGJE/Tasks/jetsubstructurehfoutput.cxx @@ -28,7 +28,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGJE/DataModel/JetHF.h" +#include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetSubstructure.h" #include "PWGJE/Core/JetFinder.h" @@ -76,7 +76,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processD0Data, "D0 jet substructure output on data", false); - void processD0MCD(soa::Join::iterator const& jet, + void processD0MCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -95,7 +95,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processD0MCD, "D0 jet substructure output on MC detector level", false); - void processD0MCP(soa::Join::iterator const& jet, + void processD0MCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { @@ -127,7 +127,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processLcData, "Lc jet substructure output on data", false); - void processLcMCD(soa::Join::iterator const& jet, + void processLcMCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -146,7 +146,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processLcMCD, "Lc jet substructure output on MC detector level", false); - void processLcMCP(soa::Join::iterator const& jet, + void processLcMCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { @@ -158,7 +158,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processLcMCP, "Lc jet substructure output on MC particle level", false); - void processBPlusData(soa::Join::iterator const& jet, // add template back + void processBPlusData(soa::Join::iterator const& jet, // add template back soa::Join const& candidates, aod::Tracks const& tracks) { @@ -174,7 +174,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processBPlusData, "B+ jet substructure output on data", false); - void processBPlusMCD(soa::Join::iterator const& jet, + void processBPlusMCD(soa::Join::iterator const& jet, soa::Join const& candidates, aod::Tracks const& tracks) { @@ -189,7 +189,7 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processBPlusMCD, "B+ jet substructure output on MC detector level", false); - void processBPlusMCP(soa::Join::iterator const& jet, + void processBPlusMCP(soa::Join::iterator const& jet, aod::McParticles const& particles) { @@ -202,14 +202,14 @@ struct JetSubstructureHFOutputTask { PROCESS_SWITCH(JetSubstructureHFOutputTask, processBPlusMCP, "B+ jet substructure output on MC particle level", false); }; using JetSubstructureOutputDataD0 = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCParticleLevelD0 = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCDetectorLevelD0 = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCParticleLevelD0 = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCDetectorLevelD0 = JetSubstructureHFOutputTask; using JetSubstructureOutputDataLc = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCParticleLevelLc = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCDetectorLevelLc = JetSubstructureHFOutputTask; -using JetSubstructureOutputDataBPlus = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCParticleLevelBPlus = JetSubstructureHFOutputTask; -using JetSubstructureOutputMCDetectorLevelBPlus = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCParticleLevelLc = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCDetectorLevelLc = JetSubstructureHFOutputTask; +using JetSubstructureOutputDataBPlus = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCParticleLevelBPlus = JetSubstructureHFOutputTask; +using JetSubstructureOutputMCDetectorLevelBPlus = JetSubstructureHFOutputTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {