18 [[maybe_unused]]
float deltap = 0.0;
19 [[maybe_unused]]
float sigmadeltap = 0.0;
20 [[maybe_unused]]
float px = 0.0;
21 [[maybe_unused]]
float py = 0.0;
22 [[maybe_unused]]
float pz = 0.0;
26 float trajpoint = 0.0;
34 float muon_dt_hits = 0.0;
35 float muon_csc_hits = 0.0;
38 const auto& matched_pftrack = orig.
trackRefPF();
39 if (matched_pftrack.isNonnull()) {
42 if (atHCAL.isValid()) {
43 eta_hcal = atHCAL.positionREP().eta();
44 phi_hcal = atHCAL.positionREP().phi();
46 if (atECAL.isValid()) {
47 eta_ecal = atECAL.positionREP().eta();
48 phi_ecal = atECAL.positionREP().phi();
65 muon_dt_hits = standAloneMu->hitPattern().numberOfValidMuonDTHits();
66 muon_csc_hits = standAloneMu->hitPattern().numberOfValidMuonCSCHits();
72 const auto& ref = orig2->GsftrackRef();
73 if (ref.isNonnull()) {
74 deltap = orig2->DeltaP();
75 sigmadeltap = orig2->SigmaDeltaP();
83 trajpoint = orig2->indTrajPoint();
89 const auto& vec = orig2->Pin();
97 if (!orig2->GsftrackRefPF().isNull()) {
98 charge = orig2->GsftrackRefPF()->charge();
105 if (ref.isNonnull()) {
108 px = ref->position().x();
109 py = ref->position().y();
110 pz = ref->position().z();
112 layer = ref->layer();
113 depth = ref->depth();
117 if (clref.isNonnull()) {
120 px = clref->position().x();
121 py = clref->position().y();
122 pz = clref->position().z();
130 return std::array<float, NUM_ELEMENT_FEATURES>({{typ_idx,
157 int argMax(std::vector<float>
const& vec) {
158 return static_cast<int>(
std::distance(vec.begin(), max_element(vec.begin(), vec.end())));
166 float pred_pt = pred_e / cosh(pred_eta);
170 if (pred_pid == 11 || pred_pid == 13 || pred_pid == 211) {
171 charge = pred_charge > 0 ? +1 : -1;
178 cand.setPdgId(pred_pid);
185 std::vector<reco::PFCandidate> pOutputCandidateCollection;
187 std::vector<const reco::PFBlockElement*> all_elements;
189 const auto& elems =
block.elements();
190 for (
const auto& elem : elems) {
192 all_elements.push_back(&elem);
195 edm::LogError(
"MLPFProducer") <<
"too many input PFElements for predefined model size: " << elems.size();
204 const std::vector<const reco::PFBlockElement*> elems,
205 size_t ielem_originator) {
212 const auto& muonref = elem->
muonRef();
213 if (muonref.isNonnull()) {
214 cand.setMuonRef(muonref);