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::EDConsumerBase edm::ProducerBase edm::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 process an event More...
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 process an event More...
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

bool eventInfo_
 
bool lazyParser_
 
std::string prefix_
 
edm::EDGetTokenT< C > srcToken_
 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
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 21 of file NtpProducer.h.

Constructor & Destructor Documentation

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

constructor from parameter set

Definition at line 43 of file NtpProducer.h.

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

43  :
44  srcToken_( consumes<C>( par.template getParameter<edm::InputTag>( "src" ) ) ),
45  lazyParser_( par.template getUntrackedParameter<bool>( "lazyParser", false ) ),
46  prefix_( par.template getUntrackedParameter<std::string>( "prefix","" ) ),
47  eventInfo_( par.template getUntrackedParameter<bool>( "eventInfo",true ) ){
48  std::vector<edm::ParameterSet> variables =
49  par.template getParameter<std::vector<edm::ParameterSet> >("variables");
50  std::vector<edm::ParameterSet>::const_iterator
51  q = variables.begin(), end = variables.end();
52  if(eventInfo_){
53  produces<edm::EventNumber_t>( prefix_+"EventNumber" ).setBranchAlias( prefix_ + "EventNumber" );
54  produces<unsigned int>( prefix_ + "RunNumber" ).setBranchAlias( prefix_ + "RunNumber" );
55  produces<unsigned int>( prefix_ + "LumiBlock" ).setBranchAlias( prefix_ + "Lumiblock" );
56  }
57  for (; q!=end; ++q) {
58  std::string tag = prefix_ + q->getUntrackedParameter<std::string>("tag");
59  StringObjectFunction<typename C::value_type> quantity(q->getUntrackedParameter<std::string>("quantity"), lazyParser_);
60  tags_.push_back(std::make_pair(tag, quantity));
61  produces<std::vector<float> >(tag).setBranchAlias(tag);
62 
63  }
64 }
bool eventInfo_
Definition: NtpProducer.h:39
std::string prefix_
Definition: NtpProducer.h:38
edm::EDGetTokenT< C > srcToken_
label of the collection to be read in
Definition: NtpProducer.h:34
#define end
Definition: vmac.h:37
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > tags_
variable tags
Definition: NtpProducer.h:36
bool lazyParser_
Definition: NtpProducer.h:37
template<typename C >
NtpProducer< C >::~NtpProducer ( )

destructor

Definition at line 67 of file NtpProducer.h.

67  {
68 }
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 >
virtual void NtpProducer< C >::produce ( edm::Event ,
const edm::EventSetup  
)
protectedvirtual

process an event

Implements edm::EDProducer.

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

process an event

Implements edm::EDProducer.

Definition at line 71 of file NtpProducer.h.

References coll, HTMLExport::elem(), end, edm::EventID::event(), event(), edm::Event::getByToken(), 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().

71  {
73  iEvent.getByToken(srcToken_, coll);
74  if(eventInfo_){
75  std::auto_ptr<edm::EventNumber_t> event( new edm::EventNumber_t );
76  std::auto_ptr<unsigned int> run( new unsigned int );
77  std::auto_ptr<unsigned int> lumi( new unsigned int );
78  *event = iEvent.id().event();
79  *run = iEvent.id().run();
80  *lumi = iEvent.luminosityBlock();
81  iEvent.put( event, prefix_ + "EventNumber" );
82  iEvent.put( run, prefix_ + "RunNumber" );
83  iEvent.put( lumi, prefix_ + "LumiBlock" );
84  }
85  typename std::vector<std::pair<std::string, StringObjectFunction<typename C::value_type> > >::const_iterator
86  q = tags_.begin(), end = tags_.end();
87  for(;q!=end; ++q) {
88  std::auto_ptr<std::vector<float> > x(new std::vector<float>);
89  x->reserve(coll->size());
90  for (typename C::const_iterator elem=coll->begin(); elem!=coll->end(); ++elem ) {
91  x->push_back(q->second(*elem));
92  }
93  iEvent.put(x, q->first);
94  }
95 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
bool eventInfo_
Definition: NtpProducer.h:39
std::string prefix_
Definition: NtpProducer.h:38
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
tuple lumi
Definition: fjr2json.py:35
edm::EDGetTokenT< C > srcToken_
label of the collection to be read in
Definition: NtpProducer.h:34
unsigned long long EventNumber_t
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
#define end
Definition: vmac.h:37
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
JetCorrectorParametersCollection coll
Definition: classes.h:10
std::vector< std::pair< std::string, StringObjectFunction< typename C::value_type > > > tags_
variable tags
Definition: NtpProducer.h:36
edm::EventID id() const
Definition: EventBase.h:60

Member Data Documentation

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

Definition at line 39 of file NtpProducer.h.

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

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

Definition at line 37 of file NtpProducer.h.

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

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

Definition at line 38 of file NtpProducer.h.

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

template<typename C >
edm::EDGetTokenT< C > NtpProducer< C >::srcToken_
private

label of the collection to be read in

Definition at line 34 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 36 of file NtpProducer.h.

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