13 struct dnn_inputs_2017v1 {
18 hasSecondaryVertex, flightLength_r, flightLength_dEta, flightLength_dPhi,
19 flightLength_sig, leadChargedHadrCand_pt, leadChargedHadrCand_dEta,
20 leadChargedHadrCand_dPhi, leadChargedHadrCand_mass, pt_weighted_deta_strip,
21 pt_weighted_dphi_strip, pt_weighted_dr_signal, pt_weighted_dr_iso,
22 leadingTrackNormChi2, e_ratio, gj_angle_diff, n_photons, emFraction,
23 has_gsf_track, inside_ecal_crack,
24 gsf_ele_matched, gsf_ele_pt, gsf_ele_dEta, gsf_ele_dPhi, gsf_ele_mass, gsf_ele_Ee,
25 gsf_ele_Egamma, gsf_ele_Pin, gsf_ele_Pout, gsf_ele_EtotOverPin, gsf_ele_Eecal,
26 gsf_ele_dEta_SeedClusterTrackAtCalo, gsf_ele_dPhi_SeedClusterTrackAtCalo, gsf_ele_mvaIn_sigmaEtaEta,
27 gsf_ele_mvaIn_hadEnergy,
28 gsf_ele_mvaIn_deltaEta, gsf_ele_Chi2NormGSF, gsf_ele_GSFNumHits, gsf_ele_GSFTrackResol,
29 gsf_ele_GSFTracklnPt, gsf_ele_Chi2NormKF, gsf_ele_KFNumHits,
30 leadChargedCand_etaAtEcalEntrance, leadChargedCand_pt, leadChargedHadrCand_HoP,
31 leadChargedHadrCand_EoP, tau_visMass_innerSigCone,
32 n_matched_muons, muon_pt, muon_dEta, muon_dPhi,
33 muon_n_matches_DT_1, muon_n_matches_DT_2, muon_n_matches_DT_3, muon_n_matches_DT_4,
34 muon_n_matches_CSC_1, muon_n_matches_CSC_2, muon_n_matches_CSC_3, muon_n_matches_CSC_4,
35 muon_n_hits_DT_2, muon_n_hits_DT_3, muon_n_hits_DT_4,
36 muon_n_hits_CSC_2, muon_n_hits_CSC_3, muon_n_hits_CSC_4,
37 muon_n_hits_RPC_2, muon_n_hits_RPC_3, muon_n_hits_RPC_4,
38 muon_n_stations_with_matches_03, muon_n_stations_with_hits_23,
39 signalChargedHadrCands_sum_innerSigCone_pt, signalChargedHadrCands_sum_innerSigCone_dEta,
40 signalChargedHadrCands_sum_innerSigCone_dPhi, signalChargedHadrCands_sum_innerSigCone_mass,
41 signalChargedHadrCands_sum_outerSigCone_pt, signalChargedHadrCands_sum_outerSigCone_dEta,
42 signalChargedHadrCands_sum_outerSigCone_dPhi, signalChargedHadrCands_sum_outerSigCone_mass,
43 signalChargedHadrCands_nTotal_innerSigCone, signalChargedHadrCands_nTotal_outerSigCone,
44 signalNeutrHadrCands_sum_innerSigCone_pt, signalNeutrHadrCands_sum_innerSigCone_dEta,
45 signalNeutrHadrCands_sum_innerSigCone_dPhi, signalNeutrHadrCands_sum_innerSigCone_mass,
46 signalNeutrHadrCands_sum_outerSigCone_pt, signalNeutrHadrCands_sum_outerSigCone_dEta,
47 signalNeutrHadrCands_sum_outerSigCone_dPhi, signalNeutrHadrCands_sum_outerSigCone_mass,
48 signalNeutrHadrCands_nTotal_innerSigCone, signalNeutrHadrCands_nTotal_outerSigCone,
49 signalGammaCands_sum_innerSigCone_pt, signalGammaCands_sum_innerSigCone_dEta,
50 signalGammaCands_sum_innerSigCone_dPhi, signalGammaCands_sum_innerSigCone_mass,
51 signalGammaCands_sum_outerSigCone_pt, signalGammaCands_sum_outerSigCone_dEta,
52 signalGammaCands_sum_outerSigCone_dPhi, signalGammaCands_sum_outerSigCone_mass,
53 signalGammaCands_nTotal_innerSigCone, signalGammaCands_nTotal_outerSigCone,
54 isolationChargedHadrCands_sum_pt, isolationChargedHadrCands_sum_dEta,
55 isolationChargedHadrCands_sum_dPhi, isolationChargedHadrCands_sum_mass,
56 isolationChargedHadrCands_nTotal,
57 isolationNeutrHadrCands_sum_pt, isolationNeutrHadrCands_sum_dEta,
58 isolationNeutrHadrCands_sum_dPhi, isolationNeutrHadrCands_sum_mass,
59 isolationNeutrHadrCands_nTotal,
60 isolationGammaCands_sum_pt, isolationGammaCands_sum_dEta,
61 isolationGammaCands_sum_dPhi, isolationGammaCands_sum_mass,
62 isolationGammaCands_nTotal,
69 template<
typename LVector1,
typename LVector2>
70 float dEta(
const LVector1&
p4,
const LVector2& tau_p4)
72 return static_cast<float>(p4.eta() - tau_p4.eta());
75 template<
typename LVector1,
typename LVector2>
76 float dPhi(
const LVector1& p4,
const LVector2& tau_p4)
88 std::map<int, std::vector<UInt_t>> n_matches, n_hits;
90 const pat::Muon* best_matched_muon{
nullptr};
91 double deltaR2_best_match{-1};
109 if(!best_matched_muon || dR2 < deltaR2_best_match) {
110 best_matched_muon = &
muon;
111 deltaR2_best_match = dR2;
114 for(
const auto& segment : muon.
matches()) {
115 if(segment.segmentMatches.empty())
continue;
116 if(n_matches.count(segment.detector()))
117 ++n_matches.at(segment.detector()).at(segment.station() - 1);
121 const auto& hit_pattern = muon.
outerTrack()->hitPattern();
124 if(hit_id == 0)
break;
127 const int station = hit_pattern.getMuonStation(hit_id) - 1;
128 if(station > 0 && station < n_stations) {
129 std::vector<UInt_t>* muon_n_hits =
nullptr;
130 if(hit_pattern.muonDTHitFilter(hit_id))
132 else if(hit_pattern.muonCSCHitFilter(hit_id))
134 else if(hit_pattern.muonRPCHitFilter(hit_id))
138 ++muon_n_hits->at(station);
151 std::vector<const pat::Muon*> matched_muons;
152 const double dR2 = deltaR*
deltaR;
155 if(muon.
pt() <=
minPt)
continue;
156 if(reco_muon == hadr_cand_muon)
continue;
158 matched_muons.push_back(&muon);
160 return matched_muons;
163 template<
typename dnn,
typename TensorElemGet>
164 void fillTensor(
const TensorElemGet&
get,
const pat::Tau& tau,
float default_value)
const 166 get(dnn::n_matched_muons) = n_muons;
167 get(dnn::muon_pt) = best_matched_muon !=
nullptr ? best_matched_muon->p4().pt() : default_value;
168 get(dnn::muon_dEta) = best_matched_muon !=
nullptr 169 ? dEta(best_matched_muon->p4(), tau.
p4()) : default_value;
170 get(dnn::muon_dPhi) = best_matched_muon !=
nullptr 171 ? dPhi(best_matched_muon->p4(), tau.
p4()) : default_value;
189 get(dnn::muon_n_stations_with_matches_03) = countMuonStationsWithMatches(0, 3);
190 get(dnn::muon_n_stations_with_hits_23) = countMuonStationsWithHits(2, 3);
194 unsigned countMuonStationsWithMatches(
size_t first_station,
size_t last_station)
const 196 static const std::map<int, std::vector<bool>>
masks = {
202 for(
unsigned n = first_station;
n <= last_station; ++
n) {
203 for(
const auto&
match : n_matches) {
204 if(!masks.at(
match.first).at(
n) &&
match.second.at(
n) > 0) ++cnt;
210 unsigned countMuonStationsWithHits(
size_t first_station,
size_t last_station)
const 212 static const std::map<int, std::vector<bool>>
masks = {
219 for(
unsigned n = first_station;
n <= last_station; ++
n) {
220 for(
const auto&
hit : n_hits) {
221 if(!masks.at(
hit.first).at(
n) &&
hit.second.at(
n) > 0) ++cnt;
237 static constexpr size_t e_index = 0, mu_index = 1, tau_index = 2, jet_index = 3;
239 {
"VSe",
Output({tau_index}, {e_index, tau_index}) },
240 {
"VSmu",
Output({tau_index}, {mu_index, tau_index}) },
241 {
"VSjet",
Output({tau_index}, {jet_index, tau_index}) },
252 desc.
add<
std::string>(
"graph_file",
"RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v1_20L1024N_quantized.pb");
253 desc.
add<
bool>(
"mem_mapped",
false);
268 descriptions.
add(
"DeepTau2017v1", desc);
273 DeepTauBase(cfg, GetOutputs(), cache),
276 input_layer(cache_->getGraph().node(0).
name()),
277 output_layer(cache_->getGraph().node(cache_->getGraph().node_size() - 1).
name())
279 const auto& shape = cache_->getGraph().node(0).attr().at(
"shape").shape();
280 if(shape.dim(1).size() != dnn_inputs_2017v1::NumberOfInputs)
281 throw cms::Exception(
"DeepTauId") <<
"number of inputs does not match the expected inputs for the given version";
287 return DeepTauBase::initializeGlobalCache(cfg);
292 return DeepTauBase::globalEndJob(cache_);
300 event.getByToken(electrons_token, electrons);
303 event.getByToken(muons_token, muons);
305 tensorflow::Tensor predictions(tensorflow::DT_FLOAT, {
static_cast<int>(taus->size()),
306 dnn_inputs_2017v1::NumberOfOutputs});
307 for(
size_t tau_index = 0; tau_index < taus->size(); ++tau_index) {
308 const tensorflow::Tensor&
inputs = createInputs<dnn_inputs_2017v1>(taus->at(tau_index), *
electrons, *
muons);
309 std::vector<tensorflow::Tensor> pred_vector;
310 tensorflow::run(&(cache_->getSession()), { { input_layer, inputs } }, { output_layer }, &pred_vector);
311 for(
int k = 0;
k < dnn_inputs_2017v1::NumberOfOutputs; ++
k)
312 predictions.matrix<
float>()(tau_index,
k) = pred_vector[0].flat<float>()(
k);
317 template<
typename dnn>
321 static constexpr bool check_all_set =
false;
322 static constexpr float default_value_for_set_check = -42;
325 tensorflow::Tensor
inputs(tensorflow::DT_FLOAT, { 1, dnn_inputs_2017v1::NumberOfInputs});
326 const auto&
get = [&](
int var_index) ->
float& {
return inputs.matrix<
float>()(0, var_index); };
330 for(
int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
331 get(var_index) = default_value_for_set_check;
345 get(dnn::dxy_sig) = tau.
dxy_Sig();
346 get(
dnn::dz) = leadChargedHadrCand ? leadChargedHadrCand->dz() : default_value;
348 get(dnn::ip3d_sig) = tau.
ip3d_Sig();
354 get(dnn::leadChargedHadrCand_pt) = leadChargedHadrCand ? leadChargedHadrCand->p4().Pt() : default_value;
355 get(dnn::leadChargedHadrCand_dEta) = leadChargedHadrCand
356 ? dEta(leadChargedHadrCand->p4(), tau.
p4()) : default_value;
357 get(dnn::leadChargedHadrCand_dPhi) = leadChargedHadrCand
358 ? dPhi(leadChargedHadrCand->p4(), tau.
p4()) : default_value;
359 get(dnn::leadChargedHadrCand_mass) = leadChargedHadrCand
360 ? leadChargedHadrCand->p4().mass() : default_value;
366 get(dnn::e_ratio) = clusterVariables.
tau_Eratio(tau);
367 get(dnn::gj_angle_diff) = calculateGottfriedJacksonAngleDifference(tau);
370 get(dnn::has_gsf_track) = leadChargedHadrCand &&
std::abs(leadChargedHadrCand->pdgId()) == 11;
371 get(dnn::inside_ecal_crack) = isInEcalCrack(tau.
p4().Eta());
372 auto gsf_ele = findMatchedElectron(tau, electrons, 0.3);
373 get(dnn::gsf_ele_matched) = gsf_ele !=
nullptr;
374 get(dnn::gsf_ele_pt) = gsf_ele !=
nullptr ? gsf_ele->p4().Pt() : default_value;
375 get(dnn::gsf_ele_dEta) = gsf_ele !=
nullptr ? dEta(gsf_ele->p4(), tau.
p4()) : default_value;
376 get(dnn::gsf_ele_dPhi) = gsf_ele !=
nullptr ? dPhi(gsf_ele->p4(), tau.
p4()) : default_value;
377 get(dnn::gsf_ele_mass) = gsf_ele !=
nullptr ? gsf_ele->p4().mass() : default_value;
378 calculateElectronClusterVars(gsf_ele,
get(dnn::gsf_ele_Ee),
get(dnn::gsf_ele_Egamma));
379 get(dnn::gsf_ele_Pin) = gsf_ele !=
nullptr ? gsf_ele->trackMomentumAtVtx().R() : default_value;
380 get(dnn::gsf_ele_Pout) = gsf_ele !=
nullptr ? gsf_ele->trackMomentumOut().R() : default_value;
381 get(dnn::gsf_ele_EtotOverPin) =
get(dnn::gsf_ele_Pin) > 0
382 ? (
get(dnn::gsf_ele_Ee) +
get(dnn::gsf_ele_Egamma)) /
get(dnn::gsf_ele_Pin)
384 get(dnn::gsf_ele_Eecal) = gsf_ele !=
nullptr ? gsf_ele->ecalEnergy() : default_value;
385 get(dnn::gsf_ele_dEta_SeedClusterTrackAtCalo) = gsf_ele !=
nullptr 386 ? gsf_ele->deltaEtaSeedClusterTrackAtCalo() : default_value;
387 get(dnn::gsf_ele_dPhi_SeedClusterTrackAtCalo) = gsf_ele !=
nullptr 388 ? gsf_ele->deltaPhiSeedClusterTrackAtCalo() : default_value;
389 get(dnn::gsf_ele_mvaIn_sigmaEtaEta) = gsf_ele !=
nullptr 390 ? gsf_ele->mvaInput().sigmaEtaEta : default_value;
391 get(dnn::gsf_ele_mvaIn_hadEnergy) = gsf_ele !=
nullptr ? gsf_ele->mvaInput().hadEnergy : default_value;
392 get(dnn::gsf_ele_mvaIn_deltaEta) = gsf_ele !=
nullptr ? gsf_ele->mvaInput().deltaEta : default_value;
394 get(dnn::gsf_ele_Chi2NormGSF) = default_value;
395 get(dnn::gsf_ele_GSFNumHits) = default_value;
396 get(dnn::gsf_ele_GSFTrackResol) = default_value;
397 get(dnn::gsf_ele_GSFTracklnPt) = default_value;
398 if(gsf_ele !=
nullptr && gsf_ele->gsfTrack().isNonnull()) {
399 get(dnn::gsf_ele_Chi2NormGSF) = gsf_ele->gsfTrack()->normalizedChi2();
400 get(dnn::gsf_ele_GSFNumHits) = gsf_ele->gsfTrack()->numberOfValidHits();
401 if(gsf_ele->gsfTrack()->pt() > 0) {
402 get(dnn::gsf_ele_GSFTrackResol) = gsf_ele->gsfTrack()->ptError() / gsf_ele->gsfTrack()->pt();
403 get(dnn::gsf_ele_GSFTracklnPt) = std::log10(gsf_ele->gsfTrack()->pt());
407 get(dnn::gsf_ele_Chi2NormKF) = default_value;
408 get(dnn::gsf_ele_KFNumHits) = default_value;
409 if(gsf_ele !=
nullptr && gsf_ele->closestCtfTrackRef().isNonnull()) {
410 get(dnn::gsf_ele_Chi2NormKF) = gsf_ele->closestCtfTrackRef()->normalizedChi2();
411 get(dnn::gsf_ele_KFNumHits) = gsf_ele->closestCtfTrackRef()->numberOfValidHits();
416 get(dnn::leadChargedHadrCand_HoP) = default_value;
417 get(dnn::leadChargedHadrCand_EoP) = default_value;
425 MuonHitMatch muon_hit_match;
429 auto matched_muons = muon_hit_match.findMatchedMuons(tau, muons, 0.3, 5);
430 for(
auto muon : matched_muons)
431 muon_hit_match.addMatchedMuon(*
muon, tau);
432 muon_hit_match.fillTensor<dnn>(
get,
tau, default_value);
434 LorentzVectorXYZ signalChargedHadrCands_sumIn, signalChargedHadrCands_sumOut;
435 processSignalPFComponents(tau, tau.signalChargedHadrCands(),
436 signalChargedHadrCands_sumIn, signalChargedHadrCands_sumOut,
437 get(dnn::signalChargedHadrCands_sum_innerSigCone_pt),
438 get(dnn::signalChargedHadrCands_sum_innerSigCone_dEta),
439 get(dnn::signalChargedHadrCands_sum_innerSigCone_dPhi),
440 get(dnn::signalChargedHadrCands_sum_innerSigCone_mass),
441 get(dnn::signalChargedHadrCands_sum_outerSigCone_pt),
442 get(dnn::signalChargedHadrCands_sum_outerSigCone_dEta),
443 get(dnn::signalChargedHadrCands_sum_outerSigCone_dPhi),
444 get(dnn::signalChargedHadrCands_sum_outerSigCone_mass),
445 get(dnn::signalChargedHadrCands_nTotal_innerSigCone),
446 get(dnn::signalChargedHadrCands_nTotal_outerSigCone));
449 processSignalPFComponents(tau, tau.signalNeutrHadrCands(),
450 signalNeutrHadrCands_sumIn, signalNeutrHadrCands_sumOut,
451 get(dnn::signalNeutrHadrCands_sum_innerSigCone_pt),
452 get(dnn::signalNeutrHadrCands_sum_innerSigCone_dEta),
453 get(dnn::signalNeutrHadrCands_sum_innerSigCone_dPhi),
454 get(dnn::signalNeutrHadrCands_sum_innerSigCone_mass),
455 get(dnn::signalNeutrHadrCands_sum_outerSigCone_pt),
456 get(dnn::signalNeutrHadrCands_sum_outerSigCone_dEta),
457 get(dnn::signalNeutrHadrCands_sum_outerSigCone_dPhi),
458 get(dnn::signalNeutrHadrCands_sum_outerSigCone_mass),
459 get(dnn::signalNeutrHadrCands_nTotal_innerSigCone),
460 get(dnn::signalNeutrHadrCands_nTotal_outerSigCone));
464 processSignalPFComponents(tau, tau.signalGammaCands(),
465 signalGammaCands_sumIn, signalGammaCands_sumOut,
466 get(dnn::signalGammaCands_sum_innerSigCone_pt),
467 get(dnn::signalGammaCands_sum_innerSigCone_dEta),
468 get(dnn::signalGammaCands_sum_innerSigCone_dPhi),
469 get(dnn::signalGammaCands_sum_innerSigCone_mass),
470 get(dnn::signalGammaCands_sum_outerSigCone_pt),
471 get(dnn::signalGammaCands_sum_outerSigCone_dEta),
472 get(dnn::signalGammaCands_sum_outerSigCone_dPhi),
473 get(dnn::signalGammaCands_sum_outerSigCone_mass),
474 get(dnn::signalGammaCands_nTotal_innerSigCone),
475 get(dnn::signalGammaCands_nTotal_outerSigCone));
478 processIsolationPFComponents(tau, tau.isolationChargedHadrCands(), isolationChargedHadrCands_sum,
479 get(dnn::isolationChargedHadrCands_sum_pt),
480 get(dnn::isolationChargedHadrCands_sum_dEta),
481 get(dnn::isolationChargedHadrCands_sum_dPhi),
482 get(dnn::isolationChargedHadrCands_sum_mass),
483 get(dnn::isolationChargedHadrCands_nTotal));
486 processIsolationPFComponents(tau, tau.isolationNeutrHadrCands(), isolationNeutrHadrCands_sum,
487 get(dnn::isolationNeutrHadrCands_sum_pt),
488 get(dnn::isolationNeutrHadrCands_sum_dEta),
489 get(dnn::isolationNeutrHadrCands_sum_dPhi),
490 get(dnn::isolationNeutrHadrCands_sum_mass),
491 get(dnn::isolationNeutrHadrCands_nTotal));
494 processIsolationPFComponents(tau, tau.isolationGammaCands(), isolationGammaCands_sum,
495 get(dnn::isolationGammaCands_sum_pt),
496 get(dnn::isolationGammaCands_sum_dEta),
497 get(dnn::isolationGammaCands_sum_dPhi),
498 get(dnn::isolationGammaCands_sum_mass),
499 get(dnn::isolationGammaCands_nTotal));
501 get(dnn::tau_visMass_innerSigCone) = (signalGammaCands_sumIn + signalChargedHadrCands_sumIn).mass();
504 for(
int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
505 if(
get(var_index) == default_value_for_set_check)
506 throw cms::Exception(
"DeepTauId: variable with index = ") << var_index <<
" is not set.";
516 elecEe = elecEgamma = 0;
518 if(superCluster.isNonnull() && superCluster.isAvailable() && superCluster->clusters().isNonnull()
519 && superCluster->clusters().isAvailable()) {
520 for(
auto iter = superCluster->clustersBegin(); iter != superCluster->clustersEnd(); ++iter) {
521 const double energy = (*iter)->energy();
522 if(iter == superCluster->clustersBegin()) elecEe += energy;
523 else elecEgamma += energy;
527 elecEe = elecEgamma = default_value;
531 template<
typename Cand
idateCollection>
534 float& pt_inner,
float& dEta_inner,
float& dPhi_inner,
float& m_inner,
535 float& pt_outer,
float& dEta_outer,
float& dPhi_outer,
float& m_outer,
536 float& n_inner,
float& n_outer)
543 const double innerSigCone_radius = getInnerSignalConeRadius(tau.
pt());
544 for(
const auto&
cand : candidates) {
546 const bool isInside_innerSigCone = dR < innerSigCone_radius;
547 if(isInside_innerSigCone) {
548 p4_inner +=
cand->p4();
551 p4_outer +=
cand->p4();
556 pt_inner = n_inner != 0 ? p4_inner.Pt() : default_value;
557 dEta_inner = n_inner != 0 ? dEta(p4_inner, tau.
p4()) : default_value;
558 dPhi_inner = n_inner != 0 ? dPhi(p4_inner, tau.
p4()) : default_value;
559 m_inner = n_inner != 0 ? p4_inner.mass() : default_value;
561 pt_outer = n_outer != 0 ? p4_outer.Pt() : default_value;
562 dEta_outer = n_outer != 0 ? dEta(p4_outer, tau.
p4()) : default_value;
563 dPhi_outer = n_outer != 0 ? dPhi(p4_outer, tau.
p4()) : default_value;
564 m_outer = n_outer != 0 ? p4_outer.mass() : default_value;
567 template<
typename Cand
idateCollection>
575 for(
const auto&
cand : candidates) {
580 pt = n != 0 ? p4.Pt() : default_value;
581 d_eta = n != 0 ? dEta(p4, tau.
p4()) : default_value;
582 d_phi = n != 0 ? dPhi(p4, tau.
p4()) : default_value;
583 m = n != 0 ? p4.mass() : default_value;
588 static constexpr double min_pt = 30., min_radius = 0.05, cone_opening_coef = 3.;
598 const double mAOne = tau.
p4().M();
599 const double pAOneMag = tau.
p();
600 const double argumentThetaGJmax = (
std::pow(mTau,2) -
std::pow(mAOne,2) ) / ( 2 * mTau * pAOneMag );
601 const double argumentThetaGJmeasured = tau.
p4().Vect().Dot(tau.
flightLength())
603 if (
std::abs(argumentThetaGJmax) <= 1. &&
std::abs(argumentThetaGJmeasured) <= 1. ) {
604 double thetaGJmax = std::asin( argumentThetaGJmax );
605 double thetaGJmeasured = std::acos( argumentThetaGJmeasured );
606 return thetaGJmeasured - thetaGJmax;
609 return default_value;
614 const double abs_eta =
std::abs(eta);
615 return abs_eta > 1.46 && abs_eta < 1.558;
621 const double dR2 = deltaR*
deltaR;
623 for(
const auto& ele : electrons) {
624 if(
reco::deltaR2(tau.
p4(), ele.p4()) < dR2 && (!matched_ele || matched_ele->
pt() < ele.pt())) {
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool isNonnull() const
Checks for non-null.
float tau_Eratio(const reco::PFTau &tau) const
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
static std::unique_ptr< deep_tau::DeepTauCache > initializeGlobalCache(const edm::ParameterSet &cfg)
float hcalEnergyLeadChargedHadrCand() const
return hcal energy from LeadChargedHadrCand
#define DEFINE_FWK_MODULE(type)
T const * get() const
Returns C++ pointer to the item.
static double getInnerSignalConeRadius(double pt)
edm::EDGetTokenT< ElectronCollection > electrons_token
const reco::PFCandidatePtr leadPFChargedHadrCand() const
static bool isInEcalCrack(double eta)
double pt() const final
transverse momentum
static void processIsolationPFComponents(const pat::Tau &tau, const CandidateCollection &candidates, LorentzVectorXYZ &p4, float &pt, float &d_eta, float &d_phi, float &m, float &n)
float tauID(const std::string &name) const
std::map< std::string, Output > OutputCollection
static const OutputCollection & GetOutputs()
DeepTauId(const edm::ParameterSet &cfg, const deep_tau::DeepTauCache *cache)
std::vector< Electron > ElectronCollection
reco::TrackRef outerTrack() const override
reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
static float calculateGottfriedJacksonAngleDifference(const pat::Tau &tau)
const pat::tau::TauPFEssential::Vector & flightLength() const
float tau_pt_weighted_dphi_strip(const reco::PFTau &tau, int dm) const
float ecalEnergyLeadChargedHadrCand() const
pat::ElectronCollection ElectronCollection
Abs< T >::type abs(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const LorentzVector & p4() const final
four-momentum Lorentz vector
static void globalEndJob(const deep_tau::DeepTauCache *cache_)
bool hasSecondaryVertex() const
const reco::CandidatePtr leadChargedHadrCand() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
float tau_pt_weighted_dr_signal(const reco::PFTau &tau, int dm) const
Analysis-level tau class.
float tau_pt_weighted_dr_iso(const reco::PFTau &tau, int dm) const
photonPtSumOutsideSignalCone
bool isNonnull() const
Checks for non-null.
double deltaR(double eta1, double eta2, double phi1, double phi2)
float ptLeadChargedCand() const
return pt from LeadChargedCand
tensorflow::Tensor getPredictions(edm::Event &event, const edm::EventSetup &es, edm::Handle< TauCollection > taus) override
double p() const final
magnitude of momentum vector
pat::MuonCollection MuonCollection
int decayMode() const
reconstructed tau decay mode (specific to PFTau)
float tau_pt_weighted_deta_strip(const reco::PFTau &tau, int dm) const
Analysis-level electron class.
std::vector< MuonChamberMatch > & matches()
get muon matching information
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
std::vector< Muon > MuonCollection
static void processSignalPFComponents(const pat::Tau &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)
float emFraction_MVA() const
return emFraction_MVA
float flightLengthSig() const
constexpr uint32_t masks[]
float leadingTrackNormChi2() const
return normalized chi2 of leading track
static const pat::Electron * findMatchedElectron(const pat::Tau &tau, const pat::ElectronCollection &electrons, double deltaR)
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, const std::vector< std::string > &targetNodes, std::vector< Tensor > *outputs)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
float etaAtEcalEntranceLeadChargedCand() const
return etaAtEcalEntrance from LeadChargedCand
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
static void calculateElectronClusterVars(const pat::Electron *ele, float &elecEe, float &elecEgamma)
tensorflow::Tensor createInputs(const TauType &tau, const ElectronCollection &electrons, const MuonCollection &muons) const
edm::EDGetTokenT< MuonCollection > muons_token
Analysis-level muon class.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double >> LorentzVectorXYZ
reco::SuperClusterRef superCluster() const override
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
Power< A, B >::type pow(const A &a, const B &b)
unsigned int tau_n_photons_total(const reco::PFTau &tau) const
return total number of pf photon candidates with pT>500 MeV, which are associated to signal ...