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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Types

typedef VariableT< bool > 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

const bool extension_
 
const std::string name_
 
std::vector< std::unique_ptr< Variable > > vars_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 11 of file GlobalVariablesTableProducer.cc.

Member Typedef Documentation

◆ BoolVar

Definition at line 149 of file GlobalVariablesTableProducer.cc.

◆ CandidateScalarSumVar

Definition at line 151 of file GlobalVariablesTableProducer.cc.

◆ CandidateSizeVar

Definition at line 153 of file GlobalVariablesTableProducer.cc.

◆ CandidateSumMassVar

Definition at line 152 of file GlobalVariablesTableProducer.cc.

◆ DoubleVar

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

Definition at line 148 of file GlobalVariablesTableProducer.cc.

◆ FloatVar

Definition at line 147 of file GlobalVariablesTableProducer.cc.

◆ IntVar

Definition at line 146 of file GlobalVariablesTableProducer.cc.

Constructor & Destructor Documentation

◆ GlobalVariablesTableProducer()

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

Definition at line 13 of file GlobalVariablesTableProducer.cc.

14  : name_(params.existsAs<std::string>("name") ? params.getParameter<std::string>("name") : ""),
15  extension_(params.existsAs<bool>("extension") ? params.getParameter<bool>("extension") : false) {
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")
21  vars_.push_back(std::make_unique<IntVar>(vname, varPSet, consumesCollector()));
22  else if (type == "float")
23  vars_.push_back(std::make_unique<FloatVar>(vname, varPSet, consumesCollector()));
24  else if (type == "double")
25  vars_.push_back(std::make_unique<DoubleVar>(vname, varPSet, consumesCollector()));
26  else if (type == "bool")
27  vars_.push_back(std::make_unique<BoolVar>(vname, varPSet, consumesCollector()));
28  else if (type == "candidatescalarsum")
29  vars_.push_back(std::make_unique<CandidateScalarSumVar>(vname, varPSet, consumesCollector()));
30  else if (type == "candidatesize")
31  vars_.push_back(std::make_unique<CandidateSizeVar>(vname, varPSet, consumesCollector()));
32  else if (type == "candidatesummass")
33  vars_.push_back(std::make_unique<CandidateSumMassVar>(vname, varPSet, consumesCollector()));
34  else
35  throw cms::Exception("Configuration", "unsupported type " + type + " for variable " + vname);
36  }
37 
38  produces<nanoaod::FlatTable>();
39  }

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), CalibrationSummaryClient_cfi::params, AlCaHLTBitMon_QueryRunRegistry::string, and vars_.

◆ ~GlobalVariablesTableProducer()

GlobalVariablesTableProducer::~GlobalVariablesTableProducer ( )
inlineoverride

Definition at line 41 of file GlobalVariablesTableProducer.cc.

41 {}

Member Function Documentation

◆ produce()

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

Definition at line 43 of file GlobalVariablesTableProducer.cc.

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

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

Member Data Documentation

◆ extension_

const bool GlobalVariablesTableProducer::extension_
protected

Definition at line 156 of file GlobalVariablesTableProducer.cc.

Referenced by produce().

◆ name_

const std::string GlobalVariablesTableProducer::name_
protected

Definition at line 155 of file GlobalVariablesTableProducer.cc.

Referenced by produce().

◆ vars_

std::vector<std::unique_ptr<Variable> > GlobalVariablesTableProducer::vars_
protected

Definition at line 154 of file GlobalVariablesTableProducer.cc.

Referenced by GlobalVariablesTableProducer(), and produce().

GlobalVariablesTableProducer::extension_
const bool extension_
Definition: GlobalVariablesTableProducer.cc:156
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
GlobalVariablesTableProducer::vars_
std::vector< std::unique_ptr< Variable > > vars_
Definition: GlobalVariablesTableProducer.cc:154
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
edm::ParameterSet
Definition: ParameterSet.h:47
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalVariablesTableProducer::name_
const std::string name_
Definition: GlobalVariablesTableProducer.cc:155
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31