CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Types | Protected Attributes
SimpleFlatTableProducerBase< T, TProd > Class Template Referenceabstract
Inheritance diagram for SimpleFlatTableProducerBase< T, TProd >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  FuncVariable
 
class  Variable
 
class  VariableBase
 

Public Member Functions

virtual std::unique_ptr< nanoaod::FlatTablefillTable (const edm::Event &iEvent, const edm::Handle< TProd > &prod) const =0
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SimpleFlatTableProducerBase (edm::ParameterSet const &params)
 
 ~SimpleFlatTableProducerBase () 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Types

typedef FuncVariable< StringCutObjectSelector< T >, uint8_t > BoolVar
 
typedef FuncVariable< StringObjectFunction< T >, float > FloatVar
 
typedef FuncVariable< StringObjectFunction< T >, int > IntVar
 
typedef FuncVariable< StringObjectFunction< T >, uint8_t > UInt8Var
 

Protected Attributes

const std::string doc_
 
const bool extension_
 
const std::string name_
 
const edm::EDGetTokenT< TProd > src_
 
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

template<typename T, typename TProd>
class SimpleFlatTableProducerBase< T, TProd >

Definition at line 15 of file SimpleFlatTableProducer.cc.

Member Typedef Documentation

template<typename T, typename TProd>
typedef FuncVariable<StringCutObjectSelector<T>,uint8_t> SimpleFlatTableProducerBase< T, TProd >::BoolVar
protected

Definition at line 101 of file SimpleFlatTableProducer.cc.

template<typename T, typename TProd>
typedef FuncVariable<StringObjectFunction<T>,float> SimpleFlatTableProducerBase< T, TProd >::FloatVar
protected

Definition at line 99 of file SimpleFlatTableProducer.cc.

template<typename T, typename TProd>
typedef FuncVariable<StringObjectFunction<T>,int> SimpleFlatTableProducerBase< T, TProd >::IntVar
protected

Definition at line 98 of file SimpleFlatTableProducer.cc.

template<typename T, typename TProd>
typedef FuncVariable<StringObjectFunction<T>,uint8_t> SimpleFlatTableProducerBase< T, TProd >::UInt8Var
protected

Definition at line 100 of file SimpleFlatTableProducer.cc.

Constructor & Destructor Documentation

template<typename T, typename TProd>
SimpleFlatTableProducerBase< T, TProd >::SimpleFlatTableProducerBase ( edm::ParameterSet const &  params)
inline

Definition at line 18 of file SimpleFlatTableProducer.cc.

18  :
19  name_( params.getParameter<std::string>("name") ),
20  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
21  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false),
22  src_(consumes<TProd>( params.getParameter<edm::InputTag>("src") ))
23  {
24  edm::ParameterSet const & varsPSet = params.getParameter<edm::ParameterSet>("variables");
25  for (const std::string & vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
26  const auto & varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
27  const std::string & type = varPSet.getParameter<std::string>("type");
28  if (type == "int") vars_.push_back(new IntVar(vname, nanoaod::FlatTable::IntColumn, varPSet));
29  else if (type == "float") vars_.push_back(new FloatVar(vname, nanoaod::FlatTable::FloatColumn, varPSet));
30  else if (type == "uint8") vars_.push_back(new UInt8Var(vname, nanoaod::FlatTable::UInt8Column, varPSet));
31  else if (type == "bool") vars_.push_back(new BoolVar(vname, nanoaod::FlatTable::BoolColumn, varPSet));
32  else throw cms::Exception("Configuration", "unsupported type "+type+" for variable "+vname);
33  }
34 
35  produces<nanoaod::FlatTable>();
36  }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
const edm::EDGetTokenT< TProd > src_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
FuncVariable< StringCutObjectSelector< T >, uint8_t > BoolVar
FuncVariable< StringObjectFunction< T >, uint8_t > UInt8Var
FuncVariable< StringObjectFunction< T >, int > IntVar
boost::ptr_vector< Variable > vars_
FuncVariable< StringObjectFunction< T >, float > FloatVar
template<typename T, typename TProd>
SimpleFlatTableProducerBase< T, TProd >::~SimpleFlatTableProducerBase ( )
inlineoverride

Definition at line 38 of file SimpleFlatTableProducer.cc.

38 {}

Member Function Documentation

template<typename T, typename TProd>
virtual std::unique_ptr<nanoaod::FlatTable> SimpleFlatTableProducerBase< T, TProd >::fillTable ( const edm::Event iEvent,
const edm::Handle< TProd > &  prod 
) const
pure virtual
template<typename T, typename TProd>
void SimpleFlatTableProducerBase< T, TProd >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverride

Definition at line 44 of file SimpleFlatTableProducer.cc.

44  {
46  iEvent.getByToken(src_, src);
47 
48  std::unique_ptr<nanoaod::FlatTable> out = fillTable(iEvent, src);
49  out->setDoc(doc_);
50 
51  iEvent.put(std::move(out));
52  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
virtual std::unique_ptr< nanoaod::FlatTable > fillTable(const edm::Event &iEvent, const edm::Handle< TProd > &prod) const =0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
const edm::EDGetTokenT< TProd > src_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename T, typename TProd>
const std::string SimpleFlatTableProducerBase< T, TProd >::doc_
protected
template<typename T, typename TProd>
const bool SimpleFlatTableProducerBase< T, TProd >::extension_
protected
template<typename T, typename TProd>
const std::string SimpleFlatTableProducerBase< T, TProd >::name_
protected

Definition at line 55 of file SimpleFlatTableProducer.cc.

template<typename T, typename TProd>
const edm::EDGetTokenT<TProd> SimpleFlatTableProducerBase< T, TProd >::src_
protected
template<typename T, typename TProd>
boost::ptr_vector<Variable> SimpleFlatTableProducerBase< T, TProd >::vars_
protected