CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
NtpProducer< C > Class Template Reference

#include <NtpProducer.h>

Inheritance diagram for NtpProducer< C >:
edm::EDProducer edm::EDProducer edm::ProducerBase edm::ProducerBase edm::ProductRegistryHelper edm::ProductRegistryHelper

Public Member Functions

 NtpProducer (const edm::ParameterSet &)
 constructor from parameter set More...
 
 NtpProducer (const edm::ParameterSet &)
 constructor from parameter set More...
 
 ~NtpProducer ()
 destructor More...
 
 ~NtpProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Protected Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 process an event More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 process an event More...
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Private Attributes

bool eventInfo_
 
bool lazyParser_
 
std::string prefix_
 
edm::InputTag src_
 label of the collection to be read in More...
 
std::vector< std::pair
< std::string,
StringObjectFunction< typename
C::value_type > > > 
tags_
 variable tags More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

template<typename C>
class NtpProducer< C >

Creates histograms defined in config file

Author
: Luca Lista, INFN

Template parameters:

Definition at line 20 of file NtpProducer.h.

Constructor & Destructor Documentation

template<typename C >
NtpProducer< C >::NtpProducer ( const edm::ParameterSet par)

constructor from parameter set

Definition at line 42 of file NtpProducer.h.

References end, NtpProducer< C >::eventInfo_, NtpProducer< C >::lazyParser_, NtpProducer< C >::prefix_, lumiQueryAPI::q, GlobalPosition_Frontier_DevDB_cff::tag, NtpProducer< C >::tags_, and makeLayoutFileForGui::variables.

42  :
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();
51  if(eventInfo_){
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" );
55  }
56  for (; q!=end; ++q) {
57  std::string tag = prefix_ + q->getUntrackedParameter<std::string>("tag");
58  StringObjectFunction<typename C::value_type> quantity(q->getUntrackedParameter<std::string>("quantity"), lazyParser_);
59  tags_.push_back(std::make_pair(tag, quantity));
60  produces<std::vector<float> >(tag).setBranchAlias(tag);
61 
62  }
63 }
edm::InputTag src_
label of the collection to be read in
Definition: NtpProducer.h:33
bool eventInfo_
Definition: NtpProducer.h:38
std::string prefix_
Definition: NtpProducer.h:37
#define end
Definition: vmac.h:38
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > tags_
variable tags
Definition: NtpProducer.h:35
bool lazyParser_
Definition: NtpProducer.h:36
template<typename C >
NtpProducer< C >::~NtpProducer ( )

destructor

Definition at line 66 of file NtpProducer.h.

66  {
67 }
template<typename C >
NtpProducer< C >::NtpProducer ( const edm::ParameterSet )

constructor from parameter set

template<typename C >
NtpProducer< C >::~NtpProducer ( )

destructor

Member Function Documentation

template<typename C >
void NtpProducer< C >::produce ( edm::Event iEvent,
const edm::EventSetup  
)
protectedvirtual

process an event

Implements edm::EDProducer.

Definition at line 70 of file NtpProducer.h.

References coll, HTMLExport::elem(), end, edm::EventID::event(), event(), edm::Event::getByLabel(), edm::EventBase::id(), fjr2json::lumi, edm::EventBase::luminosityBlock(), edm::Event::put(), lumiQueryAPI::q, edm::EventID::run(), DTTTrigCorrFirst::run, and x.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

70  {
72  iEvent.getByLabel(src_, coll);
73  if(eventInfo_){
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 );
77  *event = iEvent.id().event();
78  *run = iEvent.id().run();
79  *lumi = iEvent.luminosityBlock();
80  iEvent.put( event, prefix_ + "EventNumber" );
81  iEvent.put( run, prefix_ + "RunNumber" );
82  iEvent.put( lumi, prefix_ + "LumiBlock" );
83  }
84  typename std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >::const_iterator
85  q = tags_.begin(), end = tags_.end();
86  for(;q!=end; ++q) {
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));
91  }
92  iEvent.put(x, q->first);
93  }
94 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
edm::InputTag src_
label of the collection to be read in
Definition: NtpProducer.h:33
bool eventInfo_
Definition: NtpProducer.h:38
std::string prefix_
Definition: NtpProducer.h:37
tuple lumi
Definition: fjr2json.py:35
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
#define end
Definition: vmac.h:38
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
Definition: Event.h:356
JetCorrectorParametersCollection coll
Definition: classes.h:14
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > tags_
variable tags
Definition: NtpProducer.h:35
edm::EventID id() const
Definition: EventBase.h:56
Definition: DDAxes.h:10
template<typename C >
virtual void NtpProducer< C >::produce ( edm::Event ,
const edm::EventSetup  
)
protectedvirtual

process an event

Implements edm::EDProducer.

Member Data Documentation

template<typename C >
bool NtpProducer< C >::eventInfo_
private

Definition at line 38 of file NtpProducer.h.

Referenced by NtpProducer< C >::NtpProducer().

template<typename C >
bool NtpProducer< C >::lazyParser_
private

Definition at line 36 of file NtpProducer.h.

Referenced by NtpProducer< C >::NtpProducer().

template<typename C >
std::string NtpProducer< C >::prefix_
private

Definition at line 37 of file NtpProducer.h.

Referenced by NtpProducer< C >::NtpProducer().

template<typename C >
edm::InputTag NtpProducer< C >::src_
private

label of the collection to be read in

Definition at line 33 of file NtpProducer.h.

template<typename C >
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > NtpProducer< C >::tags_
private

variable tags

Definition at line 35 of file NtpProducer.h.

Referenced by NtpProducer< C >::NtpProducer().