CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGC3DClusterSimpleSelector.cc
Go to the documentation of this file.
6 
9 
10 namespace l1t {
12  public:
15  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
16 
17  private:
20 
21  }; // class
22 } // namespace l1t
23 
25  : src_(consumes<l1t::HGCalMulticlusterBxCollection>(iConfig.getParameter<edm::InputTag>("src"))),
26  cut_(iConfig.getParameter<std::string>("cut")) {
27  produces<l1t::HGCalMulticlusterBxCollection>();
28 }
29 
31  std::unique_ptr<l1t::HGCalMulticlusterBxCollection> out = std::make_unique<l1t::HGCalMulticlusterBxCollection>();
32 
34  iEvent.getByToken(src_, multiclusters);
35 
36  for (int bx = multiclusters->getFirstBX(); bx <= multiclusters->getLastBX(); ++bx) {
37  for (auto it = multiclusters->begin(bx), ed = multiclusters->end(bx); it != ed; ++it) {
38  const auto &c = *it;
39  if (cut_(c)) {
40  out->push_back(bx, c);
41  }
42  }
43  }
44 
45  iEvent.put(std::move(out));
46 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EventSetup & c
HGC3DClusterSimpleSelector(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
const edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const StringCutObjectSelector< l1t::HGCalMulticluster > cut_