18 struct dnn_inputs_2017v1 {
26 neutralIsoPtSumWeight,
27 photonPtSumOutsideSignalCone,
39 leadChargedHadrCand_pt,
40 leadChargedHadrCand_dEta,
41 leadChargedHadrCand_dPhi,
42 leadChargedHadrCand_mass,
65 gsf_ele_dEta_SeedClusterTrackAtCalo,
66 gsf_ele_dPhi_SeedClusterTrackAtCalo,
67 gsf_ele_mvaIn_sigmaEtaEta,
68 gsf_ele_mvaIn_hadEnergy,
69 gsf_ele_mvaIn_deltaEta,
72 gsf_ele_GSFTrackResol,
76 leadChargedCand_etaAtEcalEntrance,
78 leadChargedHadrCand_HoP,
79 leadChargedHadrCand_EoP,
80 tau_visMass_innerSigCone,
102 muon_n_stations_with_matches_03,
103 muon_n_stations_with_hits_23,
104 signalChargedHadrCands_sum_innerSigCone_pt,
105 signalChargedHadrCands_sum_innerSigCone_dEta,
106 signalChargedHadrCands_sum_innerSigCone_dPhi,
107 signalChargedHadrCands_sum_innerSigCone_mass,
108 signalChargedHadrCands_sum_outerSigCone_pt,
109 signalChargedHadrCands_sum_outerSigCone_dEta,
110 signalChargedHadrCands_sum_outerSigCone_dPhi,
111 signalChargedHadrCands_sum_outerSigCone_mass,
112 signalChargedHadrCands_nTotal_innerSigCone,
113 signalChargedHadrCands_nTotal_outerSigCone,
114 signalNeutrHadrCands_sum_innerSigCone_pt,
115 signalNeutrHadrCands_sum_innerSigCone_dEta,
116 signalNeutrHadrCands_sum_innerSigCone_dPhi,
117 signalNeutrHadrCands_sum_innerSigCone_mass,
118 signalNeutrHadrCands_sum_outerSigCone_pt,
119 signalNeutrHadrCands_sum_outerSigCone_dEta,
120 signalNeutrHadrCands_sum_outerSigCone_dPhi,
121 signalNeutrHadrCands_sum_outerSigCone_mass,
122 signalNeutrHadrCands_nTotal_innerSigCone,
123 signalNeutrHadrCands_nTotal_outerSigCone,
124 signalGammaCands_sum_innerSigCone_pt,
125 signalGammaCands_sum_innerSigCone_dEta,
126 signalGammaCands_sum_innerSigCone_dPhi,
127 signalGammaCands_sum_innerSigCone_mass,
128 signalGammaCands_sum_outerSigCone_pt,
129 signalGammaCands_sum_outerSigCone_dEta,
130 signalGammaCands_sum_outerSigCone_dPhi,
131 signalGammaCands_sum_outerSigCone_mass,
132 signalGammaCands_nTotal_innerSigCone,
133 signalGammaCands_nTotal_outerSigCone,
134 isolationChargedHadrCands_sum_pt,
135 isolationChargedHadrCands_sum_dEta,
136 isolationChargedHadrCands_sum_dPhi,
137 isolationChargedHadrCands_sum_mass,
138 isolationChargedHadrCands_nTotal,
139 isolationNeutrHadrCands_sum_pt,
140 isolationNeutrHadrCands_sum_dEta,
141 isolationNeutrHadrCands_sum_dPhi,
142 isolationNeutrHadrCands_sum_mass,
143 isolationNeutrHadrCands_nTotal,
144 isolationGammaCands_sum_pt,
145 isolationGammaCands_sum_dEta,
146 isolationGammaCands_sum_dPhi,
147 isolationGammaCands_sum_mass,
148 isolationGammaCands_nTotal,
154 constexpr
int number_of_inner_cell = 11;
155 constexpr
int number_of_outer_cell = 21;
156 constexpr
int number_of_conv_features = 64;
157 namespace TauBlockInputs {
166 tau_n_charged_prongs,
167 tau_n_neutral_prongs,
169 chargedIsoPtSumdR03_over_dR05,
172 neutralIsoPtSumWeight_over_neutralIsoPtSum,
173 neutralIsoPtSumWeightdR03_over_neutralIsoPtSum,
174 neutralIsoPtSumdR03_over_dR05,
175 photonPtSumOutsideSignalCone,
192 tau_flightLength_sig,
193 tau_pt_weighted_deta_strip,
194 tau_pt_weighted_dphi_strip,
195 tau_pt_weighted_dr_signal,
196 tau_pt_weighted_dr_iso,
197 tau_leadingTrackNormChi2,
200 tau_gj_angle_diff_valid,
204 tau_inside_ecal_crack,
205 leadChargedCand_etaAtEcalEntrance_minus_tau_eta,
210 namespace EgammaBlockInputs {
215 tau_inside_ecal_crack,
220 pfCand_ele_pvAssociationQuality,
221 pfCand_ele_puppiWeight,
223 pfCand_ele_lostInnerHits,
224 pfCand_ele_numberOfPixelHits,
225 pfCand_ele_vertex_dx,
226 pfCand_ele_vertex_dy,
227 pfCand_ele_vertex_dz,
228 pfCand_ele_vertex_dx_tauFL,
229 pfCand_ele_vertex_dy_tauFL,
230 pfCand_ele_vertex_dz_tauFL,
231 pfCand_ele_hasTrackDetails,
236 pfCand_ele_track_chi2_ndof,
237 pfCand_ele_track_ndof,
243 ele_cc_ele_rel_energy,
244 ele_cc_gamma_rel_energy,
246 ele_rel_trackMomentumAtVtx,
247 ele_rel_trackMomentumAtCalo,
248 ele_rel_trackMomentumOut,
249 ele_rel_trackMomentumAtEleClus,
250 ele_rel_trackMomentumAtVtxWithConstraint,
253 ele_eSuperClusterOverP,
254 ele_eSeedClusterOverP,
255 ele_eSeedClusterOverPout,
256 ele_eEleClusterOverPout,
257 ele_deltaEtaSuperClusterTrackAtVtx,
258 ele_deltaEtaSeedClusterTrackAtCalo,
259 ele_deltaEtaEleClusterTrackAtCalo,
260 ele_deltaPhiEleClusterTrackAtCalo,
261 ele_deltaPhiSuperClusterTrackAtVtx,
262 ele_deltaPhiSeedClusterTrackAtCalo,
263 ele_mvaInput_earlyBrem,
264 ele_mvaInput_lateBrem,
265 ele_mvaInput_sigmaEtaEta,
266 ele_mvaInput_hadEnergy,
267 ele_mvaInput_deltaEta,
268 ele_gsfTrack_normalizedChi2,
269 ele_gsfTrack_numberOfValidHits,
272 ele_has_closestCtfTrack,
273 ele_closestCtfTrack_normalizedChi2,
274 ele_closestCtfTrack_numberOfValidHits,
279 pfCand_gamma_pvAssociationQuality,
281 pfCand_gamma_puppiWeight,
282 pfCand_gamma_puppiWeightNoLep,
283 pfCand_gamma_lostInnerHits,
284 pfCand_gamma_numberOfPixelHits,
285 pfCand_gamma_vertex_dx,
286 pfCand_gamma_vertex_dy,
287 pfCand_gamma_vertex_dz,
288 pfCand_gamma_vertex_dx_tauFL,
289 pfCand_gamma_vertex_dy_tauFL,
290 pfCand_gamma_vertex_dz_tauFL,
291 pfCand_gamma_hasTrackDetails,
293 pfCand_gamma_dxy_sig,
296 pfCand_gamma_track_chi2_ndof,
297 pfCand_gamma_track_ndof,
302 namespace MuonBlockInputs {
307 tau_inside_ecal_crack,
312 pfCand_muon_pvAssociationQuality,
314 pfCand_muon_puppiWeight,
316 pfCand_muon_lostInnerHits,
317 pfCand_muon_numberOfPixelHits,
318 pfCand_muon_vertex_dx,
319 pfCand_muon_vertex_dy,
320 pfCand_muon_vertex_dz,
321 pfCand_muon_vertex_dx_tauFL,
322 pfCand_muon_vertex_dy_tauFL,
323 pfCand_muon_vertex_dz_tauFL,
324 pfCand_muon_hasTrackDetails,
329 pfCand_muon_track_chi2_ndof,
330 pfCand_muon_track_ndof,
337 muon_normalizedChi2_valid,
339 muon_numberOfValidHits,
340 muon_segmentCompatibility,
341 muon_caloCompatibility,
342 muon_pfEcalEnergy_valid,
343 muon_rel_pfEcalEnergy,
348 muon_n_matches_CSC_1,
349 muon_n_matches_CSC_2,
350 muon_n_matches_CSC_3,
351 muon_n_matches_CSC_4,
352 muon_n_matches_RPC_1,
353 muon_n_matches_RPC_2,
354 muon_n_matches_RPC_3,
355 muon_n_matches_RPC_4,
372 namespace HadronBlockInputs {
377 tau_inside_ecal_crack,
382 pfCand_chHad_leadChargedHadrCand,
383 pfCand_chHad_pvAssociationQuality,
385 pfCand_chHad_puppiWeight,
386 pfCand_chHad_puppiWeightNoLep,
388 pfCand_chHad_lostInnerHits,
389 pfCand_chHad_numberOfPixelHits,
390 pfCand_chHad_vertex_dx,
391 pfCand_chHad_vertex_dy,
392 pfCand_chHad_vertex_dz,
393 pfCand_chHad_vertex_dx_tauFL,
394 pfCand_chHad_vertex_dy_tauFL,
395 pfCand_chHad_vertex_dz_tauFL,
396 pfCand_chHad_hasTrackDetails,
398 pfCand_chHad_dxy_sig,
401 pfCand_chHad_track_chi2_ndof,
402 pfCand_chHad_track_ndof,
403 pfCand_chHad_hcalFraction,
404 pfCand_chHad_rawCaloFraction,
409 pfCand_nHad_puppiWeight,
410 pfCand_nHad_puppiWeightNoLep,
411 pfCand_nHad_hcalFraction,
417 template <
typename LVector1,
typename LVector2>
418 float dEta(
const LVector1&
p4,
const LVector2& tau_p4) {
419 return static_cast<float>(
p4.eta() - tau_p4.eta());
422 template <
typename LVector1,
typename LVector2>
423 float dPhi(
const LVector1& p4_1,
const LVector2& p4_2) {
424 return static_cast<float>(
reco::deltaPhi(p4_2.phi(), p4_1.phi()));
427 struct MuonHitMatchV1 {
428 static constexpr
int n_muon_stations = 4;
430 std::map<int, std::vector<UInt_t>> n_matches, n_hits;
432 const pat::Muon* best_matched_muon{
nullptr};
433 double deltaR2_best_match{-1};
445 static constexpr
int n_stations = 4;
449 if (!best_matched_muon || dR2 < deltaR2_best_match) {
450 best_matched_muon = &
muon;
451 deltaR2_best_match = dR2;
454 for (
const auto& segment :
muon.matches()) {
455 if (segment.segmentMatches.empty())
457 if (n_matches.count(segment.detector()))
458 ++n_matches.at(segment.detector()).at(segment.station() - 1);
461 if (
muon.outerTrack().isNonnull()) {
462 const auto& hit_pattern =
muon.outerTrack()->hitPattern();
469 const int station = hit_pattern.getMuonStation(hit_id) - 1;
471 std::vector<UInt_t>* muon_n_hits =
nullptr;
472 if (hit_pattern.muonDTHitFilter(hit_id))
474 else if (hit_pattern.muonCSCHitFilter(hit_id))
476 else if (hit_pattern.muonRPCHitFilter(hit_id))
487 static std::vector<const pat::Muon*> findMatchedMuons(
const pat::Tau&
tau,
492 if (
tau.leadPFChargedHadrCand().isNonnull() &&
tau.leadPFChargedHadrCand()->muonRef().isNonnull())
493 hadr_cand_muon =
tau.leadPFChargedHadrCand()->muonRef().get();
494 std::vector<const pat::Muon*> matched_muons;
500 if (reco_muon == hadr_cand_muon)
504 matched_muons.push_back(&
muon);
506 return matched_muons;
509 template <
typename dnn,
typename TensorElemGet>
510 void fillTensor(
const TensorElemGet&
get,
const pat::Tau&
tau,
float default_value)
const {
511 get(dnn::n_matched_muons) = n_muons;
512 get(dnn::muon_pt) = best_matched_muon !=
nullptr ? best_matched_muon->p4().pt() : default_value;
513 get(dnn::muon_dEta) = best_matched_muon !=
nullptr ?
dEta(best_matched_muon->p4(),
tau.p4()) : default_value;
514 get(dnn::muon_dPhi) = best_matched_muon !=
nullptr ?
dPhi(best_matched_muon->p4(),
tau.p4()) : default_value;
532 get(dnn::muon_n_stations_with_matches_03) = countMuonStationsWithMatches(0, 3);
533 get(dnn::muon_n_stations_with_hits_23) = countMuonStationsWithHits(2, 3);
537 unsigned countMuonStationsWithMatches(
size_t first_station,
size_t last_station)
const {
538 static const std::map<int, std::vector<bool>> masks = {
544 for (
unsigned n = first_station;
n <= last_station; ++
n) {
545 for (
const auto&
match : n_matches) {
546 if (!masks.at(
match.first).at(
n) &&
match.second.at(
n) > 0)
553 unsigned countMuonStationsWithHits(
size_t first_station,
size_t last_station)
const {
554 static const std::map<int, std::vector<bool>> masks = {
561 for (
unsigned n = first_station;
n <= last_station; ++
n) {
562 for (
const auto&
hit : n_hits) {
563 if (!masks.at(
hit.first).at(
n) &&
hit.second.at(
n) > 0)
571 struct MuonHitMatchV2 {
572 static constexpr
size_t n_muon_stations = 4;
573 static constexpr
int first_station_id = 1;
574 static constexpr
int last_station_id = first_station_id + n_muon_stations - 1;
575 using CountArray = std::array<unsigned, n_muon_stations>;
576 using CountMap = std::map<int, CountArray>;
578 const std::vector<int>& consideredSubdets() {
584 static const std::map<int, std::string> subdet_names = {
586 if (!subdet_names.count(subdet))
587 throw cms::Exception(
"MuonHitMatch") <<
"Subdet name for subdet id " << subdet <<
" not found.";
588 return subdet_names.at(subdet);
591 size_t getStationIndex(
int station,
bool throw_exception)
const {
592 if (station < first_station_id || station > last_station_id) {
594 throw cms::Exception(
"MuonHitMatch") <<
"Station id is out of range";
597 return static_cast<size_t>(
station - 1);
601 for (
int subdet : consideredSubdets()) {
602 n_matches[subdet].fill(0);
603 n_hits[subdet].fill(0);
611 for (
const auto& segment :
muon.matches()) {
612 if (segment.segmentMatches.empty() && segment.rpcMatches.empty())
614 if (n_matches.count(segment.detector())) {
615 const size_t station_index = getStationIndex(segment.station(),
true);
616 ++n_matches.at(segment.detector()).at(station_index);
622 if (
muon.outerTrack().isNonnull()) {
623 const auto& hit_pattern =
muon.outerTrack()->hitPattern();
630 const size_t station_index = getStationIndex(hit_pattern.getMuonStation(hit_id),
false);
631 if (station_index < n_muon_stations) {
632 CountArray* muon_n_hits =
nullptr;
633 if (hit_pattern.muonDTHitFilter(hit_id))
635 else if (hit_pattern.muonCSCHitFilter(hit_id))
637 else if (hit_pattern.muonRPCHitFilter(hit_id))
641 ++muon_n_hits->at(station_index);
648 unsigned nMatches(
int subdet,
int station)
const {
649 if (!n_matches.count(subdet))
650 throw cms::Exception(
"MuonHitMatch") <<
"Subdet " << subdet <<
" not found.";
651 const size_t station_index = getStationIndex(
station,
true);
652 return n_matches.at(subdet).at(station_index);
655 unsigned nHits(
int subdet,
int station)
const {
656 if (!n_hits.count(subdet))
657 throw cms::Exception(
"MuonHitMatch") <<
"Subdet " << subdet <<
" not found.";
658 const size_t station_index = getStationIndex(
station,
true);
659 return n_hits.at(subdet).at(station_index);
662 unsigned countMuonStationsWithMatches(
int first_station,
int last_station)
const {
663 static const std::map<int, std::vector<bool>> masks = {
668 const size_t first_station_index = getStationIndex(first_station,
true);
669 const size_t last_station_index = getStationIndex(last_station,
true);
671 for (
size_t n = first_station_index;
n <= last_station_index; ++
n) {
672 for (
const auto&
match : n_matches) {
673 if (!masks.at(
match.first).at(
n) &&
match.second.at(
n) > 0)
680 unsigned countMuonStationsWithHits(
int first_station,
int last_station)
const {
681 static const std::map<int, std::vector<bool>> masks = {
687 const size_t first_station_index = getStationIndex(first_station,
true);
688 const size_t last_station_index = getStationIndex(last_station,
true);
690 for (
size_t n = first_station_index;
n <= last_station_index; ++
n) {
691 for (
const auto&
hit : n_hits) {
692 if (!masks.at(
hit.first).at(
n) &&
hit.second.at(
n) > 0)
700 CountMap n_matches, n_hits;
706 PfCand_chargedHadron,
707 PfCand_neutralHadron,
714 template <
typename Object>
727 static const std::map<int, CellObjectType> obj_types = {{11, CellObjectType::PfCand_electron},
728 {13, CellObjectType::PfCand_muon},
729 {22, CellObjectType::PfCand_gamma},
730 {130, CellObjectType::PfCand_neutralHadron},
731 {211, CellObjectType::PfCand_chargedHadron}};
734 if (iter == obj_types.end())
735 return CellObjectType::Other;
739 using Cell = std::map<CellObjectType, size_t>;
752 using Map = std::map<CellIndex, Cell>;
753 using const_iterator = Map::const_iterator;
755 CellGrid(
unsigned n_cells_eta,
unsigned n_cells_phi,
double cell_size_eta,
double cell_size_phi)
756 : nCellsEta(n_cells_eta),
757 nCellsPhi(n_cells_phi),
758 nTotal(nCellsEta * nCellsPhi),
759 cellSizeEta(cell_size_eta),
760 cellSizePhi(cell_size_phi) {
761 if (nCellsEta % 2 != 1 || nCellsEta < 1)
762 throw cms::Exception(
"DeepTauId") <<
"Invalid number of eta cells.";
763 if (nCellsPhi % 2 != 1 || nCellsPhi < 1)
764 throw cms::Exception(
"DeepTauId") <<
"Invalid number of phi cells.";
765 if (cellSizeEta <= 0 || cellSizePhi <= 0)
769 int maxEtaIndex()
const {
return static_cast<int>((nCellsEta - 1) / 2); }
770 int maxPhiIndex()
const {
return static_cast<int>((nCellsPhi - 1) / 2); }
771 double maxDeltaEta()
const {
return cellSizeEta * (0.5 + maxEtaIndex()); }
772 double maxDeltaPhi()
const {
return cellSizePhi * (0.5 + maxPhiIndex()); }
773 int getEtaTensorIndex(
const CellIndex& cellIndex)
const {
return cellIndex.eta + maxEtaIndex(); }
774 int getPhiTensorIndex(
const CellIndex& cellIndex)
const {
return cellIndex.phi + maxPhiIndex(); }
776 bool tryGetCellIndex(
double deltaEta,
double deltaPhi, CellIndex& cellIndex)
const {
777 static auto getCellIndex = [](
double x,
double maxX,
double size,
int&
index) {
781 const double absIndex = std::floor(
std::abs(absX /
size - 0.5));
782 index = static_cast<int>(std::copysign(absIndex,
x));
790 size_t num_valid_cells()
const {
return cells.size(); }
792 const Cell& at(
const CellIndex& cellIndex)
const {
return cells.at(cellIndex); }
793 size_t count(
const CellIndex& cellIndex)
const {
return cells.count(cellIndex); }
794 const_iterator
find(
const CellIndex& cellIndex)
const {
return cells.find(cellIndex); }
795 const_iterator
begin()
const {
return cells.begin(); }
796 const_iterator
end()
const {
return cells.end(); }
799 const unsigned nCellsEta, nCellsPhi, nTotal;
800 const double cellSizeEta, cellSizePhi;
803 std::map<CellIndex, Cell>
cells;
813 static constexpr
size_t e_index = 0, mu_index = 1, tau_index = 2, jet_index = 3;
815 {
"VSe",
Output({tau_index}, {e_index, tau_index})},
816 {
"VSmu",
Output({tau_index}, {mu_index, tau_index})},
817 {
"VSjet",
Output({tau_index}, {jet_index, tau_index})},
830 desc.
add<std::vector<std::string>>(
"graph_file",
831 {
"RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6.pb"});
832 desc.
add<
bool>(
"mem_mapped",
false);
833 desc.
add<
unsigned>(
"version", 2);
834 desc.
add<
int>(
"debug_level", 0);
835 desc.
add<
bool>(
"disable_dxy_pca",
false);
837 desc.
add<std::vector<std::string>>(
"VSeWP");
838 desc.
add<std::vector<std::string>>(
"VSmuWP");
839 desc.
add<std::vector<std::string>>(
"VSjetWP");
840 descriptions.
add(
"DeepTau", desc);
849 version(
cfg.getParameter<unsigned>(
"version")),
855 const auto& shape =
cache_->
getGraph().node(0).attr().at(
"shape").shape();
856 if (shape.dim(1).size() != dnn_inputs_2017v1::NumberOfInputs)
858 <<
"number of inputs does not match the expected inputs for the given version";
861 tensorflow::DT_FLOAT, tensorflow::TensorShape{1, dnn_inputs_2017_v2::TauBlockInputs::NumberOfInputs});
862 for (
size_t n = 0;
n < 2; ++
n) {
863 const bool is_inner =
n == 0;
865 is_inner ? dnn_inputs_2017_v2::number_of_inner_cell : dnn_inputs_2017_v2::number_of_outer_cell;
866 eGammaTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
867 tensorflow::DT_FLOAT,
868 tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::EgammaBlockInputs::NumberOfInputs});
869 muonTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
870 tensorflow::DT_FLOAT,
871 tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::MuonBlockInputs::NumberOfInputs});
873 tensorflow::DT_FLOAT,
874 tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::HadronBlockInputs::NumberOfInputs});
875 convTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
876 tensorflow::DT_FLOAT,
877 tensorflow::TensorShape{1, n_cells, n_cells, dnn_inputs_2017_v2::number_of_conv_features});
879 tensorflow::DT_FLOAT, tensorflow::TensorShape{1, 1, 1, dnn_inputs_2017_v2::number_of_conv_features});
893 return DeepTauBase::initializeGlobalCache(
cfg);
901 template <
typename T>
903 return std::isnormal(
value) ? static_cast<float>(
value) : 0.f;
906 template <
typename T>
912 transformed_value = transformed_value * 2 - 1;
913 return transformed_value;
916 template <
typename T>
919 const float norm_value = (fixed_value -
mean) / sigma;
920 return std::clamp(norm_value, -n_sigmas_max, n_sigmas_max);
924 float& cc_ele_energy,
925 float& cc_gamma_energy,
927 cc_ele_energy = cc_gamma_energy = 0;
930 if (superCluster.isNonnull() && superCluster.isAvailable() && superCluster->clusters().isNonnull() &&
931 superCluster->clusters().isAvailable()) {
932 for (
auto iter = superCluster->clustersBegin(); iter != superCluster->clustersEnd(); ++iter) {
933 const float energy = static_cast<float>((*iter)->energy());
934 if (iter == superCluster->clustersBegin())
937 cc_gamma_energy +=
energy;
947 const tensorflow::Tensor&
inputs,
const char* block_name,
int n_inputs,
int n_eta = 1,
int n_phi = 1)
const {
951 for (
int k = 0;
k < n_inputs; ++
k) {
956 <<
"in the " << block_name <<
", input is not finite, i.e. infinite or NaN, for eta_index = " << n_eta
957 <<
", phi_index = " << n_phi <<
", input_index = " <<
k;
959 std::cout << block_name <<
"," <<
eta <<
"," <<
phi <<
"," <<
k <<
"," << std::setprecision(5)
987 for (
size_t tau_index = 0; tau_index <
taus->size(); ++tau_index) {
988 std::vector<tensorflow::Tensor> pred_vector;
996 const float pred = pred_vector[0].flat<
float>()(
k);
997 if (!(pred >= 0 && pred <= 1))
999 <<
"invalid prediction = " << pred <<
" for tau_index = " << tau_index <<
", pred_index = " <<
k;
1000 predictions.matrix<
float>()(tau_index,
k) = pred;
1009 std::vector<tensorflow::Tensor>& pred_vector) {
1020 std::vector<tensorflow::Tensor>& pred_vector) {
1021 CellGrid inner_grid(dnn_inputs_2017_v2::number_of_inner_cell, dnn_inputs_2017_v2::number_of_inner_cell, 0.02, 0.02);
1022 CellGrid outer_grid(dnn_inputs_2017_v2::number_of_outer_cell, dnn_inputs_2017_v2::number_of_outer_cell, 0.05, 0.05);
1035 {
"main_output/Softmax"},
1039 template <
typename Collection>
1041 static constexpr
double outer_dR2 = 0.25;
1043 const double inner_dR2 =
std::pow(inner_radius, 2);
1045 const auto addObject = [&](
size_t n,
double deta,
double dphi, CellGrid&
grid) {
1048 if (obj_type == CellObjectType::Other)
1050 CellIndex cell_index;
1051 if (
grid.tryGetCellIndex(deta, dphi, cell_index)) {
1053 auto iter = cell.find(obj_type);
1054 if (iter != cell.end()) {
1055 const auto& prev_obj =
objects.at(iter->second);
1056 if (
obj.polarP4().pt() > prev_obj.polarP4().pt())
1064 for (
size_t n = 0;
n <
objects.size(); ++
n) {
1066 const double deta =
obj.polarP4().eta() -
tau.polarP4().eta();
1069 if (dR2 < inner_dR2)
1070 addObject(
n, deta, dphi, inner_grid);
1071 if (dR2 < outer_dR2)
1072 addObject(
n, deta, dphi, outer_grid);
1077 std::vector<tensorflow::Tensor> pred_vector;
1085 {
"inner_all_dropout_4/Identity"},
1094 {
"outer_all_dropout_4/Identity"},
1097 return pred_vector.at(0);
1106 const CellGrid&
grid,
1108 tensorflow::Tensor& convTensor = *
convTensor_.at(is_inner);
1110 eGammaTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1111 tensorflow::DT_FLOAT,
1112 tensorflow::TensorShape{
1113 (
long long int)
grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::EgammaBlockInputs::NumberOfInputs});
1114 muonTensor_[is_inner] = std::make_unique<tensorflow::Tensor>(
1115 tensorflow::DT_FLOAT,
1116 tensorflow::TensorShape{
1117 (
long long int)
grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::MuonBlockInputs::NumberOfInputs});
1119 tensorflow::DT_FLOAT,
1120 tensorflow::TensorShape{
1121 (
long long int)
grid.num_valid_cells(), 1, 1, dnn_inputs_2017_v2::HadronBlockInputs::NumberOfInputs});
1130 const CellIndex cell_index{
eta,
phi};
1131 const auto cell_iter =
grid.find(cell_index);
1132 if (cell_iter !=
grid.end()) {
1133 const Cell& cell = cell_iter->second;
1147 const CellIndex cell_index{
eta,
phi};
1148 const int eta_index =
grid.getEtaTensorIndex(cell_index);
1149 const int phi_index =
grid.getPhiTensorIndex(cell_index);
1151 const auto cell_iter =
grid.find(cell_index);
1152 if (cell_iter !=
grid.end()) {
1163 const tensorflow::Tensor&
features,
1167 for (
int n = 0;
n < dnn_inputs_2017_v2::number_of_conv_features; ++
n)
1168 convTensor.tensor<
float, 4>()(0, eta_index, phi_index,
n) =
features.tensor<
float, 4>()(batch_idx, 0, 0,
n);
1175 inputs.flat<
float>().setZero();
1177 const auto&
get = [&](
int var_index) ->
float& {
return inputs.matrix<
float>()(0, var_index); };
1179 auto leadChargedHadrCand = dynamic_cast<const pat::PackedCandidate*>(
tau.leadChargedHadrCand().get());
1190 get(dnn::chargedIsoPtSum) =
getValueNorm(
tau.tauID(
"chargedIsoPtSum"), 47.78f, 123.5f);
1191 get(dnn::chargedIsoPtSumdR03_over_dR05) =
getValue(
tau.tauID(
"chargedIsoPtSumdR03") /
tau.tauID(
"chargedIsoPtSum"));
1192 get(dnn::footprintCorrection) =
getValueNorm(
tau.tauID(
"footprintCorrectiondR03"), 9.029f, 26.42f);
1193 get(dnn::neutralIsoPtSum) =
getValueNorm(
tau.tauID(
"neutralIsoPtSum"), 57.59f, 155.3f);
1194 get(dnn::neutralIsoPtSumWeight_over_neutralIsoPtSum) =
1195 getValue(
tau.tauID(
"neutralIsoPtSumWeight") /
tau.tauID(
"neutralIsoPtSum"));
1196 get(dnn::neutralIsoPtSumWeightdR03_over_neutralIsoPtSum) =
1197 getValue(
tau.tauID(
"neutralIsoPtSumWeightdR03") /
tau.tauID(
"neutralIsoPtSum"));
1198 get(dnn::neutralIsoPtSumdR03_over_dR05) =
getValue(
tau.tauID(
"neutralIsoPtSumdR03") /
tau.tauID(
"neutralIsoPtSum"));
1199 get(dnn::photonPtSumOutsideSignalCone) =
1200 getValueNorm(
tau.tauID(
"photonPtSumOutsideSignalConedR03"), 1.731f, 6.846f);
1211 get(dnn::tau_dxy_pca_x) = 0;
1212 get(dnn::tau_dxy_pca_y) = 0;
1213 get(dnn::tau_dxy_pca_z) = 0;
1216 const bool tau_dxy_valid =
1217 std::isnormal(
tau.dxy()) &&
tau.dxy() > -10 && std::isnormal(
tau.dxy_error()) &&
tau.dxy_error() > 0;
1218 if (tau_dxy_valid) {
1219 get(dnn::tau_dxy_valid) = tau_dxy_valid;
1223 const bool tau_ip3d_valid =
1224 std::isnormal(
tau.ip3d()) &&
tau.ip3d() > -10 && std::isnormal(
tau.ip3d_error()) &&
tau.ip3d_error() > 0;
1225 if (tau_ip3d_valid) {
1226 get(dnn::tau_ip3d_valid) = tau_ip3d_valid;
1230 if (leadChargedHadrCand) {
1231 get(dnn::tau_dz) =
getValueNorm(leadChargedHadrCand->dz(), 0.f, 0.0190f);
1232 const bool tau_dz_sig_valid = leadChargedHadrCand->hasTrackDetails() &&
1233 std::isnormal(leadChargedHadrCand->dz()) &&
1234 std::isnormal(leadChargedHadrCand->dzError()) && leadChargedHadrCand->dzError() > 0;
1235 get(dnn::tau_dz_sig_valid) = tau_dz_sig_valid;
1236 const double dzError = leadChargedHadrCand->hasTrackDetails() ? leadChargedHadrCand->dzError() :
default_value;
1239 get(dnn::tau_flightLength_x) =
getValueNorm(
tau.flightLength().x(), -0.0003f, 0.7362f);
1240 get(dnn::tau_flightLength_y) =
getValueNorm(
tau.flightLength().y(), -0.0009f, 0.7354f);
1241 get(dnn::tau_flightLength_z) =
getValueNorm(
tau.flightLength().z(), -0.0022f, 1.993f);
1243 get(dnn::tau_flightLength_sig) = 0.55756444;
1244 get(dnn::tau_pt_weighted_deta_strip) =
1247 get(dnn::tau_pt_weighted_dphi_strip) =
1249 get(dnn::tau_pt_weighted_dr_signal) =
1252 get(dnn::tau_leadingTrackNormChi2) =
getValueNorm(
tau.leadingTrackNormChi2(), 1.538f, 4.401f);
1254 const bool tau_e_ratio_valid = std::isnormal(
eratio) &&
eratio > 0.f;
1255 get(dnn::tau_e_ratio_valid) = tau_e_ratio_valid;
1258 const bool tau_gj_angle_diff_valid = (std::isnormal(gj_angle_diff) || gj_angle_diff == 0) && gj_angle_diff >= 0;
1259 get(dnn::tau_gj_angle_diff_valid) = tau_gj_angle_diff_valid;
1260 get(dnn::tau_gj_angle_diff) = tau_gj_angle_diff_valid ?
getValueLinear(gj_angle_diff, 0,
pi,
true) : 0;
1264 get(dnn::leadChargedCand_etaAtEcalEntrance_minus_tau_eta) =
1265 getValueNorm(
tau.etaAtEcalEntranceLeadChargedCand() -
tau.p4().eta(), 0.0042f, 0.0323f);
1276 const Cell& cell_map,
1282 const auto&
get = [&](
int var_index) ->
float& {
return inputs.tensor<
float, 4>()(
idx, 0, 0, var_index); };
1284 const bool valid_index_pf_ele = cell_map.count(CellObjectType::PfCand_electron);
1285 const bool valid_index_pf_gamma = cell_map.count(CellObjectType::PfCand_gamma);
1288 if (!cell_map.empty()) {
1294 if (valid_index_pf_ele) {
1295 size_t index_pf_ele = cell_map.at(CellObjectType::PfCand_electron);
1297 get(dnn::pfCand_ele_valid) = valid_index_pf_ele;
1298 get(dnn::pfCand_ele_rel_pt) =
getValueNorm(pfCands.at(index_pf_ele).polarP4().pt() /
tau.polarP4().pt(),
1299 is_inner ? 0.9792f : 0.304f,
1300 is_inner ? 0.5383f : 1.845f);
1301 get(dnn::pfCand_ele_deta) =
getValueLinear(pfCands.at(index_pf_ele).polarP4().eta() -
tau.polarP4().eta(),
1302 is_inner ? -0.1f : -0.5f,
1303 is_inner ? 0.1f : 0.5f,
1306 is_inner ? -0.1
f : -0.5
f,
1307 is_inner ? 0.1
f : 0.5
f,
1309 get(dnn::pfCand_ele_pvAssociationQuality) =
1310 getValueLinear<int>(pfCands.at(index_pf_ele).pvAssociationQuality(), 0, 7,
true);
1311 get(dnn::pfCand_ele_puppiWeight) =
getValue(pfCands.at(index_pf_ele).puppiWeight());
1312 get(dnn::pfCand_ele_charge) =
getValue(pfCands.at(index_pf_ele).charge());
1313 get(dnn::pfCand_ele_lostInnerHits) = getValue<int>(pfCands.at(index_pf_ele).lostInnerHits());
1314 get(dnn::pfCand_ele_numberOfPixelHits) =
1315 getValueLinear(pfCands.at(index_pf_ele).numberOfPixelHits(), 0, 10,
true);
1316 get(dnn::pfCand_ele_vertex_dx) =
1317 getValueNorm(pfCands.at(index_pf_ele).vertex().x() -
pv.position().x(), 0.f, 0.1221f);
1318 get(dnn::pfCand_ele_vertex_dy) =
1319 getValueNorm(pfCands.at(index_pf_ele).vertex().y() -
pv.position().y(), 0.f, 0.1226f);
1320 get(dnn::pfCand_ele_vertex_dz) =
1321 getValueNorm(pfCands.at(index_pf_ele).vertex().z() -
pv.position().z(), 0.001f, 1.024f);
1323 pfCands.at(index_pf_ele).vertex().x() -
pv.position().x() -
tau.flightLength().x(), 0.f, 0.3411f);
1325 pfCands.at(index_pf_ele).vertex().y() -
pv.position().y() -
tau.flightLength().y(), 0.0003f, 0.3385f);
1326 get(dnn::pfCand_ele_vertex_dz_tauFL) =
1327 getValueNorm(pfCands.at(index_pf_ele).vertex().z() -
pv.position().z() -
tau.flightLength().z(), 0.f, 1.307f);
1329 const bool hasTrackDetails = pfCands.at(index_pf_ele).hasTrackDetails();
1330 if (hasTrackDetails) {
1331 get(dnn::pfCand_ele_hasTrackDetails) = hasTrackDetails;
1332 get(dnn::pfCand_ele_dxy) =
getValueNorm(pfCands.at(index_pf_ele).dxy(), 0.f, 0.171f);
1333 get(dnn::pfCand_ele_dxy_sig) =
1334 getValueNorm(
std::abs(pfCands.at(index_pf_ele).dxy()) / pfCands.at(index_pf_ele).dxyError(), 1.634f, 6.45f);
1335 get(dnn::pfCand_ele_dz) =
getValueNorm(pfCands.at(index_pf_ele).dz(), 0.001f, 1.02f);
1336 get(dnn::pfCand_ele_dz_sig) =
1337 getValueNorm(
std::abs(pfCands.at(index_pf_ele).dz()) / pfCands.at(index_pf_ele).dzError(), 24.56f, 210.4f);
1338 get(dnn::pfCand_ele_track_chi2_ndof) =
1339 getValueNorm(pfCands.at(index_pf_ele).pseudoTrack().chi2() / pfCands.at(index_pf_ele).pseudoTrack().ndof(),
1342 get(dnn::pfCand_ele_track_ndof) =
getValueNorm(pfCands.at(index_pf_ele).pseudoTrack().ndof(), 15.18f, 3.203f);
1345 if (valid_index_pf_gamma) {
1346 size_t index_pf_gamma = cell_map.at(CellObjectType::PfCand_gamma);
1347 get(dnn::pfCand_gamma_valid) = valid_index_pf_gamma;
1348 get(dnn::pfCand_gamma_rel_pt) =
getValueNorm(pfCands.at(index_pf_gamma).polarP4().pt() /
tau.polarP4().pt(),
1349 is_inner ? 0.6048f : 0.02576f,
1350 is_inner ? 1.669f : 0.3833f);
1351 get(dnn::pfCand_gamma_deta) =
getValueLinear(pfCands.at(index_pf_gamma).polarP4().eta() -
tau.polarP4().eta(),
1352 is_inner ? -0.1f : -0.5f,
1353 is_inner ? 0.1f : 0.5f,
1356 is_inner ? -0.1
f : -0.5
f,
1357 is_inner ? 0.1
f : 0.5
f,
1359 get(dnn::pfCand_gamma_pvAssociationQuality) =
1360 getValueLinear<int>(pfCands.at(index_pf_gamma).pvAssociationQuality(), 0, 7,
true);
1361 get(dnn::pfCand_gamma_fromPV) = getValueLinear<int>(pfCands.at(index_pf_gamma).fromPV(), 0, 3,
true);
1362 get(dnn::pfCand_gamma_puppiWeight) =
getValue(pfCands.at(index_pf_gamma).puppiWeight());
1363 get(dnn::pfCand_gamma_puppiWeightNoLep) =
getValue(pfCands.at(index_pf_gamma).puppiWeightNoLep());
1364 get(dnn::pfCand_gamma_lostInnerHits) = getValue<int>(pfCands.at(index_pf_gamma).lostInnerHits());
1365 get(dnn::pfCand_gamma_numberOfPixelHits) =
1366 getValueLinear(pfCands.at(index_pf_gamma).numberOfPixelHits(), 0, 7,
true);
1367 get(dnn::pfCand_gamma_vertex_dx) =
1368 getValueNorm(pfCands.at(index_pf_gamma).vertex().x() -
pv.position().x(), 0.f, 0.0067f);
1369 get(dnn::pfCand_gamma_vertex_dy) =
1370 getValueNorm(pfCands.at(index_pf_gamma).vertex().y() -
pv.position().y(), 0.f, 0.0069f);
1371 get(dnn::pfCand_gamma_vertex_dz) =
1372 getValueNorm(pfCands.at(index_pf_gamma).vertex().z() -
pv.position().z(), 0.f, 0.0578f);
1374 pfCands.at(index_pf_gamma).vertex().x() -
pv.position().x() -
tau.flightLength().x(), 0.001f, 0.9565f);
1376 pfCands.at(index_pf_gamma).vertex().y() -
pv.position().y() -
tau.flightLength().y(), 0.0008f, 0.9592f);
1378 pfCands.at(index_pf_gamma).vertex().z() -
pv.position().z() -
tau.flightLength().z(), 0.0038f, 2.154f);
1380 const bool hasTrackDetails = pfCands.at(index_pf_gamma).hasTrackDetails();
1381 if (hasTrackDetails) {
1382 get(dnn::pfCand_gamma_hasTrackDetails) = hasTrackDetails;
1383 get(dnn::pfCand_gamma_dxy) =
getValueNorm(pfCands.at(index_pf_gamma).dxy(), 0.0004f, 0.882f);
1385 std::abs(pfCands.at(index_pf_gamma).dxy()) / pfCands.at(index_pf_gamma).dxyError(), 4.271f, 63.78f);
1386 get(dnn::pfCand_gamma_dz) =
getValueNorm(pfCands.at(index_pf_gamma).dz(), 0.0071f, 5.285f);
1388 std::abs(pfCands.at(index_pf_gamma).dz()) / pfCands.at(index_pf_gamma).dzError(), 162.1f, 622.4f);
1389 get(dnn::pfCand_gamma_track_chi2_ndof) = pfCands.at(index_pf_gamma).pseudoTrack().ndof() > 0
1390 ?
getValueNorm(pfCands.at(index_pf_gamma).pseudoTrack().chi2() /
1391 pfCands.at(index_pf_gamma).pseudoTrack().ndof(),
1395 get(dnn::pfCand_gamma_track_ndof) =
1396 pfCands.at(index_pf_gamma).pseudoTrack().ndof() > 0
1397 ?
getValueNorm(pfCands.at(index_pf_gamma).pseudoTrack().ndof(), 12.25f, 4.774f)
1401 if (valid_index_ele) {
1404 get(dnn::ele_valid) = valid_index_ele;
1406 is_inner ? 1.067f : 0.5111f,
1407 is_inner ? 1.521f : 2.765f);
1409 is_inner ? -0.1f : -0.5f,
1410 is_inner ? 0.1f : 0.5f,
1413 is_inner ? -0.1
f : -0.5
f,
1414 is_inner ? 0.1
f : 0.5
f,
1417 float cc_ele_energy, cc_gamma_energy;
1419 const bool cc_valid =
1422 get(dnn::ele_cc_valid) = cc_valid;
1423 get(dnn::ele_cc_ele_rel_energy) =
1425 get(dnn::ele_cc_gamma_rel_energy) =
getValueNorm(cc_gamma_energy / cc_ele_energy, 0.1439
f, 0.3284
f);
1429 electrons.at(index_ele).trackMomentumAtVtx().R() /
electrons.at(index_ele).polarP4().pt(), 1.531f, 1.424f);
1431 electrons.at(index_ele).trackMomentumAtCalo().R() /
electrons.at(index_ele).polarP4().pt(), 1.531f, 1.424f);
1433 electrons.at(index_ele).trackMomentumOut().R() /
electrons.at(index_ele).polarP4().pt(), 0.7735f, 0.935f);
1434 get(dnn::ele_rel_trackMomentumAtEleClus) =
1439 electrons.at(index_ele).trackMomentumAtVtxWithConstraint().R() /
electrons.at(index_ele).polarP4().pt(),
1442 get(dnn::ele_rel_ecalEnergy) =
1445 electrons.at(index_ele).ecalEnergy() /
electrons.at(index_ele).ecalEnergyError(), 70.25f, 58.16f);
1450 get(dnn::ele_deltaEtaSuperClusterTrackAtVtx) =
1452 get(dnn::ele_deltaEtaSeedClusterTrackAtCalo) =
1454 get(dnn::ele_deltaEtaEleClusterTrackAtCalo) =
1456 get(dnn::ele_deltaPhiEleClusterTrackAtCalo) =
1458 get(dnn::ele_deltaPhiSuperClusterTrackAtVtx) =
1460 get(dnn::ele_deltaPhiSeedClusterTrackAtCalo) =
1464 get(dnn::ele_mvaInput_sigmaEtaEta) =
1469 const auto& gsfTrack =
electrons.at(index_ele).gsfTrack();
1470 if (gsfTrack.isNonnull()) {
1471 get(dnn::ele_gsfTrack_normalizedChi2) =
getValueNorm(gsfTrack->normalizedChi2(), 3.049f, 10.39f);
1472 get(dnn::ele_gsfTrack_numberOfValidHits) =
getValueNorm(gsfTrack->numberOfValidHits(), 16.52f, 2.806f);
1473 get(dnn::ele_rel_gsfTrack_pt) =
1475 get(dnn::ele_gsfTrack_pt_sig) =
getValueNorm(gsfTrack->pt() / gsfTrack->ptError(), 5.046f, 3.119f);
1477 const auto& closestCtfTrack =
electrons.at(index_ele).closestCtfTrackRef();
1478 const bool has_closestCtfTrack = closestCtfTrack.isNonnull();
1479 if (has_closestCtfTrack) {
1480 get(dnn::ele_has_closestCtfTrack) = has_closestCtfTrack;
1481 get(dnn::ele_closestCtfTrack_normalizedChi2) =
getValueNorm(closestCtfTrack->normalizedChi2(), 2.411f, 6.98f);
1482 get(dnn::ele_closestCtfTrack_numberOfValidHits) =
1483 getValueNorm(closestCtfTrack->numberOfValidHits(), 15.16f, 5.26f);
1486 checkInputs(
inputs, is_inner ?
"egamma_inner_block" :
"egamma_outer_block", dnn::NumberOfInputs);
1495 const Cell& cell_map,
1501 const auto&
get = [&](
int var_index) ->
float& {
return inputs.tensor<
float, 4>()(
idx, 0, 0, var_index); };
1503 const bool valid_index_pf_muon = cell_map.count(CellObjectType::PfCand_muon);
1506 if (!cell_map.empty()) {
1512 if (valid_index_pf_muon) {
1513 size_t index_pf_muon = cell_map.at(CellObjectType::PfCand_muon);
1515 get(dnn::pfCand_muon_valid) = valid_index_pf_muon;
1516 get(dnn::pfCand_muon_rel_pt) =
getValueNorm(pfCands.at(index_pf_muon).polarP4().pt() /
tau.polarP4().pt(),
1517 is_inner ? 0.9509f : 0.0861f,
1518 is_inner ? 0.4294f : 0.4065f);
1519 get(dnn::pfCand_muon_deta) =
getValueLinear(pfCands.at(index_pf_muon).polarP4().eta() -
tau.polarP4().eta(),
1520 is_inner ? -0.1f : -0.5f,
1521 is_inner ? 0.1f : 0.5f,
1524 is_inner ? -0.1
f : -0.5
f,
1525 is_inner ? 0.1
f : 0.5
f,
1527 get(dnn::pfCand_muon_pvAssociationQuality) =
1528 getValueLinear<int>(pfCands.at(index_pf_muon).pvAssociationQuality(), 0, 7,
true);
1529 get(dnn::pfCand_muon_fromPV) = getValueLinear<int>(pfCands.at(index_pf_muon).fromPV(), 0, 3,
true);
1530 get(dnn::pfCand_muon_puppiWeight) =
getValue(pfCands.at(index_pf_muon).puppiWeight());
1531 get(dnn::pfCand_muon_charge) =
getValue(pfCands.at(index_pf_muon).charge());
1532 get(dnn::pfCand_muon_lostInnerHits) = getValue<int>(pfCands.at(index_pf_muon).lostInnerHits());
1533 get(dnn::pfCand_muon_numberOfPixelHits) =
1534 getValueLinear(pfCands.at(index_pf_muon).numberOfPixelHits(), 0, 11,
true);
1535 get(dnn::pfCand_muon_vertex_dx) =
1536 getValueNorm(pfCands.at(index_pf_muon).vertex().x() -
pv.position().x(), -0.0007f, 0.6869f);
1537 get(dnn::pfCand_muon_vertex_dy) =
1538 getValueNorm(pfCands.at(index_pf_muon).vertex().y() -
pv.position().y(), 0.0001f, 0.6784f);
1539 get(dnn::pfCand_muon_vertex_dz) =
1540 getValueNorm(pfCands.at(index_pf_muon).vertex().z() -
pv.position().z(), -0.0117f, 4.097f);
1542 pfCands.at(index_pf_muon).vertex().x() -
pv.position().x() -
tau.flightLength().x(), -0.0001f, 0.8642f);
1544 pfCands.at(index_pf_muon).vertex().y() -
pv.position().y() -
tau.flightLength().y(), 0.0004f, 0.8561f);
1546 pfCands.at(index_pf_muon).vertex().z() -
pv.position().z() -
tau.flightLength().z(), -0.0118f, 4.405f);
1548 const bool hasTrackDetails = pfCands.at(index_pf_muon).hasTrackDetails();
1549 if (hasTrackDetails) {
1550 get(dnn::pfCand_muon_hasTrackDetails) = hasTrackDetails;
1551 get(dnn::pfCand_muon_dxy) =
getValueNorm(pfCands.at(index_pf_muon).dxy(), -0.0045f, 0.9655f);
1553 std::abs(pfCands.at(index_pf_muon).dxy()) / pfCands.at(index_pf_muon).dxyError(), 4.575f, 42.36f);
1554 get(dnn::pfCand_muon_dz) =
getValueNorm(pfCands.at(index_pf_muon).dz(), -0.0117f, 4.097f);
1556 std::abs(pfCands.at(index_pf_muon).dz()) / pfCands.at(index_pf_muon).dzError(), 80.37f, 343.3f);
1558 pfCands.at(index_pf_muon).pseudoTrack().chi2() / pfCands.at(index_pf_muon).pseudoTrack().ndof(),
1561 get(dnn::pfCand_muon_track_ndof) =
getValueNorm(pfCands.at(index_pf_muon).pseudoTrack().ndof(), 17.5f, 5.11f);
1564 if (valid_index_muon) {
1567 get(dnn::muon_valid) = valid_index_muon;
1569 is_inner ? 0.7966f : 0.2678f,
1570 is_inner ? 3.402f : 3.592f);
1572 is_inner ? -0.1f : -0.5f,
1573 is_inner ? 0.1f : 0.5f,
1576 dPhi(
tau.polarP4(),
muons.at(index_muon).polarP4()), is_inner ? -0.1
f : -0.5
f, is_inner ? 0.1
f : 0.5
f,
false);
1578 get(dnn::muon_dxy_sig) =
1583 const bool normalizedChi2_valid =
1584 muons.at(index_muon).globalTrack().isNonnull() &&
muons.at(index_muon).normChi2() >= 0;
1585 if (normalizedChi2_valid) {
1586 get(dnn::muon_normalizedChi2_valid) = normalizedChi2_valid;
1588 if (
muons.at(index_muon).innerTrack().isNonnull())
1589 get(dnn::muon_numberOfValidHits) =
getValueNorm(
muons.at(index_muon).numberOfValidHits(), 21.84f, 10.59f);
1591 get(dnn::muon_segmentCompatibility) =
getValue(
muons.at(index_muon).segmentCompatibility());
1592 get(dnn::muon_caloCompatibility) =
getValue(
muons.at(index_muon).caloCompatibility());
1594 const bool pfEcalEnergy_valid =
muons.at(index_muon).pfEcalEnergy() >= 0;
1595 if (pfEcalEnergy_valid) {
1596 get(dnn::muon_pfEcalEnergy_valid) = pfEcalEnergy_valid;
1597 get(dnn::muon_rel_pfEcalEnergy) =
1598 getValueNorm(
muons.at(index_muon).pfEcalEnergy() /
muons.at(index_muon).polarP4().pt(), 0.2273f, 0.4865f);
1601 MuonHitMatchV2 hit_match(
muons.at(index_muon));
1602 static const std::map<int, std::pair<int, int>> muonMatchHitVars = {
1607 static const std::map<int, std::vector<float>> muonMatchVarLimits = {
1608 {
MuonSubdetId::DT, {2, 2, 2, 2}}, {
MuonSubdetId::CSC, {6, 2, 2, 2}}, {
MuonSubdetId::RPC, {7, 6, 4, 4}}};
1610 static const std::map<int, std::vector<float>> muonHitVarLimits = {{
MuonSubdetId::DT, {12, 12, 12, 8}},
1614 for (
int subdet : hit_match.MuonHitMatchV2::consideredSubdets()) {
1615 const auto& matchHitVar = muonMatchHitVars.at(subdet);
1616 const auto& matchLimits = muonMatchVarLimits.at(subdet);
1617 const auto& hitLimits = muonHitVarLimits.at(subdet);
1618 for (
int station = MuonHitMatchV2::first_station_id;
station <= MuonHitMatchV2::last_station_id; ++
station) {
1619 const unsigned n_matches = hit_match.nMatches(subdet,
station);
1620 const unsigned n_hits = hit_match.nHits(subdet,
station);
1626 checkInputs(
inputs, is_inner ?
"muon_inner_block" :
"muon_outer_block", dnn::NumberOfInputs);
1634 const Cell& cell_map,
1640 const auto&
get = [&](
int var_index) ->
float& {
return inputs.tensor<
float, 4>()(
idx, 0, 0, var_index); };
1642 const bool valid_chH = cell_map.count(CellObjectType::PfCand_chargedHadron);
1643 const bool valid_nH = cell_map.count(CellObjectType::PfCand_neutralHadron);
1645 if (!cell_map.empty()) {
1652 size_t index_chH = cell_map.at(CellObjectType::PfCand_chargedHadron);
1654 get(dnn::pfCand_chHad_valid) = valid_chH;
1655 get(dnn::pfCand_chHad_rel_pt) =
getValueNorm(pfCands.at(index_chH).polarP4().pt() /
tau.polarP4().pt(),
1656 is_inner ? 0.2564f : 0.0194f,
1657 is_inner ? 0.8607f : 0.1865f);
1658 get(dnn::pfCand_chHad_deta) =
getValueLinear(pfCands.at(index_chH).polarP4().eta() -
tau.polarP4().eta(),
1659 is_inner ? -0.1f : -0.5f,
1660 is_inner ? 0.1f : 0.5f,
1663 is_inner ? -0.1
f : -0.5
f,
1664 is_inner ? 0.1
f : 0.5
f,
1666 get(dnn::pfCand_chHad_leadChargedHadrCand) =
getValue(
1667 &pfCands.at(index_chH) == dynamic_cast<const pat::PackedCandidate*>(
tau.leadChargedHadrCand().get()));
1668 get(dnn::pfCand_chHad_pvAssociationQuality) =
1669 getValueLinear<int>(pfCands.at(index_chH).pvAssociationQuality(), 0, 7,
true);
1670 get(dnn::pfCand_chHad_fromPV) = getValueLinear<int>(pfCands.at(index_chH).fromPV(), 0, 3,
true);
1671 get(dnn::pfCand_chHad_puppiWeight) =
getValue(pfCands.at(index_chH).puppiWeight());
1672 get(dnn::pfCand_chHad_puppiWeightNoLep) =
getValue(pfCands.at(index_chH).puppiWeightNoLep());
1673 get(dnn::pfCand_chHad_charge) =
getValue(pfCands.at(index_chH).charge());
1674 get(dnn::pfCand_chHad_lostInnerHits) = getValue<int>(pfCands.at(index_chH).lostInnerHits());
1675 get(dnn::pfCand_chHad_numberOfPixelHits) =
getValueLinear(pfCands.at(index_chH).numberOfPixelHits(), 0, 12,
true);
1676 get(dnn::pfCand_chHad_vertex_dx) =
1677 getValueNorm(pfCands.at(index_chH).vertex().x() -
pv.position().x(), 0.0005f, 1.735f);
1678 get(dnn::pfCand_chHad_vertex_dy) =
1679 getValueNorm(pfCands.at(index_chH).vertex().y() -
pv.position().y(), -0.0008f, 1.752f);
1680 get(dnn::pfCand_chHad_vertex_dz) =
1681 getValueNorm(pfCands.at(index_chH).vertex().z() -
pv.position().z(), -0.0201f, 8.333f);
1683 pfCands.at(index_chH).vertex().x() -
pv.position().x() -
tau.flightLength().x(), -0.0014f, 1.93f);
1685 pfCands.at(index_chH).vertex().y() -
pv.position().y() -
tau.flightLength().y(), 0.0022f, 1.948f);
1687 pfCands.at(index_chH).vertex().z() -
pv.position().z() -
tau.flightLength().z(), -0.0138f, 8.622f);
1689 const bool hasTrackDetails = pfCands.at(index_chH).hasTrackDetails();
1690 if (hasTrackDetails) {
1691 get(dnn::pfCand_chHad_hasTrackDetails) = hasTrackDetails;
1692 get(dnn::pfCand_chHad_dxy) =
getValueNorm(pfCands.at(index_chH).dxy(), -0.012f, 2.386f);
1693 get(dnn::pfCand_chHad_dxy_sig) =
1694 getValueNorm(
std::abs(pfCands.at(index_chH).dxy()) / pfCands.at(index_chH).dxyError(), 6.417f, 36.28f);
1695 get(dnn::pfCand_chHad_dz) =
getValueNorm(pfCands.at(index_chH).dz(), -0.0246f, 7.618f);
1696 get(dnn::pfCand_chHad_dz_sig) =
1697 getValueNorm(
std::abs(pfCands.at(index_chH).dz()) / pfCands.at(index_chH).dzError(), 301.3f, 491.1f);
1698 get(dnn::pfCand_chHad_track_chi2_ndof) =
1699 pfCands.at(index_chH).pseudoTrack().ndof() > 0
1700 ?
getValueNorm(pfCands.at(index_chH).pseudoTrack().chi2() / pfCands.at(index_chH).pseudoTrack().ndof(),
1704 get(dnn::pfCand_chHad_track_ndof) =
1705 pfCands.at(index_chH).pseudoTrack().ndof() > 0
1706 ?
getValueNorm(pfCands.at(index_chH).pseudoTrack().ndof(), 13.92f, 6.581f)
1709 float hcal_fraction = 0.;
1710 if (pfCands.at(index_chH).pdgId() == 1 || pfCands.at(index_chH).pdgId() == 130) {
1711 hcal_fraction = pfCands.at(index_chH).hcalFraction();
1712 }
else if (pfCands.at(index_chH).isIsolatedChargedHadron()) {
1713 hcal_fraction = pfCands.at(index_chH).rawHcalFraction();
1715 get(dnn::pfCand_chHad_hcalFraction) =
getValue(hcal_fraction);
1716 get(dnn::pfCand_chHad_rawCaloFraction) =
getValueLinear(pfCands.at(index_chH).rawCaloFraction(), 0.f, 2.6f,
true);
1719 size_t index_nH = cell_map.at(CellObjectType::PfCand_neutralHadron);
1721 get(dnn::pfCand_nHad_valid) = valid_nH;
1722 get(dnn::pfCand_nHad_rel_pt) =
getValueNorm(pfCands.at(index_nH).polarP4().pt() /
tau.polarP4().pt(),
1723 is_inner ? 0.3163f : 0.0502f,
1724 is_inner ? 0.2769f : 0.4266f);
1725 get(dnn::pfCand_nHad_deta) =
getValueLinear(pfCands.at(index_nH).polarP4().eta() -
tau.polarP4().eta(),
1726 is_inner ? -0.1f : -0.5f,
1727 is_inner ? 0.1f : 0.5f,
1730 dPhi(
tau.polarP4(), pfCands.at(index_nH).polarP4()), is_inner ? -0.1
f : -0.5
f, is_inner ? 0.1
f : 0.5
f,
false);
1731 get(dnn::pfCand_nHad_puppiWeight) =
getValue(pfCands.at(index_nH).puppiWeight());
1732 get(dnn::pfCand_nHad_puppiWeightNoLep) =
getValue(pfCands.at(index_nH).puppiWeightNoLep());
1733 float hcal_fraction = 0.;
1734 if (pfCands.at(index_nH).pdgId() == 1 || pfCands.at(index_nH).pdgId() == 130) {
1735 hcal_fraction = pfCands.at(index_nH).hcalFraction();
1736 }
else if (pfCands.at(index_nH).isIsolatedChargedHadron()) {
1737 hcal_fraction = pfCands.at(index_nH).rawHcalFraction();
1739 get(dnn::pfCand_nHad_hcalFraction) =
getValue(hcal_fraction);
1741 checkInputs(
inputs, is_inner ?
"hadron_inner_block" :
"hadron_outer_block", dnn::NumberOfInputs);
1744 template <
typename dnn>
1748 static constexpr
bool check_all_set =
false;
1749 static constexpr
float default_value_for_set_check = -42;
1751 tensorflow::Tensor
inputs(tensorflow::DT_FLOAT, {1, dnn_inputs_2017v1::NumberOfInputs});
1752 const auto&
get = [&](
int var_index) ->
float& {
return inputs.matrix<
float>()(0, var_index); };
1753 auto leadChargedHadrCand = dynamic_cast<const pat::PackedCandidate*>(
tau.leadChargedHadrCand().get());
1755 if (check_all_set) {
1756 for (
int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
1757 get(var_index) = default_value_for_set_check;
1765 get(dnn::chargedIsoPtSum) =
tau.tauID(
"chargedIsoPtSum");
1766 get(dnn::neutralIsoPtSum) =
tau.tauID(
"neutralIsoPtSum");
1767 get(dnn::neutralIsoPtSumWeight) =
tau.tauID(
"neutralIsoPtSumWeight");
1768 get(dnn::photonPtSumOutsideSignalCone) =
tau.tauID(
"photonPtSumOutsideSignalCone");
1769 get(dnn::puCorrPtSum) =
tau.tauID(
"puCorrPtSum");
1771 get(dnn::dxy_sig) =
tau.dxy_Sig();
1774 get(dnn::ip3d_sig) =
tau.ip3d_Sig();
1775 get(dnn::hasSecondaryVertex) =
tau.hasSecondaryVertex();
1776 get(dnn::flightLength_r) =
tau.flightLength().R();
1777 get(dnn::flightLength_dEta) =
dEta(
tau.flightLength(),
tau.p4());
1778 get(dnn::flightLength_dPhi) =
dPhi(
tau.flightLength(),
tau.p4());
1779 get(dnn::flightLength_sig) =
tau.flightLengthSig();
1780 get(dnn::leadChargedHadrCand_pt) = leadChargedHadrCand ? leadChargedHadrCand->p4().Pt() :
default_value;
1781 get(dnn::leadChargedHadrCand_dEta) =
1783 get(dnn::leadChargedHadrCand_dPhi) =
1785 get(dnn::leadChargedHadrCand_mass) = leadChargedHadrCand ? leadChargedHadrCand->p4().mass() :
default_value;
1790 get(dnn::leadingTrackNormChi2) =
tau.leadingTrackNormChi2();
1794 get(dnn::emFraction) =
tau.emFraction_MVA();
1795 get(dnn::has_gsf_track) = leadChargedHadrCand &&
std::abs(leadChargedHadrCand->pdgId()) == 11;
1798 get(dnn::gsf_ele_matched) = gsf_ele !=
nullptr;
1799 get(dnn::gsf_ele_pt) = gsf_ele !=
nullptr ? gsf_ele->p4().Pt() :
default_value;
1802 get(dnn::gsf_ele_mass) = gsf_ele !=
nullptr ? gsf_ele->p4().mass() :
default_value;
1804 get(dnn::gsf_ele_Pin) = gsf_ele !=
nullptr ? gsf_ele->trackMomentumAtVtx().R() :
default_value;
1805 get(dnn::gsf_ele_Pout) = gsf_ele !=
nullptr ? gsf_ele->trackMomentumOut().R() :
default_value;
1806 get(dnn::gsf_ele_EtotOverPin) =
get(dnn::gsf_ele_Pin) > 0
1807 ? (
get(dnn::gsf_ele_Ee) +
get(dnn::gsf_ele_Egamma)) /
get(dnn::gsf_ele_Pin)
1809 get(dnn::gsf_ele_Eecal) = gsf_ele !=
nullptr ? gsf_ele->ecalEnergy() :
default_value;
1810 get(dnn::gsf_ele_dEta_SeedClusterTrackAtCalo) =
1811 gsf_ele !=
nullptr ? gsf_ele->deltaEtaSeedClusterTrackAtCalo() :
default_value;
1812 get(dnn::gsf_ele_dPhi_SeedClusterTrackAtCalo) =
1813 gsf_ele !=
nullptr ? gsf_ele->deltaPhiSeedClusterTrackAtCalo() :
default_value;
1814 get(dnn::gsf_ele_mvaIn_sigmaEtaEta) = gsf_ele !=
nullptr ? gsf_ele->mvaInput().sigmaEtaEta :
default_value;
1815 get(dnn::gsf_ele_mvaIn_hadEnergy) = gsf_ele !=
nullptr ? gsf_ele->mvaInput().hadEnergy :
default_value;
1816 get(dnn::gsf_ele_mvaIn_deltaEta) = gsf_ele !=
nullptr ? gsf_ele->mvaInput().deltaEta :
default_value;
1822 if (gsf_ele !=
nullptr && gsf_ele->gsfTrack().isNonnull()) {
1823 get(dnn::gsf_ele_Chi2NormGSF) = gsf_ele->gsfTrack()->normalizedChi2();
1824 get(dnn::gsf_ele_GSFNumHits) = gsf_ele->gsfTrack()->numberOfValidHits();
1825 if (gsf_ele->gsfTrack()->pt() > 0) {
1826 get(dnn::gsf_ele_GSFTrackResol) = gsf_ele->gsfTrack()->ptError() / gsf_ele->gsfTrack()->pt();
1827 get(dnn::gsf_ele_GSFTracklnPt) = std::log10(gsf_ele->gsfTrack()->pt());
1833 if (gsf_ele !=
nullptr && gsf_ele->closestCtfTrackRef().isNonnull()) {
1834 get(dnn::gsf_ele_Chi2NormKF) = gsf_ele->closestCtfTrackRef()->normalizedChi2();
1835 get(dnn::gsf_ele_KFNumHits) = gsf_ele->closestCtfTrackRef()->numberOfValidHits();
1837 get(dnn::leadChargedCand_etaAtEcalEntrance) =
tau.etaAtEcalEntranceLeadChargedCand();
1838 get(dnn::leadChargedCand_pt) =
tau.ptLeadChargedCand();
1842 if (
tau.leadChargedHadrCand()->pt() > 0) {
1843 get(dnn::leadChargedHadrCand_HoP) =
tau.hcalEnergyLeadChargedHadrCand() /
tau.leadChargedHadrCand()->pt();
1844 get(dnn::leadChargedHadrCand_EoP) =
tau.ecalEnergyLeadChargedHadrCand() /
tau.leadChargedHadrCand()->pt();
1847 MuonHitMatchV1 muon_hit_match;
1848 if (
tau.leadPFChargedHadrCand().isNonnull() &&
tau.leadPFChargedHadrCand()->muonRef().isNonnull())
1849 muon_hit_match.addMatchedMuon(*
tau.leadPFChargedHadrCand()->muonRef(),
tau);
1851 auto matched_muons = muon_hit_match.findMatchedMuons(
tau,
muons, 0.3, 5);
1852 for (
auto muon : matched_muons)
1853 muon_hit_match.addMatchedMuon(*
muon,
tau);
1856 LorentzVectorXYZ signalChargedHadrCands_sumIn, signalChargedHadrCands_sumOut;
1858 tau.signalChargedHadrCands(),
1859 signalChargedHadrCands_sumIn,
1860 signalChargedHadrCands_sumOut,
1861 get(dnn::signalChargedHadrCands_sum_innerSigCone_pt),
1862 get(dnn::signalChargedHadrCands_sum_innerSigCone_dEta),
1863 get(dnn::signalChargedHadrCands_sum_innerSigCone_dPhi),
1864 get(dnn::signalChargedHadrCands_sum_innerSigCone_mass),
1865 get(dnn::signalChargedHadrCands_sum_outerSigCone_pt),
1866 get(dnn::signalChargedHadrCands_sum_outerSigCone_dEta),
1867 get(dnn::signalChargedHadrCands_sum_outerSigCone_dPhi),
1868 get(dnn::signalChargedHadrCands_sum_outerSigCone_mass),
1869 get(dnn::signalChargedHadrCands_nTotal_innerSigCone),
1870 get(dnn::signalChargedHadrCands_nTotal_outerSigCone));
1874 tau.signalNeutrHadrCands(),
1875 signalNeutrHadrCands_sumIn,
1876 signalNeutrHadrCands_sumOut,
1877 get(dnn::signalNeutrHadrCands_sum_innerSigCone_pt),
1878 get(dnn::signalNeutrHadrCands_sum_innerSigCone_dEta),
1879 get(dnn::signalNeutrHadrCands_sum_innerSigCone_dPhi),
1880 get(dnn::signalNeutrHadrCands_sum_innerSigCone_mass),
1881 get(dnn::signalNeutrHadrCands_sum_outerSigCone_pt),
1882 get(dnn::signalNeutrHadrCands_sum_outerSigCone_dEta),
1883 get(dnn::signalNeutrHadrCands_sum_outerSigCone_dPhi),
1884 get(dnn::signalNeutrHadrCands_sum_outerSigCone_mass),
1885 get(dnn::signalNeutrHadrCands_nTotal_innerSigCone),
1886 get(dnn::signalNeutrHadrCands_nTotal_outerSigCone));
1890 tau.signalGammaCands(),
1891 signalGammaCands_sumIn,
1892 signalGammaCands_sumOut,
1893 get(dnn::signalGammaCands_sum_innerSigCone_pt),
1894 get(dnn::signalGammaCands_sum_innerSigCone_dEta),
1895 get(dnn::signalGammaCands_sum_innerSigCone_dPhi),
1896 get(dnn::signalGammaCands_sum_innerSigCone_mass),
1897 get(dnn::signalGammaCands_sum_outerSigCone_pt),
1898 get(dnn::signalGammaCands_sum_outerSigCone_dEta),
1899 get(dnn::signalGammaCands_sum_outerSigCone_dPhi),
1900 get(dnn::signalGammaCands_sum_outerSigCone_mass),
1901 get(dnn::signalGammaCands_nTotal_innerSigCone),
1902 get(dnn::signalGammaCands_nTotal_outerSigCone));
1906 tau.isolationChargedHadrCands(),
1907 isolationChargedHadrCands_sum,
1908 get(dnn::isolationChargedHadrCands_sum_pt),
1909 get(dnn::isolationChargedHadrCands_sum_dEta),
1910 get(dnn::isolationChargedHadrCands_sum_dPhi),
1911 get(dnn::isolationChargedHadrCands_sum_mass),
1912 get(dnn::isolationChargedHadrCands_nTotal));
1916 tau.isolationNeutrHadrCands(),
1917 isolationNeutrHadrCands_sum,
1918 get(dnn::isolationNeutrHadrCands_sum_pt),
1919 get(dnn::isolationNeutrHadrCands_sum_dEta),
1920 get(dnn::isolationNeutrHadrCands_sum_dPhi),
1921 get(dnn::isolationNeutrHadrCands_sum_mass),
1922 get(dnn::isolationNeutrHadrCands_nTotal));
1926 tau.isolationGammaCands(),
1927 isolationGammaCands_sum,
1928 get(dnn::isolationGammaCands_sum_pt),
1929 get(dnn::isolationGammaCands_sum_dEta),
1930 get(dnn::isolationGammaCands_sum_dPhi),
1931 get(dnn::isolationGammaCands_sum_mass),
1932 get(dnn::isolationGammaCands_nTotal));
1934 get(dnn::tau_visMass_innerSigCone) = (signalGammaCands_sumIn + signalChargedHadrCands_sumIn).
mass();
1936 if (check_all_set) {
1937 for (
int var_index = 0; var_index < dnn::NumberOfInputs; ++var_index) {
1938 if (
get(var_index) == default_value_for_set_check)
1939 throw cms::Exception(
"DeepTauId: variable with index = ") << var_index <<
" is not set.";
1948 elecEe = elecEgamma = 0;
1950 if (superCluster.isNonnull() && superCluster.isAvailable() && superCluster->clusters().isNonnull() &&
1951 superCluster->clusters().isAvailable()) {
1952 for (
auto iter = superCluster->clustersBegin(); iter != superCluster->clustersEnd(); ++iter) {
1953 const double energy = (*iter)->energy();
1954 if (iter == superCluster->clustersBegin())
1965 template <
typename Cand
idateCollection>
1988 const bool isInside_innerSigCone =
dR < innerSigCone_radius;
1989 if (isInside_innerSigCone) {
1990 p4_inner +=
cand->p4();
1993 p4_outer +=
cand->p4();
2009 template <
typename Cand
idateCollection>
2033 static constexpr
double min_pt = 30., min_radius = 0.05, cone_opening_coef = 3.;
2040 if (
tau.hasSecondaryVertex()) {
2041 static constexpr
double mTau = 1.77682;
2042 const double mAOne =
tau.p4().M();
2043 const double pAOneMag =
tau.p();
2044 const double argumentThetaGJmax = (
std::pow(mTau, 2) -
std::pow(mAOne, 2)) / (2 * mTau * pAOneMag);
2045 const double argumentThetaGJmeasured =
2046 tau.p4().Vect().Dot(
tau.flightLength()) / (pAOneMag *
tau.flightLength().R());
2047 if (
std::abs(argumentThetaGJmax) <= 1. &&
std::abs(argumentThetaGJmeasured) <= 1.) {
2048 double thetaGJmax = std::asin(argumentThetaGJmax);
2049 double thetaGJmeasured = std::acos(argumentThetaGJmeasured);
2050 gj_diff = thetaGJmeasured - thetaGJmax;
2060 return static_cast<float>(gj_diff);
2066 return abs_eta > 1.46 && abs_eta < 1.558;
2075 if (
reco::deltaR2(
tau.p4(), ele.p4()) < dR2 && (!matched_ele || matched_ele->
pt() < ele.pt())) {