33 norm_(
cfg.getParameter<double>(
"norm_factor")),
34 ignore_leptons_(
cfg.getParameter<
bool>(
"ignore_leptons")),
35 max_n_pf_(
cfg.getParameter<unsigned
int>(
"max_n_pf")),
37 produces<pat::METCollection>();
48 auto&
input = iInput.at(
"input");
49 auto pfdata =
input.allocate<
float>();
50 auto& vpfdata = (*pfdata)[0];
52 auto& input_cat0 = iInput.at(
"input_cat0");
53 auto pfchg = input_cat0.allocate<
float>();
54 auto& vpfchg = (*pfchg)[0];
56 auto& input_cat1 = iInput.at(
"input_cat1");
57 auto pfpdgId = input_cat1.allocate<
float>();
58 auto& vpfpdgId = (*pfpdgId)[0];
60 auto& input_cat2 = iInput.at(
"input_cat2");
61 auto pffromPV = input_cat2.allocate<
float>();
62 auto& vpffromPV = (*pffromPV)[0];
65 for (
const auto&
pf : pfs) {
76 vpfdata.push_back(
pf.dxy());
77 vpfdata.push_back(
pf.dz());
78 vpfdata.push_back(
pf.eta());
79 vpfdata.push_back(
pf.mass());
81 vpfdata.push_back(
pf.puppiWeight());
89 vpffromPV.push_back(
pf.fromPV());
94 <<
"<DeepMETSonicProducer::acquire>:" << std::endl
95 <<
" The number of particles is equal to or exceeds the maximum considerable for DeepMET" << std::endl;
107 input.toServer(pfdata);
108 input_cat0.toServer(pfchg);
109 input_cat1.toServer(pfpdgId);
110 input_cat2.toServer(pffromPV);
114 const auto&
output1 = iOutput.begin()->second;
125 LogDebug(
"produce") <<
"<DeepMETSonicProducer::produce>:" << std::endl
126 <<
" MET from DeepMET Sonic Producer is MET_x " <<
px <<
" and MET_y " <<
py << std::endl;
128 auto pf_mets = std::make_unique<pat::METCollection>();
130 pf_mets->emplace_back(
reco::MET(p4, {}));
138 desc.add<
bool>(
"ignore_leptons",
false);
139 desc.add<
double>(
"norm_factor", 50.);
140 desc.add<
unsigned int>(
"max_n_pf", 4500);
141 descriptions.
add(
"deepMETSonicProducer",
desc);
const unsigned int max_n_pf_
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, Input &iInput) override
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup, Output const &iOutput) override
static const std::unordered_map< int, int32_t > charge_embedding
static std::string const input
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const bool ignore_leptons_
TritonClient ::Output Output
const edm::EDGetTokenT< std::vector< pat::PackedCandidate > > pf_token_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
TritonClient ::Input Input
static const std::unordered_map< int, int32_t > pdg_id_embedding
DeepMETSonicProducer(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
float scale_and_rm_outlier(float val, float scale)
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
Log< level::Warning, false > LogWarning
std::unique_ptr< TritonClient > client_