CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
UnclusteredBlobProducer.cc
Go to the documentation of this file.
1 #include <string>
2 #include <memory>
3 
9 
14 
15 namespace pat {
17  public:
19  ~UnclusteredBlobProducer() override;
20  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
21  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
22 
23  private:
25  };
26 } // namespace pat
27 
29  : candsrc_(consumes<edm::View<reco::Candidate>>(iConfig.getParameter<edm::InputTag>("candsrc"))) {
30  produces<std::vector<reco::VertexCompositePtrCandidate>>();
31 }
32 
34 
36  auto blob = std::make_unique<std::vector<reco::VertexCompositePtrCandidate>>();
37 
39  iEvent.getByToken(candsrc_, candidates);
40 
41  blob->emplace_back();
42 
43  auto& c_blob = blob->back();
44 
45  // combine all candidates into composite so they can be accessed properly by CandPtrSelector
46  for (unsigned i = 0; i < candidates->size(); ++i) {
47  c_blob.addDaughter(candidates->ptrAt(i));
48  }
49 
50  iEvent.put(std::move(blob));
51 }
52 
55  desc.add<edm::InputTag>("candsrc", edm::InputTag("badUnclustered"));
56 
57  descriptions.add("UnclusteredBlobProducer", desc);
58 }
59 
61 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
UnclusteredBlobProducer(const edm::ParameterSet &)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
edm::EDGetTokenT< edm::View< reco::Candidate > > candsrc_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)