CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Types | Protected Attributes
GlobalVariablesTableProducer Class Reference
Inheritance diagram for GlobalVariablesTableProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  Identity
 
class  MassSum
 
class  Max
 
class  Min
 
class  PtVectorSum
 
class  ScalarPtSum
 
class  Size
 
class  Variable
 
class  VariableT
 

Public Member Functions

 GlobalVariablesTableProducer (edm::ParameterSet const &params)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~GlobalVariablesTableProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Types

typedef VariableT< bool, uint8_t > BoolVar
 
typedef VariableT< edm::View< reco::Candidate >, float, ScalarPtSum< float, edm::View< reco::Candidate > > > CandidateScalarSumVar
 
typedef VariableT< edm::View< reco::Candidate >, int, Size< edm::View< reco::Candidate > > > CandidateSizeVar
 
typedef VariableT< edm::View< reco::Candidate >, float, MassSum< float, edm::View< reco::Candidate > > > CandidateSumMassVar
 
typedef VariableT< double, float > DoubleVar
 
typedef VariableT< float > FloatVar
 
typedef VariableT< int > IntVar
 

Protected Attributes

boost::ptr_vector< Variablevars_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 

Detailed Description

Definition at line 11 of file GlobalVariablesTableProducer.cc.

Member Typedef Documentation

typedef VariableT<bool,uint8_t> GlobalVariablesTableProducer::BoolVar
protected

Definition at line 137 of file GlobalVariablesTableProducer.cc.

Definition at line 138 of file GlobalVariablesTableProducer.cc.

Definition at line 140 of file GlobalVariablesTableProducer.cc.

Definition at line 139 of file GlobalVariablesTableProducer.cc.

typedef VariableT<double,float> GlobalVariablesTableProducer::DoubleVar
protected

Definition at line 136 of file GlobalVariablesTableProducer.cc.

Definition at line 135 of file GlobalVariablesTableProducer.cc.

Definition at line 134 of file GlobalVariablesTableProducer.cc.

Constructor & Destructor Documentation

GlobalVariablesTableProducer::GlobalVariablesTableProducer ( edm::ParameterSet const &  params)
inline

Definition at line 14 of file GlobalVariablesTableProducer.cc.

References edm::EDConsumerBase::consumesCollector(), Exception, nanoaod::FlatTable::FloatColumn, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), nanoaod::FlatTable::IntColumn, AlCaHLTBitMon_QueryRunRegistry::string, nanoaod::FlatTable::UInt8Column, and vars_.

15  {
16  edm::ParameterSet const & varsPSet = params.getParameter<edm::ParameterSet>("variables");
17  for (const std::string & vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
18  const auto & varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
19  const std::string & type = varPSet.getParameter<std::string>("type");
20  if (type == "int") vars_.push_back(new IntVar(vname, nanoaod::FlatTable::IntColumn, varPSet, consumesCollector()));
21  else if (type == "float") vars_.push_back(new FloatVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
22  else if (type == "double") vars_.push_back(new DoubleVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
23  else if (type == "bool") vars_.push_back(new BoolVar(vname, nanoaod::FlatTable::UInt8Column, varPSet, consumesCollector()));
24  else if (type == "candidatescalarsum") vars_.push_back(new CandidateScalarSumVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
25  else if (type == "candidatesize") vars_.push_back(new CandidateSizeVar(vname, nanoaod::FlatTable::IntColumn, varPSet, consumesCollector()));
26  else if (type == "candidatesummass") vars_.push_back(new CandidateSumMassVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
27  else throw cms::Exception("Configuration", "unsupported type "+type+" for variable "+vname);
28  }
29 
30  produces<nanoaod::FlatTable>();
31  }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
VariableT< edm::View< reco::Candidate >, int, Size< edm::View< reco::Candidate > > > CandidateSizeVar
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
VariableT< edm::View< reco::Candidate >, float, ScalarPtSum< float, edm::View< reco::Candidate > > > CandidateScalarSumVar
boost::ptr_vector< Variable > vars_
VariableT< edm::View< reco::Candidate >, float, MassSum< float, edm::View< reco::Candidate > > > CandidateSumMassVar
GlobalVariablesTableProducer::~GlobalVariablesTableProducer ( )
inlineoverride

Definition at line 33 of file GlobalVariablesTableProducer.cc.

33 {}

Member Function Documentation

void GlobalVariablesTableProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverride

Definition at line 35 of file GlobalVariablesTableProducer.cc.

References eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), JetChargeProducer_cfi::var, and vars_.

35  {
36  auto out = std::make_unique<nanoaod::FlatTable>(1, "", true);
37 
38  for (const auto & var : vars_) var.fill(iEvent, *out);
39 
40  iEvent.put(std::move(out));
41  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
boost::ptr_vector< Variable > vars_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

boost::ptr_vector<Variable> GlobalVariablesTableProducer::vars_
protected

Definition at line 141 of file GlobalVariablesTableProducer.cc.

Referenced by GlobalVariablesTableProducer(), and produce().