ATLAS Offline Software
Loading...
Searching...
No Matches
TausRUsEvaluator Class Reference

Evaluates the TausRUs network and decorates its predictions on the tau and on its tracks. More...

#include <TausRUsEvaluator.h>

Inheritance diagram for TausRUsEvaluator:
Collaboration diagram for TausRUsEvaluator:

Classes

struct  Output

Public Types

enum  PrimaryClass : size_t { QCD = 0 , Tau = 1 , Electron = 2 }
 Class order of the 'primary' head, which is three raw logits. More...
enum  PhiComponent : size_t { PHI_SIN = 0 , PHI_COS = 1 }
 The two components of a phi head, which regresses the angle as a point on the unit circle: phi = atan2(sin, cos). More...

Public Member Functions

 TausRUsEvaluator (const std::string &name="TausRUsEvaluator")
virtual ~TausRUsEvaluator ()
virtual StatusCode initialize () override
 Tool initializer.
virtual StatusCode execute (xAOD::TauJet &tau) const override
 Execute - called for each tau candidate.
virtual StatusCode eventInitialize () override
 Event initializer - called at the beginning of each event.
virtual StatusCode executePi0CreateROI (xAOD::TauJet &pTau, CaloConstCellContainer &caloCellContainer, boost::dynamic_bitset<> &map) const override
virtual StatusCode executeVertexFinder (xAOD::TauJet &pTau, const xAOD::VertexContainer *vertexContainer=nullptr) const override
virtual StatusCode executeTrackFinder (xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackContainer) const override
virtual StatusCode executeTrackClassifier (xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackContainer) const override
virtual StatusCode executeShotFinder (xAOD::TauJet &pTau, xAOD::CaloClusterContainer &shotClusterContainer, xAOD::PFOContainer &PFOContainer) const override
virtual StatusCode executePi0ClusterCreator (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer, xAOD::PFOContainer &hadronicPFOContainer, const xAOD::CaloClusterContainer &pCaloClusterContainer) const override
virtual StatusCode executeVertexVariables (xAOD::TauJet &pTau, xAOD::VertexContainer &vertexContainer) const override
virtual StatusCode executePi0ClusterScaler (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer, xAOD::PFOContainer &chargedPFOContainer) const override
virtual StatusCode executePi0nPFO (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer) const override
virtual StatusCode executePanTau (xAOD::TauJet &pTau, xAOD::ParticleContainer &particleContainer, xAOD::PFOContainer &neutralPFOContainer) const override
virtual StatusCode eventFinalize () override
 Event finalizer - called at the end of each event.
virtual StatusCode finalize () override
 Finalizer.
std::string find_file (const std::string &fname) const
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Static Public Attributes

static constexpr float DEFAULT_VALUE = -1111.0f
 initialized with these default values
static constexpr int DEFAULT_CLASS = -1
static constexpr int TAU_TRACK_CLASS = 0
 Class for true-tau track from tau_track_class head.

Protected Member Functions

bool inTrigger () const
bool inAOD () const
bool inEleRM () const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

Gaudi::Property< bool > m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
Gaudi::Property< bool > m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
Gaudi::Property< bool > m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
Gaudi::Property< std::string > m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}

Private Types

using FourMomDecorators = std::vector<SG::Accessor<float>>
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

StatusCode readModel (const std::string &path)
 Configure the data loader and build m_outputs from the metadata and node shapes of the model.
void setDefaults (xAOD::TauJet &tau) const
void decorateFourMomentum (xAOD::TauJet &tau, const FourMomDecorators &decorators, std::span< const float > ptQuantiles, std::span< const float > etaValues, std::span< const float > phiValues, float mass) const
 Decorate the four floats of decorators from a pt, an eta and a phi head, taking the mass from mass.
void decorateVertex (xAOD::TauJet &tau, std::span< const float > scoresscores, const std::vector< const xAOD::Vertex * > &vertices) const
 Decorate the position of the vertex that scores picks out of vertices, which must be the list the input tensor was built from.
void decorateTracks (xAOD::TauJet &tau, std::span< const float > scoresscores) const
 Decorate each track of tau with its slot of the per-track head.
std::vector< std::string > tauDecorationNames () const
 Every decoration written on the tau, and every one written on its tracks, which is what the output data dependencies are declared from.
std::vector< std::string > trackDecorationNames () const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< AthInfer::IAthInferenceTool > m_inferenceTool
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputContainer
Gaudi::Property< std::string > m_modelFile
Gaudi::Property< std::string > m_tauContainerName
Gaudi::Property< std::string > m_tauTrackContainerName
Gaudi::Property< float > m_minTauPt
std::unique_ptr< TausRUsDataLoader > m_loader
std::vector< Output > m_outputs
 The model's output nodes, from its metadata.
size_t m_nDecayModes {0}
 Read off the metadata at initialize().
size_t m_nTrackClasses {0}
size_t m_nQuantiles {0}
size_t m_ptMedianQuantile {0}
 The pt heads ('tes', 'charged_pion_pt', 'neutral_pion_pt') regress quantiles of the log response, log(pt_seedjet / pt_true).
SG::Accessor< float > m_tauIDScore
 The decorators.
SG::Accessor< float > m_eleRejScore
SG::Accessor< float > m_decayMode
SG::Accessor< float > m_tauCharge
std::vector< SG::Accessor< float > > m_decayModeScores
FourMomDecorators m_tauP4
FourMomDecorators m_chargedPionP4
FourMomDecorators m_neutralPionP4
std::vector< SG::Accessor< float > > m_vertexPosition
SG::Decorator< int > m_trackClass
std::vector< SG::Decorator< float > > m_trackScores
std::vector< SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_decorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::TauTrackContainer > > m_trackDecorKeys
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Evaluates the TausRUs network and decorates its predictions on the tau and on its tracks.

The input and output nodes are read from the "metadata" JSON the model carries. Inputs are built by TausRUsDataLoader.

Nothing is decorated as it comes out of the graph. This tool owns the whole translation into quantities that stand on their own:

TausRUsTauIDScore tau vs QCD, a two-class softmax over those two logits of the 'primary' head TausRUsEleRejScore tau vs electron, the same over that pair TausRUsDecayMode decay mode decision, and TausRUsDecayModeScore the raw scores it is the argmax of TausRUsTauP4_* the regressed tau four-momentum, and TausRUsChargedPionP4_* the two pion four-momenta, each four floats, TausRUsNeutralPionP4_* _pt, _eta, _phi and _m. The mass is the PDG mass of the particle. TausRUsVertex_x/_y/_z position of the vertex the 'vertex_classification' head picks out of the event vertex collection TausRUsTauCharge sum of the charges of the tracks classified as tau tracks, kept only when it is -1 or +1, else 0

Then, per xAOD::TauTrack the following are parsed

TausRUsTrackClass track class decision, and TausRUsTrackScore the raw scores it is the argmax of

Definition at line 60 of file TausRUsEvaluator.h.

Member Typedef Documentation

◆ FourMomDecorators

using TausRUsEvaluator::FourMomDecorators = std::vector<SG::Accessor<float>>
private

Definition at line 93 of file TausRUsEvaluator.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ PhiComponent

The two components of a phi head, which regresses the angle as a point on the unit circle: phi = atan2(sin, cos).

Enumerator
PHI_SIN 
PHI_COS 

Definition at line 89 of file TausRUsEvaluator.h.

◆ PrimaryClass

Class order of the 'primary' head, which is three raw logits.

Enumerator
QCD 
Tau 
Electron 

Definition at line 82 of file TausRUsEvaluator.h.

Constructor & Destructor Documentation

◆ TausRUsEvaluator()

TausRUsEvaluator::TausRUsEvaluator ( const std::string & name = "TausRUsEvaluator")

Definition at line 85 of file TausRUsEvaluator.cxx.

86 : TauRecToolBase(name),
87 m_tauIDScore(TAU_ID_SCORE),
88 m_eleRejScore(ELE_REJ_SCORE),
89 m_decayMode(DECAY_MODE),
90 m_tauCharge(TAU_CHARGE),
91 m_trackClass(TRACK_CLASS) {}
TauRecToolBase(const std::string &name)
SG::Accessor< float > m_decayMode
SG::Accessor< float > m_eleRejScore
SG::Accessor< float > m_tauIDScore
The decorators.
SG::Accessor< float > m_tauCharge
SG::Decorator< int > m_trackClass

◆ ~TausRUsEvaluator()

TausRUsEvaluator::~TausRUsEvaluator ( )
virtual

Definition at line 93 of file TausRUsEvaluator.cxx.

93{}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ decorateFourMomentum()

void TausRUsEvaluator::decorateFourMomentum ( xAOD::TauJet & tau,
const FourMomDecorators & decorators,
std::span< const float > ptQuantiles,
std::span< const float > etaValues,
std::span< const float > phiValues,
float mass ) const
private

Decorate the four floats of decorators from a pt, an eta and a phi head, taking the mass from mass.

Definition at line 349 of file TausRUsEvaluator.cxx.

354 {
355 // The pt heads regress quantiles of the log response, log(ptJetSeed / pt), so
356 // the seed pt is needed to undo it and a seed with no pt leaves the defaults.
357 const float ptJetSeed = tau.ptJetSeed();
358 if (ptJetSeed <= 0.f) {
359 ATH_MSG_DEBUG("Seed jet pt is " << ptJetSeed << ", leaving the regressed "
360 "four-momenta at their defaults");
361 return;
362 }
363
364 const float response = ptQuantiles[m_ptMedianQuantile];
365 decorators[0](tau) = std::exp(std::log(ptJetSeed) - response);
366 decorators[1](tau) = etaValues[0];
367 decorators[2](tau) = std::atan2(phiValues[PHI_SIN], phiValues[PHI_COS]);
368 decorators[3](tau) = mass;
369}
#define ATH_MSG_DEBUG(x,...)
MDT_Response response
size_t m_ptMedianQuantile
The pt heads ('tes', 'charged_pion_pt', 'neutral_pion_pt') regress quantiles of the log response,...
bool ptJetSeed(const xAOD::TauJet &tau, float &out)

◆ decorateTracks()

void TausRUsEvaluator::decorateTracks ( xAOD::TauJet & tau,
std::span< const float > scores ) const
private

Decorate each track of tau with its slot of the per-track head.

Definition at line 390 of file TausRUsEvaluator.cxx.

391 {
392
393 const std::vector<const xAOD::TauTrack*> tracks = m_loader->selectTracks(tau);
394
395 int tauCharge = 0; // set default value of charge
396 for (size_t iTrack = 0; iTrack < tracks.size(); ++iTrack) {
397 const std::span<const float> slot =
398 scores.subspan(iTrack * m_nTrackClasses, m_nTrackClasses);
399 const int trackClass = argMax(slot);
400 m_trackClass(*tracks[iTrack]) = trackClass;
401 for (size_t iClass = 0; iClass < m_nTrackClasses; ++iClass) {
402 m_trackScores[iClass](*tracks[iTrack]) = slot[iClass];
403 }
404 // only add charge to tau charge if the track is the correct one.
405 if (trackClass == TAU_TRACK_CLASS) {
406 tauCharge += static_cast<int>(tracks[iTrack]->track()->charge());
407 }
408 }
409
410 // Only append a valid charge
411 if (tauCharge == -1 || tauCharge == 1) {
412 m_tauCharge(tau) = tauCharge;
413 }
414}
double charge(const T &p)
Definition AtlasPID.h:1003
std::vector< std::vector< float > > scores
static constexpr int TAU_TRACK_CLASS
Class for true-tau track from tau_track_class head.
std::unique_ptr< TausRUsDataLoader > m_loader
std::vector< SG::Decorator< float > > m_trackScores

◆ decorateVertex()

void TausRUsEvaluator::decorateVertex ( xAOD::TauJet & tau,
std::span< const float > scores,
const std::vector< const xAOD::Vertex * > & vertices ) const
private

Decorate the position of the vertex that scores picks out of vertices, which must be the list the input tensor was built from.

Definition at line 371 of file TausRUsEvaluator.cxx.

373 {
374 // Only the slots backed by a real vertex carry a meaningful score: the rest
375 // score zero-padded inputs, and an event with no vertex at all leaves the
376 // defaults.
377 const size_t nSlots = std::min(vertices.size(), scores.size());
378 if (nSlots == 0) {
379 ATH_MSG_DEBUG("No vertex to choose from, leaving the vertex position at its default");
380 return;
381 }
382
383 const int selected = argMax(scores.first(nSlots));
384 const xAOD::Vertex* vertex = vertices[selected];
385 m_vertexPosition[0](tau) = vertex->x();
386 m_vertexPosition[1](tau) = vertex->y();
387 m_vertexPosition[2](tau) = vertex->z();
388}
std::vector< SG::Accessor< float > > m_vertexPosition
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ eventFinalize()

StatusCode TauRecToolBase::eventFinalize ( )
overridevirtualinherited

Event finalizer - called at the end of each event.

Implements ITauToolBase.

Definition at line 105 of file TauRecToolBase.cxx.

105 {
106 return StatusCode::SUCCESS;
107}

◆ eventInitialize()

StatusCode TauRecToolBase::eventInitialize ( )
overridevirtualinherited

Event initializer - called at the beginning of each event.

Implements ITauToolBase.

Definition at line 36 of file TauRecToolBase.cxx.

36 {
37 return StatusCode::SUCCESS;
38}

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TausRUsEvaluator::execute ( xAOD::TauJet & pTau) const
overridevirtual

Execute - called for each tau candidate.

Reimplemented from TauRecToolBase.

Definition at line 416 of file TausRUsEvaluator.cxx.

416 {
417
418 // Set the defaults before any early return, so that a tau skipped below still
419 // carries every decoration and no consumer has to test for their presence.
420 setDefaults(tau);
421
422 if (tau.pt() < m_minTauPt) {
423 return StatusCode::SUCCESS;
424 }
425
426 SG::ReadHandle<xAOD::VertexContainer> vertexInHandle(m_vertexInputContainer);
427 if (!vertexInHandle.isValid()) {
428 ATH_MSG_ERROR("Could not retrieve vertex container "
429 << m_vertexInputContainer.key());
430 return StatusCode::FAILURE;
431 }
432
433 AthInfer::InputDataMap inputData = m_loader->loadInputs(tau, *vertexInHandle);
434
435 AthInfer::OutputDataMap outputData;
436 for (const Output& output : m_outputs) {
437 outputData[output.name] = std::make_pair(output.dims, std::vector<float>{});
438 }
439
440 // MARK: run the inference
441 ATH_CHECK(m_inferenceTool->inference(inputData, outputData));
442
443 std::unordered_map<std::string, std::span<const float>> raw;
444 raw.reserve(m_outputs.size());
445 for (const Output& output : m_outputs) {
446 const std::vector<float>& values =
447 std::get<std::vector<float>>(outputData.at(output.name).second);
448 if (values.size() != output.size) {
449 ATH_MSG_ERROR("Output '" << output.name << "' returned " << values.size()
450 << " values but the tool expects " << output.size);
451 return StatusCode::FAILURE;
452 }
453 raw[output.name] = values;
454 }
455
456 const std::span<const float> primary = raw.at("primary");
457 m_tauIDScore(tau) = twoClassScore(primary[Tau], primary[QCD]);
458 m_eleRejScore(tau) = twoClassScore(primary[Tau], primary[Electron]);
459
460 const std::span<const float> decayMode = raw.at("decay_mode");
461 m_decayMode(tau) = static_cast<float>(argMax(decayMode));
462 for (size_t iMode = 0; iMode < m_nDecayModes; ++iMode) {
463 m_decayModeScores[iMode](tau) = decayMode[iMode];
464 }
465
466 // The network gives pt, eta and phi only, so the four-momenta are completed
467 // with the PDG masses.
468 decorateFourMomentum(tau, m_tauP4, raw.at("tes"), raw.at("tau_eta"),
469 raw.at("tau_phi"),
471 decorateFourMomentum(tau, m_chargedPionP4, raw.at("charged_pion_pt"),
472 raw.at("charged_pion_eta"), raw.at("charged_pion_phi"),
474 decorateFourMomentum(tau, m_neutralPionP4, raw.at("neutral_pion_pt"),
475 raw.at("neutral_pion_eta"), raw.at("neutral_pion_phi"),
477
478 decorateVertex(tau, raw.at("vertex_classification"),
479 m_loader->selectVertices(*vertexInHandle));
480 decorateTracks(tau, raw.at("tautrack_class"));
481
482 return StatusCode::SUCCESS;
483}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
void decorateTracks(xAOD::TauJet &tau, std::span< const float > scores) const
Decorate each track of tau with its slot of the per-track head.
FourMomDecorators m_chargedPionP4
void decorateFourMomentum(xAOD::TauJet &tau, const FourMomDecorators &decorators, std::span< const float > ptQuantiles, std::span< const float > etaValues, std::span< const float > phiValues, float mass) const
Decorate the four floats of decorators from a pt, an eta and a phi head, taking the mass from mass.
size_t m_nDecayModes
Read off the metadata at initialize().
FourMomDecorators m_neutralPionP4
Gaudi::Property< float > m_minTauPt
void decorateVertex(xAOD::TauJet &tau, std::span< const float > scores, const std::vector< const xAOD::Vertex * > &vertices) const
Decorate the position of the vertex that scores picks out of vertices, which must be the list the inp...
ToolHandle< AthInfer::IAthInferenceTool > m_inferenceTool
FourMomDecorators m_tauP4
void setDefaults(xAOD::TauJet &tau) const
std::vector< Output > m_outputs
The model's output nodes, from its metadata.
std::vector< SG::Accessor< float > > m_decayModeScores
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputContainer
std::map< std::string, InferenceData > OutputDataMap
std::map< std::string, InferenceData > InputDataMap
constexpr double tauMassInMeV
the mass of the tau (in MeV)
constexpr double piZeroMassInMeV
the mass of the pi zero (in MeV)
constexpr double chargedPionMassInMeV
the mass of the charged pion (in MeV)
output
Definition merge.py:16

◆ executePanTau()

StatusCode TauRecToolBase::executePanTau ( xAOD::TauJet & pTau,
xAOD::ParticleContainer & particleContainer,
xAOD::PFOContainer & neutralPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in PanTau::PanTauProcessor.

Definition at line 100 of file TauRecToolBase.cxx.

100 {
101 ATH_MSG_ERROR("function not implemented");
102 return StatusCode::FAILURE;
103}

◆ executePi0ClusterCreator()

StatusCode TauRecToolBase::executePi0ClusterCreator ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer,
xAOD::PFOContainer & hadronicPFOContainer,
const xAOD::CaloClusterContainer & pCaloClusterContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ClusterCreator.

Definition at line 78 of file TauRecToolBase.cxx.

80 {
81 ATH_MSG_ERROR("function not implemented");
82 return StatusCode::FAILURE;
83}

◆ executePi0ClusterScaler()

StatusCode TauRecToolBase::executePi0ClusterScaler ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer,
xAOD::PFOContainer & chargedPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ClusterScaler.

Definition at line 90 of file TauRecToolBase.cxx.

90 {
91 ATH_MSG_ERROR("function not implemented");
92 return StatusCode::FAILURE;
93}

◆ executePi0CreateROI()

StatusCode TauRecToolBase::executePi0CreateROI ( xAOD::TauJet & pTau,
CaloConstCellContainer & caloCellContainer,
boost::dynamic_bitset<> & map ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0CreateROI.

Definition at line 52 of file TauRecToolBase.cxx.

52 {
53 ATH_MSG_ERROR("function not implemented");
54 return StatusCode::FAILURE;
55}

◆ executePi0nPFO()

StatusCode TauRecToolBase::executePi0nPFO ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ScoreCalculator, and TauPi0Selector.

Definition at line 95 of file TauRecToolBase.cxx.

95 {
96 ATH_MSG_ERROR("function not implemented");
97 return StatusCode::FAILURE;
98}

◆ executeShotFinder()

StatusCode TauRecToolBase::executeShotFinder ( xAOD::TauJet & pTau,
xAOD::CaloClusterContainer & shotClusterContainer,
xAOD::PFOContainer & PFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauShotFinder.

Definition at line 73 of file TauRecToolBase.cxx.

73 {
74 ATH_MSG_ERROR("function not implemented");
75 return StatusCode::FAILURE;
76}

◆ executeTrackClassifier()

StatusCode TauRecToolBase::executeTrackClassifier ( xAOD::TauJet & pTau,
xAOD::TauTrackContainer & tauTrackContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in tauRecTools::TauTrackRNNClassifier.

Definition at line 68 of file TauRecToolBase.cxx.

68 {
69 ATH_MSG_ERROR("function not implemented");
70 return StatusCode::FAILURE;
71}

◆ executeTrackFinder()

StatusCode TauRecToolBase::executeTrackFinder ( xAOD::TauJet & pTau,
xAOD::TauTrackContainer & tauTrackContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauTrackFinder.

Definition at line 63 of file TauRecToolBase.cxx.

63 {
64 ATH_MSG_ERROR("function not implemented");
65 return StatusCode::FAILURE;
66}

◆ executeVertexFinder()

StatusCode TauRecToolBase::executeVertexFinder ( xAOD::TauJet & pTau,
const xAOD::VertexContainer * vertexContainer = nullptr ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauVertexFinder.

Definition at line 58 of file TauRecToolBase.cxx.

58 {
59 ATH_MSG_ERROR("function not implemented");
60 return StatusCode::FAILURE;
61}

◆ executeVertexVariables()

StatusCode TauRecToolBase::executeVertexVariables ( xAOD::TauJet & pTau,
xAOD::VertexContainer & vertexContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauVertexVariables.

Definition at line 85 of file TauRecToolBase.cxx.

85 {
86 ATH_MSG_ERROR("function not implemented");
87 return StatusCode::FAILURE;
88}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode TauRecToolBase::finalize ( )
overridevirtualinherited

Finalizer.

Implements ITauToolBase.

Reimplemented in PanTau::PanTauProcessor.

Definition at line 109 of file TauRecToolBase.cxx.

109 {
110 return StatusCode::SUCCESS;
111}

◆ find_file()

std::string TauRecToolBase::find_file ( const std::string & fname) const
inherited

Definition at line 19 of file TauRecToolBase.cxx.

19 {
20 std::string full_path;
21 //offline calib files are in GroupData
22 //online calib files are in release
23 full_path = PathResolverFindCalibFile(m_tauRecToolsTag+"/"+fname);
24 if(full_path.empty()) full_path = PathResolverFindCalibFile(fname);
25 return full_path;
26}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_tauRecToolsTag

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ inAOD()

bool TauRecToolBase::inAOD ( ) const
inlineprotectedinherited

Definition at line 87 of file TauRecToolBase.h.

87{ return m_in_AOD; }
Gaudi::Property< bool > m_in_AOD

◆ inEleRM()

bool TauRecToolBase::inEleRM ( ) const
inlineprotectedinherited

Definition at line 88 of file TauRecToolBase.h.

88{ return m_in_EleRM; }
Gaudi::Property< bool > m_in_EleRM

◆ initialize()

StatusCode TausRUsEvaluator::initialize ( void )
overridevirtual

Tool initializer.

Reimplemented from TauRecToolBase.

Definition at line 189 of file TausRUsEvaluator.cxx.

189 {
190 ATH_CHECK(m_inferenceTool.retrieve());
191 ATH_CHECK(m_vertexInputContainer.initialize());
192
193 const std::string modelPath = find_file(m_modelFile);
194 if (modelPath.empty()) {
195 ATH_MSG_ERROR("Could not find the model file '" << m_modelFile.value() << "'");
196 return StatusCode::FAILURE;
197 }
198 m_loader = std::make_unique<TausRUsDataLoader>(name() + "_DataLoader");
199 ATH_CHECK(readModel(modelPath));
200
201 // Check the graph against what the decoding below assumes about it, so that a
202 // re-exported model with a changed head fails here rather than silently
203 // decorating nonsense.
204 auto checkNode = [this](const std::string& name, const std::string& type,
205 const std::vector<int64_t>& dims) -> StatusCode {
206 auto output = std::find_if(m_outputs.begin(), m_outputs.end(),
207 [&name](const Output& o) { return o.name == name; });
208 if (output == m_outputs.end()) {
209 ATH_MSG_ERROR("The model metadata has no output '" << name << "'");
210 return StatusCode::FAILURE;
211 }
212 if (output->type != type) {
213 ATH_MSG_ERROR("Output '" << name << "' is a '" << output->type
214 << "' head but the tool decodes it as '" << type << "'");
215 return StatusCode::FAILURE;
216 }
217 if (output->dims != dims) {
218 ATH_MSG_ERROR("Output '" << name << "' has shape " << toString(output->dims)
219 << " but the tool decodes " << toString(dims));
220 return StatusCode::FAILURE;
221 }
222 return StatusCode::SUCCESS;
223 };
224
225 ATH_CHECK(checkNode("primary", "classification", {1, 3}));
226 ATH_CHECK(checkNode("decay_mode", "classification",
227 {1, static_cast<int64_t>(m_nDecayModes)}));
228 for (const char* name : {"tes", "charged_pion_pt", "neutral_pion_pt"}) {
229 ATH_CHECK(checkNode(name, "quantile_regression",
230 {1, static_cast<int64_t>(m_nQuantiles)}));
231 }
232 for (const char* name : {"tau_eta", "charged_pion_eta", "neutral_pion_eta"}) {
233 ATH_CHECK(checkNode(name, "regression", {1, 1}));
234 }
235 for (const char* name : {"tau_phi", "charged_pion_phi", "neutral_pion_phi"}) {
236 ATH_CHECK(checkNode(name, "periodic_regression", {1, 2}));
237 }
238 ATH_CHECK(checkNode("vertex_classification", "classification",
239 {1, static_cast<int64_t>(m_loader->maxVertices())}));
240 ATH_CHECK(checkNode("tautrack_class", "classification",
241 {1, static_cast<int64_t>(m_loader->maxTracks()),
242 static_cast<int64_t>(m_nTrackClasses)}));
243
244 // The decorators, in the order of the suffixes they are named after.
245 for (size_t i = 0; i < m_nDecayModes; ++i) {
246 m_decayModeScores.emplace_back(std::string(DECAY_MODE_SCORE_PREFIX)
247 + std::to_string(i));
248 }
249 for (const auto& suffix : P4_SUFFIXES) {
250 m_tauP4.emplace_back(std::string(TAU_P4) + suffix);
251 m_chargedPionP4.emplace_back(std::string(CHARGED_PION_P4) + suffix);
252 m_neutralPionP4.emplace_back(std::string(NEUTRAL_PION_P4) + suffix);
253 }
254 for (const auto& suffix : POSITION_SUFFIXES) {
255 m_vertexPosition.emplace_back(std::string(VERTEX) + suffix);
256 }
257 for (size_t i = 0; i < m_nTrackClasses; ++i) {
258 m_trackScores.emplace_back(std::string(TRACK_SCORE_PREFIX) + std::to_string(i));
259 }
260
261 ATH_MSG_INFO("TausRUs decorates " << tauDecorationNames().size()
262 << " variables on the tau and " << trackDecorationNames().size()
263 << " on each of its up to " << m_loader->maxTracks() << " leading tracks");
264
265 // Create the decoration keys to enforce data dependencies in the scheduler
266 if (!m_tauContainerName.empty()) {
267 for (const std::string& decoration : tauDecorationNames()) {
268 m_decorKeys.emplace_back(m_tauContainerName + "." + decoration);
269 }
270 for (SG::WriteDecorHandleKey<xAOD::TauJetContainer>& key : m_decorKeys) {
271 ATH_CHECK(key.initialize());
272 }
273 }
274 // The per-track decorations are written through handles on these keys, so
275 // unlike the tau ones the container has to be named.
276 if (m_tauTrackContainerName.empty()) {
277 ATH_MSG_ERROR("TauTrackContainerName is not set, but the per-track "
278 << trackDecorationNames().size() << " decorations are written on it");
279 return StatusCode::FAILURE;
280 }
281 for (const std::string& decoration : trackDecorationNames()) {
282 m_trackDecorKeys.emplace_back(m_tauTrackContainerName + "." + decoration);
283 }
284 for (SG::WriteDecorHandleKey<xAOD::TauTrackContainer>& key : m_trackDecorKeys) {
285 ATH_CHECK(key.initialize());
286 }
287
288 return StatusCode::SUCCESS;
289}
#define ATH_MSG_INFO(x,...)
size_t size() const
Number of registered mappings.
std::string find_file(const std::string &fname) const
Gaudi::Property< std::string > m_tauContainerName
Gaudi::Property< std::string > m_modelFile
std::vector< SG::WriteDecorHandleKey< xAOD::TauTrackContainer > > m_trackDecorKeys
Gaudi::Property< std::string > m_tauTrackContainerName
std::vector< SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_decorKeys
StatusCode readModel(const std::string &path)
Configure the data loader and build m_outputs from the metadata and node shapes of the model.
std::vector< std::string > trackDecorationNames() const
std::vector< std::string > tauDecorationNames() const
Every decoration written on the tau, and every one written on its tracks, which is what the output da...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ inTrigger()

bool TauRecToolBase::inTrigger ( ) const
inlineprotectedinherited

Definition at line 86 of file TauRecToolBase.h.

86{ return m_in_trigger; }
Gaudi::Property< bool > m_in_trigger

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ readModel()

StatusCode TausRUsEvaluator::readModel ( const std::string & path)
private

Configure the data loader and build m_outputs from the metadata and node shapes of the model.

Definition at line 99 of file TausRUsEvaluator.cxx.

99 {
100
101 Ort::Env env(ORT_LOGGING_LEVEL_FATAL, "");
102 Ort::SessionOptions sessionOptions;
103 sessionOptions.SetIntraOpNumThreads(1);
104 sessionOptions.SetLogSeverityLevel(4);
105 sessionOptions.DisableCpuMemArena();
106 const Ort::Session session(env, path.c_str(), sessionOptions);
107
108 Ort::AllocatorWithDefaultOptions allocator;
109 const Ort::ModelMetadata modelMetadata = session.GetModelMetadata();
110 const Ort::AllocatedStringPtr metadataString =
111 modelMetadata.LookupCustomMetadataMapAllocated(METADATA_KEY, allocator);
112 if (!metadataString) {
113 ATH_MSG_ERROR("Model " << path << " has no '" << METADATA_KEY << "' metadata");
114 return StatusCode::FAILURE;
115 }
116
117 const auto inputShapes = nodeShapes(session, true);
118 const auto outputShapes = nodeShapes(session, false);
119
120 const nlohmann::json metadata = nlohmann::json::parse(metadataString.get());
121
122 std::vector<TausRUsDataLoader::InputConfig> inputs;
123 for (const nlohmann::json& node : metadata.at("inputs")) {
124 TausRUsDataLoader::InputConfig input;
125 input.name = node.at("name").get<std::string>();
126 input.collection = node.at("collection").get<std::string>();
127 input.maxObjects = node.value("max_objects", size_t{1});
128 for (const nlohmann::json& variable : node.at("variables")) {
129 input.variables.push_back({variable.at("name").get<std::string>(),
130 variable.at("offset").get<float>(),
131 variable.at("scale").get<float>()});
132 }
133 if (inputShapes.find(input.name) == inputShapes.end()) {
134 ATH_MSG_ERROR("The model has no input node '" << input.name << "'");
135 return StatusCode::FAILURE;
136 }
137 inputs.push_back(std::move(input));
138 }
139
140 ATH_CHECK(m_loader->initialize(inputs));
141
142 std::map<std::string, nlohmann::json> outputMetadata;
143 for (const nlohmann::json& node : metadata.at("outputs")) {
145 output.name = node.at("name").get<std::string>();
146 output.type = node.value("type", "");
147 const auto shape = outputShapes.find(output.name);
148 if (shape == outputShapes.end()) {
149 ATH_MSG_ERROR("The model has no output node '" << output.name << "'");
150 return StatusCode::FAILURE;
151 }
152 output.dims = shape->second;
153 output.size = std::accumulate(output.dims.begin(), output.dims.end(), size_t{1},
154 std::multiplies<>());
155 outputMetadata[output.name] = node;
156 m_outputs.push_back(std::move(output));
157 }
158
159 // The heads the decoding needs to size itself.
160 m_nDecayModes = outputMetadata.at("decay_mode").at("num_classes").get<size_t>();
161 m_nTrackClasses = outputMetadata.at("tautrack_class").at("num_classes").get<size_t>();
162
163 // The pt heads share one set of quantiles, and the median is decorated.
164 const auto quantiles = outputMetadata.at("tes").at("quantiles").get<std::vector<double>>();
165 for (const char* name : {"charged_pion_pt", "neutral_pion_pt"}) {
166 if (outputMetadata.at(name).at("quantiles").get<std::vector<double>>() != quantiles) {
167 ATH_MSG_ERROR("Output '" << name << "' regresses other quantiles than 'tes'");
168 return StatusCode::FAILURE;
169 }
170 }
171 const auto median = std::find_if(quantiles.begin(), quantiles.end(),
172 [](double q) { return std::abs(q - 0.5) < 1e-6; });
173 if (median == quantiles.end()) {
174 ATH_MSG_ERROR("The pt heads regress no median quantile");
175 return StatusCode::FAILURE;
176 }
177 m_nQuantiles = quantiles.size();
178 m_ptMedianQuantile = std::distance(quantiles.begin(), median);
179
180 // The per-slot heads are decoded against the track and vertex inputs.
181 if (m_loader->maxTracks() == 0 || m_loader->maxVertices() == 0) {
182 ATH_MSG_ERROR("The model needs both a track and a vertex input");
183 return StatusCode::FAILURE;
184 }
185
186 return StatusCode::SUCCESS;
187}
float median(std::vector< float > &Vec)
path
python interpreter configuration --------------------------------------—
Definition athena.py:130

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setDefaults()

void TausRUsEvaluator::setDefaults ( xAOD::TauJet & tau) const
private

Definition at line 321 of file TausRUsEvaluator.cxx.

321 {
326 for (const SG::Accessor<float>& decorator : m_decayModeScores) {
327 decorator(tau) = DEFAULT_VALUE;
328 }
329 for (const FourMomDecorators* decorators : {&m_tauP4, &m_chargedPionP4, &m_neutralPionP4}) {
330 for (const SG::Accessor<float>& decorator : *decorators) {
331 decorator(tau) = DEFAULT_VALUE;
332 }
333 }
334 for (const SG::Accessor<float>& decorator : m_vertexPosition) {
335 decorator(tau) = DEFAULT_VALUE;
336 }
337
338 // All of the tracks, not just the leading ones the network sees, so that a
339 // track dropped by the truncation is still decorated.
340 for (const xAOD::TauTrack* track : tau.allTracks()) {
341 if (!track) continue;
342 m_trackClass(*track) = DEFAULT_CLASS;
343 for (const SG::Decorator<float>& decorator : m_trackScores) {
344 decorator(*track) = DEFAULT_VALUE;
345 }
346 }
347}
static constexpr float DEFAULT_VALUE
initialized with these default values
std::vector< SG::Accessor< float > > FourMomDecorators
static constexpr int DEFAULT_CLASS
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
TauTrack_v1 TauTrack
Definition of the current version.
Definition TauTrack.h:16

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tauDecorationNames()

std::vector< std::string > TausRUsEvaluator::tauDecorationNames ( ) const
private

Every decoration written on the tau, and every one written on its tracks, which is what the output data dependencies are declared from.

Definition at line 297 of file TausRUsEvaluator.cxx.

297 {
298 std::vector<std::string> names{TAU_ID_SCORE, ELE_REJ_SCORE, DECAY_MODE, TAU_CHARGE};
299 for (size_t iMode = 0; iMode < m_nDecayModes; ++iMode) {
300 names.emplace_back(std::string(DECAY_MODE_SCORE_PREFIX) + std::to_string(iMode));
301 }
302 for (const char* base : {TAU_P4, CHARGED_PION_P4, NEUTRAL_PION_P4}) {
303 for (const auto& suffix : P4_SUFFIXES) {
304 names.emplace_back(std::string(base) + suffix);
305 }
306 }
307 for (const auto& suffix : POSITION_SUFFIXES) {
308 names.emplace_back(std::string(VERTEX) + suffix);
309 }
310 return names;
311}
std::string base
Definition hcg.cxx:83

◆ trackDecorationNames()

std::vector< std::string > TausRUsEvaluator::trackDecorationNames ( ) const
private

Definition at line 313 of file TausRUsEvaluator.cxx.

313 {
314 std::vector<std::string> names{TRACK_CLASS};
315 for (size_t iClass = 0; iClass < m_nTrackClasses; ++iClass) {
316 names.emplace_back(std::string(TRACK_SCORE_PREFIX) + std::to_string(iClass));
317 }
318 return names;
319}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ DEFAULT_CLASS

int TausRUsEvaluator::DEFAULT_CLASS = -1
staticconstexpr

Definition at line 72 of file TausRUsEvaluator.h.

◆ DEFAULT_VALUE

float TausRUsEvaluator::DEFAULT_VALUE = -1111.0f
staticconstexpr

initialized with these default values

Definition at line 71 of file TausRUsEvaluator.h.

◆ m_chargedPionP4

FourMomDecorators TausRUsEvaluator::m_chargedPionP4
private

Definition at line 162 of file TausRUsEvaluator.h.

◆ m_decayMode

SG::Accessor<float> TausRUsEvaluator::m_decayMode
private

Definition at line 158 of file TausRUsEvaluator.h.

◆ m_decayModeScores

std::vector<SG::Accessor<float> > TausRUsEvaluator::m_decayModeScores
private

Definition at line 160 of file TausRUsEvaluator.h.

◆ m_decorKeys

std::vector<SG::WriteDecorHandleKey<xAOD::TauJetContainer> > TausRUsEvaluator::m_decorKeys
private

Definition at line 169 of file TausRUsEvaluator.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eleRejScore

SG::Accessor<float> TausRUsEvaluator::m_eleRejScore
private

Definition at line 157 of file TausRUsEvaluator.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_in_AOD

Gaudi::Property<bool> TauRecToolBase::m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
protectedinherited

Definition at line 76 of file TauRecToolBase.h.

76{this, "inAOD", false, "Indicate if the tool is running on AOD"};

◆ m_in_EleRM

Gaudi::Property<bool> TauRecToolBase::m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
protectedinherited

Definition at line 77 of file TauRecToolBase.h.

77{this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"};

◆ m_in_trigger

Gaudi::Property<bool> TauRecToolBase::m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
protectedinherited

Definition at line 75 of file TauRecToolBase.h.

75{this, "inTrigger", false, "Indicate if the tool is running on trigger"};

◆ m_inferenceTool

ToolHandle<AthInfer::IAthInferenceTool> TausRUsEvaluator::m_inferenceTool
private
Initial value:
{
this, "InferenceTool", "", "ONNX Runtime or Triton inference backend"}

Definition at line 121 of file TausRUsEvaluator.h.

121 {
122 this, "InferenceTool", "", "ONNX Runtime or Triton inference backend"};

◆ m_loader

std::unique_ptr<TausRUsDataLoader> TausRUsEvaluator::m_loader
private

Definition at line 139 of file TausRUsEvaluator.h.

◆ m_minTauPt

Gaudi::Property<float> TausRUsEvaluator::m_minTauPt
private
Initial value:
{
this, "MinTauPt", 15., "Skip taus below this pt to save CPU"}

Definition at line 136 of file TausRUsEvaluator.h.

136 {
137 this, "MinTauPt", 15., "Skip taus below this pt to save CPU"};

◆ m_modelFile

Gaudi::Property<std::string> TausRUsEvaluator::m_modelFile
private
Initial value:
{
this, "ModelFile", "",
"ONNX model the input and output nodes are read from, also when inference runs on Triton"}

Definition at line 127 of file TausRUsEvaluator.h.

127 {
128 this, "ModelFile", "",
129 "ONNX model the input and output nodes are read from, also when inference runs on Triton"};

◆ m_nDecayModes

size_t TausRUsEvaluator::m_nDecayModes {0}
private

Read off the metadata at initialize().

Definition at line 145 of file TausRUsEvaluator.h.

145{0};

◆ m_neutralPionP4

FourMomDecorators TausRUsEvaluator::m_neutralPionP4
private

Definition at line 163 of file TausRUsEvaluator.h.

◆ m_nQuantiles

size_t TausRUsEvaluator::m_nQuantiles {0}
private

Definition at line 147 of file TausRUsEvaluator.h.

147{0};

◆ m_nTrackClasses

size_t TausRUsEvaluator::m_nTrackClasses {0}
private

Definition at line 146 of file TausRUsEvaluator.h.

146{0};

◆ m_outputs

std::vector<Output> TausRUsEvaluator::m_outputs
private

The model's output nodes, from its metadata.

Definition at line 142 of file TausRUsEvaluator.h.

◆ m_ptMedianQuantile

size_t TausRUsEvaluator::m_ptMedianQuantile {0}
private

The pt heads ('tes', 'charged_pion_pt', 'neutral_pion_pt') regress quantiles of the log response, log(pt_seedjet / pt_true).

This is the index of the median, the one to take as the point estimate; the pt then follows as pt = exp(log(ptJetSeed) - quantile[m_ptMedianQuantile]).

Definition at line 152 of file TausRUsEvaluator.h.

152{0};

◆ m_tauCharge

SG::Accessor<float> TausRUsEvaluator::m_tauCharge
private

Definition at line 159 of file TausRUsEvaluator.h.

◆ m_tauContainerName

Gaudi::Property<std::string> TausRUsEvaluator::m_tauContainerName
private
Initial value:
{
this, "TauContainerName", "",
"Name of the TauJetContainer, needed to declare the output data dependencies"}

Definition at line 130 of file TausRUsEvaluator.h.

130 {
131 this, "TauContainerName", "",
132 "Name of the TauJetContainer, needed to declare the output data dependencies"};

◆ m_tauIDScore

SG::Accessor<float> TausRUsEvaluator::m_tauIDScore
private

The decorators.

The scalar ones are named in the constructor and the rest, which are one decoration per class or per component, in initialize().

Definition at line 156 of file TausRUsEvaluator.h.

◆ m_tauP4

FourMomDecorators TausRUsEvaluator::m_tauP4
private

Definition at line 161 of file TausRUsEvaluator.h.

◆ m_tauRecToolsTag

Gaudi::Property<std::string> TauRecToolBase::m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}
protectedinherited

Definition at line 78 of file TauRecToolBase.h.

78{this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"};

◆ m_tauTrackContainerName

Gaudi::Property<std::string> TausRUsEvaluator::m_tauTrackContainerName
private
Initial value:
{
this, "TauTrackContainerName", "",
"Name of the TauTrackContainer, needed to declare the per-track output data dependencies"}

Definition at line 133 of file TausRUsEvaluator.h.

133 {
134 this, "TauTrackContainerName", "",
135 "Name of the TauTrackContainer, needed to declare the per-track output data dependencies"};

◆ m_trackClass

SG::Decorator<int> TausRUsEvaluator::m_trackClass
private

Definition at line 166 of file TausRUsEvaluator.h.

◆ m_trackDecorKeys

std::vector<SG::WriteDecorHandleKey<xAOD::TauTrackContainer> > TausRUsEvaluator::m_trackDecorKeys
private

Definition at line 170 of file TausRUsEvaluator.h.

◆ m_trackScores

std::vector<SG::Decorator<float> > TausRUsEvaluator::m_trackScores
private

Definition at line 167 of file TausRUsEvaluator.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexInputContainer

SG::ReadHandleKey<xAOD::VertexContainer> TausRUsEvaluator::m_vertexInputContainer
private
Initial value:
{
this, "Key_vertexInputContainer", "PrimaryVertices", "Input vertex container key"}

Definition at line 124 of file TausRUsEvaluator.h.

124 {
125 this, "Key_vertexInputContainer", "PrimaryVertices", "Input vertex container key"};

◆ m_vertexPosition

std::vector<SG::Accessor<float> > TausRUsEvaluator::m_vertexPosition
private

Definition at line 164 of file TausRUsEvaluator.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ TAU_TRACK_CLASS

int TausRUsEvaluator::TAU_TRACK_CLASS = 0
staticconstexpr

Class for true-tau track from tau_track_class head.

Definition at line 85 of file TausRUsEvaluator.h.


The documentation for this class was generated from the following files: