CMS 3D CMS Logo

PFConcretePFCandidateProducer.cc
Go to the documentation of this file.
6 
7 namespace edm {
8  class EventSetup;
9 } // namespace edm
10 
12 public:
15 
16  void produce(edm::Event&, const edm::EventSetup&) override;
17  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
18 
19 private:
21 };
22 
24 
27  desc.add<edm::InputTag>("src", {"particleFlow"});
28  descriptions.addWithDefaultLabel(desc);
29 }
30 
32  : inputColl_(consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>("src"))) {
33  // register products
34  produces<reco::PFCandidateCollection>();
35 }
36 
38 
40  const auto& inputColl = iEvent.getHandle(inputColl_);
41 
42  if (!inputColl.isValid()) {
43  // nothing ... I guess we prefer to send an exception in the next lines
44  }
45 
46  auto outputColl = std::make_unique<reco::PFCandidateCollection>();
47  outputColl->resize(inputColl->size());
48 
49  for (unsigned int iCopy = 0; iCopy != inputColl->size(); ++iCopy) {
50  const reco::PFCandidate& pf = (*inputColl)[iCopy];
51  (*outputColl)[iCopy] = pf;
52  //dereferenced internally the ref and hardcopy the value
53  (*outputColl)[iCopy].setVertex(pf.vertex());
54  //math::XYZPoint(pf.vx(),pf.vy(),pf.vz()));
55  }
56 
58 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
PFConcretePFCandidateProducer(const edm::ParameterSet &)
std::vector< l1t::PFCandidate > PFCandidateCollection
Definition: PFCandidate.h:86
int iEvent
Definition: GenABIO.cc:224
void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
fixed size matrix
HLT enums.
const edm::EDGetTokenT< reco::PFCandidateCollection > inputColl_
def move(src, dest)
Definition: eostools.py:511