19 [[maybe_unused]]
float deltap = 0.0;
20 [[maybe_unused]]
float sigmadeltap = 0.0;
21 [[maybe_unused]]
float px = 0.0;
22 [[maybe_unused]]
float py = 0.0;
23 [[maybe_unused]]
float pz = 0.0;
27 float trajpoint = 0.0;
35 float muon_dt_hits = 0.0;
36 float muon_csc_hits = 0.0;
39 const auto& matched_pftrack = orig.
trackRefPF();
40 if (matched_pftrack.isNonnull()) {
43 if (atHCAL.isValid()) {
44 eta_hcal = atHCAL.positionREP().eta();
45 phi_hcal = atHCAL.positionREP().phi();
47 if (atECAL.isValid()) {
48 eta_ecal = atECAL.positionREP().eta();
49 phi_ecal = atECAL.positionREP().phi();
66 muon_dt_hits = standAloneMu->hitPattern().numberOfValidMuonDTHits();
67 muon_csc_hits = standAloneMu->hitPattern().numberOfValidMuonCSCHits();
73 const auto& ref = orig2->GsftrackRef();
74 if (ref.isNonnull()) {
75 deltap = orig2->DeltaP();
76 sigmadeltap = orig2->SigmaDeltaP();
84 trajpoint = orig2->indTrajPoint();
90 const auto& vec = orig2->Pin();
98 if (!orig2->GsftrackRefPF().isNull()) {
99 charge = orig2->GsftrackRefPF()->charge();
106 if (ref.isNonnull()) {
109 px = ref->position().x();
110 py = ref->position().y();
111 pz = ref->position().z();
113 layer = ref->layer();
114 depth = ref->depth();
118 if (clref.isNonnull()) {
121 px = clref->position().x();
122 py = clref->position().y();
123 pz = clref->position().z();
131 return std::array<float, NUM_ELEMENT_FEATURES>({{typ_idx,
158 int argMax(std::vector<float>
const& vec) {
159 return static_cast<int>(
std::distance(vec.begin(), max_element(vec.begin(), vec.end())));
167 float pred_pt = pred_e / cosh(pred_eta);
171 if (pred_pid == 11 || pred_pid == 13 || pred_pid == 211) {
172 charge = pred_charge > 0 ? +1 : -1;
179 cand.setPdgId(pred_pid);
186 std::vector<reco::PFCandidate> pOutputCandidateCollection;
188 std::vector<const reco::PFBlockElement*> all_elements;
190 const auto& elems =
block.elements();
191 for (
const auto& elem : elems) {
193 all_elements.push_back(&elem);
196 edm::LogError(
"MLPFProducer") <<
"too many input PFElements for predefined model size: " << elems.size();
205 const std::vector<const reco::PFBlockElement*> elems,
206 size_t ielem_originator) {
213 const auto& muonref = elem->
muonRef();
214 if (muonref.isNonnull()) {
215 cand.setMuonRef(muonref);