CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Definition at line 149 of file GlobalVariablesTableProducer.cc.

Definition at line 151 of file GlobalVariablesTableProducer.cc.

Definition at line 153 of file GlobalVariablesTableProducer.cc.

Definition at line 152 of file GlobalVariablesTableProducer.cc.

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

Definition at line 148 of file GlobalVariablesTableProducer.cc.

Definition at line 147 of file GlobalVariablesTableProducer.cc.

Definition at line 146 of file GlobalVariablesTableProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 13 of file GlobalVariablesTableProducer.cc.

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

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  }
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< std::unique_ptr< Variable > > vars_
GlobalVariablesTableProducer::~GlobalVariablesTableProducer ( )
inlineoverride

Definition at line 41 of file GlobalVariablesTableProducer.cc.

41 {}

Member Function Documentation

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

Definition at line 43 of file GlobalVariablesTableProducer.cc.

References extension_, eostools::move(), name_, submitPVResolutionJobs::out, edm::Event::put(), isotrackApplyRegressor::var, and vars_.

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  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
list var
if using global norm cols_to_minmax = [&#39;t_delta&#39;, &#39;t_hmaxNearP&#39;,&#39;t_emaxNearP&#39;, &#39;t_hAnnular&#39;, &#39;t_eAnnular&#39;,&#39;t_pt&#39;,&#39;t_nVtx&#39;,&#39;t_ieta&#39;,&#39;t_eHcal10&#39;, &#39;t_eHcal30&#39;,&#39;t_rhoh&#39;,&#39;t_eHcal&#39;] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() &gt; 0) else 1.0/200.0)
def move
Definition: eostools.py:511
std::vector< std::unique_ptr< Variable > > vars_

Member Data Documentation

const bool GlobalVariablesTableProducer::extension_
protected

Definition at line 156 of file GlobalVariablesTableProducer.cc.

Referenced by produce().

const std::string GlobalVariablesTableProducer::name_
protected

Definition at line 155 of file GlobalVariablesTableProducer.cc.

Referenced by produce().

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

Definition at line 154 of file GlobalVariablesTableProducer.cc.

Referenced by GlobalVariablesTableProducer(), and produce().