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  private:
24  };
25 }
26 
27 
29  candsrc_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("candsrc") ))
30 {
31  produces<std::vector<reco::VertexCompositePtrCandidate>>();
32 }
33 
35 
37 
38  auto blob = std::make_unique<std::vector<reco::VertexCompositePtrCandidate>>();
39 
41  iEvent.getByToken(candsrc_, candidates);
42 
43  blob->emplace_back();
44 
45  auto& c_blob = blob->back();
46 
47  // combine all candidates into composite so they can be accessed properly by CandPtrSelector
48  for(unsigned i = 0; i < candidates->size(); ++i){
49  c_blob.addDaughter(candidates->ptrAt(i));
50  }
51 
52  iEvent.put(std::move(blob));
53 
54 }
55 
58  desc.add<edm::InputTag>("candsrc",edm::InputTag("badUnclustered"));
59 
60  descriptions.add("UnclusteredBlobProducer",desc);
61 }
62 
64 
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
UnclusteredBlobProducer(const edm::ParameterSet &)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: HeavyIon.h:7
int iEvent
Definition: GenABIO.cc:230
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)
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:510