CMS 3D CMS Logo

CandReducer.cc
Go to the documentation of this file.
1 
22 
23 class CandReducer : public edm::EDProducer {
24 public:
26  explicit CandReducer(const edm::ParameterSet&);
28  ~CandReducer() override;
29 
30 private:
32  void produce(edm::Event& evt, const edm::EventSetup&) override;
35 };
36 
41 
42 using namespace reco;
43 using namespace edm;
44 
46  : srcToken_(consumes<reco::CandidateView>(cfg.getParameter<edm::InputTag>("src"))) {
47  produces<CandidateCollection>();
48 }
49 
51 
54  evt.getByToken(srcToken_, cands);
55  std::unique_ptr<CandidateCollection> comp(new CandidateCollection);
56  for (reco::CandidateView::const_iterator c = cands->begin(); c != cands->end(); ++c) {
57  std::unique_ptr<Candidate> cand(new LeafCandidate(*c));
58  comp->push_back(cand.release());
59  }
60  evt.put(std::move(comp));
61 }
62 
64 
CandReducer::srcToken_
edm::EDGetTokenT< reco::CandidateView > srcToken_
label of source candidate collection
Definition: CandReducer.cc:34
EDProducer.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
EDMException.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
LeafCandidate.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
CandReducer::~CandReducer
~CandReducer() override
destructor
Definition: CandReducer.cc:50
CandReducer::produce
void produce(edm::Event &evt, const edm::EventSetup &) override
process one evevnt
Definition: CandReducer.cc:52
edm::View
Definition: CaloClusterFwd.h:14
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15144
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
cand
Definition: decayParser.h:32
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
CandReducer::CandReducer
CandReducer(const edm::ParameterSet &)
constructor from parameter set
Definition: CandReducer.cc:45
edm::EventSetup
Definition: EventSetup.h:58
CandReducer
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::EDProducer
Definition: EDProducer.h:35
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
reco::LeafCandidate
Definition: LeafCandidate.h:16
Candidate.h
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::OwnVector
Definition: OwnVector.h:24