ATLAS Offline Software
ConstituentsLoader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4  This is a virtual class to represent loader of any type of constituents.
5  It defines the interface for loading constituents from a jet
6  and extracting their features for the NN evaluation.
7 */
8 
9 #ifndef CONTITUENTS_LOADER_H
10 #define CONTITUENTS_LOADER_H
11 
12 // local includes
18 
19 // EDM includes
20 #include "xAODJet/Jet.h"
21 #include "xAODBTagging/BTagging.h"
22 
23 // STL includes
24 #include <string>
25 #include <vector>
26 #include <set>
27 #include <tuple>
28 
29 namespace FlavorTagDiscriminants {
30 
32  enum class ConstituentsSortOrder {
37  };
38  enum class ConstituentsSelection {
39  ALL,
40  IP3D_2018,
46  R22_LOOSE
47  };
48  enum class ConstituentsType {
49  IPARTICLE,
50  TRACK
51  };
52 
54  std::string name;
56  bool flip_sign;
57  };
58 
60  std::string name;
61  std::string output_name;
65  std::vector<InputVariableConfig> inputs;
66  };
67 
69  const std::string & name,
70  const std::vector<std::string> & input_variables,
71  FlipTagConfig flip_config
72  );
73 
74  // Virtual class to represent loader of any type of constituents
76  public:
78  m_config = cfg;
79  };
80  virtual ~IConstituentsLoader() = default;
81  virtual std::tuple<std::string, Inputs, std::vector<const xAOD::IParticle*>> getData(
82  const xAOD::Jet& jet,
83  [[maybe_unused]] const SG::AuxElement& btag) const = 0;
85  virtual std::set<std::string> getUsedRemap() const = 0;
86  virtual std::string getName() const = 0;
87  virtual ConstituentsType getType() const = 0;
88 
89  protected:
92  std::set<std::string> m_used_remap;
93  std::string m_name;
94  };
95 }
96 
97 
98 #endif
FlavorTagDiscriminants::IConstituentsLoader::getDependencies
virtual FTagDataDependencyNames getDependencies() const =0
FlavorTagDiscriminants::ConstituentsSortOrder
ConstituentsSortOrder
Definition: ConstituentsLoader.h:32
Jet.h
FlavorTagDiscriminants::ConstituentsSelection::IP3D_2018
@ IP3D_2018
FlavorTagDiscriminants::ConstituentsInputConfig
Definition: ConstituentsLoader.h:59
BTagging.h
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
FlavorTagDiscriminants::IConstituentsLoader
Definition: ConstituentsLoader.h:75
FlavorTagDiscriminants::ConstituentsInputConfig::name
std::string name
Definition: ConstituentsLoader.h:60
FlavorTagDiscriminants::ConstituentsInputConfig::type
ConstituentsType type
Definition: ConstituentsLoader.h:62
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
FlavorTagDiscriminants::ConstituentsEDMType
ConstituentsEDMType
Definition: ConstituentsLoader.h:31
FlipTagEnums.h
FlavorTagDiscriminants::IConstituentsLoader::m_name
std::string m_name
Definition: ConstituentsLoader.h:93
FlavorTagDiscriminants::IConstituentsLoader::~IConstituentsLoader
virtual ~IConstituentsLoader()=default
FlavorTagDiscriminants::IConstituentsLoader::m_used_remap
std::set< std::string > m_used_remap
Definition: ConstituentsLoader.h:92
FlavorTagDiscriminants::IConstituentsLoader::IConstituentsLoader
IConstituentsLoader(ConstituentsInputConfig cfg)
Definition: ConstituentsLoader.h:77
FlavorTagDiscriminants::createConstituentsLoaderConfig
ConstituentsInputConfig createConstituentsLoaderConfig(const std::string &name, const std::vector< std::string > &input_variables, FlipTagConfig flip_config)
Definition: ConstituentsLoader.cxx:84
FlavorTagDiscriminants::ConstituentsSortOrder::ABS_D0_SIGNIFICANCE_DESCENDING
@ ABS_D0_SIGNIFICANCE_DESCENDING
FlavorTagDiscriminants::ConstituentsEDMType::CUSTOM_GETTER
@ CUSTOM_GETTER
FlavorTagDiscriminants::ConstituentsEDMType::DOUBLE
@ DOUBLE
FlavorTagDiscriminants::ConstituentsSelection::DIPS_TIGHT_UPGRADE
@ DIPS_TIGHT_UPGRADE
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
FlavorTagDiscriminants::FTagDataDependencyNames
Definition: FTagDataDependencyNames.h:12
FlavorTagDiscriminants::ConstituentsInputConfig::order
ConstituentsSortOrder order
Definition: ConstituentsLoader.h:63
FlavorTagDiscriminants::IConstituentsLoader::getData
virtual std::tuple< std::string, Inputs, std::vector< const xAOD::IParticle * > > getData(const xAOD::Jet &jet, [[maybe_unused]] const SG::AuxElement &btag) const =0
FlavorTagDiscriminants::ConstituentsSortOrder::ABS_D0_DESCENDING
@ ABS_D0_DESCENDING
FlavorTagDiscriminants::IConstituentsLoader::getUsedRemap
virtual std::set< std::string > getUsedRemap() const =0
FlavorTagDiscriminants::IConstituentsLoader::getType
virtual ConstituentsType getType() const =0
FlavorTagDiscriminants::ConstituentsSelection
ConstituentsSelection
Definition: ConstituentsLoader.h:38
FlavorTagDiscriminants::ConstituentsSelection::DIPS_LOOSE_UPGRADE
@ DIPS_LOOSE_UPGRADE
FlavorTagDiscriminants::InputVariableConfig::name
std::string name
Definition: ConstituentsLoader.h:54
FlavorTagDiscriminants::IConstituentsLoader::m_deps
FTagDataDependencyNames m_deps
Definition: ConstituentsLoader.h:90
FlavorTagDiscriminants::ConstituentsInputConfig::output_name
std::string output_name
Definition: ConstituentsLoader.h:61
FlavorTagDiscriminants::ConstituentsSelection::ALL
@ ALL
FTagDataDependencyNames.h
FlavorTagDiscriminants::ConstituentsInputConfig::inputs
std::vector< InputVariableConfig > inputs
Definition: ConstituentsLoader.h:65
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FlavorTagDiscriminants::ConstituentsSortOrder::PT_DESCENDING
@ PT_DESCENDING
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
FlavorTagDiscriminants::ConstituentsSelection::R22_DEFAULT
@ R22_DEFAULT
FlavorTagDiscriminants::ConstituentsEDMType::UCHAR
@ UCHAR
FlavorTagDiscriminants::IConstituentsLoader::m_config
ConstituentsInputConfig m_config
Definition: ConstituentsLoader.h:91
FlavorTagDiscriminants::ConstituentsSelection::R22_LOOSE
@ R22_LOOSE
FlavorTagDiscriminants::IConstituentsLoader::getName
virtual std::string getName() const =0
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
FlavorTagDiscriminants::ConstituentsInputConfig::selection
ConstituentsSelection selection
Definition: ConstituentsLoader.h:64
FlavorTagDiscriminants::ConstituentsEDMType::CHAR
@ CHAR
FlavorTagDiscriminants::ConstituentsSelection::DIPS_LOOSE_202102
@ DIPS_LOOSE_202102
FlavorTagDiscriminants::InputVariableConfig::type
ConstituentsEDMType type
Definition: ConstituentsLoader.h:55
FlavorTagDiscriminants::ConstituentsEDMType::FLOAT
@ FLOAT
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
FlavorTagDiscriminants::FlipTagConfig
FlipTagConfig
Definition: FlipTagEnums.h:14
FlavorTagDiscriminants::ConstituentsEDMType::INT
@ INT
FlavorTagDiscriminants::ConstituentsType::IPARTICLE
@ IPARTICLE
FlavorTagDiscriminants::ConstituentsType
ConstituentsType
Definition: ConstituentsLoader.h:48
FlavorTagDiscriminants::ConstituentsSelection::LOOSE_202102_NOIP
@ LOOSE_202102_NOIP
FlavorTagDiscriminants::InputVariableConfig::flip_sign
bool flip_sign
Definition: ConstituentsLoader.h:56
FlavorTagDiscriminants::InputVariableConfig
Definition: ConstituentsLoader.h:53
AssociationEnums.h
StringUtils.h
FlavorTagDiscriminants::ConstituentsSortOrder::D0_SIGNIFICANCE_DESCENDING
@ D0_SIGNIFICANCE_DESCENDING
OnnxUtil.h