CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
DeepTauId::Output Struct Reference

Public Member Functions

std::unique_ptr< TauDiscriminatorget_value (const edm::Handle< TauCollection > &taus, const tensorflow::Tensor &pred, const WPList *working_points, bool is_online) const
 
 Output (const std::vector< size_t > &num, const std::vector< size_t > &den)
 

Public Attributes

std::vector< size_t > den_
 
std::vector< size_t > num_
 

Detailed Description

Definition at line 909 of file DeepTauId.cc.

Constructor & Destructor Documentation

◆ Output()

DeepTauId::Output::Output ( const std::vector< size_t > &  num,
const std::vector< size_t > &  den 
)
inline

Definition at line 912 of file DeepTauId.cc.

912 : num_(num), den_(den) {}
std::vector< size_t > den_
Definition: DeepTauId.cc:910
std::vector< size_t > num_
Definition: DeepTauId.cc:910

Member Function Documentation

◆ get_value()

std::unique_ptr<TauDiscriminator> DeepTauId::Output::get_value ( const edm::Handle< TauCollection > &  taus,
const tensorflow::Tensor &  pred,
const WPList working_points,
bool  is_online 
) const
inline

Definition at line 914 of file DeepTauId.cc.

References den_, trigObjTnPSource_cfi::filler, HLT_2023v12_cff::is_online, SiStripPI::max, num_, convertSQLitetoXML_cfg::output, Tau3MuMonitor_cff::taus, FWLite::working_points, pfClustersFromHGC3DClusters_cfi::wp, and x.

917  {
918  std::vector<reco::SingleTauDiscriminatorContainer> outputbuffer(taus->size());
919 
920  for (size_t tau_index = 0; tau_index < taus->size(); ++tau_index) {
921  float x = 0;
922  for (size_t num_elem : num_)
923  x += pred.matrix<float>()(tau_index, num_elem);
924  if (x != 0 && !den_.empty()) {
925  float den_val = 0;
926  for (size_t den_elem : den_)
927  den_val += pred.matrix<float>()(tau_index, den_elem);
928  x = den_val != 0 ? x / den_val : std::numeric_limits<float>::max();
929  }
930  outputbuffer[tau_index].rawValues.push_back(x);
931  if (working_points) {
932  for (const auto& wp : *working_points) {
933  const bool pass = x > (*wp)(taus->at(tau_index), is_online);
934  outputbuffer[tau_index].workingPoints.push_back(pass);
935  }
936  }
937  }
938  std::unique_ptr<TauDiscriminator> output = std::make_unique<TauDiscriminator>();
940  filler.insert(taus, outputbuffer.begin(), outputbuffer.end());
941  filler.fill();
942  return output;
943  }
working_points
Definition: FWLite.py:134
std::vector< size_t > den_
Definition: DeepTauId.cc:910
std::vector< size_t > num_
Definition: DeepTauId.cc:910
Definition: output.py:1

Member Data Documentation

◆ den_

std::vector<size_t> DeepTauId::Output::den_

Definition at line 910 of file DeepTauId.cc.

Referenced by get_value().

◆ num_

std::vector<size_t> DeepTauId::Output::num_

Definition at line 910 of file DeepTauId.cc.

Referenced by get_value().