1 #ifndef UtilAlgos_NtpProducer_h
2 #define UtilAlgos_NtpProducer_h
35 std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >
tags_;
40 src_( par.
template getParameter<edm::InputTag>(
"src" ) ) {
41 std::vector<edm::ParameterSet>
variables =
42 par.template getParameter<std::vector<edm::ParameterSet> >(
"variables");
43 std::vector<edm::ParameterSet>::const_iterator
44 q = variables.begin(),
end = variables.end();
46 std::string
tag = q->getUntrackedParameter<std::string>(
"tag");
48 tags_.push_back(std::make_pair(tag, quantity));
49 produces<std::vector<float> >(
tag).setBranchAlias(tag);
62 typename std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >::const_iterator
63 q = tags_.begin(),
end = tags_.end();
65 std::auto_ptr<std::vector<float> >
x(
new std::vector<float>);
66 x->reserve(coll->size());
67 for (
typename C::const_iterator
elem=coll->begin();
elem!=coll->end(); ++
elem ) {
68 x->push_back(q->second(*
elem));
70 iEvent.
put(
x, q->first);
edm::InputTag src_
label of the collection to be read in
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > tags_
variable tags
NtpProducer(const edm::ParameterSet &)
constructor from parameter set
virtual void produce(edm::Event &, const edm::EventSetup &)
process an event