CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
DeepTauId Class Reference
Inheritance diagram for DeepTauId:
deep_tau::DeepTauBase edm::stream::EDProducer< edm::GlobalCache< DeepTauCache > >

Public Member Functions

 DeepTauId (const edm::ParameterSet &cfg, const deep_tau::DeepTauCache *cache)
 
const std::map< BasicDiscriminator, size_t > matchDiscriminatorIndices (edm::Event &event, edm::EDGetTokenT< reco::TauDiscriminatorContainer > discriminatorContainerToken, std::vector< BasicDiscriminator > requiredDiscr)
 
- Public Member Functions inherited from deep_tau::DeepTauBase
 DeepTauBase (const edm::ParameterSet &cfg, const OutputCollection &outputs, const DeepTauCache *cache)
 
void produce (edm::Event &event, const edm::EventSetup &es) override
 
 ~DeepTauBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DeepTauCache > >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static const OutputCollectionGetOutputs ()
 
static void globalEndJob (const deep_tau::DeepTauCache *cache_)
 
static std::unique_ptr< deep_tau::DeepTauCacheinitializeGlobalCache (const edm::ParameterSet &cfg)
 
- Static Public Member Functions inherited from deep_tau::DeepTauBase
static void globalEndJob (const DeepTauCache *cache)
 
static std::unique_ptr< DeepTauCacheinitializeGlobalCache (const edm::ParameterSet &cfg)
 

Static Public Attributes

static constexpr float default_value = -999.
 

Private Member Functions

void checkInputs (const tensorflow::Tensor &inputs, const char *block_name, int n_inputs, int n_eta=1, int n_phi=1) const
 
template<typename CandidateCastType , typename TauCastType >
void createConvFeatures (const TauCastType &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const reco::Vertex &pv, double rho, const std::vector< pat::Electron > *electrons, const std::vector< pat::Muon > *muons, const edm::View< reco::Candidate > &pfCands, const CellGrid &grid, TauFunc tau_funcs, bool is_inner)
 
template<typename CandidateCastType , typename TauCastType >
void createEgammaBlockInputs (unsigned idx, const TauCastType &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const reco::Vertex &pv, double rho, const std::vector< pat::Electron > *electrons, const edm::View< reco::Candidate > &pfCands, const Cell &cell_map, TauFunc tau_funcs, bool is_inner)
 
template<typename CandidateCastType , typename TauCastType >
void createHadronsBlockInputs (unsigned idx, const TauCastType &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const reco::Vertex &pv, double rho, const edm::View< reco::Candidate > &pfCands, const Cell &cell_map, TauFunc tau_funcs, bool is_inner)
 
template<typename dnn , typename CandidateCastType , typename TauCastType >
tensorflow::Tensor createInputsV1 (const TauCastType &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const std::vector< pat::Electron > *electrons, const std::vector< pat::Muon > *muons, TauFunc tau_funcs) const
 
template<typename CandidateCastType , typename TauCastType >
void createMuonBlockInputs (unsigned idx, const TauCastType &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const reco::Vertex &pv, double rho, const std::vector< pat::Muon > *muons, const edm::View< reco::Candidate > &pfCands, const Cell &cell_map, TauFunc tau_funcs, bool is_inner)
 
template<typename CandidateCastType , typename TauCastType >
void createTauBlockInputs (const TauCastType &tau, const size_t &tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const reco::Vertex &pv, double rho, TauFunc tau_funcs)
 
template<typename Collection , typename TauCastType >
void fillGrids (const TauCastType &tau, const Collection &objects, CellGrid &inner_grid, CellGrid &outer_grid)
 
tensorflow::Tensor getPartialPredictions (bool is_inner)
 
tensorflow::Tensor getPredictions (edm::Event &event, edm::Handle< TauCollection > taus) override
 
template<typename CandidateCastType , typename TauCastType >
void getPredictionsV1 (TauCollection::const_reference &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const std::vector< pat::Electron > *electrons, const std::vector< pat::Muon > *muons, std::vector< tensorflow::Tensor > &pred_vector, TauFunc tau_funcs)
 
template<typename CandidateCastType , typename TauCastType >
void getPredictionsV2 (TauCollection::const_reference &tau, const size_t tau_index, const edm::RefToBase< reco::BaseTau > tau_ref, const std::vector< pat::Electron > *electrons, const std::vector< pat::Muon > *muons, const edm::View< reco::Candidate > &pfCands, const reco::Vertex &pv, double rho, std::vector< tensorflow::Tensor > &pred_vector, TauFunc tau_funcs)
 
void setCellConvFeatures (tensorflow::Tensor &convTensor, const tensorflow::Tensor &features, unsigned batch_idx, int eta_index, int phi_index)
 

Static Private Member Functions

static void calculateElectronClusterVars (const pat::Electron *ele, float &elecEe, float &elecEgamma)
 
static bool calculateElectronClusterVarsV2 (const pat::Electron &ele, float &cc_ele_energy, float &cc_gamma_energy, int &cc_n_gamma)
 
template<typename TauCastType >
static bool calculateGottfriedJacksonAngleDifference (const TauCastType &tau, const size_t tau_index, double &gj_diff, TauFunc tau_funcs)
 
template<typename TauCastType >
static float calculateGottfriedJacksonAngleDifference (const TauCastType &tau, const size_t tau_index, TauFunc tau_funcs)
 
template<typename TauCastType >
static const pat::ElectronfindMatchedElectron (const TauCastType &tau, const std::vector< pat::Electron > *electrons, double deltaR)
 
static double getInnerSignalConeRadius (double pt)
 
template<typename T >
static float getValue (T value)
 
template<typename T >
static float getValueLinear (T value, float min_value, float max_value, bool positive)
 
template<typename T >
static float getValueNorm (T value, float mean, float sigma, float n_sigmas_max=5)
 
static bool isAbove (double value, double min)
 
static bool isInEcalCrack (double eta)
 
template<typename CandidateCollection , typename TauCastType >
static void processIsolationPFComponents (const TauCastType &tau, const CandidateCollection &candidates, LorentzVectorXYZ &p4, float &pt, float &d_eta, float &d_phi, float &m, float &n)
 
template<typename CandidateCollection , typename TauCastType >
static void processSignalPFComponents (const TauCastType &tau, const CandidateCollection &candidates, LorentzVectorXYZ &p4_inner, LorentzVectorXYZ &p4_outer, float &pt_inner, float &dEta_inner, float &dPhi_inner, float &m_inner, float &pt_outer, float &dEta_outer, float &dPhi_outer, float &m_outer, float &n_inner, float &n_outer)
 

Private Attributes

std::map< BasicDiscriminator, size_t > basicDiscrdR03IndexMap_
 
std::map< BasicDiscriminator, size_t > basicDiscrIndexMap_
 
edm::EDGetTokenT< reco::TauDiscriminatorContainerbasicTauDiscriminators_inputToken_
 
edm::EDGetTokenT< reco::TauDiscriminatorContainerbasicTauDiscriminatorsdR03_inputToken_
 
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > convTensor_
 
const int debug_level
 
const bool disable_dxy_pca_
 
bool discrIndicesMapped_ = false
 
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > eGammaTensor_
 
edm::EDGetTokenT< std::vector< pat::Electron > > electrons_token_
 
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > hadronsTensor_
 
std::string input_layer_
 
edm::EDGetTokenT< std::vector< pat::Muon > > muons_token_
 
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > muonTensor_
 
std::string output_layer_
 
edm::EDGetTokenT< edm::AssociationVector< reco::PFTauRefProd, std::vector< reco::PFTauTransverseImpactParameterRef > > > pfTauTransverseImpactParameters_token_
 
edm::EDGetTokenT< double > rho_token_
 
std::unique_ptr< tensorflow::Tensor > tauBlockTensor_
 
const unsigned version_
 
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > zeroOutputTensor_
 

Static Private Attributes

static constexpr float pi = M_PI
 

Additional Inherited Members

- Public Types inherited from deep_tau::DeepTauBase
enum  BasicDiscriminator {
  ChargedIsoPtSum, NeutralIsoPtSum, NeutralIsoPtSumWeight, FootprintCorrection,
  PhotonPtSumOutsideSignalCone, PUcorrPtSum
}
 
using CandidateCollection = edm::View< reco::Candidate >
 
using Cutter = TauWPThreshold
 
using CutterPtr = std::unique_ptr< Cutter >
 
using ElectronCollection = pat::ElectronCollection
 
using LorentzVectorXYZ = ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > >
 
using MuonCollection = pat::MuonCollection
 
using OutputCollection = std::map< std::string, Output >
 
using TauCollection = edm::View< reco::BaseTau >
 
using TauDiscriminator = reco::TauDiscriminatorContainer
 
using TauRef = edm::Ref< TauCollection >
 
using TauRefProd = edm::RefProd< TauCollection >
 
using WPList = std::vector< CutterPtr >
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DeepTauCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Attributes inherited from deep_tau::DeepTauBase
uint8_t andPrediscriminants_
 
std::vector< TauDiscInfo< pat::PATTauDiscriminator > > patPrediscriminants_
 
std::vector< TauDiscInfo< reco::PFTauDiscriminator > > recoPrediscriminants_
 
- Protected Attributes inherited from deep_tau::DeepTauBase
const DeepTauCachecache_
 
const bool is_online_
 
OutputCollection outputs_
 
edm::EDGetTokenT< CandidateCollectionpfcandToken_
 
edm::EDGetTokenT< TauCollectiontausToken_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
std::map< std::string, WPListworkingPoints_
 
- Static Protected Attributes inherited from deep_tau::DeepTauBase
static const std::vector< BasicDiscriminatorrequiredBasicDiscriminators_
 
static const std::vector< BasicDiscriminatorrequiredBasicDiscriminatorsdR03_
 
static const std::map< BasicDiscriminator, std::string > stringFromDiscriminator_
 

Detailed Description

Definition at line 1066 of file DeepTauId.cc.

Constructor & Destructor Documentation

◆ DeepTauId()

DeepTauId::DeepTauId ( const edm::ParameterSet cfg,
const deep_tau::DeepTauCache cache 
)
inlineexplicit

Definition at line 1152 of file DeepTauId.cc.

1154  electrons_token_(consumes<std::vector<pat::Electron>>(cfg.getParameter<edm::InputTag>("electrons"))),
1155  muons_token_(consumes<std::vector<pat::Muon>>(cfg.getParameter<edm::InputTag>("muons"))),
1156  rho_token_(consumes<double>(cfg.getParameter<edm::InputTag>("rho"))),
1157  basicTauDiscriminators_inputToken_(consumes<reco::TauDiscriminatorContainer>(
1158  cfg.getUntrackedParameter<edm::InputTag>("basicTauDiscriminators"))),
1159  basicTauDiscriminatorsdR03_inputToken_(consumes<reco::TauDiscriminatorContainer>(
1160  cfg.getUntrackedParameter<edm::InputTag>("basicTauDiscriminatorsdR03"))),
1162  consumes<edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>>(
1163  cfg.getParameter<edm::InputTag>("pfTauTransverseImpactParameters"))),
1164  version_(cfg.getParameter<unsigned>("version")),
1165  debug_level(cfg.getParameter<int>("debug_level")),
1166  disable_dxy_pca_(cfg.getParameter<bool>("disable_dxy_pca")) {
1167  if (version_ == 1) {
1168  input_layer_ = cache_->getGraph().node(0).name();
1169  output_layer_ = cache_->getGraph().node(cache_->getGraph().node_size() - 1).name();
1170  const auto& shape = cache_->getGraph().node(0).attr().at("shape").shape();
1171  if (shape.dim(1).size() != dnn_inputs_2017v1::NumberOfInputs)
1172  throw cms::Exception("DeepTauId")
1173  << "number of inputs does not match the expected inputs for the given version";
1174  } else if (version_ == 2) {
1175  tauBlockTensor_ = std::make_unique<tensorflow::Tensor>(
1176  tensorflow::DT_FLOAT, tensorflow::TensorShape{1, dnn_inputs_2017_v2::TauBlockInputs::NumberOfInputs});
1177  for (size_t n = 0; n < 2; ++n) {
1178  const bool is_inner = n == 0;
1179  const auto n_cells =
1180  is_inner ? dnn_inputs_2017_v2::number_of_inner_cell : dnn_inputs_2017_v2::number_of_outer_cell;
1181  eGammaTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1182  tensorflow::DT_FLOAT,
1183  tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::EgammaBlockInputs::NumberOfInputs});
1184  muonTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1185  tensorflow::DT_FLOAT,
1186  tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::MuonBlockInputs::NumberOfInputs});
1187  hadronsTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1188  tensorflow::DT_FLOAT,
1189  tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::HadronBlockInputs::NumberOfInputs});
1190  convTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1191  tensorflow::DT_FLOAT,
1192  tensorflow::TensorShape{1, n_cells, n_cells, dnn_inputs_2017_v2::number_of_conv_features});
1193  zeroOutputTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1194  tensorflow::DT_FLOAT, tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::number_of_conv_features});
1195 
1196  eGammaTensor_[is_inner]->flat<float>().setZero();
1197  muonTensor_[is_inner]->flat<float>().setZero();
1198  hadronsTensor_[is_inner]->flat<float>().setZero();
1199 
1200  setCellConvFeatures(*zeroOutputTensor_[is_inner], getPartialPredictions(is_inner), 0, 0, 0);
1201  }
1202  } else {
1203  throw cms::Exception("DeepTauId") << "version " << version_ << " is not supported.";
1204  }
1205  }

References deep_tau::DeepTauBase::cache_, convTensor_, eGammaTensor_, Exception, deep_tau::DeepTauCache::getGraph(), getPartialPredictions(), hadronsTensor_, input_layer_, muonTensor_, dqmiodumpmetadata::n, Skims_PA_cff::name, output_layer_, setCellConvFeatures(), tauBlockTensor_, version_, and zeroOutputTensor_.

Member Function Documentation

◆ calculateElectronClusterVars()

static void DeepTauId::calculateElectronClusterVars ( const pat::Electron ele,
float &  elecEe,
float &  elecEgamma 
)
inlinestaticprivate

Definition at line 2427 of file DeepTauId.cc.

2427  {
2428  if (ele) {
2429  elecEe = elecEgamma = 0;
2430  auto superCluster = ele->superCluster();
2431  if (superCluster.isNonnull() && superCluster.isAvailable() && superCluster->clusters().isNonnull() &&
2432  superCluster->clusters().isAvailable()) {
2433  for (auto iter = superCluster->clustersBegin(); iter != superCluster->clustersEnd(); ++iter) {
2434  const double energy = (*iter)->energy();
2435  if (iter == superCluster->clustersBegin())
2436  elecEe += energy;
2437  else
2438  elecEgamma += energy;
2439  }
2440  }
2441  } else {
2442  elecEe = elecEgamma = default_value;
2443  }
2444  }

References default_value, HCALHighEnergyHPDFilter_cfi::energy, and pat::Electron::superCluster().

Referenced by createInputsV1().

◆ calculateElectronClusterVarsV2()

static bool DeepTauId::calculateElectronClusterVarsV2 ( const pat::Electron ele,
float &  cc_ele_energy,
float &  cc_gamma_energy,
int &  cc_n_gamma 
)
inlinestaticprivate

Definition at line 1240 of file DeepTauId.cc.

1243  {
1244  cc_ele_energy = cc_gamma_energy = 0;
1245  cc_n_gamma = 0;
1246  const auto& superCluster = ele.superCluster();
1247  if (superCluster.isNonnull() && superCluster.isAvailable() && superCluster->clusters().isNonnull() &&
1248  superCluster->clusters().isAvailable()) {
1249  for (auto iter = superCluster->clustersBegin(); iter != superCluster->clustersEnd(); ++iter) {
1250  const float energy = static_cast<float>((*iter)->energy());
1251  if (iter == superCluster->clustersBegin())
1252  cc_ele_energy += energy;
1253  else {
1254  cc_gamma_energy += energy;
1255  ++cc_n_gamma;
1256  }
1257  }
1258  return true;
1259  } else
1260  return false;
1261  }

References HCALHighEnergyHPDFilter_cfi::energy, and pat::Electron::superCluster().

Referenced by createEgammaBlockInputs().

◆ calculateGottfriedJacksonAngleDifference() [1/2]

template<typename TauCastType >
static bool DeepTauId::calculateGottfriedJacksonAngleDifference ( const TauCastType &  tau,
const size_t  tau_index,
double &  gj_diff,
TauFunc  tau_funcs 
)
inlinestaticprivate

Definition at line 2521 of file DeepTauId.cc.

2524  {
2525  if (tau_funcs.getHasSecondaryVertex(tau, tau_index)) {
2526  static constexpr double mTau = 1.77682;
2527  const double mAOne = tau.p4().M();
2528  const double pAOneMag = tau.p();
2529  const double argumentThetaGJmax = (std::pow(mTau, 2) - std::pow(mAOne, 2)) / (2 * mTau * pAOneMag);
2530  const double argumentThetaGJmeasured = tau.p4().Vect().Dot(tau_funcs.getFlightLength(tau, tau_index)) /
2531  (pAOneMag * tau_funcs.getFlightLength(tau, tau_index).R());
2532  if (std::abs(argumentThetaGJmax) <= 1. && std::abs(argumentThetaGJmeasured) <= 1.) {
2533  double thetaGJmax = std::asin(argumentThetaGJmax);
2534  double thetaGJmeasured = std::acos(argumentThetaGJmeasured);
2535  gj_diff = thetaGJmeasured - thetaGJmax;
2536  return true;
2537  }
2538  }
2539  return false;
2540  }

References funct::abs(), funct::pow(), and metsig::tau.

Referenced by calculateGottfriedJacksonAngleDifference(), createInputsV1(), and createTauBlockInputs().

◆ calculateGottfriedJacksonAngleDifference() [2/2]

template<typename TauCastType >
static float DeepTauId::calculateGottfriedJacksonAngleDifference ( const TauCastType &  tau,
const size_t  tau_index,
TauFunc  tau_funcs 
)
inlinestaticprivate

Definition at line 2543 of file DeepTauId.cc.

2545  {
2546  double gj_diff;
2547  if (calculateGottfriedJacksonAngleDifference(tau, tau_index, gj_diff, tau_funcs))
2548  return static_cast<float>(gj_diff);
2549  return default_value;
2550  }

References calculateGottfriedJacksonAngleDifference(), default_value, and metsig::tau.

◆ checkInputs()

void DeepTauId::checkInputs ( const tensorflow::Tensor &  inputs,
const char *  block_name,
int  n_inputs,
int  n_eta = 1,
int  n_phi = 1 
) const
inlineprivate

Definition at line 1263 of file DeepTauId.cc.

1264  {
1265  if (debug_level >= 1) {
1266  for (int eta = 0; eta < n_eta; ++eta) {
1267  for (int phi = 0; phi < n_phi; phi++) {
1268  for (int k = 0; k < n_inputs; ++k) {
1269  const float input =
1270  n_eta == 1 && n_phi == 1 ? inputs.matrix<float>()(0, k) : inputs.tensor<float, 4>()(0, eta, phi, k);
1271  if (edm::isNotFinite(input))
1272  throw cms::Exception("DeepTauId")
1273  << "in the " << block_name << ", input is not finite, i.e. infinite or NaN, for eta_index = " << n_eta
1274  << ", phi_index = " << n_phi << ", input_index = " << k;
1275  if (debug_level >= 2)
1276  std::cout << block_name << "," << eta << "," << phi << "," << k << "," << std::setprecision(5)
1277  << std::fixed << input << '\n';
1278  }
1279  }
1280  }
1281  }
1282  }

References gather_cfg::cout, debug_level, PVValHelper::eta, Exception, alignBH_cfg::fixed, dqmMemoryStats::float, input, PixelMapPlotter::inputs, edm::isNotFinite(), dqmdumpme::k, and phi.

Referenced by createEgammaBlockInputs(), createHadronsBlockInputs(), createMuonBlockInputs(), and createTauBlockInputs().

◆ createConvFeatures()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::createConvFeatures ( const TauCastType &  tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const reco::Vertex pv,
double  rho,
const std::vector< pat::Electron > *  electrons,
const std::vector< pat::Muon > *  muons,
const edm::View< reco::Candidate > &  pfCands,
const CellGrid &  grid,
TauFunc  tau_funcs,
bool  is_inner 
)
inlineprivate

Definition at line 1527 of file DeepTauId.cc.

1537  {
1538  tensorflow::Tensor& convTensor = *convTensor_.at(is_inner);
1539  eGammaTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1540  tensorflow::DT_FLOAT,
1541  tensorflow::TensorShape{
1542  (long long int)grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::EgammaBlockInputs::NumberOfInputs});
1543  muonTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1544  tensorflow::DT_FLOAT,
1545  tensorflow::TensorShape{
1546  (long long int)grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::MuonBlockInputs::NumberOfInputs});
1547  hadronsTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1548  tensorflow::DT_FLOAT,
1549  tensorflow::TensorShape{
1550  (long long int)grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::HadronBlockInputs::NumberOfInputs});
1551 
1552  eGammaTensor_[is_inner]->flat<float>().setZero();
1553  muonTensor_[is_inner]->flat<float>().setZero();
1554  hadronsTensor_[is_inner]->flat<float>().setZero();
1555 
1556  unsigned idx = 0;
1557  for (int eta = -grid.maxEtaIndex(); eta <= grid.maxEtaIndex(); ++eta) {
1558  for (int phi = -grid.maxPhiIndex(); phi <= grid.maxPhiIndex(); ++phi) {
1559  const CellIndex cell_index{eta, phi};
1560  const auto cell_iter = grid.find(cell_index);
1561  if (cell_iter != grid.end()) {
1562  const Cell& cell = cell_iter->second;
1563  createEgammaBlockInputs<CandidateCastType>(
1564  idx, tau, tau_index, tau_ref, pv, rho, electrons, pfCands, cell, tau_funcs, is_inner);
1565  createMuonBlockInputs<CandidateCastType>(
1566  idx, tau, tau_index, tau_ref, pv, rho, muons, pfCands, cell, tau_funcs, is_inner);
1567  createHadronsBlockInputs<CandidateCastType>(
1568  idx, tau, tau_index, tau_ref, pv, rho, pfCands, cell, tau_funcs, is_inner);
1569  idx += 1;
1570  }
1571  }
1572  }
1573 
1574  const auto predTensor = getPartialPredictions(is_inner);
1575  idx = 0;
1576  for (int eta = -grid.maxEtaIndex(); eta <= grid.maxEtaIndex(); ++eta) {
1577  for (int phi = -grid.maxPhiIndex(); phi <= grid.maxPhiIndex(); ++phi) {
1578  const CellIndex cell_index{eta, phi};
1579  const int eta_index = grid.getEtaTensorIndex(cell_index);
1580  const int phi_index = grid.getPhiTensorIndex(cell_index);
1581 
1582  const auto cell_iter = grid.find(cell_index);
1583  if (cell_iter != grid.end()) {
1584  setCellConvFeatures(convTensor, predTensor, idx, eta_index, phi_index);
1585  idx += 1;
1586  } else {
1587  setCellConvFeatures(convTensor, *zeroOutputTensor_[is_inner], 0, eta_index, phi_index);
1588  }
1589  }
1590  }
1591  }

References convTensor_, eGammaTensor_, pwdgSkimBPark_cfi::electrons, PVValHelper::eta, getPartialPredictions(), getRunAppsInfo::grid, hadronsTensor_, heavyIonCSV_trainingSettings::idx, createfilelist::int, PDWG_BPHSkim_cff::muons, muonTensor_, phi, MetAnalyzer::pv(), rho, setCellConvFeatures(), metsig::tau, and zeroOutputTensor_.

◆ createEgammaBlockInputs()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::createEgammaBlockInputs ( unsigned  idx,
const TauCastType &  tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const reco::Vertex pv,
double  rho,
const std::vector< pat::Electron > *  electrons,
const edm::View< reco::Candidate > &  pfCands,
const Cell cell_map,
TauFunc  tau_funcs,
bool  is_inner 
)
inlineprivate

Definition at line 1709 of file DeepTauId.cc.

1719  {
1720  namespace dnn = dnn_inputs_2017_v2::EgammaBlockInputs;
1721 
1722  tensorflow::Tensor& inputs = *eGammaTensor_.at(is_inner);
1723 
1724  const auto& get = [&](int var_index) -> float& { return inputs.tensor<float, 4>()(idx, 0, 0, var_index); };
1725 
1726  const bool valid_index_pf_ele = cell_map.count(CellObjectType::PfCand_electron);
1727  const bool valid_index_pf_gamma = cell_map.count(CellObjectType::PfCand_gamma);
1728  const bool valid_index_ele = cell_map.count(CellObjectType::Electron);
1729 
1730  if (!cell_map.empty()) {
1731  get(dnn::rho) = getValueNorm(rho, 21.49f, 9.713f);
1732  get(dnn::tau_pt) = getValueLinear(tau.polarP4().pt(), 20.f, 1000.f, true);
1733  get(dnn::tau_eta) = getValueLinear(tau.polarP4().eta(), -2.3f, 2.3f, false);
1734  get(dnn::tau_inside_ecal_crack) = getValue(isInEcalCrack(tau.polarP4().eta()));
1735  }
1736  if (valid_index_pf_ele) {
1737  size_t index_pf_ele = cell_map.at(CellObjectType::PfCand_electron);
1738  const auto& ele_cand = dynamic_cast<const CandidateCastType&>(pfCands.at(index_pf_ele));
1739 
1740  get(dnn::pfCand_ele_valid) = valid_index_pf_ele;
1741  get(dnn::pfCand_ele_rel_pt) = getValueNorm(pfCands.at(index_pf_ele).polarP4().pt() / tau.polarP4().pt(),
1742  is_inner ? 0.9792f : 0.304f,
1743  is_inner ? 0.5383f : 1.845f);
1744  get(dnn::pfCand_ele_deta) = getValueLinear(pfCands.at(index_pf_ele).polarP4().eta() - tau.polarP4().eta(),
1745  is_inner ? -0.1f : -0.5f,
1746  is_inner ? 0.1f : 0.5f,
1747  false);
1748  get(dnn::pfCand_ele_dphi) = getValueLinear(dPhi(tau.polarP4(), pfCands.at(index_pf_ele).polarP4()),
1749  is_inner ? -0.1f : -0.5f,
1750  is_inner ? 0.1f : 0.5f,
1751  false);
1752  get(dnn::pfCand_ele_pvAssociationQuality) =
1753  getValueLinear<int>(candFunc::getPvAssocationQuality(ele_cand), 0, 7, true);
1754  get(dnn::pfCand_ele_puppiWeight) = getValue(candFunc::getPuppiWeight(ele_cand));
1755  get(dnn::pfCand_ele_charge) = getValue(ele_cand.charge());
1756  get(dnn::pfCand_ele_lostInnerHits) = getValue<int>(candFunc::getLostInnerHits(ele_cand, default_value));
1757  get(dnn::pfCand_ele_numberOfPixelHits) =
1758  getValueLinear(candFunc::getNumberOfPixelHits(ele_cand, default_value), 0, 10, true);
1759  get(dnn::pfCand_ele_vertex_dx) =
1760  getValueNorm(pfCands.at(index_pf_ele).vertex().x() - pv.position().x(), 0.f, 0.1221f);
1761  get(dnn::pfCand_ele_vertex_dy) =
1762  getValueNorm(pfCands.at(index_pf_ele).vertex().y() - pv.position().y(), 0.f, 0.1226f);
1763  get(dnn::pfCand_ele_vertex_dz) =
1764  getValueNorm(pfCands.at(index_pf_ele).vertex().z() - pv.position().z(), 0.001f, 1.024f);
1765  get(dnn::pfCand_ele_vertex_dx_tauFL) = getValueNorm(
1766  pfCands.at(index_pf_ele).vertex().x() - pv.position().x() - tau_funcs.getFlightLength(tau, tau_index).x(),
1767  0.f,
1768  0.3411f);
1769  get(dnn::pfCand_ele_vertex_dy_tauFL) = getValueNorm(
1770  pfCands.at(index_pf_ele).vertex().y() - pv.position().y() - tau_funcs.getFlightLength(tau, tau_index).y(),
1771  0.0003f,
1772  0.3385f);
1773  get(dnn::pfCand_ele_vertex_dz_tauFL) = getValueNorm(
1774  pfCands.at(index_pf_ele).vertex().z() - pv.position().z() - tau_funcs.getFlightLength(tau, tau_index).z(),
1775  0.f,
1776  1.307f);
1777 
1778  const bool hasTrackDetails = candFunc::getHasTrackDetails(ele_cand);
1779  if (hasTrackDetails) {
1780  get(dnn::pfCand_ele_hasTrackDetails) = hasTrackDetails;
1781  get(dnn::pfCand_ele_dxy) = getValueNorm(candFunc::getTauDxy(ele_cand, default_value), 0.f, 0.171f);
1782  get(dnn::pfCand_ele_dxy_sig) =
1783  getValueNorm(std::abs(candFunc::getTauDxy(ele_cand, default_value)) / pfCands.at(index_pf_ele).dxyError(),
1784  1.634f,
1785  6.45f);
1786  get(dnn::pfCand_ele_dz) = getValueNorm(candFunc::getTauDz(ele_cand, default_value), 0.001f, 1.02f);
1787  get(dnn::pfCand_ele_dz_sig) = getValueNorm(
1788  std::abs(candFunc::getTauDz(ele_cand, default_value)) / candFunc::getTauDzError(ele_cand, default_value),
1789  24.56f,
1790  210.4f);
1791  get(dnn::pfCand_ele_track_chi2_ndof) = getValueNorm(
1792  candFunc::getPseudoTrack(ele_cand).chi2() / candFunc::getPseudoTrack(ele_cand).ndof(), 2.272f, 8.439f);
1793  get(dnn::pfCand_ele_track_ndof) = getValueNorm(candFunc::getPseudoTrack(ele_cand).ndof(), 15.18f, 3.203f);
1794  }
1795  }
1796  if (valid_index_pf_gamma) {
1797  size_t index_pf_gamma = cell_map.at(CellObjectType::PfCand_gamma);
1798  const auto& gamma_cand = dynamic_cast<const CandidateCastType&>(pfCands.at(index_pf_gamma));
1799 
1800  get(dnn::pfCand_gamma_valid) = valid_index_pf_gamma;
1801  get(dnn::pfCand_gamma_rel_pt) = getValueNorm(pfCands.at(index_pf_gamma).polarP4().pt() / tau.polarP4().pt(),
1802  is_inner ? 0.6048f : 0.02576f,
1803  is_inner ? 1.669f : 0.3833f);
1804  get(dnn::pfCand_gamma_deta) = getValueLinear(pfCands.at(index_pf_gamma).polarP4().eta() - tau.polarP4().eta(),
1805  is_inner ? -0.1f : -0.5f,
1806  is_inner ? 0.1f : 0.5f,
1807  false);
1808  get(dnn::pfCand_gamma_dphi) = getValueLinear(dPhi(tau.polarP4(), pfCands.at(index_pf_gamma).polarP4()),
1809  is_inner ? -0.1f : -0.5f,
1810  is_inner ? 0.1f : 0.5f,
1811  false);
1812  get(dnn::pfCand_gamma_pvAssociationQuality) =
1813  getValueLinear<int>(candFunc::getPvAssocationQuality(gamma_cand), 0, 7, true);
1814  get(dnn::pfCand_gamma_fromPV) = getValueLinear<int>(candFunc::getFromPV(gamma_cand), 0, 3, true);
1815  get(dnn::pfCand_gamma_puppiWeight) = getValue(candFunc::getPuppiWeight(gamma_cand));
1816  get(dnn::pfCand_gamma_puppiWeightNoLep) = getValue(candFunc::getPuppiWeightNoLep(gamma_cand));
1817  get(dnn::pfCand_gamma_lostInnerHits) = getValue<int>(candFunc::getLostInnerHits(gamma_cand, default_value));
1818  get(dnn::pfCand_gamma_numberOfPixelHits) =
1819  getValueLinear(candFunc::getNumberOfPixelHits(gamma_cand, default_value), 0, 7, true);
1820  get(dnn::pfCand_gamma_vertex_dx) =
1821  getValueNorm(pfCands.at(index_pf_gamma).vertex().x() - pv.position().x(), 0.f, 0.0067f);
1822  get(dnn::pfCand_gamma_vertex_dy) =
1823  getValueNorm(pfCands.at(index_pf_gamma).vertex().y() - pv.position().y(), 0.f, 0.0069f);
1824  get(dnn::pfCand_gamma_vertex_dz) =
1825  getValueNorm(pfCands.at(index_pf_gamma).vertex().z() - pv.position().z(), 0.f, 0.0578f);
1826  get(dnn::pfCand_gamma_vertex_dx_tauFL) = getValueNorm(
1827  pfCands.at(index_pf_gamma).vertex().x() - pv.position().x() - tau_funcs.getFlightLength(tau, tau_index).x(),
1828  0.001f,
1829  0.9565f);
1830  get(dnn::pfCand_gamma_vertex_dy_tauFL) = getValueNorm(
1831  pfCands.at(index_pf_gamma).vertex().y() - pv.position().y() - tau_funcs.getFlightLength(tau, tau_index).y(),
1832  0.0008f,
1833  0.9592f);
1834  get(dnn::pfCand_gamma_vertex_dz_tauFL) = getValueNorm(
1835  pfCands.at(index_pf_gamma).vertex().z() - pv.position().z() - tau_funcs.getFlightLength(tau, tau_index).z(),
1836  0.0038f,
1837  2.154f);
1838  const bool hasTrackDetails = candFunc::getHasTrackDetails(gamma_cand);
1839  if (hasTrackDetails) {
1840  get(dnn::pfCand_gamma_hasTrackDetails) = hasTrackDetails;
1841  get(dnn::pfCand_gamma_dxy) = getValueNorm(candFunc::getTauDxy(gamma_cand, default_value), 0.0004f, 0.882f);
1842  get(dnn::pfCand_gamma_dxy_sig) = getValueNorm(
1843  std::abs(candFunc::getTauDxy(gamma_cand, default_value)) / gamma_cand.dxyError(), 4.271f, 63.78f);
1844  get(dnn::pfCand_gamma_dz) = getValueNorm(candFunc::getTauDz(gamma_cand, default_value), 0.0071f, 5.285f);
1845  get(dnn::pfCand_gamma_dz_sig) = getValueNorm(std::abs(candFunc::getTauDz(gamma_cand, default_value)) /
1846  candFunc::getTauDzError(gamma_cand, default_value),
1847  162.1f,
1848  622.4f);
1849  get(dnn::pfCand_gamma_track_chi2_ndof) = candFunc::getPseudoTrack(gamma_cand).ndof() > 0
1850  ? getValueNorm(candFunc::getPseudoTrack(gamma_cand).chi2() /
1851  candFunc::getPseudoTrack(gamma_cand).ndof(),
1852  4.268f,
1853  15.47f)
1854  : 0;
1855  get(dnn::pfCand_gamma_track_ndof) =
1856  candFunc::getPseudoTrack(gamma_cand).ndof() > 0
1857  ? getValueNorm(candFunc::getPseudoTrack(gamma_cand).ndof(), 12.25f, 4.774f)
1858  : 0;
1859  }
1860  }
1861  if (valid_index_ele) {
1862  size_t index_ele = cell_map.at(CellObjectType::Electron);
1863 
1864  get(dnn::ele_valid) = valid_index_ele;
1865  get(dnn::ele_rel_pt) = getValueNorm(electrons->at(index_ele).polarP4().pt() / tau.polarP4().pt(),
1866  is_inner ? 1.067f : 0.5111f,
1867  is_inner ? 1.521f : 2.765f);
1868  get(dnn::ele_deta) = getValueLinear(electrons->at(index_ele).polarP4().eta() - tau.polarP4().eta(),
1869  is_inner ? -0.1f : -0.5f,
1870  is_inner ? 0.1f : 0.5f,
1871  false);
1872  get(dnn::ele_dphi) = getValueLinear(dPhi(tau.polarP4(), electrons->at(index_ele).polarP4()),
1873  is_inner ? -0.1f : -0.5f,
1874  is_inner ? 0.1f : 0.5f,
1875  false);
1876 
1877  float cc_ele_energy, cc_gamma_energy;
1878  int cc_n_gamma;
1879  const bool cc_valid =
1880  calculateElectronClusterVarsV2(electrons->at(index_ele), cc_ele_energy, cc_gamma_energy, cc_n_gamma);
1881  if (cc_valid) {
1882  get(dnn::ele_cc_valid) = cc_valid;
1883  get(dnn::ele_cc_ele_rel_energy) =
1884  getValueNorm(cc_ele_energy / electrons->at(index_ele).polarP4().pt(), 1.729f, 1.644f);
1885  get(dnn::ele_cc_gamma_rel_energy) = getValueNorm(cc_gamma_energy / cc_ele_energy, 0.1439f, 0.3284f);
1886  get(dnn::ele_cc_n_gamma) = getValueNorm(cc_n_gamma, 1.794f, 2.079f);
1887  }
1888  get(dnn::ele_rel_trackMomentumAtVtx) = getValueNorm(
1889  electrons->at(index_ele).trackMomentumAtVtx().R() / electrons->at(index_ele).polarP4().pt(), 1.531f, 1.424f);
1890  get(dnn::ele_rel_trackMomentumAtCalo) = getValueNorm(
1891  electrons->at(index_ele).trackMomentumAtCalo().R() / electrons->at(index_ele).polarP4().pt(), 1.531f, 1.424f);
1892  get(dnn::ele_rel_trackMomentumOut) = getValueNorm(
1893  electrons->at(index_ele).trackMomentumOut().R() / electrons->at(index_ele).polarP4().pt(), 0.7735f, 0.935f);
1894  get(dnn::ele_rel_trackMomentumAtEleClus) =
1895  getValueNorm(electrons->at(index_ele).trackMomentumAtEleClus().R() / electrons->at(index_ele).polarP4().pt(),
1896  0.7735f,
1897  0.935f);
1898  get(dnn::ele_rel_trackMomentumAtVtxWithConstraint) = getValueNorm(
1899  electrons->at(index_ele).trackMomentumAtVtxWithConstraint().R() / electrons->at(index_ele).polarP4().pt(),
1900  1.625f,
1901  1.581f);
1902  get(dnn::ele_rel_ecalEnergy) =
1903  getValueNorm(electrons->at(index_ele).ecalEnergy() / electrons->at(index_ele).polarP4().pt(), 1.993f, 1.308f);
1904  get(dnn::ele_ecalEnergy_sig) = getValueNorm(
1905  electrons->at(index_ele).ecalEnergy() / electrons->at(index_ele).ecalEnergyError(), 70.25f, 58.16f);
1906  get(dnn::ele_eSuperClusterOverP) = getValueNorm(electrons->at(index_ele).eSuperClusterOverP(), 2.432f, 15.13f);
1907  get(dnn::ele_eSeedClusterOverP) = getValueNorm(electrons->at(index_ele).eSeedClusterOverP(), 2.034f, 13.96f);
1908  get(dnn::ele_eSeedClusterOverPout) = getValueNorm(electrons->at(index_ele).eSeedClusterOverPout(), 6.64f, 36.8f);
1909  get(dnn::ele_eEleClusterOverPout) = getValueNorm(electrons->at(index_ele).eEleClusterOverPout(), 4.183f, 20.63f);
1910  get(dnn::ele_deltaEtaSuperClusterTrackAtVtx) =
1911  getValueNorm(electrons->at(index_ele).deltaEtaSuperClusterTrackAtVtx(), 0.f, 0.0363f);
1912  get(dnn::ele_deltaEtaSeedClusterTrackAtCalo) =
1913  getValueNorm(electrons->at(index_ele).deltaEtaSeedClusterTrackAtCalo(), -0.0001f, 0.0512f);
1914  get(dnn::ele_deltaEtaEleClusterTrackAtCalo) =
1915  getValueNorm(electrons->at(index_ele).deltaEtaEleClusterTrackAtCalo(), -0.0001f, 0.0541f);
1916  get(dnn::ele_deltaPhiEleClusterTrackAtCalo) =
1917  getValueNorm(electrons->at(index_ele).deltaPhiEleClusterTrackAtCalo(), 0.0002f, 0.0553f);
1918  get(dnn::ele_deltaPhiSuperClusterTrackAtVtx) =
1919  getValueNorm(electrons->at(index_ele).deltaPhiSuperClusterTrackAtVtx(), 0.0001f, 0.0523f);
1920  get(dnn::ele_deltaPhiSeedClusterTrackAtCalo) =
1921  getValueNorm(electrons->at(index_ele).deltaPhiSeedClusterTrackAtCalo(), 0.0004f, 0.0777f);
1922  get(dnn::ele_mvaInput_earlyBrem) = getValue(electrons->at(index_ele).mvaInput().earlyBrem);
1923  get(dnn::ele_mvaInput_lateBrem) = getValue(electrons->at(index_ele).mvaInput().lateBrem);
1924  get(dnn::ele_mvaInput_sigmaEtaEta) =
1925  getValueNorm(electrons->at(index_ele).mvaInput().sigmaEtaEta, 0.0008f, 0.0052f);
1926  get(dnn::ele_mvaInput_hadEnergy) = getValueNorm(electrons->at(index_ele).mvaInput().hadEnergy, 14.04f, 69.48f);
1927  get(dnn::ele_mvaInput_deltaEta) = getValueNorm(electrons->at(index_ele).mvaInput().deltaEta, 0.0099f, 0.0851f);
1928  const auto& gsfTrack = electrons->at(index_ele).gsfTrack();
1929  if (gsfTrack.isNonnull()) {
1930  get(dnn::ele_gsfTrack_normalizedChi2) = getValueNorm(gsfTrack->normalizedChi2(), 3.049f, 10.39f);
1931  get(dnn::ele_gsfTrack_numberOfValidHits) = getValueNorm(gsfTrack->numberOfValidHits(), 16.52f, 2.806f);
1932  get(dnn::ele_rel_gsfTrack_pt) =
1933  getValueNorm(gsfTrack->pt() / electrons->at(index_ele).polarP4().pt(), 1.355f, 16.81f);
1934  get(dnn::ele_gsfTrack_pt_sig) = getValueNorm(gsfTrack->pt() / gsfTrack->ptError(), 5.046f, 3.119f);
1935  }
1936  const auto& closestCtfTrack = electrons->at(index_ele).closestCtfTrackRef();
1937  const bool has_closestCtfTrack = closestCtfTrack.isNonnull();
1938  if (has_closestCtfTrack) {
1939  get(dnn::ele_has_closestCtfTrack) = has_closestCtfTrack;
1940  get(dnn::ele_closestCtfTrack_normalizedChi2) = getValueNorm(closestCtfTrack->normalizedChi2(), 2.411f, 6.98f);
1941  get(dnn::ele_closestCtfTrack_numberOfValidHits) =
1942  getValueNorm(closestCtfTrack->numberOfValidHits(), 15.16f, 5.26f);
1943  }
1944  }
1945  if (valid_index_ele or valid_index_pf_ele or valid_index_pf_gamma)
1946  checkInputs(inputs, is_inner ? "egamma_inner_block" : "egamma_outer_block", dnn::NumberOfInputs);
1947  }

References funct::abs(), edm::View< T >::at(), calculateElectronClusterVarsV2(), checkInputs(), hltPixelTracks_cff::chi2, default_value, HLT_FULL_cff::dPhi, eGammaTensor_, nanoDQM_cff::Electron, pwdgSkimBPark_cfi::electrons, f, dqmMemoryStats::float, get, getValue(), getValueLinear(), getValueNorm(), heavyIonCSV_trainingSettings::idx, PixelMapPlotter::inputs, isInEcalCrack(), ndof, or, MetAnalyzer::pv(), rho, ZElectronSkim_cff::rho, metsig::tau, runTauDisplay::tau_eta, and runTauDisplay::tau_pt.

◆ createHadronsBlockInputs()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::createHadronsBlockInputs ( unsigned  idx,
const TauCastType &  tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const reco::Vertex pv,
double  rho,
const edm::View< reco::Candidate > &  pfCands,
const Cell cell_map,
TauFunc  tau_funcs,
bool  is_inner 
)
inlineprivate

Definition at line 2103 of file DeepTauId.cc.

2112  {
2113  namespace dnn = dnn_inputs_2017_v2::HadronBlockInputs;
2114 
2115  tensorflow::Tensor& inputs = *hadronsTensor_.at(is_inner);
2116 
2117  const auto& get = [&](int var_index) -> float& { return inputs.tensor<float, 4>()(idx, 0, 0, var_index); };
2118 
2119  const bool valid_chH = cell_map.count(CellObjectType::PfCand_chargedHadron);
2120  const bool valid_nH = cell_map.count(CellObjectType::PfCand_neutralHadron);
2121 
2122  if (!cell_map.empty()) {
2123  get(dnn::rho) = getValueNorm(rho, 21.49f, 9.713f);
2124  get(dnn::tau_pt) = getValueLinear(tau.polarP4().pt(), 20.f, 1000.f, true);
2125  get(dnn::tau_eta) = getValueLinear(tau.polarP4().eta(), -2.3f, 2.3f, false);
2126  get(dnn::tau_inside_ecal_crack) = getValue(isInEcalCrack(tau.polarP4().eta()));
2127  }
2128  if (valid_chH) {
2129  size_t index_chH = cell_map.at(CellObjectType::PfCand_chargedHadron);
2130  const auto& chH_cand = dynamic_cast<const CandidateCastType&>(pfCands.at(index_chH));
2131 
2132  get(dnn::pfCand_chHad_valid) = valid_chH;
2133  get(dnn::pfCand_chHad_rel_pt) = getValueNorm(pfCands.at(index_chH).polarP4().pt() / tau.polarP4().pt(),
2134  is_inner ? 0.2564f : 0.0194f,
2135  is_inner ? 0.8607f : 0.1865f);
2136  get(dnn::pfCand_chHad_deta) = getValueLinear(pfCands.at(index_chH).polarP4().eta() - tau.polarP4().eta(),
2137  is_inner ? -0.1f : -0.5f,
2138  is_inner ? 0.1f : 0.5f,
2139  false);
2140  get(dnn::pfCand_chHad_dphi) = getValueLinear(dPhi(tau.polarP4(), pfCands.at(index_chH).polarP4()),
2141  is_inner ? -0.1f : -0.5f,
2142  is_inner ? 0.1f : 0.5f,
2143  false);
2144  get(dnn::pfCand_chHad_leadChargedHadrCand) =
2145  getValue(&chH_cand == dynamic_cast<const CandidateCastType*>(tau.leadChargedHadrCand().get()));
2146  get(dnn::pfCand_chHad_pvAssociationQuality) =
2147  getValueLinear<int>(candFunc::getPvAssocationQuality(chH_cand), 0, 7, true);
2148  get(dnn::pfCand_chHad_fromPV) = getValueLinear<int>(candFunc::getFromPV(chH_cand), 0, 3, true);
2149  get(dnn::pfCand_chHad_puppiWeight) = getValue(candFunc::getPuppiWeight(chH_cand));
2150  get(dnn::pfCand_chHad_puppiWeightNoLep) = getValue(candFunc::getPuppiWeightNoLep(chH_cand));
2151  get(dnn::pfCand_chHad_charge) = getValue(chH_cand.charge());
2152  get(dnn::pfCand_chHad_lostInnerHits) = getValue<int>(candFunc::getLostInnerHits(chH_cand, default_value));
2153  get(dnn::pfCand_chHad_numberOfPixelHits) =
2154  getValueLinear(candFunc::getNumberOfPixelHits(chH_cand, default_value), 0, 12, true);
2155  get(dnn::pfCand_chHad_vertex_dx) =
2156  getValueNorm(pfCands.at(index_chH).vertex().x() - pv.position().x(), 0.0005f, 1.735f);
2157  get(dnn::pfCand_chHad_vertex_dy) =
2158  getValueNorm(pfCands.at(index_chH).vertex().y() - pv.position().y(), -0.0008f, 1.752f);
2159  get(dnn::pfCand_chHad_vertex_dz) =
2160  getValueNorm(pfCands.at(index_chH).vertex().z() - pv.position().z(), -0.0201f, 8.333f);
2161  get(dnn::pfCand_chHad_vertex_dx_tauFL) = getValueNorm(
2162  pfCands.at(index_chH).vertex().x() - pv.position().x() - tau_funcs.getFlightLength(tau, tau_index).x(),
2163  -0.0014f,
2164  1.93f);
2165  get(dnn::pfCand_chHad_vertex_dy_tauFL) = getValueNorm(
2166  pfCands.at(index_chH).vertex().y() - pv.position().y() - tau_funcs.getFlightLength(tau, tau_index).y(),
2167  0.0022f,
2168  1.948f);
2169  get(dnn::pfCand_chHad_vertex_dz_tauFL) = getValueNorm(
2170  pfCands.at(index_chH).vertex().z() - pv.position().z() - tau_funcs.getFlightLength(tau, tau_index).z(),
2171  -0.0138f,
2172  8.622f);
2173 
2174  const bool hasTrackDetails = candFunc::getHasTrackDetails(chH_cand);
2175  if (hasTrackDetails) {
2176  get(dnn::pfCand_chHad_hasTrackDetails) = hasTrackDetails;
2177  get(dnn::pfCand_chHad_dxy) = getValueNorm(candFunc::getTauDxy(chH_cand, default_value), -0.012f, 2.386f);
2178  get(dnn::pfCand_chHad_dxy_sig) =
2179  getValueNorm(std::abs(candFunc::getTauDxy(chH_cand, default_value)) / chH_cand.dxyError(), 6.417f, 36.28f);
2180  get(dnn::pfCand_chHad_dz) = getValueNorm(candFunc::getTauDz(chH_cand, default_value), -0.0246f, 7.618f);
2181  get(dnn::pfCand_chHad_dz_sig) = getValueNorm(
2182  std::abs(candFunc::getTauDz(chH_cand, default_value)) / candFunc::getTauDzError(chH_cand, default_value),
2183  301.3f,
2184  491.1f);
2185  get(dnn::pfCand_chHad_track_chi2_ndof) =
2186  candFunc::getPseudoTrack(chH_cand).ndof() > 0
2187  ? getValueNorm(candFunc::getPseudoTrack(chH_cand).chi2() / candFunc::getPseudoTrack(chH_cand).ndof(),
2188  0.7876f,
2189  3.694f)
2190  : 0;
2191  get(dnn::pfCand_chHad_track_ndof) =
2192  candFunc::getPseudoTrack(chH_cand).ndof() > 0
2193  ? getValueNorm(candFunc::getPseudoTrack(chH_cand).ndof(), 13.92f, 6.581f)
2194  : 0;
2195  }
2196  float hcal_fraction = candFunc::getHCalFraction(chH_cand);
2197  get(dnn::pfCand_chHad_hcalFraction) = getValue(hcal_fraction);
2198  get(dnn::pfCand_chHad_rawCaloFraction) = getValueLinear(candFunc::getRawCaloFraction(chH_cand), 0.f, 2.6f, true);
2199  }
2200  if (valid_nH) {
2201  size_t index_nH = cell_map.at(CellObjectType::PfCand_neutralHadron);
2202  const auto& nH_cand = dynamic_cast<const CandidateCastType&>(pfCands.at(index_nH));
2203 
2204  get(dnn::pfCand_nHad_valid) = valid_nH;
2205  get(dnn::pfCand_nHad_rel_pt) = getValueNorm(pfCands.at(index_nH).polarP4().pt() / tau.polarP4().pt(),
2206  is_inner ? 0.3163f : 0.0502f,
2207  is_inner ? 0.2769f : 0.4266f);
2208  get(dnn::pfCand_nHad_deta) = getValueLinear(pfCands.at(index_nH).polarP4().eta() - tau.polarP4().eta(),
2209  is_inner ? -0.1f : -0.5f,
2210  is_inner ? 0.1f : 0.5f,
2211  false);
2212  get(dnn::pfCand_nHad_dphi) = getValueLinear(
2213  dPhi(tau.polarP4(), pfCands.at(index_nH).polarP4()), is_inner ? -0.1f : -0.5f, is_inner ? 0.1f : 0.5f, false);
2214  get(dnn::pfCand_nHad_puppiWeight) = getValue(candFunc::getPuppiWeight(nH_cand));
2215  get(dnn::pfCand_nHad_puppiWeightNoLep) = getValue(candFunc::getPuppiWeightNoLep(nH_cand));
2216  float hcal_fraction = candFunc::getHCalFraction(nH_cand);
2217  get(dnn::pfCand_nHad_hcalFraction) = getValue(hcal_fraction);
2218  }
2219  checkInputs(inputs, is_inner ? "hadron_inner_block" : "hadron_outer_block", dnn::NumberOfInputs);
2220  }

References funct::abs(), edm::View< T >::at(), checkInputs(), hltPixelTracks_cff::chi2, default_value, HLT_FULL_cff::dPhi, f, dqmMemoryStats::float, get, getValue(), getValueLinear(), getValueNorm(), hadronsTensor_, heavyIonCSV_trainingSettings::idx, PixelMapPlotter::inputs, isInEcalCrack(), ndof, MetAnalyzer::pv(), rho, ZElectronSkim_cff::rho, metsig::tau, runTauDisplay::tau_eta, and runTauDisplay::tau_pt.

◆ createInputsV1()

template<typename dnn , typename CandidateCastType , typename TauCastType >
tensorflow::Tensor DeepTauId::createInputsV1 ( const TauCastType &  tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const std::vector< pat::Electron > *  electrons,
const std::vector< pat::Muon > *  muons,
TauFunc  tau_funcs 
) const
inlineprivate

Definition at line 2223 of file DeepTauId.cc.

2228  {
2229  static constexpr bool check_all_set = false;
2230  static constexpr float default_value_for_set_check = -42;
2231 
2232  tensorflow::Tensor inputs(tensorflow::DT_FLOAT, {1, dnn_inputs_2017v1::NumberOfInputs});
2233  const auto& get = [&](int var_index) -> float& { return inputs.matrix<float>()(0, var_index); };
2234  auto leadChargedHadrCand = dynamic_cast<const CandidateCastType*>(tau.leadChargedHadrCand().get());
2235 
2236  if (check_all_set) {
2237  for (int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
2238  get(var_index) = default_value_for_set_check;
2239  }
2240  }
2241 
2242  get(dnn::pt) = tau.p4().pt();
2243  get(dnn::eta) = tau.p4().eta();
2244  get(dnn::mass) = tau.p4().mass();
2245  get(dnn::decayMode) = tau.decayMode();
2246  get(dnn::chargedIsoPtSum) = tau_funcs.getChargedIsoPtSum(tau, tau_ref);
2247  get(dnn::neutralIsoPtSum) = tau_funcs.getNeutralIsoPtSum(tau, tau_ref);
2248  get(dnn::neutralIsoPtSumWeight) = tau_funcs.getNeutralIsoPtSumWeight(tau, tau_ref);
2249  get(dnn::photonPtSumOutsideSignalCone) = tau_funcs.getPhotonPtSumOutsideSignalCone(tau, tau_ref);
2250  get(dnn::puCorrPtSum) = tau_funcs.getPuCorrPtSum(tau, tau_ref);
2251  get(dnn::dxy) = tau_funcs.getdxy(tau, tau_index);
2252  get(dnn::dxy_sig) = tau_funcs.getdxySig(tau, tau_index);
2253  get(dnn::dz) = leadChargedHadrCand ? candFunc::getTauDz(*leadChargedHadrCand, default_value) : default_value;
2254  get(dnn::ip3d) = tau_funcs.getip3d(tau, tau_index);
2255  get(dnn::ip3d_sig) = tau_funcs.getip3dSig(tau, tau_index);
2256  get(dnn::hasSecondaryVertex) = tau_funcs.getHasSecondaryVertex(tau, tau_index);
2257  get(dnn::flightLength_r) = tau_funcs.getFlightLength(tau, tau_index).R();
2258  get(dnn::flightLength_dEta) = dEta(tau_funcs.getFlightLength(tau, tau_index), tau.p4());
2259  get(dnn::flightLength_dPhi) = dPhi(tau_funcs.getFlightLength(tau, tau_index), tau.p4());
2260  get(dnn::flightLength_sig) = tau_funcs.getFlightLengthSig(tau, tau_index);
2261  get(dnn::leadChargedHadrCand_pt) = leadChargedHadrCand ? leadChargedHadrCand->p4().Pt() : default_value;
2262  get(dnn::leadChargedHadrCand_dEta) =
2263  leadChargedHadrCand ? dEta(leadChargedHadrCand->p4(), tau.p4()) : default_value;
2264  get(dnn::leadChargedHadrCand_dPhi) =
2265  leadChargedHadrCand ? dPhi(leadChargedHadrCand->p4(), tau.p4()) : default_value;
2266  get(dnn::leadChargedHadrCand_mass) = leadChargedHadrCand ? leadChargedHadrCand->p4().mass() : default_value;
2271  get(dnn::leadingTrackNormChi2) = tau_funcs.getLeadingTrackNormChi2(tau);
2272  get(dnn::e_ratio) = reco::tau::eratio(tau);
2273  get(dnn::gj_angle_diff) = calculateGottfriedJacksonAngleDifference(tau, tau_index, tau_funcs);
2274  get(dnn::n_photons) = reco::tau::n_photons_total(tau);
2275  get(dnn::emFraction) = tau_funcs.getEmFraction(tau);
2276  get(dnn::has_gsf_track) = leadChargedHadrCand && std::abs(leadChargedHadrCand->pdgId()) == 11;
2277  get(dnn::inside_ecal_crack) = isInEcalCrack(tau.p4().Eta());
2278  auto gsf_ele = findMatchedElectron(tau, electrons, 0.3);
2279  get(dnn::gsf_ele_matched) = gsf_ele != nullptr;
2280  get(dnn::gsf_ele_pt) = gsf_ele != nullptr ? gsf_ele->p4().Pt() : default_value;
2281  get(dnn::gsf_ele_dEta) = gsf_ele != nullptr ? dEta(gsf_ele->p4(), tau.p4()) : default_value;
2282  get(dnn::gsf_ele_dPhi) = gsf_ele != nullptr ? dPhi(gsf_ele->p4(), tau.p4()) : default_value;
2283  get(dnn::gsf_ele_mass) = gsf_ele != nullptr ? gsf_ele->p4().mass() : default_value;
2284  calculateElectronClusterVars(gsf_ele, get(dnn::gsf_ele_Ee), get(dnn::gsf_ele_Egamma));
2285  get(dnn::gsf_ele_Pin) = gsf_ele != nullptr ? gsf_ele->trackMomentumAtVtx().R() : default_value;
2286  get(dnn::gsf_ele_Pout) = gsf_ele != nullptr ? gsf_ele->trackMomentumOut().R() : default_value;
2287  get(dnn::gsf_ele_EtotOverPin) = get(dnn::gsf_ele_Pin) > 0
2288  ? (get(dnn::gsf_ele_Ee) + get(dnn::gsf_ele_Egamma)) / get(dnn::gsf_ele_Pin)
2289  : default_value;
2290  get(dnn::gsf_ele_Eecal) = gsf_ele != nullptr ? gsf_ele->ecalEnergy() : default_value;
2291  get(dnn::gsf_ele_dEta_SeedClusterTrackAtCalo) =
2292  gsf_ele != nullptr ? gsf_ele->deltaEtaSeedClusterTrackAtCalo() : default_value;
2293  get(dnn::gsf_ele_dPhi_SeedClusterTrackAtCalo) =
2294  gsf_ele != nullptr ? gsf_ele->deltaPhiSeedClusterTrackAtCalo() : default_value;
2295  get(dnn::gsf_ele_mvaIn_sigmaEtaEta) = gsf_ele != nullptr ? gsf_ele->mvaInput().sigmaEtaEta : default_value;
2296  get(dnn::gsf_ele_mvaIn_hadEnergy) = gsf_ele != nullptr ? gsf_ele->mvaInput().hadEnergy : default_value;
2297  get(dnn::gsf_ele_mvaIn_deltaEta) = gsf_ele != nullptr ? gsf_ele->mvaInput().deltaEta : default_value;
2298 
2299  get(dnn::gsf_ele_Chi2NormGSF) = default_value;
2300  get(dnn::gsf_ele_GSFNumHits) = default_value;
2301  get(dnn::gsf_ele_GSFTrackResol) = default_value;
2302  get(dnn::gsf_ele_GSFTracklnPt) = default_value;
2303  if (gsf_ele != nullptr && gsf_ele->gsfTrack().isNonnull()) {
2304  get(dnn::gsf_ele_Chi2NormGSF) = gsf_ele->gsfTrack()->normalizedChi2();
2305  get(dnn::gsf_ele_GSFNumHits) = gsf_ele->gsfTrack()->numberOfValidHits();
2306  if (gsf_ele->gsfTrack()->pt() > 0) {
2307  get(dnn::gsf_ele_GSFTrackResol) = gsf_ele->gsfTrack()->ptError() / gsf_ele->gsfTrack()->pt();
2308  get(dnn::gsf_ele_GSFTracklnPt) = std::log10(gsf_ele->gsfTrack()->pt());
2309  }
2310  }
2311 
2312  get(dnn::gsf_ele_Chi2NormKF) = default_value;
2313  get(dnn::gsf_ele_KFNumHits) = default_value;
2314  if (gsf_ele != nullptr && gsf_ele->closestCtfTrackRef().isNonnull()) {
2315  get(dnn::gsf_ele_Chi2NormKF) = gsf_ele->closestCtfTrackRef()->normalizedChi2();
2316  get(dnn::gsf_ele_KFNumHits) = gsf_ele->closestCtfTrackRef()->numberOfValidHits();
2317  }
2318  get(dnn::leadChargedCand_etaAtEcalEntrance) = tau_funcs.getEtaAtEcalEntrance(tau);
2319  get(dnn::leadChargedCand_pt) = leadChargedHadrCand->pt();
2320 
2321  get(dnn::leadChargedHadrCand_HoP) = default_value;
2322  get(dnn::leadChargedHadrCand_EoP) = default_value;
2323  if (leadChargedHadrCand->pt() > 0) {
2324  get(dnn::leadChargedHadrCand_HoP) = tau_funcs.getEcalEnergyLeadingChargedHadr(tau) / leadChargedHadrCand->pt();
2325  get(dnn::leadChargedHadrCand_EoP) = tau_funcs.getHcalEnergyLeadingChargedHadr(tau) / leadChargedHadrCand->pt();
2326  }
2327 
2328  MuonHitMatchV1 muon_hit_match;
2329  if (tau.leadPFChargedHadrCand().isNonnull() && tau.leadPFChargedHadrCand()->muonRef().isNonnull())
2330  muon_hit_match.addMatchedMuon(*tau.leadPFChargedHadrCand()->muonRef(), tau);
2331 
2332  auto matched_muons = muon_hit_match.findMatchedMuons(tau, muons, 0.3, 5);
2333  for (auto muon : matched_muons)
2334  muon_hit_match.addMatchedMuon(*muon, tau);
2335  muon_hit_match.fillTensor<dnn>(get, tau, default_value);
2336 
2337  LorentzVectorXYZ signalChargedHadrCands_sumIn, signalChargedHadrCands_sumOut;
2339  tau.signalChargedHadrCands(),
2340  signalChargedHadrCands_sumIn,
2341  signalChargedHadrCands_sumOut,
2342  get(dnn::signalChargedHadrCands_sum_innerSigCone_pt),
2343  get(dnn::signalChargedHadrCands_sum_innerSigCone_dEta),
2344  get(dnn::signalChargedHadrCands_sum_innerSigCone_dPhi),
2345  get(dnn::signalChargedHadrCands_sum_innerSigCone_mass),
2346  get(dnn::signalChargedHadrCands_sum_outerSigCone_pt),
2347  get(dnn::signalChargedHadrCands_sum_outerSigCone_dEta),
2348  get(dnn::signalChargedHadrCands_sum_outerSigCone_dPhi),
2349  get(dnn::signalChargedHadrCands_sum_outerSigCone_mass),
2350  get(dnn::signalChargedHadrCands_nTotal_innerSigCone),
2351  get(dnn::signalChargedHadrCands_nTotal_outerSigCone));
2352 
2353  LorentzVectorXYZ signalNeutrHadrCands_sumIn, signalNeutrHadrCands_sumOut;
2355  tau.signalNeutrHadrCands(),
2356  signalNeutrHadrCands_sumIn,
2357  signalNeutrHadrCands_sumOut,
2358  get(dnn::signalNeutrHadrCands_sum_innerSigCone_pt),
2359  get(dnn::signalNeutrHadrCands_sum_innerSigCone_dEta),
2360  get(dnn::signalNeutrHadrCands_sum_innerSigCone_dPhi),
2361  get(dnn::signalNeutrHadrCands_sum_innerSigCone_mass),
2362  get(dnn::signalNeutrHadrCands_sum_outerSigCone_pt),
2363  get(dnn::signalNeutrHadrCands_sum_outerSigCone_dEta),
2364  get(dnn::signalNeutrHadrCands_sum_outerSigCone_dPhi),
2365  get(dnn::signalNeutrHadrCands_sum_outerSigCone_mass),
2366  get(dnn::signalNeutrHadrCands_nTotal_innerSigCone),
2367  get(dnn::signalNeutrHadrCands_nTotal_outerSigCone));
2368 
2369  LorentzVectorXYZ signalGammaCands_sumIn, signalGammaCands_sumOut;
2371  tau.signalGammaCands(),
2372  signalGammaCands_sumIn,
2373  signalGammaCands_sumOut,
2374  get(dnn::signalGammaCands_sum_innerSigCone_pt),
2375  get(dnn::signalGammaCands_sum_innerSigCone_dEta),
2376  get(dnn::signalGammaCands_sum_innerSigCone_dPhi),
2377  get(dnn::signalGammaCands_sum_innerSigCone_mass),
2378  get(dnn::signalGammaCands_sum_outerSigCone_pt),
2379  get(dnn::signalGammaCands_sum_outerSigCone_dEta),
2380  get(dnn::signalGammaCands_sum_outerSigCone_dPhi),
2381  get(dnn::signalGammaCands_sum_outerSigCone_mass),
2382  get(dnn::signalGammaCands_nTotal_innerSigCone),
2383  get(dnn::signalGammaCands_nTotal_outerSigCone));
2384 
2385  LorentzVectorXYZ isolationChargedHadrCands_sum;
2387  tau.isolationChargedHadrCands(),
2388  isolationChargedHadrCands_sum,
2389  get(dnn::isolationChargedHadrCands_sum_pt),
2390  get(dnn::isolationChargedHadrCands_sum_dEta),
2391  get(dnn::isolationChargedHadrCands_sum_dPhi),
2392  get(dnn::isolationChargedHadrCands_sum_mass),
2393  get(dnn::isolationChargedHadrCands_nTotal));
2394 
2395  LorentzVectorXYZ isolationNeutrHadrCands_sum;
2397  tau.isolationNeutrHadrCands(),
2398  isolationNeutrHadrCands_sum,
2399  get(dnn::isolationNeutrHadrCands_sum_pt),
2400  get(dnn::isolationNeutrHadrCands_sum_dEta),
2401  get(dnn::isolationNeutrHadrCands_sum_dPhi),
2402  get(dnn::isolationNeutrHadrCands_sum_mass),
2403  get(dnn::isolationNeutrHadrCands_nTotal));
2404 
2405  LorentzVectorXYZ isolationGammaCands_sum;
2407  tau.isolationGammaCands(),
2408  isolationGammaCands_sum,
2409  get(dnn::isolationGammaCands_sum_pt),
2410  get(dnn::isolationGammaCands_sum_dEta),
2411  get(dnn::isolationGammaCands_sum_dPhi),
2412  get(dnn::isolationGammaCands_sum_mass),
2413  get(dnn::isolationGammaCands_nTotal));
2414 
2415  get(dnn::tau_visMass_innerSigCone) = (signalGammaCands_sumIn + signalChargedHadrCands_sumIn).mass();
2416 
2417  if (check_all_set) {
2418  for (int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
2419  if (get(var_index) == default_value_for_set_check)
2420  throw cms::Exception("DeepTauId: variable with index = ") << var_index << " is not set.";
2421  }
2422  }
2423 
2424  return inputs;
2425  }

References funct::abs(), calculateElectronClusterVars(), calculateGottfriedJacksonAngleDifference(), taus_cff::decayMode, default_value, HLT_FULL_cff::dEta, HLT_FULL_cff::dPhi, PVValHelper::dxy, PVValHelper::dz, pwdgSkimBPark_cfi::electrons, reco::tau::eratio(), PVValHelper::eta, findMatchedElectron(), get, PixelMapPlotter::inputs, electrons_cff::ip3d, isInEcalCrack(), EgHLTOffHistBins_cfi::mass, PDWG_BPHSkim_cff::muons, reco::tau::n_photons_total(), processIsolationPFComponents(), processSignalPFComponents(), DiDispStaMuonMonitor_cfi::pt, reco::tau::pt_weighted_deta_strip(), reco::tau::pt_weighted_dphi_strip(), reco::tau::pt_weighted_dr_iso(), reco::tau::pt_weighted_dr_signal(), and metsig::tau.

◆ createMuonBlockInputs()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::createMuonBlockInputs ( unsigned  idx,
const TauCastType &  tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const reco::Vertex pv,
double  rho,
const std::vector< pat::Muon > *  muons,
const edm::View< reco::Candidate > &  pfCands,
const Cell cell_map,
TauFunc  tau_funcs,
bool  is_inner 
)
inlineprivate

Definition at line 1950 of file DeepTauId.cc.

1960  {
1961  namespace dnn = dnn_inputs_2017_v2::MuonBlockInputs;
1962 
1963  tensorflow::Tensor& inputs = *muonTensor_.at(is_inner);
1964 
1965  const auto& get = [&](int var_index) -> float& { return inputs.tensor<float, 4>()(idx, 0, 0, var_index); };
1966 
1967  const bool valid_index_pf_muon = cell_map.count(CellObjectType::PfCand_muon);
1968  const bool valid_index_muon = cell_map.count(CellObjectType::Muon);
1969 
1970  if (!cell_map.empty()) {
1971  get(dnn::rho) = getValueNorm(rho, 21.49f, 9.713f);
1972  get(dnn::tau_pt) = getValueLinear(tau.polarP4().pt(), 20.f, 1000.f, true);
1973  get(dnn::tau_eta) = getValueLinear(tau.polarP4().eta(), -2.3f, 2.3f, false);
1974  get(dnn::tau_inside_ecal_crack) = getValue(isInEcalCrack(tau.polarP4().eta()));
1975  }
1976  if (valid_index_pf_muon) {
1977  size_t index_pf_muon = cell_map.at(CellObjectType::PfCand_muon);
1978  const auto& muon_cand = dynamic_cast<const CandidateCastType&>(pfCands.at(index_pf_muon));
1979 
1980  get(dnn::pfCand_muon_valid) = valid_index_pf_muon;
1981  get(dnn::pfCand_muon_rel_pt) = getValueNorm(pfCands.at(index_pf_muon).polarP4().pt() / tau.polarP4().pt(),
1982  is_inner ? 0.9509f : 0.0861f,
1983  is_inner ? 0.4294f : 0.4065f);
1984  get(dnn::pfCand_muon_deta) = getValueLinear(pfCands.at(index_pf_muon).polarP4().eta() - tau.polarP4().eta(),
1985  is_inner ? -0.1f : -0.5f,
1986  is_inner ? 0.1f : 0.5f,
1987  false);
1988  get(dnn::pfCand_muon_dphi) = getValueLinear(dPhi(tau.polarP4(), pfCands.at(index_pf_muon).polarP4()),
1989  is_inner ? -0.1f : -0.5f,
1990  is_inner ? 0.1f : 0.5f,
1991  false);
1992  get(dnn::pfCand_muon_pvAssociationQuality) =
1993  getValueLinear<int>(candFunc::getPvAssocationQuality(muon_cand), 0, 7, true);
1994  get(dnn::pfCand_muon_fromPV) = getValueLinear<int>(candFunc::getFromPV(muon_cand), 0, 3, true);
1995  get(dnn::pfCand_muon_puppiWeight) = getValue(candFunc::getPuppiWeight(muon_cand));
1996  get(dnn::pfCand_muon_charge) = getValue(muon_cand.charge());
1997  get(dnn::pfCand_muon_lostInnerHits) = getValue<int>(candFunc::getLostInnerHits(muon_cand, default_value));
1998  get(dnn::pfCand_muon_numberOfPixelHits) =
1999  getValueLinear(candFunc::getNumberOfPixelHits(muon_cand, default_value), 0, 11, true);
2000  get(dnn::pfCand_muon_vertex_dx) =
2001  getValueNorm(pfCands.at(index_pf_muon).vertex().x() - pv.position().x(), -0.0007f, 0.6869f);
2002  get(dnn::pfCand_muon_vertex_dy) =
2003  getValueNorm(pfCands.at(index_pf_muon).vertex().y() - pv.position().y(), 0.0001f, 0.6784f);
2004  get(dnn::pfCand_muon_vertex_dz) =
2005  getValueNorm(pfCands.at(index_pf_muon).vertex().z() - pv.position().z(), -0.0117f, 4.097f);
2006  get(dnn::pfCand_muon_vertex_dx_tauFL) = getValueNorm(
2007  pfCands.at(index_pf_muon).vertex().x() - pv.position().x() - tau_funcs.getFlightLength(tau, tau_index).x(),
2008  -0.0001f,
2009  0.8642f);
2010  get(dnn::pfCand_muon_vertex_dy_tauFL) = getValueNorm(
2011  pfCands.at(index_pf_muon).vertex().y() - pv.position().y() - tau_funcs.getFlightLength(tau, tau_index).y(),
2012  0.0004f,
2013  0.8561f);
2014  get(dnn::pfCand_muon_vertex_dz_tauFL) = getValueNorm(
2015  pfCands.at(index_pf_muon).vertex().z() - pv.position().z() - tau_funcs.getFlightLength(tau, tau_index).z(),
2016  -0.0118f,
2017  4.405f);
2018 
2019  const bool hasTrackDetails = candFunc::getHasTrackDetails(muon_cand);
2020  if (hasTrackDetails) {
2021  get(dnn::pfCand_muon_hasTrackDetails) = hasTrackDetails;
2022  get(dnn::pfCand_muon_dxy) = getValueNorm(candFunc::getTauDxy(muon_cand, default_value), -0.0045f, 0.9655f);
2023  get(dnn::pfCand_muon_dxy_sig) = getValueNorm(
2024  std::abs(candFunc::getTauDxy(muon_cand, default_value)) / muon_cand.dxyError(), 4.575f, 42.36f);
2025  get(dnn::pfCand_muon_dz) = getValueNorm(candFunc::getTauDz(muon_cand, default_value), -0.0117f, 4.097f);
2026  get(dnn::pfCand_muon_dz_sig) = getValueNorm(
2027  std::abs(candFunc::getTauDz(muon_cand, default_value)) / candFunc::getTauDzError(muon_cand, default_value),
2028  80.37f,
2029  343.3f);
2030  get(dnn::pfCand_muon_track_chi2_ndof) = getValueNorm(
2031  candFunc::getPseudoTrack(muon_cand).chi2() / candFunc::getPseudoTrack(muon_cand).ndof(), 0.69f, 1.711f);
2032  get(dnn::pfCand_muon_track_ndof) = getValueNorm(candFunc::getPseudoTrack(muon_cand).ndof(), 17.5f, 5.11f);
2033  }
2034  }
2035  if (valid_index_muon) {
2036  size_t index_muon = cell_map.at(CellObjectType::Muon);
2037 
2038  get(dnn::muon_valid) = valid_index_muon;
2039  get(dnn::muon_rel_pt) = getValueNorm(muons->at(index_muon).polarP4().pt() / tau.polarP4().pt(),
2040  is_inner ? 0.7966f : 0.2678f,
2041  is_inner ? 3.402f : 3.592f);
2042  get(dnn::muon_deta) = getValueLinear(muons->at(index_muon).polarP4().eta() - tau.polarP4().eta(),
2043  is_inner ? -0.1f : -0.5f,
2044  is_inner ? 0.1f : 0.5f,
2045  false);
2046  get(dnn::muon_dphi) = getValueLinear(dPhi(tau.polarP4(), muons->at(index_muon).polarP4()),
2047  is_inner ? -0.1f : -0.5f,
2048  is_inner ? 0.1f : 0.5f,
2049  false);
2050  get(dnn::muon_dxy) = getValueNorm(muons->at(index_muon).dB(pat::Muon::PV2D), 0.0019f, 1.039f);
2051  get(dnn::muon_dxy_sig) =
2052  getValueNorm(std::abs(muons->at(index_muon).dB(pat::Muon::PV2D)) / muons->at(index_muon).edB(pat::Muon::PV2D),
2053  8.98f,
2054  71.17f);
2055 
2056  const bool normalizedChi2_valid =
2057  muons->at(index_muon).globalTrack().isNonnull() && muons->at(index_muon).normChi2() >= 0;
2058  if (normalizedChi2_valid) {
2059  get(dnn::muon_normalizedChi2_valid) = normalizedChi2_valid;
2060  get(dnn::muon_normalizedChi2) = getValueNorm(muons->at(index_muon).normChi2(), 21.52f, 265.8f);
2061  if (muons->at(index_muon).innerTrack().isNonnull())
2062  get(dnn::muon_numberOfValidHits) = getValueNorm(muons->at(index_muon).numberOfValidHits(), 21.84f, 10.59f);
2063  }
2064  get(dnn::muon_segmentCompatibility) = getValue(muons->at(index_muon).segmentCompatibility());
2065  get(dnn::muon_caloCompatibility) = getValue(muons->at(index_muon).caloCompatibility());
2066 
2067  const bool pfEcalEnergy_valid = muons->at(index_muon).pfEcalEnergy() >= 0;
2068  if (pfEcalEnergy_valid) {
2069  get(dnn::muon_pfEcalEnergy_valid) = pfEcalEnergy_valid;
2070  get(dnn::muon_rel_pfEcalEnergy) =
2071  getValueNorm(muons->at(index_muon).pfEcalEnergy() / muons->at(index_muon).polarP4().pt(), 0.2273f, 0.4865f);
2072  }
2073 
2074  MuonHitMatchV2 hit_match(muons->at(index_muon));
2075  static const std::map<int, std::pair<int, int>> muonMatchHitVars = {
2076  {MuonSubdetId::DT, {dnn::muon_n_matches_DT_1, dnn::muon_n_hits_DT_1}},
2077  {MuonSubdetId::CSC, {dnn::muon_n_matches_CSC_1, dnn::muon_n_hits_CSC_1}},
2078  {MuonSubdetId::RPC, {dnn::muon_n_matches_RPC_1, dnn::muon_n_hits_RPC_1}}};
2079 
2080  static const std::map<int, std::vector<float>> muonMatchVarLimits = {
2081  {MuonSubdetId::DT, {2, 2, 2, 2}}, {MuonSubdetId::CSC, {6, 2, 2, 2}}, {MuonSubdetId::RPC, {7, 6, 4, 4}}};
2082 
2083  static const std::map<int, std::vector<float>> muonHitVarLimits = {{MuonSubdetId::DT, {12, 12, 12, 8}},
2084  {MuonSubdetId::CSC, {24, 12, 12, 12}},
2085  {MuonSubdetId::RPC, {4, 4, 2, 2}}};
2086 
2087  for (int subdet : hit_match.MuonHitMatchV2::consideredSubdets()) {
2088  const auto& matchHitVar = muonMatchHitVars.at(subdet);
2089  const auto& matchLimits = muonMatchVarLimits.at(subdet);
2090  const auto& hitLimits = muonHitVarLimits.at(subdet);
2091  for (int station = MuonHitMatchV2::first_station_id; station <= MuonHitMatchV2::last_station_id; ++station) {
2092  const unsigned n_matches = hit_match.nMatches(subdet, station);
2093  const unsigned n_hits = hit_match.nHits(subdet, station);
2094  get(matchHitVar.first + station - 1) = getValueLinear(n_matches, 0, matchLimits.at(station - 1), true);
2095  get(matchHitVar.second + station - 1) = getValueLinear(n_hits, 0, hitLimits.at(station - 1), true);
2096  }
2097  }
2098  }
2099  checkInputs(inputs, is_inner ? "muon_inner_block" : "muon_outer_block", dnn::NumberOfInputs);
2100  }

References funct::abs(), edm::View< T >::at(), checkInputs(), hltPixelTracks_cff::chi2, MuonSubdetId::CSC, default_value, HLT_FULL_cff::dPhi, MuonSubdetId::DT, f, dqmMemoryStats::float, get, getValue(), getValueLinear(), getValueNorm(), heavyIonCSV_trainingSettings::idx, PixelMapPlotter::inputs, isInEcalCrack(), dumpRecoGeometry_cfg::Muon, PDWG_BPHSkim_cff::muons, muonTensor_, ndof, MetAnalyzer::pv(), pat::Muon::PV2D, rho, ZElectronSkim_cff::rho, MuonSubdetId::RPC, relativeConstraints::station, metsig::tau, runTauDisplay::tau_eta, and runTauDisplay::tau_pt.

◆ createTauBlockInputs()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::createTauBlockInputs ( const TauCastType &  tau,
const size_t &  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const reco::Vertex pv,
double  rho,
TauFunc  tau_funcs 
)
inlineprivate

Definition at line 1603 of file DeepTauId.cc.

1608  {
1609  namespace dnn = dnn_inputs_2017_v2::TauBlockInputs;
1610 
1611  tensorflow::Tensor& inputs = *tauBlockTensor_;
1612  inputs.flat<float>().setZero();
1613 
1614  const auto& get = [&](int var_index) -> float& { return inputs.matrix<float>()(0, var_index); };
1615 
1616  auto leadChargedHadrCand = dynamic_cast<const CandidateCastType*>(tau.leadChargedHadrCand().get());
1617 
1618  get(dnn::rho) = getValueNorm(rho, 21.49f, 9.713f);
1619  get(dnn::tau_pt) = getValueLinear(tau.polarP4().pt(), 20.f, 1000.f, true);
1620  get(dnn::tau_eta) = getValueLinear(tau.polarP4().eta(), -2.3f, 2.3f, false);
1621  get(dnn::tau_phi) = getValueLinear(tau.polarP4().phi(), -pi, pi, false);
1622  get(dnn::tau_mass) = getValueNorm(tau.polarP4().mass(), 0.6669f, 0.6553f);
1623  get(dnn::tau_E_over_pt) = getValueLinear(tau.p4().energy() / tau.p4().pt(), 1.f, 5.2f, true);
1624  get(dnn::tau_charge) = getValue(tau.charge());
1625  get(dnn::tau_n_charged_prongs) = getValueLinear(tau.decayMode() / 5 + 1, 1, 3, true);
1626  get(dnn::tau_n_neutral_prongs) = getValueLinear(tau.decayMode() % 5, 0, 2, true);
1627  get(dnn::chargedIsoPtSum) = getValueNorm(tau_funcs.getChargedIsoPtSum(tau, tau_ref), 47.78f, 123.5f);
1628  get(dnn::chargedIsoPtSumdR03_over_dR05) =
1629  getValue(tau_funcs.getChargedIsoPtSumdR03(tau, tau_ref) / tau_funcs.getChargedIsoPtSum(tau, tau_ref));
1630  get(dnn::footprintCorrection) = getValueNorm(tau_funcs.getFootprintCorrectiondR03(tau, tau_ref), 9.029f, 26.42f);
1631  get(dnn::neutralIsoPtSum) = getValueNorm(tau_funcs.getNeutralIsoPtSum(tau, tau_ref), 57.59f, 155.3f);
1632  get(dnn::neutralIsoPtSumWeight_over_neutralIsoPtSum) =
1633  getValue(tau_funcs.getNeutralIsoPtSumWeight(tau, tau_ref) / tau_funcs.getNeutralIsoPtSum(tau, tau_ref));
1634  get(dnn::neutralIsoPtSumWeightdR03_over_neutralIsoPtSum) =
1635  getValue(tau_funcs.getNeutralIsoPtSumdR03Weight(tau, tau_ref) / tau_funcs.getNeutralIsoPtSum(tau, tau_ref));
1636  get(dnn::neutralIsoPtSumdR03_over_dR05) =
1637  getValue(tau_funcs.getNeutralIsoPtSumdR03(tau, tau_ref) / tau_funcs.getNeutralIsoPtSum(tau, tau_ref));
1638  get(dnn::photonPtSumOutsideSignalCone) =
1639  getValueNorm(tau_funcs.getPhotonPtSumOutsideSignalCone(tau, tau_ref), 1.731f, 6.846f);
1640  get(dnn::puCorrPtSum) = getValueNorm(tau_funcs.getPuCorrPtSum(tau, tau_ref), 22.38f, 16.34f);
1641  // The global PCA coordinates were used as inputs during the NN training, but it was decided to disable
1642  // them for the inference, because modeling of dxy_PCA in MC poorly describes the data, and x and y coordinates
1643  // in data results outside of the expected 5 std. dev. input validity range. On the other hand,
1644  // these coordinates are strongly era-dependent. Kept as comment to document what NN expects.
1645  if (!disable_dxy_pca_) {
1646  auto const pca = tau_funcs.getdxyPCA(tau, tau_index);
1647  get(dnn::tau_dxy_pca_x) = getValueNorm(pca.x(), -0.0241f, 0.0074f);
1648  get(dnn::tau_dxy_pca_y) = getValueNorm(pca.y(), 0.0675f, 0.0128f);
1649  get(dnn::tau_dxy_pca_z) = getValueNorm(pca.z(), 0.7973f, 3.456f);
1650  } else {
1651  get(dnn::tau_dxy_pca_x) = 0;
1652  get(dnn::tau_dxy_pca_y) = 0;
1653  get(dnn::tau_dxy_pca_z) = 0;
1654  }
1655  const bool tau_dxy_valid =
1656  isAbove(tau_funcs.getdxy(tau, tau_index), -10) && isAbove(tau_funcs.getdxyError(tau, tau_index), 0);
1657  if (tau_dxy_valid) {
1658  get(dnn::tau_dxy_valid) = tau_dxy_valid;
1659  get(dnn::tau_dxy) = getValueNorm(tau_funcs.getdxy(tau, tau_index), 0.0018f, 0.0085f);
1660  get(dnn::tau_dxy_sig) = getValueNorm(
1661  std::abs(tau_funcs.getdxy(tau, tau_index)) / tau_funcs.getdxyError(tau, tau_index), 2.26f, 4.191f);
1662  }
1663  const bool tau_ip3d_valid =
1664  isAbove(tau_funcs.getip3d(tau, tau_index), -10) && isAbove(tau_funcs.getip3dError(tau, tau_index), 0);
1665  if (tau_ip3d_valid) {
1666  get(dnn::tau_ip3d_valid) = tau_ip3d_valid;
1667  get(dnn::tau_ip3d) = getValueNorm(tau_funcs.getip3d(tau, tau_index), 0.0026f, 0.0114f);
1668  get(dnn::tau_ip3d_sig) = getValueNorm(
1669  std::abs(tau_funcs.getip3d(tau, tau_index)) / tau_funcs.getip3dError(tau, tau_index), 2.928f, 4.466f);
1670  }
1671  if (leadChargedHadrCand) {
1672  get(dnn::tau_dz) = getValueNorm(candFunc::getTauDz(*leadChargedHadrCand, default_value), 0.f, 0.0190f);
1673  get(dnn::tau_dz_sig_valid) = candFunc::getTauDZSigValid(*leadChargedHadrCand);
1674  const double dzError = candFunc::getTauDzError(*leadChargedHadrCand, default_value);
1675  get(dnn::tau_dz_sig) =
1676  getValueNorm(std::abs(candFunc::getTauDz(*leadChargedHadrCand, default_value)) / dzError, 4.717f, 11.78f);
1677  }
1678  get(dnn::tau_flightLength_x) = getValueNorm(tau_funcs.getFlightLength(tau, tau_index).x(), -0.0003f, 0.7362f);
1679  get(dnn::tau_flightLength_y) = getValueNorm(tau_funcs.getFlightLength(tau, tau_index).y(), -0.0009f, 0.7354f);
1680  get(dnn::tau_flightLength_z) = getValueNorm(tau_funcs.getFlightLength(tau, tau_index).z(), -0.0022f, 1.993f);
1681  get(dnn::tau_flightLength_sig) = 0.55756444; //This value is set due to a bug in the training
1682  get(dnn::tau_pt_weighted_deta_strip) =
1683  getValueLinear(reco::tau::pt_weighted_deta_strip(tau, tau.decayMode()), 0, 1, true);
1684 
1685  get(dnn::tau_pt_weighted_dphi_strip) =
1686  getValueLinear(reco::tau::pt_weighted_dphi_strip(tau, tau.decayMode()), 0, 1, true);
1687  get(dnn::tau_pt_weighted_dr_signal) =
1688  getValueNorm(reco::tau::pt_weighted_dr_signal(tau, tau.decayMode()), 0.0052f, 0.01433f);
1689  get(dnn::tau_pt_weighted_dr_iso) = getValueLinear(reco::tau::pt_weighted_dr_iso(tau, tau.decayMode()), 0, 1, true);
1690  get(dnn::tau_leadingTrackNormChi2) = getValueNorm(tau_funcs.getLeadingTrackNormChi2(tau), 1.538f, 4.401f);
1691  const auto eratio = reco::tau::eratio(tau);
1692  const bool tau_e_ratio_valid = std::isnormal(eratio) && eratio > 0.f;
1693  get(dnn::tau_e_ratio_valid) = tau_e_ratio_valid;
1694  get(dnn::tau_e_ratio) = tau_e_ratio_valid ? getValueLinear(eratio, 0, 1, true) : 0.f;
1695  const double gj_angle_diff = calculateGottfriedJacksonAngleDifference(tau, tau_index, tau_funcs);
1696  const bool tau_gj_angle_diff_valid = (std::isnormal(gj_angle_diff) || gj_angle_diff == 0) && gj_angle_diff >= 0;
1697  get(dnn::tau_gj_angle_diff_valid) = tau_gj_angle_diff_valid;
1698  get(dnn::tau_gj_angle_diff) = tau_gj_angle_diff_valid ? getValueLinear(gj_angle_diff, 0, pi, true) : 0;
1699  get(dnn::tau_n_photons) = getValueNorm(reco::tau::n_photons_total(tau), 2.95f, 3.927f);
1700  get(dnn::tau_emFraction) = getValueLinear(tau_funcs.getEmFraction(tau), -1, 1, false);
1701 
1702  get(dnn::tau_inside_ecal_crack) = getValue(isInEcalCrack(tau.p4().eta()));
1703  get(dnn::leadChargedCand_etaAtEcalEntrance_minus_tau_eta) =
1704  getValueNorm(tau_funcs.getEtaAtEcalEntrance(tau) - tau.p4().eta(), 0.0042f, 0.0323f);
1705  checkInputs(inputs, "tau_block", dnn::NumberOfInputs);
1706  }

References funct::abs(), calculateGottfriedJacksonAngleDifference(), checkInputs(), default_value, disable_dxy_pca_, reco::tau::eratio(), f, get, getValue(), getValueLinear(), getValueNorm(), PixelMapPlotter::inputs, isAbove(), isInEcalCrack(), reco::tau::n_photons_total(), pi, reco::tau::pt_weighted_deta_strip(), reco::tau::pt_weighted_dphi_strip(), reco::tau::pt_weighted_dr_iso(), reco::tau::pt_weighted_dr_signal(), rho, ZElectronSkim_cff::rho, metsig::tau, runTauDisplay::tau_eta, runTauDisplay::tau_mass, runTauDisplay::tau_phi, runTauDisplay::tau_pt, and tauBlockTensor_.

◆ fillDescriptions()

static void DeepTauId::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 1112 of file DeepTauId.cc.

1112  {
1114  desc.add<edm::InputTag>("electrons", edm::InputTag("slimmedElectrons"));
1115  desc.add<edm::InputTag>("muons", edm::InputTag("slimmedMuons"));
1116  desc.add<edm::InputTag>("taus", edm::InputTag("slimmedTaus"));
1117  desc.add<edm::InputTag>("pfcands", edm::InputTag("packedPFCandidates"));
1118  desc.add<edm::InputTag>("vertices", edm::InputTag("offlineSlimmedPrimaryVertices"));
1119  desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoAll"));
1120  desc.add<std::vector<std::string>>("graph_file",
1121  {"RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6.pb"});
1122  desc.add<bool>("mem_mapped", false);
1123  desc.add<unsigned>("version", 2);
1124  desc.add<int>("debug_level", 0);
1125  desc.add<bool>("disable_dxy_pca", false);
1126  desc.add<bool>("is_online", false);
1127 
1128  desc.add<std::vector<std::string>>("VSeWP");
1129  desc.add<std::vector<std::string>>("VSmuWP");
1130  desc.add<std::vector<std::string>>("VSjetWP");
1131 
1132  desc.addUntracked<edm::InputTag>("basicTauDiscriminators", edm::InputTag("basicTauDiscriminators"));
1133  desc.addUntracked<edm::InputTag>("basicTauDiscriminatorsdR03", edm::InputTag("basicTauDiscriminatorsdR03"));
1134  desc.add<edm::InputTag>("pfTauTransverseImpactParameters", edm::InputTag("hpsPFTauTransverseImpactParameters"));
1135 
1136  {
1137  edm::ParameterSetDescription pset_Prediscriminants;
1138  pset_Prediscriminants.add<std::string>("BooleanOperator", "and");
1139  {
1141  psd1.add<double>("cut");
1142  psd1.add<edm::InputTag>("Producer");
1143  pset_Prediscriminants.addOptional<edm::ParameterSetDescription>("decayMode", psd1);
1144  }
1145  desc.add<edm::ParameterSetDescription>("Prediscriminants", pset_Prediscriminants);
1146  }
1147 
1148  descriptions.add("DeepTau", desc);
1149  }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillGrids()

template<typename Collection , typename TauCastType >
void DeepTauId::fillGrids ( const TauCastType &  tau,
const Collection &  objects,
CellGrid &  inner_grid,
CellGrid &  outer_grid 
)
inlineprivate

Definition at line 1466 of file DeepTauId.cc.

1466  {
1467  static constexpr double outer_dR2 = 0.25; //0.5^2
1468  const double inner_radius = getInnerSignalConeRadius(tau.polarP4().pt());
1469  const double inner_dR2 = std::pow(inner_radius, 2);
1470 
1471  const auto addObject = [&](size_t n, double deta, double dphi, CellGrid& grid) {
1472  const auto& obj = objects.at(n);
1473  const CellObjectType obj_type = GetCellObjectType(obj);
1474  if (obj_type == CellObjectType::Other)
1475  return;
1476  CellIndex cell_index;
1477  if (grid.tryGetCellIndex(deta, dphi, cell_index)) {
1478  Cell& cell = grid[cell_index];
1479  auto iter = cell.find(obj_type);
1480  if (iter != cell.end()) {
1481  const auto& prev_obj = objects.at(iter->second);
1482  if (obj.polarP4().pt() > prev_obj.polarP4().pt())
1483  iter->second = n;
1484  } else {
1485  cell[obj_type] = n;
1486  }
1487  }
1488  };
1489 
1490  for (size_t n = 0; n < objects.size(); ++n) {
1491  const auto& obj = objects.at(n);
1492  const double deta = obj.polarP4().eta() - tau.polarP4().eta();
1493  const double dphi = reco::deltaPhi(obj.polarP4().phi(), tau.polarP4().phi());
1494  const double dR2 = std::pow(deta, 2) + std::pow(dphi, 2);
1495  if (dR2 < inner_dR2)
1496  addObject(n, deta, dphi, inner_grid);
1497  if (dR2 < outer_dR2)
1498  addObject(n, deta, dphi, outer_grid);
1499  }
1500  }

References reco::deltaPhi(), getInnerSignalConeRadius(), getRunAppsInfo::grid, dqmiodumpmetadata::n, getGTfromDQMFile::obj, funct::pow(), and metsig::tau.

Referenced by getPredictionsV2().

◆ findMatchedElectron()

template<typename TauCastType >
static const pat::Electron* DeepTauId::findMatchedElectron ( const TauCastType &  tau,
const std::vector< pat::Electron > *  electrons,
double  deltaR 
)
inlinestaticprivate

Definition at line 2558 of file DeepTauId.cc.

2560  {
2561  const double dR2 = deltaR * deltaR;
2562  const pat::Electron* matched_ele = nullptr;
2563  for (const auto& ele : *electrons) {
2564  if (reco::deltaR2(tau.p4(), ele.p4()) < dR2 && (!matched_ele || matched_ele->pt() < ele.pt())) {
2565  matched_ele = &ele;
2566  }
2567  }
2568  return matched_ele;
2569  }

References PbPb_ZMuSkimMuonDPG_cff::deltaR, reco::deltaR2(), pwdgSkimBPark_cfi::electrons, reco::LeafCandidate::pt(), and metsig::tau.

Referenced by createInputsV1().

◆ getInnerSignalConeRadius()

static double DeepTauId::getInnerSignalConeRadius ( double  pt)
inlinestaticprivate

Definition at line 2513 of file DeepTauId.cc.

2513  {
2514  static constexpr double min_pt = 30., min_radius = 0.05, cone_opening_coef = 3.;
2515  // This is equivalent of the original formula (std::max(std::min(0.1, 3.0/pt), 0.05)
2516  return std::max(cone_opening_coef / std::max(pt, min_pt), min_radius);
2517  }

References SiStripPI::max, cosmictrackSelector_cfi::min_pt, and DiDispStaMuonMonitor_cfi::pt.

Referenced by fillGrids(), and processSignalPFComponents().

◆ GetOutputs()

static const OutputCollection& DeepTauId::GetOutputs ( )
inlinestatic

Definition at line 1070 of file DeepTauId.cc.

1070  {
1071  static constexpr size_t e_index = 0, mu_index = 1, tau_index = 2, jet_index = 3;
1072  static const OutputCollection outputs_ = {
1073  {"VSe", Output({tau_index}, {e_index, tau_index})},
1074  {"VSmu", Output({tau_index}, {mu_index, tau_index})},
1075  {"VSjet", Output({tau_index}, {jet_index, tau_index})},
1076  };
1077  return outputs_;
1078  }

References GetRecoTauVFromDQM_MC_cff::Output, and deep_tau::DeepTauBase::outputs_.

◆ getPartialPredictions()

tensorflow::Tensor DeepTauId::getPartialPredictions ( bool  is_inner)
inlineprivate

Definition at line 1502 of file DeepTauId.cc.

1502  {
1503  std::vector<tensorflow::Tensor> pred_vector;
1504  if (is_inner) {
1505  tensorflow::run(&(cache_->getSession("inner")),
1506  {
1507  {"input_inner_egamma", *eGammaTensor_.at(is_inner)},
1508  {"input_inner_muon", *muonTensor_.at(is_inner)},
1509  {"input_inner_hadrons", *hadronsTensor_.at(is_inner)},
1510  },
1511  {"inner_all_dropout_4/Identity"},
1512  &pred_vector);
1513  } else {
1514  tensorflow::run(&(cache_->getSession("outer")),
1515  {
1516  {"input_outer_egamma", *eGammaTensor_.at(is_inner)},
1517  {"input_outer_muon", *muonTensor_.at(is_inner)},
1518  {"input_outer_hadrons", *hadronsTensor_.at(is_inner)},
1519  },
1520  {"outer_all_dropout_4/Identity"},
1521  &pred_vector);
1522  }
1523  return pred_vector.at(0);
1524  }

References deep_tau::DeepTauBase::cache_, eGammaTensor_, deep_tau::DeepTauCache::getSession(), hadronsTensor_, muonTensor_, and tensorflow::run().

Referenced by createConvFeatures(), and DeepTauId().

◆ getPredictions()

tensorflow::Tensor DeepTauId::getPredictions ( edm::Event event,
edm::Handle< TauCollection taus 
)
inlineoverrideprivatevirtual

Implements deep_tau::DeepTauBase.

Definition at line 1285 of file DeepTauId.cc.

1285  {
1286  // Empty dummy vectors
1287  const std::vector<pat::Electron> electron_collection_default;
1288  const std::vector<pat::Muon> muon_collection_default;
1289  const reco::TauDiscriminatorContainer basicTauDiscriminators_default;
1290  const reco::TauDiscriminatorContainer basicTauDiscriminatorsdR03_default;
1292  pfTauTransverseImpactParameters_default;
1293 
1294  const std::vector<pat::Electron>* electron_collection;
1295  const std::vector<pat::Muon>* muon_collection;
1296  const reco::TauDiscriminatorContainer* basicTauDiscriminators;
1297  const reco::TauDiscriminatorContainer* basicTauDiscriminatorsdR03;
1299  pfTauTransverseImpactParameters;
1300 
1301  if (!is_online_) {
1302  electron_collection = &event.get(electrons_token_);
1303  muon_collection = &event.get(muons_token_);
1304  pfTauTransverseImpactParameters = &pfTauTransverseImpactParameters_default;
1305  basicTauDiscriminators = &basicTauDiscriminators_default;
1306  basicTauDiscriminatorsdR03 = &basicTauDiscriminatorsdR03_default;
1307  } else {
1308  electron_collection = &electron_collection_default;
1309  muon_collection = &muon_collection_default;
1310  pfTauTransverseImpactParameters = &event.get(pfTauTransverseImpactParameters_token_);
1311  basicTauDiscriminators = &event.get(basicTauDiscriminators_inputToken_);
1312  basicTauDiscriminatorsdR03 = &event.get(basicTauDiscriminatorsdR03_inputToken_);
1313 
1314  // Get indices for discriminators
1315  if (!discrIndicesMapped_) {
1320  discrIndicesMapped_ = true;
1321  }
1322  }
1323 
1324  TauFunc tauIDs = {basicTauDiscriminators,
1325  basicTauDiscriminatorsdR03,
1326  pfTauTransverseImpactParameters,
1329 
1331  event.getByToken(pfcandToken_, pfCands);
1332 
1334  event.getByToken(vtxToken_, vertices);
1335 
1337  event.getByToken(rho_token_, rho);
1338 
1339  tensorflow::Tensor predictions(tensorflow::DT_FLOAT, {static_cast<int>(taus->size()), deep_tau::NumberOfOutputs});
1340 
1341  for (size_t tau_index = 0; tau_index < taus->size(); ++tau_index) {
1342  const edm::RefToBase<reco::BaseTau> tauRef = taus->refAt(tau_index);
1343 
1344  std::vector<tensorflow::Tensor> pred_vector;
1345 
1346  bool passesPrediscriminants;
1347  if (is_online_) {
1348  passesPrediscriminants = tauIDs.passPrediscriminants<std::vector<TauDiscInfo<reco::PFTauDiscriminator>>>(
1350  } else {
1351  passesPrediscriminants = tauIDs.passPrediscriminants<std::vector<TauDiscInfo<pat::PATTauDiscriminator>>>(
1353  }
1354 
1355  if (passesPrediscriminants) {
1356  if (version_ == 1) {
1357  if (is_online_)
1358  getPredictionsV1<reco::PFCandidate, reco::PFTau>(
1359  taus->at(tau_index), tau_index, tauRef, electron_collection, muon_collection, pred_vector, tauIDs);
1360  else
1361  getPredictionsV1<pat::PackedCandidate, pat::Tau>(
1362  taus->at(tau_index), tau_index, tauRef, electron_collection, muon_collection, pred_vector, tauIDs);
1363  } else if (version_ == 2) {
1364  if (is_online_) {
1365  getPredictionsV2<reco::PFCandidate, reco::PFTau>(taus->at(tau_index),
1366  tau_index,
1367  tauRef,
1368  electron_collection,
1369  muon_collection,
1370  *pfCands,
1371  vertices->at(0),
1372  *rho,
1373  pred_vector,
1374  tauIDs);
1375  } else
1376  getPredictionsV2<pat::PackedCandidate, pat::Tau>(taus->at(tau_index),
1377  tau_index,
1378  tauRef,
1379  electron_collection,
1380  muon_collection,
1381  *pfCands,
1382  vertices->at(0),
1383  *rho,
1384  pred_vector,
1385  tauIDs);
1386  } else {
1387  throw cms::Exception("DeepTauId") << "version " << version_ << " is not supported.";
1388  }
1389 
1390  for (int k = 0; k < deep_tau::NumberOfOutputs; ++k) {
1391  const float pred = pred_vector[0].flat<float>()(k);
1392  if (!(pred >= 0 && pred <= 1))
1393  throw cms::Exception("DeepTauId")
1394  << "invalid prediction = " << pred << " for tau_index = " << tau_index << ", pred_index = " << k;
1395  predictions.matrix<float>()(tau_index, k) = pred;
1396  }
1397  }
1398  }
1399  return predictions;
1400  }

References deep_tau::DeepTauBase::andPrediscriminants_, basicDiscrdR03IndexMap_, basicDiscrIndexMap_, basicTauDiscriminators_inputToken_, basicTauDiscriminatorsdR03_inputToken_, discrIndicesMapped_, electrons_token_, Exception, edm::ValueMap< T >::get(), deep_tau::DeepTauBase::is_online_, dqmdumpme::k, matchDiscriminatorIndices(), muons_token_, deep_tau::NumberOfOutputs, deep_tau::DeepTauBase::patPrediscriminants_, deep_tau::DeepTauBase::pfcandToken_, pfTauTransverseImpactParameters_token_, deep_tau::DeepTauBase::recoPrediscriminants_, deep_tau::DeepTauBase::requiredBasicDiscriminators_, deep_tau::DeepTauBase::requiredBasicDiscriminatorsdR03_, rho, rho_token_, Tau3MuMonitor_cff::taus, version_, pwdgSkimBPark_cfi::vertices, and deep_tau::DeepTauBase::vtxToken_.

◆ getPredictionsV1()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::getPredictionsV1 ( TauCollection::const_reference tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const std::vector< pat::Electron > *  electrons,
const std::vector< pat::Muon > *  muons,
std::vector< tensorflow::Tensor > &  pred_vector,
TauFunc  tau_funcs 
)
inlineprivate

Definition at line 1403 of file DeepTauId.cc.

1409  {
1410  const tensorflow::Tensor& inputs = createInputsV1<dnn_inputs_2017v1, const CandidateCastType>(
1411  dynamic_cast<const TauCastType&>(tau), tau_index, tau_ref, electrons, muons, tau_funcs);
1412  tensorflow::run(&(cache_->getSession()), {{input_layer_, inputs}}, {output_layer_}, &pred_vector);
1413  }

References deep_tau::DeepTauBase::cache_, pwdgSkimBPark_cfi::electrons, deep_tau::DeepTauCache::getSession(), input_layer_, PixelMapPlotter::inputs, PDWG_BPHSkim_cff::muons, output_layer_, tensorflow::run(), and metsig::tau.

◆ getPredictionsV2()

template<typename CandidateCastType , typename TauCastType >
void DeepTauId::getPredictionsV2 ( TauCollection::const_reference tau,
const size_t  tau_index,
const edm::RefToBase< reco::BaseTau tau_ref,
const std::vector< pat::Electron > *  electrons,
const std::vector< pat::Muon > *  muons,
const edm::View< reco::Candidate > &  pfCands,
const reco::Vertex pv,
double  rho,
std::vector< tensorflow::Tensor > &  pred_vector,
TauFunc  tau_funcs 
)
inlineprivate

Definition at line 1416 of file DeepTauId.cc.

1425  {
1426  CellGrid inner_grid(dnn_inputs_2017_v2::number_of_inner_cell, dnn_inputs_2017_v2::number_of_inner_cell, 0.02, 0.02);
1427  CellGrid outer_grid(dnn_inputs_2017_v2::number_of_outer_cell, dnn_inputs_2017_v2::number_of_outer_cell, 0.05, 0.05);
1428  fillGrids(dynamic_cast<const TauCastType&>(tau), *electrons, inner_grid, outer_grid);
1429  fillGrids(dynamic_cast<const TauCastType&>(tau), *muons, inner_grid, outer_grid);
1430  fillGrids(dynamic_cast<const TauCastType&>(tau), pfCands, inner_grid, outer_grid);
1431 
1432  createTauBlockInputs<CandidateCastType>(
1433  dynamic_cast<const TauCastType&>(tau), tau_index, tau_ref, pv, rho, tau_funcs);
1434  createConvFeatures<CandidateCastType>(dynamic_cast<const TauCastType&>(tau),
1435  tau_index,
1436  tau_ref,
1437  pv,
1438  rho,
1439  electrons,
1440  muons,
1441  pfCands,
1442  inner_grid,
1443  tau_funcs,
1444  true);
1445  createConvFeatures<CandidateCastType>(dynamic_cast<const TauCastType&>(tau),
1446  tau_index,
1447  tau_ref,
1448  pv,
1449  rho,
1450  electrons,
1451  muons,
1452  pfCands,
1453  outer_grid,
1454  tau_funcs,
1455  false);
1456 
1457  tensorflow::run(&(cache_->getSession("core")),
1458  {{"input_tau", *tauBlockTensor_},
1459  {"input_inner", *convTensor_.at(true)},
1460  {"input_outer", *convTensor_.at(false)}},
1461  {"main_output/Softmax"},
1462  &pred_vector);
1463  }

References deep_tau::DeepTauBase::cache_, convTensor_, pwdgSkimBPark_cfi::electrons, fillGrids(), deep_tau::DeepTauCache::getSession(), PDWG_BPHSkim_cff::muons, MetAnalyzer::pv(), rho, tensorflow::run(), metsig::tau, and tauBlockTensor_.

◆ getValue()

template<typename T >
static float DeepTauId::getValue ( T  value)
inlinestaticprivate

Definition at line 1217 of file DeepTauId.cc.

1217  {
1218  return std::isnormal(value) ? static_cast<float>(value) : 0.f;
1219  }

Referenced by createEgammaBlockInputs(), createHadronsBlockInputs(), createMuonBlockInputs(), createTauBlockInputs(), getValueLinear(), and getValueNorm().

◆ getValueLinear()

template<typename T >
static float DeepTauId::getValueLinear ( T  value,
float  min_value,
float  max_value,
bool  positive 
)
inlinestaticprivate

Definition at line 1222 of file DeepTauId.cc.

1222  {
1223  const float fixed_value = getValue(value);
1224  const float clamped_value = std::clamp(fixed_value, min_value, max_value);
1225  float transformed_value = (clamped_value - min_value) / (max_value - min_value);
1226  if (!positive)
1227  transformed_value = transformed_value * 2 - 1;
1228  return transformed_value;
1229  }

References getValue(), hcaldqm::quantity::max_value, and hcaldqm::quantity::min_value.

Referenced by createEgammaBlockInputs(), createHadronsBlockInputs(), createMuonBlockInputs(), and createTauBlockInputs().

◆ getValueNorm()

template<typename T >
static float DeepTauId::getValueNorm ( T  value,
float  mean,
float  sigma,
float  n_sigmas_max = 5 
)
inlinestaticprivate

Definition at line 1232 of file DeepTauId.cc.

1232  {
1233  const float fixed_value = getValue(value);
1234  const float norm_value = (fixed_value - mean) / sigma;
1235  return std::clamp(norm_value, -n_sigmas_max, n_sigmas_max);
1236  }

References getValue(), and SiStripPI::mean.

Referenced by createEgammaBlockInputs(), createHadronsBlockInputs(), createMuonBlockInputs(), and createTauBlockInputs().

◆ globalEndJob()

static void DeepTauId::globalEndJob ( const deep_tau::DeepTauCache cache_)
inlinestatic

Definition at line 1211 of file DeepTauId.cc.

1211 { return DeepTauBase::globalEndJob(cache_); }

References deep_tau::DeepTauBase::cache_.

◆ initializeGlobalCache()

static std::unique_ptr<deep_tau::DeepTauCache> DeepTauId::initializeGlobalCache ( const edm::ParameterSet cfg)
inlinestatic

Definition at line 1207 of file DeepTauId.cc.

1207  {
1208  return DeepTauBase::initializeGlobalCache(cfg);
1209  }

References looper::cfg.

◆ isAbove()

static bool DeepTauId::isAbove ( double  value,
double  min 
)
inlinestaticprivate

Definition at line 1238 of file DeepTauId.cc.

1238 { return std::isnormal(value) && value > min; }

References min().

Referenced by createTauBlockInputs().

◆ isInEcalCrack()

static bool DeepTauId::isInEcalCrack ( double  eta)
inlinestaticprivate

Definition at line 2552 of file DeepTauId.cc.

2552  {
2553  const double abs_eta = std::abs(eta);
2554  return abs_eta > 1.46 && abs_eta < 1.558;
2555  }

References funct::abs(), and PVValHelper::eta.

Referenced by createEgammaBlockInputs(), createHadronsBlockInputs(), createInputsV1(), createMuonBlockInputs(), and createTauBlockInputs().

◆ matchDiscriminatorIndices()

const std::map<BasicDiscriminator, size_t> DeepTauId::matchDiscriminatorIndices ( edm::Event event,
edm::EDGetTokenT< reco::TauDiscriminatorContainer discriminatorContainerToken,
std::vector< BasicDiscriminator requiredDiscr 
)
inline

Definition at line 1080 of file DeepTauId.cc.

1083  {
1084  std::map<std::string, size_t> discrIndexMapStr;
1085  auto const aHandle = event.getHandle(discriminatorContainerToken);
1086  auto const aProv = aHandle.provenance();
1087  if (aProv == nullptr)
1088  aHandle.whyFailed()->raise();
1089  const auto& psetsFromProvenance = edm::parameterSet(*aProv, event.processHistory());
1090  auto const idlist = psetsFromProvenance.getParameter<std::vector<edm::ParameterSet>>("IDdefinitions");
1091  for (size_t j = 0; j < idlist.size(); ++j) {
1092  std::string idname = idlist[j].getParameter<std::string>("IDname");
1093  if (discrIndexMapStr.count(idname)) {
1094  throw cms::Exception("DeepTauId")
1095  << "basic discriminator " << idname << " appears more than once in the input.";
1096  }
1097  discrIndexMapStr[idname] = j;
1098  }
1099 
1100  //translate to a map of <BasicDiscriminator, index> and check if all discriminators are present
1101  std::map<BasicDiscriminator, size_t> discrIndexMap;
1102  for (size_t i = 0; i < requiredDiscr.size(); i++) {
1103  if (discrIndexMapStr.find(stringFromDiscriminator_.at(requiredDiscr[i])) == discrIndexMapStr.end())
1104  throw cms::Exception("DeepTauId") << "Basic Discriminator " << stringFromDiscriminator_.at(requiredDiscr[i])
1105  << " was not provided in the config file.";
1106  else
1107  discrIndexMap[requiredDiscr[i]] = discrIndexMapStr[stringFromDiscriminator_.at(requiredDiscr[i])];
1108  }
1109  return discrIndexMap;
1110  }

References Exception, edm::ParameterSet::getParameter(), mps_fire::i, dqmiolumiharvest::j, edm::parameterSet(), AlCaHLTBitMon_QueryRunRegistry::string, and deep_tau::DeepTauBase::stringFromDiscriminator_.

Referenced by getPredictions().

◆ processIsolationPFComponents()

template<typename CandidateCollection , typename TauCastType >
static void DeepTauId::processIsolationPFComponents ( const TauCastType &  tau,
const CandidateCollection candidates,
LorentzVectorXYZ p4,
float &  pt,
float &  d_eta,
float &  d_phi,
float &  m,
float &  n 
)
inlinestaticprivate

Definition at line 2491 of file DeepTauId.cc.

2498  {
2499  p4 = LorentzVectorXYZ(0, 0, 0, 0);
2500  n = 0;
2501 
2502  for (const auto& cand : candidates) {
2503  p4 += cand->p4();
2504  ++n;
2505  }
2506 
2507  pt = n != 0 ? p4.Pt() : default_value;
2508  d_eta = n != 0 ? dEta(p4, tau.p4()) : default_value;
2509  d_phi = n != 0 ? dPhi(p4, tau.p4()) : default_value;
2510  m = n != 0 ? p4.mass() : default_value;
2511  }

References HLT_FULL_cff::candidates, default_value, HLT_FULL_cff::dEta, HLT_FULL_cff::dPhi, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, p4, DiDispStaMuonMonitor_cfi::pt, and metsig::tau.

Referenced by createInputsV1().

◆ processSignalPFComponents()

template<typename CandidateCollection , typename TauCastType >
static void DeepTauId::processSignalPFComponents ( const TauCastType &  tau,
const CandidateCollection candidates,
LorentzVectorXYZ p4_inner,
LorentzVectorXYZ p4_outer,
float &  pt_inner,
float &  dEta_inner,
float &  dPhi_inner,
float &  m_inner,
float &  pt_outer,
float &  dEta_outer,
float &  dPhi_outer,
float &  m_outer,
float &  n_inner,
float &  n_outer 
)
inlinestaticprivate

Definition at line 2447 of file DeepTauId.cc.

2460  {
2461  p4_inner = LorentzVectorXYZ(0, 0, 0, 0);
2462  p4_outer = LorentzVectorXYZ(0, 0, 0, 0);
2463  n_inner = 0;
2464  n_outer = 0;
2465 
2466  const double innerSigCone_radius = getInnerSignalConeRadius(tau.pt());
2467  for (const auto& cand : candidates) {
2468  const double dR = reco::deltaR(cand->p4(), tau.leadChargedHadrCand()->p4());
2469  const bool isInside_innerSigCone = dR < innerSigCone_radius;
2470  if (isInside_innerSigCone) {
2471  p4_inner += cand->p4();
2472  ++n_inner;
2473  } else {
2474  p4_outer += cand->p4();
2475  ++n_outer;
2476  }
2477  }
2478 
2479  pt_inner = n_inner != 0 ? p4_inner.Pt() : default_value;
2480  dEta_inner = n_inner != 0 ? dEta(p4_inner, tau.p4()) : default_value;
2481  dPhi_inner = n_inner != 0 ? dPhi(p4_inner, tau.p4()) : default_value;
2482  m_inner = n_inner != 0 ? p4_inner.mass() : default_value;
2483 
2484  pt_outer = n_outer != 0 ? p4_outer.Pt() : default_value;
2485  dEta_outer = n_outer != 0 ? dEta(p4_outer, tau.p4()) : default_value;
2486  dPhi_outer = n_outer != 0 ? dPhi(p4_outer, tau.p4()) : default_value;
2487  m_outer = n_outer != 0 ? p4_outer.mass() : default_value;
2488  }

References HLT_FULL_cff::candidates, default_value, reco::deltaR(), HLT_FULL_cff::dEta, HLT_FULL_cff::dPhi, HGC3DClusterGenMatchSelector_cfi::dR, getInnerSignalConeRadius(), and metsig::tau.

Referenced by createInputsV1().

◆ setCellConvFeatures()

void DeepTauId::setCellConvFeatures ( tensorflow::Tensor &  convTensor,
const tensorflow::Tensor &  features,
unsigned  batch_idx,
int  eta_index,
int  phi_index 
)
inlineprivate

Definition at line 1593 of file DeepTauId.cc.

1597  {
1598  for (int n = 0; n < dnn_inputs_2017_v2::number_of_conv_features; ++n)
1599  convTensor.tensor<float, 4>()(0, eta_index, phi_index, n) = features.tensor<float, 4>()(batch_idx, 0, 0, n);
1600  }

References postprocess-scan-build::features, and dqmiodumpmetadata::n.

Referenced by createConvFeatures(), and DeepTauId().

Member Data Documentation

◆ basicDiscrdR03IndexMap_

std::map<BasicDiscriminator, size_t> DeepTauId::basicDiscrdR03IndexMap_
private

Definition at line 2590 of file DeepTauId.cc.

Referenced by getPredictions().

◆ basicDiscrIndexMap_

std::map<BasicDiscriminator, size_t> DeepTauId::basicDiscrIndexMap_
private

Definition at line 2589 of file DeepTauId.cc.

Referenced by getPredictions().

◆ basicTauDiscriminators_inputToken_

edm::EDGetTokenT<reco::TauDiscriminatorContainer> DeepTauId::basicTauDiscriminators_inputToken_
private

Definition at line 2575 of file DeepTauId.cc.

Referenced by getPredictions().

◆ basicTauDiscriminatorsdR03_inputToken_

edm::EDGetTokenT<reco::TauDiscriminatorContainer> DeepTauId::basicTauDiscriminatorsdR03_inputToken_
private

Definition at line 2576 of file DeepTauId.cc.

Referenced by getPredictions().

◆ convTensor_

std::array<std::unique_ptr<tensorflow::Tensor>, 2> DeepTauId::convTensor_
private

Definition at line 2584 of file DeepTauId.cc.

Referenced by createConvFeatures(), DeepTauId(), and getPredictionsV2().

◆ debug_level

const int DeepTauId::debug_level
private

Definition at line 2581 of file DeepTauId.cc.

Referenced by checkInputs().

◆ default_value

constexpr float DeepTauId::default_value = -999.
staticconstexpr

◆ disable_dxy_pca_

const bool DeepTauId::disable_dxy_pca_
private

Definition at line 2582 of file DeepTauId.cc.

Referenced by createTauBlockInputs().

◆ discrIndicesMapped_

bool DeepTauId::discrIndicesMapped_ = false
private

Definition at line 2588 of file DeepTauId.cc.

Referenced by getPredictions().

◆ eGammaTensor_

std::array<std::unique_ptr<tensorflow::Tensor>, 2> DeepTauId::eGammaTensor_
private

◆ electrons_token_

edm::EDGetTokenT<std::vector<pat::Electron> > DeepTauId::electrons_token_
private

Definition at line 2572 of file DeepTauId.cc.

Referenced by getPredictions().

◆ hadronsTensor_

std::array<std::unique_ptr<tensorflow::Tensor>, 2> DeepTauId::hadronsTensor_
private

◆ input_layer_

std::string DeepTauId::input_layer_
private

Definition at line 2579 of file DeepTauId.cc.

Referenced by DeepTauId(), and getPredictionsV1().

◆ muons_token_

edm::EDGetTokenT<std::vector<pat::Muon> > DeepTauId::muons_token_
private

Definition at line 2573 of file DeepTauId.cc.

Referenced by getPredictions().

◆ muonTensor_

std::array<std::unique_ptr<tensorflow::Tensor>, 2> DeepTauId::muonTensor_
private

◆ output_layer_

std::string DeepTauId::output_layer_
private

Definition at line 2579 of file DeepTauId.cc.

Referenced by DeepTauId(), and getPredictionsV1().

◆ pfTauTransverseImpactParameters_token_

edm::EDGetTokenT<edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef> > > DeepTauId::pfTauTransverseImpactParameters_token_
private

Definition at line 2578 of file DeepTauId.cc.

Referenced by getPredictions().

◆ pi

constexpr float DeepTauId::pi = M_PI
staticconstexprprivate

Definition at line 1214 of file DeepTauId.cc.

Referenced by createTauBlockInputs().

◆ rho_token_

edm::EDGetTokenT<double> DeepTauId::rho_token_
private

Definition at line 2574 of file DeepTauId.cc.

Referenced by getPredictions().

◆ tauBlockTensor_

std::unique_ptr<tensorflow::Tensor> DeepTauId::tauBlockTensor_
private

Definition at line 2583 of file DeepTauId.cc.

Referenced by createTauBlockInputs(), DeepTauId(), and getPredictionsV2().

◆ version_

const unsigned DeepTauId::version_
private

Definition at line 2580 of file DeepTauId.cc.

Referenced by DeepTauId(), and getPredictions().

◆ zeroOutputTensor_

std::array<std::unique_ptr<tensorflow::Tensor>, 2> DeepTauId::zeroOutputTensor_
private

Definition at line 2584 of file DeepTauId.cc.

Referenced by createConvFeatures(), and DeepTauId().

edm::RefProd
Definition: EDProductfwd.h:25
reco::tau::pt_weighted_deta_strip
float pt_weighted_deta_strip(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:36
deep_tau::DeepTauBase::cache_
const DeepTauCache * cache_
Definition: DeepTauBase.h:135
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
deep_tau::DeepTauBase::patPrediscriminants_
std::vector< TauDiscInfo< pat::PATTauDiscriminator > > patPrediscriminants_
Definition: DeepTauBase.h:112
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
DeepTauId::rho_token_
edm::EDGetTokenT< double > rho_token_
Definition: DeepTauId.cc:2574
DeepTauId::calculateElectronClusterVars
static void calculateElectronClusterVars(const pat::Electron *ele, float &elecEe, float &elecEgamma)
Definition: DeepTauId.cc:2427
mps_fire.i
i
Definition: mps_fire.py:428
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DeepTauId::getInnerSignalConeRadius
static double getInnerSignalConeRadius(double pt)
Definition: DeepTauId.cc:2513
input
static const std::string input
Definition: EdmProvDump.cc:48
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
deep_tau::DeepTauCache::getSession
tensorflow::Session & getSession(const std::string &name="") const
Definition: DeepTauBase.h:57
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
deep_tau::DeepTauBase::pfcandToken_
edm::EDGetTokenT< CandidateCollection > pfcandToken_
Definition: DeepTauBase.h:130
runTauDisplay.tau_eta
tau_eta
Definition: runTauDisplay.py:126
dnn_inputs_2017_v2::MuonBlockInputs
Definition: DeepTauId.cc:303
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
metsig::tau
Definition: SignAlgoResolutions.h:49
muon
Definition: MuonCocktails.h:17
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
DeepTauId::isInEcalCrack
static bool isInEcalCrack(double eta)
Definition: DeepTauId.cc:2552
DeepTauId::pi
static constexpr float pi
Definition: DeepTauId.cc:1214
DeepTauId::getValue
static float getValue(T value)
Definition: DeepTauId.cc:1217
DeepTauId::setCellConvFeatures
void setCellConvFeatures(tensorflow::Tensor &convTensor, const tensorflow::Tensor &features, unsigned batch_idx, int eta_index, int phi_index)
Definition: DeepTauId.cc:1593
DeepTauId::version_
const unsigned version_
Definition: DeepTauId.cc:2580
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
min
T min(T a, T b)
Definition: MathUtil.h:58
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
postprocess-scan-build.features
features
Definition: postprocess-scan-build.py:8
Tau3MuMonitor_cff.taus
taus
Definition: Tau3MuMonitor_cff.py:7
relativeConstraints.station
station
Definition: relativeConstraints.py:67
reco::tau::eratio
float eratio(const reco::PFTau &tau)
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
Definition: PFRecoTauClusterVariables.cc:78
deep_tau::DeepTauBase::OutputCollection
std::map< std::string, Output > OutputCollection
Definition: DeepTauBase.h:91
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DeepTauId::matchDiscriminatorIndices
const std::map< BasicDiscriminator, size_t > matchDiscriminatorIndices(edm::Event &event, edm::EDGetTokenT< reco::TauDiscriminatorContainer > discriminatorContainerToken, std::vector< BasicDiscriminator > requiredDiscr)
Definition: DeepTauId.cc:1080
objects
Definition: __init__.py:1
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
DeepTauId::hadronsTensor_
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > hadronsTensor_
Definition: DeepTauId.cc:2584
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
DeepTauId::debug_level
const int debug_level
Definition: DeepTauId.cc:2581
deep_tau::DeepTauBase::requiredBasicDiscriminatorsdR03_
static const std::vector< BasicDiscriminator > requiredBasicDiscriminatorsdR03_
Definition: DeepTauBase.h:139
DeepTauId::getValueNorm
static float getValueNorm(T value, float mean, float sigma, float n_sigmas_max=5)
Definition: DeepTauId.cc:1232
getRunAppsInfo.grid
grid
Definition: getRunAppsInfo.py:92
deep_tau::DeepTauBase::vtxToken_
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: DeepTauBase.h:131
DeepTauId::muons_token_
edm::EDGetTokenT< std::vector< pat::Muon > > muons_token_
Definition: DeepTauId.cc:2573
deep_tau::DeepTauBase::LorentzVectorXYZ
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > LorentzVectorXYZ
Definition: DeepTauBase.h:75
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13765
DeepTauId::disable_dxy_pca_
const bool disable_dxy_pca_
Definition: DeepTauId.cc:2582
edm::Handle
Definition: AssociativeIterator.h:50
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
DeepTauId::zeroOutputTensor_
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > zeroOutputTensor_
Definition: DeepTauId.cc:2584
DeepTauId::basicDiscrIndexMap_
std::map< BasicDiscriminator, size_t > basicDiscrIndexMap_
Definition: DeepTauId.cc:2589
deep_tau::NumberOfOutputs
constexpr int NumberOfOutputs
Definition: DeepTauId.cc:14
cosmictrackSelector_cfi.min_pt
min_pt
Definition: cosmictrackSelector_cfi.py:18
GetRecoTauVFromDQM_MC_cff.Output
Output
Definition: GetRecoTauVFromDQM_MC_cff.py:12
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
DeepTauId::default_value
static constexpr float default_value
Definition: DeepTauId.cc:1068
ndof
Definition: HIMultiTrackSelector.h:49
deep_tau::DeepTauBase::DeepTauBase
DeepTauBase(const edm::ParameterSet &cfg, const OutputCollection &outputs, const DeepTauCache *cache)
Definition: DeepTauBase.cc:84
reco::tau::pt_weighted_dphi_strip
float pt_weighted_dphi_strip(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:44
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
DeepTauId::processIsolationPFComponents
static void processIsolationPFComponents(const TauCastType &tau, const CandidateCollection &candidates, LorentzVectorXYZ &p4, float &pt, float &d_eta, float &d_phi, float &m, float &n)
Definition: DeepTauId.cc:2491
deep_tau::DeepTauBase::requiredBasicDiscriminators_
static const std::vector< BasicDiscriminator > requiredBasicDiscriminators_
Definition: DeepTauBase.h:138
PVValHelper::eta
Definition: PVValidationHelpers.h:69
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
DeepTauId::basicTauDiscriminators_inputToken_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > basicTauDiscriminators_inputToken_
Definition: DeepTauId.cc:2575
dnn_inputs_2017_v2::HadronBlockInputs
Definition: DeepTauId.cc:373
deep_tau::DeepTauBase::is_online_
const bool is_online_
Definition: DeepTauBase.h:133
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
DeepTauId::getValueLinear
static float getValueLinear(T value, float min_value, float max_value, bool positive)
Definition: DeepTauId.cc:1222
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
DeepTauId::findMatchedElectron
static const pat::Electron * findMatchedElectron(const TauCastType &tau, const std::vector< pat::Electron > *electrons, double deltaR)
Definition: DeepTauId.cc:2558
dqmdumpme.k
k
Definition: dqmdumpme.py:60
hcaldqm::quantity::min_value
const std::map< ValueQuantityType, double > min_value
Definition: ValueQuantity.h:130
DeepTauId::convTensor_
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > convTensor_
Definition: DeepTauId.cc:2584
DeepTauId::calculateElectronClusterVarsV2
static bool calculateElectronClusterVarsV2(const pat::Electron &ele, float &cc_ele_energy, float &cc_gamma_energy, int &cc_n_gamma)
Definition: DeepTauId.cc:1240
taus_cff.decayMode
decayMode
Definition: taus_cff.py:58
utilities.cache
def cache(function)
Definition: utilities.py:3
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
runTauDisplay.tau_phi
tau_phi
Definition: runTauDisplay.py:127
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::AssociationVector
Definition: AssociationVector.h:67
DeepTauId::basicTauDiscriminatorsdR03_inputToken_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > basicTauDiscriminatorsdR03_inputToken_
Definition: DeepTauId.cc:2576
deep_tau::DeepTauBase::outputs_
OutputCollection outputs_
Definition: DeepTauBase.h:134
edm::View::at
const_reference at(size_type pos) const
DeepTauId::calculateGottfriedJacksonAngleDifference
static bool calculateGottfriedJacksonAngleDifference(const TauCastType &tau, const size_t tau_index, double &gj_diff, TauFunc tau_funcs)
Definition: DeepTauId.cc:2521
DeepTauId::pfTauTransverseImpactParameters_token_
edm::EDGetTokenT< edm::AssociationVector< reco::PFTauRefProd, std::vector< reco::PFTauTransverseImpactParameterRef > > > pfTauTransverseImpactParameters_token_
Definition: DeepTauId.cc:2578
DeepTauId::isAbove
static bool isAbove(double value, double min)
Definition: DeepTauId.cc:1238
DeepTauId::output_layer_
std::string output_layer_
Definition: DeepTauId.cc:2579
Cell
Definition: LogEleMapdb.h:8
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
dnn_inputs_2017_v2::EgammaBlockInputs
Definition: DeepTauId.cc:211
deep_tau::DeepTauBase::stringFromDiscriminator_
static const std::map< BasicDiscriminator, std::string > stringFromDiscriminator_
Definition: DeepTauBase.h:137
reco::tau::n_photons_total
unsigned int n_photons_total(const reco::PFTau &tau)
return total number of pf photon candidates with pT>500 MeV, which are associated to signal
Definition: PFRecoTauClusterVariables.cc:157
cand
Definition: decayParser.h:32
electrons_cff.ip3d
ip3d
Definition: electrons_cff.py:384
runTauDisplay.tau_mass
tau_mass
Definition: runTauDisplay.py:128
createfilelist.int
int
Definition: createfilelist.py:10
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
dumpRecoGeometry_cfg.Muon
Muon
Definition: dumpRecoGeometry_cfg.py:190
p4
double p4[4]
Definition: TauolaWrapper.h:92
value
Definition: value.py:1
pat::Muon::PV2D
Definition: Muon.h:237
PixelMapPlotter.inputs
inputs
Definition: PixelMapPlotter.py:490
DeepTauId::GetOutputs
static const OutputCollection & GetOutputs()
Definition: DeepTauId.cc:1070
DeepTauId::checkInputs
void checkInputs(const tensorflow::Tensor &inputs, const char *block_name, int n_inputs, int n_eta=1, int n_phi=1) const
Definition: DeepTauId.cc:1263
DeepTauId::eGammaTensor_
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > eGammaTensor_
Definition: DeepTauId.cc:2584
get
#define get
DeepTauId::tauBlockTensor_
std::unique_ptr< tensorflow::Tensor > tauBlockTensor_
Definition: DeepTauId.cc:2583
looper.cfg
cfg
Definition: looper.py:297
nanoDQM_cff.Electron
Electron
Definition: nanoDQM_cff.py:62
DDAxes::phi
edm::ValueMap::get
const_reference_type get(ProductID id, size_t idx) const
Definition: ValueMap.h:144
DeepTauId::basicDiscrdR03IndexMap_
std::map< BasicDiscriminator, size_t > basicDiscrdR03IndexMap_
Definition: DeepTauId.cc:2590
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
hcaldqm::quantity::max_value
const std::map< ValueQuantityType, double > max_value
Definition: ValueQuantity.h:190
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
pat::Electron::superCluster
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
DeepTauId::muonTensor_
std::array< std::unique_ptr< tensorflow::Tensor >, 2 > muonTensor_
Definition: DeepTauId.cc:2584
DeepTauId::electrons_token_
edm::EDGetTokenT< std::vector< pat::Electron > > electrons_token_
Definition: DeepTauId.cc:2572
PVValHelper::dz
Definition: PVValidationHelpers.h:50
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13764
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
deep_tau::DeepTauBase::recoPrediscriminants_
std::vector< TauDiscInfo< reco::PFTauDiscriminator > > recoPrediscriminants_
Definition: DeepTauBase.h:113
CellObjectType
CellObjectType
Definition: DeepTauId.cc:942
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:55048
edm::ValueMap
Definition: ValueMap.h:107
runTauDisplay.tau_pt
tau_pt
Definition: runTauDisplay.py:125
Exception
Definition: hltDiff.cc:246
reco::tau::pt_weighted_dr_signal
float pt_weighted_dr_signal(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:32
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
tensorflow::run
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
Definition: TensorFlow.cc:211
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
DeepTauId::input_layer_
std::string input_layer_
Definition: DeepTauId.cc:2579
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
reco::tau::pt_weighted_dr_iso
float pt_weighted_dr_iso(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:52
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase
Definition: AssociativeIterator.h:54
DeepTauId::fillGrids
void fillGrids(const TauCastType &tau, const Collection &objects, CellGrid &inner_grid, CellGrid &outer_grid)
Definition: DeepTauId.cc:1466
deep_tau::DeepTauBase::andPrediscriminants_
uint8_t andPrediscriminants_
Definition: DeepTauBase.h:111
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
cms::Exception
Definition: Exception.h:70
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
dnn_inputs_2017_v2::TauBlockInputs
Definition: DeepTauId.cc:158
edm::InputTag
Definition: InputTag.h:15
DeepTauId::getPartialPredictions
tensorflow::Tensor getPartialPredictions(bool is_inner)
Definition: DeepTauId.cc:1502
deep_tau::DeepTauCache::getGraph
const tensorflow::GraphDef & getGraph(const std::string &name="") const
Definition: DeepTauBase.h:58
DeepTauId::discrIndicesMapped_
bool discrIndicesMapped_
Definition: DeepTauId.cc:2588
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
DeepTauId::processSignalPFComponents
static void processSignalPFComponents(const TauCastType &tau, const CandidateCollection &candidates, LorentzVectorXYZ &p4_inner, LorentzVectorXYZ &p4_outer, float &pt_inner, float &dEta_inner, float &dPhi_inner, float &m_inner, float &pt_outer, float &dEta_outer, float &dPhi_outer, float &m_outer, float &n_inner, float &n_outer)
Definition: DeepTauId.cc:2447