1 #ifndef UtilAlgos_NtpProducer_h
2 #define UtilAlgos_NtpProducer_h
35 std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >
tags_;
43 src_( par.
template getParameter<edm::InputTag>(
"src" ) ),
44 lazyParser_( par.
template getUntrackedParameter<bool>(
"lazyParser",
false ) ),
45 prefix_( par.
template getUntrackedParameter<std::string>(
"prefix",
"" ) ),
46 eventInfo_( par.
template getUntrackedParameter<bool>(
"eventInfo",
true ) ){
47 std::vector<edm::ParameterSet>
variables =
48 par.template getParameter<std::vector<edm::ParameterSet> >(
"variables");
49 std::vector<edm::ParameterSet>::const_iterator
50 q = variables.begin(),
end = variables.end();
52 produces<unsigned int>(
prefix_+
"EventNumber" ).setBranchAlias(
prefix_ +
"EventNumber" );
53 produces<unsigned int>(
prefix_ +
"RunNumber" ).setBranchAlias(
prefix_ +
"RunNumber" );
54 produces<unsigned int>(
prefix_ +
"LumiBlock" ).setBranchAlias(
prefix_ +
"Lumiblock" );
57 std::string
tag =
prefix_ + q->getUntrackedParameter<std::string>(
"tag");
59 tags_.push_back(std::make_pair(tag, quantity));
60 produces<std::vector<float> >(
tag).setBranchAlias(tag);
74 std::auto_ptr<unsigned int>
event(
new unsigned int );
75 std::auto_ptr<unsigned int>
run(
new unsigned int );
76 std::auto_ptr<unsigned int>
lumi(
new unsigned int );
78 *run = iEvent.
id().
run();
80 iEvent.
put( event, prefix_ +
"EventNumber" );
81 iEvent.
put( run, prefix_ +
"RunNumber" );
82 iEvent.
put( lumi, prefix_ +
"LumiBlock" );
84 typename std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >::const_iterator
85 q = tags_.begin(),
end = tags_.end();
87 std::auto_ptr<std::vector<float> >
x(
new std::vector<float>);
88 x->reserve(coll->size());
89 for (
typename C::const_iterator
elem=coll->begin();
elem!=coll->end(); ++
elem ) {
90 x->push_back(q->second(*
elem));
92 iEvent.
put(x, q->first);
EventNumber_t event() const
edm::InputTag src_
label of the collection to be read in
edm::LuminosityBlockNumber_t luminosityBlock() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
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