 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 m_max_cluster_dr(max_cluster_dr),
13 m_doVertexCorrection(doVertexCorrection)
15 for (
auto input_var :
cfg.inputs) {
21 std::vector<xAOD::CaloVertexedTopoCluster>
clusters;
24 TLorentzVector clusterP4 = vertexedCluster.p4();
31 return lhs.
p4().Et() > rhs.p4().Et();
36 throw std::runtime_error(
"Unsupported sorting order");
47 std::vector<int64_t> features_dim = {
static_cast<int64_t
>(tau_clusters.size()),
static_cast<int64_t
>(
m_feature_extractors.size())};
48 std::vector<float> features;
50 for (
const auto& cluster : tau_clusters) {
52 features.push_back(extractor(cluster, *tau));
55 return Inputs{std::move(features), std::move(features_dim)};
60 std::vector<xAOD::CaloVertexedTopoCluster> sorted_tau_cls =
getTauClusters(tau);
61 return std::make_tuple(
getFeatures(tau, sorted_tau_cls), std::vector<const xAOD::IParticle*>{} );
68 }
catch (
const std::out_of_range &
e) {
69 throw std::runtime_error(
"Variable '" +
var_name +
"' not defined");
73 bool success = func_as_ref(tau,
cls,
out);
75 throw std::runtime_error(
"Error in cluster variable calculation");
100 out = std::log10(cluster.
p4().Et());
120 out = cluster.
p4().DeltaPhi(tau.
p4());
127 out =
static_cast<float>(double_out);
134 out =
static_cast<float>(double_out);
141 out =
static_cast<float>(double_out);
148 double secondLambda(0);
157 double centerLambda(0);
175 double clusterFirstEngDens = 0.0;
177 if (clusterFirstEngDens < 1
e-6) clusterFirstEngDens = 1
e-6;
180 float clusterTotalEnergy = acc_ClusterTotalEnergy(tau);
181 if (clusterTotalEnergy < 1
e-6) clusterTotalEnergy = 1
e-6;
184 float clustersMeanFirstEngDens = acc_ClustersMeanFirstEngDens(tau);
186 out = std::log10(clusterFirstEngDens/clusterTotalEnergy) - clustersMeanFirstEngDens;
193 out = cluster.
p4().E();
198 out = cluster.
p4().Et();
203 double clusterFirstEngDens = 0.0;
205 out = clusterFirstEngDens;
210 double clusterEMprob = 0.0;
217 double clusterCenterMag = 0.0;
219 out = clusterCenterMag;
virtual FourMom_t p4() const final
The full 4-momentum of the particle.
This file contains "getter" functions used for accessing tagger inputs from the EDM.
virtual double eta() const
The pseudorapidity ( ) of the particle.
@ ClustersMeanSecondLambda
const ConstituentsType & getType() const override
bool EM_PROBABILITY(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool SECOND_R(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
static const std::unordered_map< std::string, FeatureFuncAsReference_t > m_func_map
const std::set< std::string > & getUsedRemap() const override
virtual double eta() const final
The pseudorapidity ( ) of the particle.
const CaloCluster & clust() const
Return the cluster being proxied,.
Class providing the definition of the 4-vector interface.
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool pt_jetseed_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
MomentType
Enums to identify different moments.
bool et_log(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
virtual double pt() const
The transverse momentum ( ) of the particle.
bool e(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool CENTER_MAG(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool SECOND_LAMBDAOverClustersMeanSecondLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool CENTER_LAMBDAOverClustersMeanCenterLambda(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
FTagDataDependencyNames m_deps
const FTagDataDependencyNames & getDependencies() const override
Class describing a tau jet.
ConstituentLoaderTauCluster(const ConstituentsInputConfig &cfg, double max_cluster_dr, bool doVertexCorrection)
bool FIRST_ENG_DENS(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
std::function< float(const xAOD::CaloVertexedTopoCluster &, const xAOD::TauJet &)> FeatureFunc_t
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Inputs getFeatures(const xAOD::TauJet *tau, const std::vector< xAOD::CaloVertexedTopoCluster > &tau_clusters) const
std::vector< FeatureFunc_t > m_feature_extractors
bool m_doVertexCorrection
bool FirstEngDensOverClustersMeanFirstEngDens(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
std::function< float(const xAOD::CaloVertexedTopoCluster &, const xAOD::TauJet &)> FeatureFunc_t
std::vector< xAOD::CaloVertexedTopoCluster > getTauClusters(const xAOD::TauJet *tau) const
@ ClustersMeanCenterLambda
std::vector< xAOD::CaloVertexedTopoCluster > vertexedClusters() const
const std::string & getName() const override
bool pt_tau_log(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &, float &out)
FeatureFunc_t getFeatureExtractor(const std::string &var_name) const
std::function< bool(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &, float &)> FeatureFuncAsReference_t
ConstituentsInputConfig m_config
bool et(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
std::tuple< Inputs, std::vector< const xAOD::IParticle * > > getData(const xAOD::IParticle &p) const override
virtual FourMom_t p4() const
The full 4-momentum of the particle.
std::function< bool(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &, float &)> FeatureFuncAsReference_t
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
Evaluate cluster kinematics with a different vertex / signal state.
bool SECOND_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
setBGCode setTAP setLVL2ErrorBits bool
std::set< std::string > m_used_remap