ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
JetPileupTag::NNJvtBinning Struct Reference

Helper struct to hold the bin edges for the NN Jvt cut maps. More...

#include <NNJvtBinning.h>

Collaboration diagram for JetPileupTag::NNJvtBinning:

Public Member Functions

std::string toJSON () const
 
bool operator() (float pt, float eta, std::size_t &ptBin, std::size_t &etaBin) const
 Get the correct bin for the provided pt/eta values. More...
 
bool operator() (const xAOD::IParticle &particle, std::size_t &ptBin, std::size_t &etaBin) const
 Get the correct bin for the provided particle. More...
 

Static Public Member Functions

static NNJvtBinning fromJSON (std::istream &is)
 

Public Attributes

std::vector< float > ptEdges
 
std::vector< float > etaEdges
 

Detailed Description

Helper struct to hold the bin edges for the NN Jvt cut maps.

Definition at line 23 of file NNJvtBinning.h.

Member Function Documentation

◆ fromJSON()

NNJvtBinning JetPileupTag::NNJvtBinning::fromJSON ( std::istream &  is)
static

Definition at line 56 of file NNJvtBinning.cxx.

56  {
58  is >> j;
59  return j.get<NNJvtBinning>();
60  }

◆ operator()() [1/2]

bool JetPileupTag::NNJvtBinning::operator() ( const xAOD::IParticle particle,
std::size_t &  ptBin,
std::size_t &  etaBin 
) const

Get the correct bin for the provided particle.

Parameters
particleThe particle to test
[out]ptBinThe pt bin this belongs to, SIZE_MAX if none
[out]etaBinThe eta bin this belongs to, SIZE_MAX if none
Returns
Whether or not the object falls into a bin

Definition at line 85 of file NNJvtBinning.cxx.

86  {
87  return this->operator()(particle.pt(), particle.eta(), ptBin, etaBin);
88  }

◆ operator()() [2/2]

bool JetPileupTag::NNJvtBinning::operator() ( float  pt,
float  eta,
std::size_t &  ptBin,
std::size_t &  etaBin 
) const

Get the correct bin for the provided pt/eta values.

Parameters
ptThe pt of the object
etaThe eta of the object
[out]ptBinThe pt bin this belongs to, SIZE_MAX if none
[out]etaBinThe eta bin this belongs to, SIZE_MAX if none
Returns
Whether or not the object falls into a bin

Definition at line 67 of file NNJvtBinning.cxx.

67  {
68  ptBin = std::distance(
69  ptEdges.begin(), std::lower_bound(ptEdges.begin(), ptEdges.end(), pt));
71  etaEdges.begin(), std::lower_bound(etaEdges.begin(), etaEdges.end(), eta));
72  // 0 => below the lowest bin edge, size() => above the highest bin edge
73  if (ptBin == 0 || ptBin == ptEdges.size())
74  ptBin = SIZE_MAX;
75  else
76  ptBin -= 1;
77  if (etaBin == 0 || etaBin == etaEdges.size())
78  etaBin = SIZE_MAX;
79  else
80  etaBin -= 1;
81 
82  return ptBin != SIZE_MAX && etaBin != SIZE_MAX;
83  }

◆ toJSON()

std::string JetPileupTag::NNJvtBinning::toJSON ( ) const

Definition at line 62 of file NNJvtBinning.cxx.

62  {
63  return nlohmann::json(*this).dump();
64  }

Member Data Documentation

◆ etaEdges

std::vector<float> JetPileupTag::NNJvtBinning::etaEdges

Definition at line 25 of file NNJvtBinning.h.

◆ ptEdges

std::vector<float> JetPileupTag::NNJvtBinning::ptEdges

Definition at line 24 of file NNJvtBinning.h.


The documentation for this struct was generated from the following files:
JetPileupTag::NNJvtBinning::operator()
bool operator()(float pt, float eta, std::size_t &ptBin, std::size_t &etaBin) const
Get the correct bin for the provided pt/eta values.
Definition: NNJvtBinning.cxx:67
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
json
nlohmann::json json
Definition: HistogramDef.cxx:9
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
test_pyathena.pt
pt
Definition: test_pyathena.py:11
JetPileupTag::NNJvtBinning::etaEdges
std::vector< float > etaEdges
Definition: NNJvtBinning.h:25
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
JetPileupTag::NNJvtBinning::ptEdges
std::vector< float > ptEdges
Definition: NNJvtBinning.h:24
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54