ATLAS Offline Software
Loading...
Searching...
No Matches
ConstituentsLoaderTauHit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
4 This is a subclass of IConstituentsLoader. It is used to load the TrackParticleValidation attached
5 to a tau by the JetHitAssociationAlg, and extract their features for the NN evaluation.
6*/
7
8#pragma once
9
10// local includes
13
14// EDM includes
15#include <xAODBase/IParticle.h>
17
18// Eigen is needed for Vector3D
20
21// STL includes
22#include <string>
23#include <vector>
24#include <functional>
25
26
27namespace TauHitVars {
28
29float j(const xAOD::IParticle &p, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv);
30
31float a(const xAOD::IParticle &p, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv);
32
33float b(const xAOD::IParticle &p, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv);
34
35float layer(const xAOD::IParticle &p, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv);
36
37} // namespace TauHitVars
38
39
40namespace FlavorTagInference {
41 // Subclass for IParticles loader inherited from abstract IConstituentsLoader class
43 public:
44 ConstituentLoaderTauHit(const ConstituentsInputConfig& cfg, const std::string& hits_key);
45
46 Inputs getData(const xAOD::IParticle& p) const override;
47
48 inline const std::string& getName() const override { return m_name; }
49 inline const ConstituentsType& getType() const override { return m_config.type; }
50 inline const FTagDataDependencyNames& getDependencies() const override { return m_deps; }
51 inline const std::set<std::string>& getUsedRemap() const override { return m_used_remap; }
52
53 using FeatureFunc_t = std::function<float(const xAOD::IParticle&, const xAOD::TrackMeasurementValidation&, const Eigen::Matrix3d&)>;
54 private:
55 const std::string m_hits_key;
56 const std::vector<const xAOD::TrackMeasurementValidation*> getParticleHits(const xAOD::IParticle& p) const;
57
58 const Eigen::Matrix3d getJABInvMatrix(const xAOD::IParticle& p) const;
59
60 const Inputs getFeatures(const xAOD::IParticle& p, const std::vector<const xAOD::TrackMeasurementValidation*>& hits) const;
61
62 std::vector<FeatureFunc_t> m_feature_extractors;
63 FeatureFunc_t getFeatureExtractor(const std::string& var_name) const;
64 inline static const std::unordered_map<std::string, FeatureFunc_t> m_func_map = {
65 {"j", TauHitVars::j},
66 {"a", TauHitVars::a},
67 {"b", TauHitVars::b},
68 {"layer", TauHitVars::layer}
69 };
70 };
71}
72
static Double_t a
const std::set< std::string > & getUsedRemap() const override
std::function< float(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &, const Eigen::Matrix3d &)> FeatureFunc_t
FeatureFunc_t getFeatureExtractor(const std::string &var_name) const
const Inputs getFeatures(const xAOD::IParticle &p, const std::vector< const xAOD::TrackMeasurementValidation * > &hits) const
ConstituentLoaderTauHit(const ConstituentsInputConfig &cfg, const std::string &hits_key)
static const std::unordered_map< std::string, FeatureFunc_t > m_func_map
const FTagDataDependencyNames & getDependencies() const override
const std::vector< const xAOD::TrackMeasurementValidation * > getParticleHits(const xAOD::IParticle &p) const
const ConstituentsType & getType() const override
Inputs getData(const xAOD::IParticle &p) const override
const Eigen::Matrix3d getJABInvMatrix(const xAOD::IParticle &p) const
const std::string & getName() const override
Class providing the definition of the 4-vector interface.
This file contains "getter" functions used for accessing tagger inputs from the EDM.
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
float layer(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &)
float b(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
float a(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version: