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 958 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 961 of file DeepTauId.cc.

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

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 963 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.

966  {
967  std::vector<reco::SingleTauDiscriminatorContainer> outputbuffer(taus->size());
968 
969  for (size_t tau_index = 0; tau_index < taus->size(); ++tau_index) {
970  float x = 0;
971  for (size_t num_elem : num_)
972  x += pred.matrix<float>()(tau_index, num_elem);
973  if (x != 0 && !den_.empty()) {
974  float den_val = 0;
975  for (size_t den_elem : den_)
976  den_val += pred.matrix<float>()(tau_index, den_elem);
977  x = den_val != 0 ? x / den_val : std::numeric_limits<float>::max();
978  }
979  outputbuffer[tau_index].rawValues.push_back(x);
980  if (working_points) {
981  for (const auto& wp : *working_points) {
982  const bool pass = x > (*wp)(taus->at(tau_index), is_online);
983  outputbuffer[tau_index].workingPoints.push_back(pass);
984  }
985  }
986  }
987  std::unique_ptr<TauDiscriminator> output = std::make_unique<TauDiscriminator>();
989  filler.insert(taus, outputbuffer.begin(), outputbuffer.end());
990  filler.fill();
991  return output;
992  }
working_points
Definition: FWLite.py:134
std::vector< size_t > den_
Definition: DeepTauId.cc:959
std::vector< size_t > num_
Definition: DeepTauId.cc:959

Member Data Documentation

◆ den_

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

Definition at line 959 of file DeepTauId.cc.

Referenced by get_value().

◆ num_

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

Definition at line 959 of file DeepTauId.cc.

Referenced by get_value().