File indexing completed on 2024-04-06 12:27:27
0001 #ifndef RecoParticleFlow_PFProducer_interface_MLPFModel
0002 #define RecoParticleFlow_PFProducer_interface_MLPFModel
0003
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
0006 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0007
0008 namespace reco::mlpf {
0009
0010 static constexpr unsigned int NUM_ELEMENT_FEATURES = 25;
0011 static constexpr unsigned int NUM_OUTPUT_FEATURES = 14;
0012
0013
0014 static constexpr int LSH_BIN_SIZE = 64;
0015 static constexpr int NUM_MAX_ELEMENTS_BATCH = 200 * LSH_BIN_SIZE;
0016
0017
0018 static constexpr int BATCH_SIZE = 1;
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 static constexpr unsigned int IDX_CLASS = 7;
0029
0030 static constexpr unsigned int IDX_CHARGE = 8;
0031
0032 static constexpr unsigned int IDX_PT = 9;
0033 static constexpr unsigned int IDX_ETA = 10;
0034 static constexpr unsigned int IDX_SIN_PHI = 11;
0035 static constexpr unsigned int IDX_COS_PHI = 12;
0036 static constexpr unsigned int IDX_ENERGY = 13;
0037
0038
0039 static constexpr float PI_MASS = 0.13957;
0040
0041
0042
0043 static const std::vector<int> pdgid_encoding = {0, 211, 130, 1, 2, 22, 11, 13};
0044
0045
0046
0047 static const std::map<int, int> elem_type_encoding = {
0048 {0, 0},
0049 {1, 1},
0050 {2, 2},
0051 {3, 3},
0052 {4, 4},
0053 {5, 5},
0054 {6, 6},
0055 {7, 7},
0056 {8, 8},
0057 {9, 9},
0058 {10, 10},
0059 {11, 11},
0060 };
0061
0062 std::array<float, NUM_ELEMENT_FEATURES> getElementProperties(const reco::PFBlockElement& orig);
0063 float normalize(float in);
0064
0065 int argMax(std::vector<float> const& vec);
0066
0067 reco::PFCandidate makeCandidate(int pred_pid,
0068 int pred_charge,
0069 float pred_pt,
0070 float pred_eta,
0071 float pred_sin_phi,
0072 float pred_cos_phi,
0073 float pred_e);
0074
0075 const std::vector<const reco::PFBlockElement*> getPFElements(const reco::PFBlockCollection& blocks);
0076
0077 void setCandidateRefs(reco::PFCandidate& cand,
0078 const std::vector<const reco::PFBlockElement*> elems,
0079 size_t ielem_originator);
0080 };
0081
0082 #endif