CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Merger.h
Go to the documentation of this file.
1 #ifndef UtilAlgos_Merger_h
2 #define UtilAlgos_Merger_h
3 
25 #include <vector>
26 
27 template<typename InputCollection,
30 class Merger : public edm::EDProducer {
31 public:
33  explicit Merger( const edm::ParameterSet& );
35  ~Merger();
36 
37 private:
39  virtual void produce( edm::Event&, const edm::EventSetup&) override;
41  typedef std::vector<edm::InputTag> vtag;
44 };
45 
46 template<typename InputCollection, typename OutputCollection, typename P>
48  src_( par.template getParameter<vtag>( "src" ) ) {
49  produces<OutputCollection>();
50 }
51 
52 template<typename InputCollection, typename OutputCollection, typename P>
54 }
55 
56 template<typename InputCollection, typename OutputCollection, typename P>
58  std::auto_ptr<OutputCollection> coll( new OutputCollection );
59  for( vtag::const_iterator s = src_.begin(); s != src_.end(); ++ s ) {
61  evt.getByLabel( * s, h );
62  for( typename InputCollection::const_iterator c = h->begin(); c != h->end(); ++c ) {
63  coll->push_back( P::clone( * c ) );
64  }
65  }
66  evt.put( coll );
67 }
68 
69 #endif
70 
std::vector< ProtoJet > OutputCollection
Definition: JetRecoTypes.h:63
vtag src_
labels of the collections to be merged
Definition: Merger.h:43
std::vector< InputItem > InputCollection
Definition: JetRecoTypes.h:62
#define P
~Merger()
destructor
Definition: Merger.h:53
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
Definition: Merger.h:30
std::vector< edm::InputTag > vtag
vector of strings
Definition: Merger.h:41
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
JetCorrectorParametersCollection coll
Definition: classes.h:16
virtual void produce(edm::Event &, const edm::EventSetup &) override
process an event
Definition: Merger.h:57
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Merger(const edm::ParameterSet &)
constructor from parameter set
Definition: Merger.h:47
def template
Definition: svgfig.py:520