|
|
Go to the documentation of this file.
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()));
35 throw cms::Exception(
"Configuration",
"unsupported type " +
type +
" for variable " + vname);
38 produces<nanoaod::FlatTable>();
44 auto out = std::make_unique<nanoaod::FlatTable>(1, this->
name_,
true, this->
extension_);
64 template <
typename ValType>
69 template <
typename ValType>
75 template <
typename ColType,
typename ValType>
80 for (
const auto&
i :
x)
86 template <
typename ColType,
typename ValType>
91 for (
const auto&
i :
x)
97 template <
typename ColType,
typename ValType>
102 for (
const auto&
i :
x)
107 template <
typename ColType,
typename ValType>
114 for (
const auto&
i :
x)
119 template <
typename ColType,
typename ValType>
127 for (
const auto&
i :
x)
133 template <
typename ValType,
typename ColType = ValType,
typename Converter = Identity<ValType>>
154 std::vector<std::unique_ptr<Variable>>
vars_;
~GlobalVariablesTableProducer() override
static ColType convert(ValType x)
std::vector< std::unique_ptr< Variable > > vars_
VariableT< double, float > DoubleVar
Variable(const std::string &aname, const edm::ParameterSet &cfg)
#define DEFINE_FWK_MODULE(type)
VariableT(const std::string &aname, const edm::ParameterSet &cfg, edm::ConsumesCollector &&cc)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
static ColType convert(ValType x)
VariableT< bool > BoolVar
def convert(infile, ofile)
GlobalVariablesTableProducer(edm::ParameterSet const ¶ms)
static int convert(ValType x)
static ValType convert(ValType x)
const std::string & name() const
edm::EDGetTokenT< ValType > src_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
VariableT< edm::View< reco::Candidate >, float, MassSum< float, edm::View< reco::Candidate > > > CandidateSumMassVar
VariableT< float > FloatVar
static ColType convert(ValType x)
T getParameter(std::string const &) const
static ColType convert(ValType x)
void fill(const edm::Event &iEvent, nanoaod::FlatTable &out) const override
virtual void fill(const edm::Event &iEvent, nanoaod::FlatTable &out) const =0
bool get(ProductID const &oid, Handle< PROD > &result) const
static ColType convert(ValType x)
VariableT< edm::View< reco::Candidate >, int, Size< edm::View< reco::Candidate > > > CandidateSizeVar
VariableT< edm::View< reco::Candidate >, float, ScalarPtSum< float, edm::View< reco::Candidate > > > CandidateScalarSumVar