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<>

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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
 

Detailed Description

Definition at line 11 of file GlobalVariablesTableProducer.cc.

Member Typedef Documentation

◆ BoolVar

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

Definition at line 155 of file GlobalVariablesTableProducer.cc.

◆ CandidateScalarSumVar

Definition at line 157 of file GlobalVariablesTableProducer.cc.

◆ CandidateSizeVar

Definition at line 159 of file GlobalVariablesTableProducer.cc.

◆ CandidateSumMassVar

Definition at line 158 of file GlobalVariablesTableProducer.cc.

◆ DoubleVar

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

Definition at line 154 of file GlobalVariablesTableProducer.cc.

◆ FloatVar

Definition at line 153 of file GlobalVariablesTableProducer.cc.

◆ IntVar

Definition at line 152 of file GlobalVariablesTableProducer.cc.

Constructor & Destructor Documentation

◆ GlobalVariablesTableProducer()

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

Definition at line 13 of file GlobalVariablesTableProducer.cc.

13  {
14  edm::ParameterSet const& varsPSet = params.getParameter<edm::ParameterSet>("variables");
15  for (const std::string& vname : varsPSet.getParameterNamesForType<edm::ParameterSet>()) {
16  const auto& varPSet = varsPSet.getParameter<edm::ParameterSet>(vname);
17  const std::string& type = varPSet.getParameter<std::string>("type");
18  if (type == "int")
19  vars_.push_back(new IntVar(vname, nanoaod::FlatTable::IntColumn, varPSet, consumesCollector()));
20  else if (type == "float")
21  vars_.push_back(new FloatVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
22  else if (type == "double")
23  vars_.push_back(new DoubleVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
24  else if (type == "bool")
25  vars_.push_back(new BoolVar(vname, nanoaod::FlatTable::BoolColumn, varPSet, consumesCollector()));
26  else if (type == "candidatescalarsum")
27  vars_.push_back(
28  new CandidateScalarSumVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
29  else if (type == "candidatesize")
30  vars_.push_back(new CandidateSizeVar(vname, nanoaod::FlatTable::IntColumn, varPSet, consumesCollector()));
31  else if (type == "candidatesummass")
32  vars_.push_back(new CandidateSumMassVar(vname, nanoaod::FlatTable::FloatColumn, varPSet, consumesCollector()));
33  else
34  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
35  }
36 
37  produces<nanoaod::FlatTable>();
38  }

References nanoaod::FlatTable::BoolColumn, Exception, nanoaod::FlatTable::FloatColumn, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), nanoaod::FlatTable::IntColumn, CalibrationSummaryClient_cfi::params, AlCaHLTBitMon_QueryRunRegistry::string, and vars_.

◆ ~GlobalVariablesTableProducer()

GlobalVariablesTableProducer::~GlobalVariablesTableProducer ( )
inlineoverride

Definition at line 40 of file GlobalVariablesTableProducer.cc.

40 {}

Member Function Documentation

◆ produce()

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

Definition at line 42 of file GlobalVariablesTableProducer.cc.

42  {
43  auto out = std::make_unique<nanoaod::FlatTable>(1, "", true);
44 
45  for (const auto& var : vars_)
46  var.fill(iEvent, *out);
47 
48  iEvent.put(std::move(out));
49  }

References iEvent, eostools::move(), MillePedeFileConverter_cfg::out, trigObjTnPSource_cfi::var, and vars_.

Member Data Documentation

◆ vars_

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

Definition at line 160 of file GlobalVariablesTableProducer.cc.

Referenced by GlobalVariablesTableProducer(), and produce().

nanoaod::FlatTable::FloatColumn
Definition: FlatTable.h:39
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
GlobalVariablesTableProducer::IntVar
VariableT< int > IntVar
Definition: GlobalVariablesTableProducer.cc:152
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
GlobalVariablesTableProducer::DoubleVar
VariableT< double, float > DoubleVar
Definition: GlobalVariablesTableProducer.cc:154
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
GlobalVariablesTableProducer::BoolVar
VariableT< bool, uint8_t > BoolVar
Definition: GlobalVariablesTableProducer.cc:155
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:168
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalVariablesTableProducer::vars_
boost::ptr_vector< Variable > vars_
Definition: GlobalVariablesTableProducer.cc:160
GlobalVariablesTableProducer::CandidateSumMassVar
VariableT< edm::View< reco::Candidate >, float, MassSum< float, edm::View< reco::Candidate > > > CandidateSumMassVar
Definition: GlobalVariablesTableProducer.cc:158
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
nanoaod::FlatTable::IntColumn
Definition: FlatTable.h:40
type
type
Definition: HCALResponse.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
GlobalVariablesTableProducer::FloatVar
VariableT< float > FloatVar
Definition: GlobalVariablesTableProducer.cc:153
nanoaod::FlatTable::BoolColumn
Definition: FlatTable.h:42
Exception
Definition: hltDiff.cc:246
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
GlobalVariablesTableProducer::CandidateSizeVar
VariableT< edm::View< reco::Candidate >, int, Size< edm::View< reco::Candidate > > > CandidateSizeVar
Definition: GlobalVariablesTableProducer.cc:159
GlobalVariablesTableProducer::CandidateScalarSumVar
VariableT< edm::View< reco::Candidate >, float, ScalarPtSum< float, edm::View< reco::Candidate > > > CandidateScalarSumVar
Definition: GlobalVariablesTableProducer.cc:157