CMS 3D CMS Logo

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 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
UnclusteredBlobProducer(const edm::ParameterSet &)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: HeavyIon.h:7
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::View< reco::Candidate > > candsrc_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511