CMS 3D CMS Logo

Public Member Functions | Private Attributes

reco::tautools::CopyProducer< Collection > Class Template Reference

#include <CopyProducer.h>

Inheritance diagram for reco::tautools::CopyProducer< Collection >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CopyProducer (const edm::ParameterSet &pset)
 constructor from parameter set
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
 process an event
 ~CopyProducer ()
 destructor

Private Attributes

edm::InputTag src_
 labels of the collection to be converted

Detailed Description

template<typename Collection>
class reco::tautools::CopyProducer< Collection >

Definition at line 25 of file CopyProducer.h.


Constructor & Destructor Documentation

template<typename Collection >
reco::tautools::CopyProducer< Collection >::CopyProducer ( const edm::ParameterSet pset) [inline, explicit]

constructor from parameter set

Definition at line 28 of file CopyProducer.h.

        :src_(pset.template getParameter<edm::InputTag>("src")) {
          produces<Collection>();
        }
template<typename Collection >
reco::tautools::CopyProducer< Collection >::~CopyProducer ( ) [inline]

destructor

Definition at line 33 of file CopyProducer.h.

{};

Member Function Documentation

template<typename Collection >
virtual void reco::tautools::CopyProducer< Collection >::produce ( edm::Event evt,
const edm::EventSetup es 
) [inline, virtual]

process an event

Implements edm::EDProducer.

Definition at line 35 of file CopyProducer.h.

References coll, filterCSVwithJSON::copy, edm::Event::getByLabel(), collect_tpl::input, edm::Event::put(), and reco::tautools::CopyProducer< Collection >::src_.

                                                                 {
      // Output collection
      std::auto_ptr<Collection> coll(new Collection());
      typedef edm::View<typename Collection::value_type> CView;
      // Get input
      edm::Handle<CView> input;
      evt.getByLabel(src_, input);
      // Reserve space
      coll->reserve(input->size());
      // Copy the input to the output
      std::copy(input->begin(), input->end(), std::back_inserter(*coll));
      evt.put( coll );
    }

Member Data Documentation

template<typename Collection >
edm::InputTag reco::tautools::CopyProducer< Collection >::src_ [private]

labels of the collection to be converted

Definition at line 50 of file CopyProducer.h.

Referenced by reco::tautools::CopyProducer< Collection >::produce().