39 emOnly_(iConfig.getParameter<bool>(
"emOnly")),
40 etCut_(iConfig.getParameter<double>(
"etMin")),
41 preEmId_(iConfig.getParameter<std::
string>(
"preEmId")),
42 emVsPionID_(iConfig.getParameter<edm::
ParameterSet>(
"emVsPionID")),
43 emVsPUID_(iConfig.getParameter<edm::
ParameterSet>(
"emVsPUID")),
44 hasEmId_((iConfig.existsAs<std::
string>(
"preEmId") && !iConfig.getParameter<std::
string>(
"preEmId").
empty()) ||
45 !emVsPionID_.method().
empty()),
46 corrector_(iConfig.getParameter<std::
string>(
"corrector"),
47 emOnly_ || iConfig.getParameter<std::
string>(
"corrector").
empty()
49 : iConfig.getParameter<double>(
"correctorEmfMax")),
50 resol_(iConfig.getParameter<edm::
ParameterSet>(
"resol")) {
58 produces<l1t::PFClusterCollection>();
60 produces<l1t::PFClusterCollection>(
"em");
61 produces<l1t::PFClusterCollection>(
"had");
66 auto out = std::make_unique<l1t::PFClusterCollection>();
67 std::unique_ptr<l1t::PFClusterCollection> outEm, outHad;
69 outEm = std::make_unique<l1t::PFClusterCollection>();
70 outHad = std::make_unique<l1t::PFClusterCollection>();
75 for (
auto it = multiclusters->begin(0), ed = multiclusters->end(0); it != ed; ++it) {
76 float pt = it->pt(), hoe = it->hOverE();
77 bool isEM = hasEmId_ ? preEmId_(*it) : emOnly_;
88 if (!emVsPUID_.method().empty()) {
89 if (!emVsPUID_.passID(*it, cluster)) {
93 if (!emVsPionID_.method().empty()) {
94 cluster.
setIsEM(emVsPionID_.passID(*it, cluster));
96 if (corrector_.valid())
97 corrector_.correctPt(cluster);
98 cluster.setPtError(resol_(cluster.pt(),
std::abs(cluster.eta())));
100 out->push_back(cluster);
103 (isEM ? outEm : outHad)->push_back(
out->back());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
PFClusterProducerFromHGC3DClusters(const edm::ParameterSet &)
BXVector< HGCalMulticluster > HGCalMulticlusterBxCollection
Abs< T >::type abs(const T &t)
l1tpf::HGC3DClusterEgID emVsPionID_
l1tpf::HGC3DClusterEgID emVsPUID_
l1tpf::ParametricResolution resol_
l1tpf::corrector corrector_
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
void produce(edm::Event &, const edm::EventSetup &) override
StringCutObjectSelector< l1t::HGCalMulticluster > preEmId_
~PFClusterProducerFromHGC3DClusters() override