CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Python11ParameterSet Class Reference

#include <Python11ParameterSet.h>

Public Member Functions

void addNewFileInPath (bool tracked, std::string const &name, std::string const &value)
 
template<typename T >
void addParameter (bool tracked, std::string const &name, T const &value)
 
template<typename T >
void addParameters (bool tracked, std::string const &name, pybind11::list value)
 unfortunate side effect: destroys the original list! More...
 
void addPSet (bool tracked, std::string const &name, Python11ParameterSet const &ppset)
 
void addVPSet (bool tracked, std::string const &name, pybind11::list value)
 
std::string dump () const
 
template<typename T >
T getParameter (bool tracked, std::string const &name) const
 
template<typename T >
pybind11::list getParameters (bool tracked, std::string const &name) const
 templated on the type of the contained object More...
 
Python11ParameterSet getPSet (bool tracked, std::string const &name) const
 
pybind11::list getVPSet (bool tracked, std::string const &name)
 
edm::ESInputTag newESInputTag (std::string const &module, std::string const &data)
 
edm::EventID newEventID (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 
edm::EventRange newEventRange (edm::RunNumber_t start, edm::LuminosityBlockNumber_t startLumi, edm::EventNumber_t startSub, edm::RunNumber_t end, edm::LuminosityBlockNumber_t endLumi, edm::EventNumber_t endSub)
 
edm::InputTag newInputTag (std::string const &label, std::string const &instance, std::string const &process)
 
edm::LuminosityBlockID newLuminosityBlockID (unsigned int run, unsigned int lumi)
 
edm::LuminosityBlockRange newLuminosityBlockRange (unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
 
Python11ParameterSet newPSet () const
 
edm::ParameterSetpset ()
 
edm::ParameterSet const & pset () const
 
 Python11ParameterSet ()
 
 Python11ParameterSet (edm::ParameterSet const &p)
 

Private Attributes

edm::ParameterSet theParameterSet
 

Detailed Description

Definition at line 19 of file Python11ParameterSet.h.

Constructor & Destructor Documentation

◆ Python11ParameterSet() [1/2]

Python11ParameterSet::Python11ParameterSet ( )

Definition at line 4 of file Python11ParameterSet.cc.

Referenced by getPSet(), getVPSet(), and newPSet().

4 : theParameterSet() {}
edm::ParameterSet theParameterSet

◆ Python11ParameterSet() [2/2]

Python11ParameterSet::Python11ParameterSet ( edm::ParameterSet const &  p)
inline

Member Function Documentation

◆ addNewFileInPath()

void Python11ParameterSet::addNewFileInPath ( bool  tracked,
std::string const &  name,
std::string const &  value 
)

Definition at line 31 of file Python11ParameterSet.cc.

References addParameter(), and Skims_PA_cff::name.

Referenced by PYBIND11_MODULE().

31  {
33 }
void addParameter(bool tracked, std::string const &name, T const &value)
Definition: value.py:1

◆ addParameter()

template<typename T >
void Python11ParameterSet::addParameter ( bool  tracked,
std::string const &  name,
T const &  value 
)
inline

Definition at line 37 of file Python11ParameterSet.h.

References Skims_PA_cff::name, theParameterSet, and relativeConstraints::value.

Referenced by metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), tauTools.AddTauCollection::__init__(), trackTools.MakeTrackCandidates::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.AddJetCollection::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), jetTools.SetTagInfos::__init__(), addNewFileInPath(), addParameters(), addPSet(), and addVPSet().

37  {
38  if (tracked) {
39  theParameterSet.template addParameter<T>(name, value);
40  } else {
41  theParameterSet.template addUntrackedParameter<T>(name, value);
42  }
43  }
edm::ParameterSet theParameterSet

◆ addParameters()

template<typename T >
void Python11ParameterSet::addParameters ( bool  tracked,
std::string const &  name,
pybind11::list  value 
)
inline

unfortunate side effect: destroys the original list!

Definition at line 54 of file Python11ParameterSet.h.

References addParameter(), Skims_PA_cff::name, findQualityFiles::v, and relativeConstraints::value.

54  {
55  std::vector<T> v = edm::toVector<T>(value);
56  addParameter(tracked, name, v);
57  }
void addParameter(bool tracked, std::string const &name, T const &value)

◆ addPSet()

void Python11ParameterSet::addPSet ( bool  tracked,
std::string const &  name,
Python11ParameterSet const &  ppset 
)
inline

these custom classes do seem to be a hassle to wrap, compared to, say, InputTag maybe we will need to template these someday

Definition at line 62 of file Python11ParameterSet.h.

References addParameter(), Skims_PA_cff::name, and theParameterSet.

Referenced by PYBIND11_MODULE().

62  {
63  addParameter(tracked, name, ppset.theParameterSet);
64  }
void addParameter(bool tracked, std::string const &name, T const &value)

◆ addVPSet()

void Python11ParameterSet::addVPSet ( bool  tracked,
std::string const &  name,
pybind11::list  value 
)

Definition at line 6 of file Python11ParameterSet.cc.

References addParameter(), Skims_PA_cff::name, findQualityFiles::v, and relativeConstraints::value.

Referenced by PYBIND11_MODULE().

6  {
7  std::vector<Python11ParameterSet> v = edm::toVector<Python11ParameterSet>(value);
8  std::vector<edm::ParameterSet> v2;
9  v2.reserve(v.size());
10  for (std::vector<Python11ParameterSet>::iterator ppsetItr = v.begin(), ppsetItrEnd = v.end(); ppsetItr != ppsetItrEnd;
11  ++ppsetItr) {
12  v2.push_back(ppsetItr->theParameterSet);
13  }
14  addParameter(tracked, name, v2);
15 }
void addParameter(bool tracked, std::string const &name, T const &value)

◆ dump()

std::string Python11ParameterSet::dump ( void  ) const
inline

Definition at line 115 of file Python11ParameterSet.h.

References edm::ParameterSet::dump(), and theParameterSet.

Referenced by PyBind11ProcessDesc::dump(), and PYBIND11_MODULE().

115 { return theParameterSet.dump(); }
edm::ParameterSet theParameterSet
std::string dump(unsigned int indent=0) const

◆ getParameter()

template<typename T >
T Python11ParameterSet::getParameter ( bool  tracked,
std::string const &  name 
) const
inline

Definition at line 26 of file Python11ParameterSet.h.

References Skims_PA_cff::name, mps_fire::result, and theParameterSet.

26  {
27  T result;
28  if (tracked) {
29  result = theParameterSet.template getParameter<T>(name);
30  } else {
31  result = theParameterSet.template getUntrackedParameter<T>(name);
32  }
33  return result;
34  }
edm::ParameterSet theParameterSet
long double T

◆ getParameters()

template<typename T >
pybind11::list Python11ParameterSet::getParameters ( bool  tracked,
std::string const &  name 
) const
inline

templated on the type of the contained object

Definition at line 47 of file Python11ParameterSet.h.

References Skims_PA_cff::name, edm::toPython11List(), and findQualityFiles::v.

47  {
48  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
49  return edm::toPython11List(v);
50  }
pybind11::list toPython11List(const std::vector< T > &v)

◆ getPSet()

Python11ParameterSet Python11ParameterSet::getPSet ( bool  tracked,
std::string const &  name 
) const
inline

Definition at line 66 of file Python11ParameterSet.h.

References Skims_PA_cff::name, and Python11ParameterSet().

Referenced by PYBIND11_MODULE().

66  {
67  return Python11ParameterSet(getParameter<edm::ParameterSet>(tracked, name));
68  }

◆ getVPSet()

pybind11::list Python11ParameterSet::getVPSet ( bool  tracked,
std::string const &  name 
)

Definition at line 17 of file Python11ParameterSet.cc.

References edm::ParameterSet::getParameterSetVector(), edm::ParameterSet::getUntrackedParameterSetVector(), MainPageGenerator::l, Skims_PA_cff::name, Python11ParameterSet(), theParameterSet, and findQualityFiles::v.

Referenced by PYBIND11_MODULE().

17  {
18  std::vector<edm::ParameterSet> const& v =
20 
21  // convert to Python11ParameterSets
22  pybind11::list l;
23  for (std::vector<edm::ParameterSet>::const_iterator psetItr = v.begin(), psetItrEnd = v.end(); psetItr != psetItrEnd;
24  ++psetItr) {
25  l.append(Python11ParameterSet(*psetItr));
26  }
27 
28  return l;
29 }
edm::ParameterSet theParameterSet
VParameterSet getUntrackedParameterSetVector(std::string const &name, VParameterSet const &defaultValue) const
VParameterSet const & getParameterSetVector(std::string const &name) const

◆ newESInputTag()

edm::ESInputTag Python11ParameterSet::newESInputTag ( std::string const &  module,
std::string const &  data 
)
inline

Definition at line 79 of file Python11ParameterSet.h.

References data, and callgraph::module.

Referenced by PYBIND11_MODULE().

79  {
80  return edm::ESInputTag(module, data);
81  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ newEventID()

edm::EventID Python11ParameterSet::newEventID ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
inline

Definition at line 83 of file Python11ParameterSet.h.

References writedatasetfile::run.

Referenced by PYBIND11_MODULE().

83  {
84  return edm::EventID(run, lumi, event);
85  }
Definition: event.py:1

◆ newEventRange()

edm::EventRange Python11ParameterSet::newEventRange ( edm::RunNumber_t  start,
edm::LuminosityBlockNumber_t  startLumi,
edm::EventNumber_t  startSub,
edm::RunNumber_t  end,
edm::LuminosityBlockNumber_t  endLumi,
edm::EventNumber_t  endSub 
)
inline

Definition at line 98 of file Python11ParameterSet.h.

References mps_fire::end.

Referenced by PYBIND11_MODULE().

103  {
104  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
105  }
Definition: start.py:1

◆ newInputTag()

edm::InputTag Python11ParameterSet::newInputTag ( std::string const &  label,
std::string const &  instance,
std::string const &  process 
)
inline

Definition at line 75 of file Python11ParameterSet.h.

References ProducerED_cfi::InputTag, instance, label, and LaserDQM_cfg::process.

Referenced by PYBIND11_MODULE().

75  {
77  }
static PFTauRenderPlugin instance
char const * label

◆ newLuminosityBlockID()

edm::LuminosityBlockID Python11ParameterSet::newLuminosityBlockID ( unsigned int  run,
unsigned int  lumi 
)
inline

◆ newLuminosityBlockRange()

edm::LuminosityBlockRange Python11ParameterSet::newLuminosityBlockRange ( unsigned int  start,
unsigned int  startSub,
unsigned int  end,
unsigned int  endSub 
)
inline

Definition at line 91 of file Python11ParameterSet.h.

References mps_fire::end.

Referenced by PYBIND11_MODULE().

94  {
95  return edm::LuminosityBlockRange(start, startSub, end, endSub);
96  }
Definition: start.py:1

◆ newPSet()

Python11ParameterSet Python11ParameterSet::newPSet ( ) const
inline

Definition at line 109 of file Python11ParameterSet.h.

References Python11ParameterSet().

Referenced by PYBIND11_MODULE().

◆ pset() [1/2]

edm::ParameterSet& Python11ParameterSet::pset ( )
inline

Definition at line 111 of file Python11ParameterSet.h.

References theParameterSet.

Referenced by PyBind11ProcessDesc::parameterSet(), and edm::cmspybind11::readPSetsFrom().

111 { return theParameterSet; }
edm::ParameterSet theParameterSet

◆ pset() [2/2]

edm::ParameterSet const& Python11ParameterSet::pset ( ) const
inline

Definition at line 113 of file Python11ParameterSet.h.

References theParameterSet.

113 { return theParameterSet; }
edm::ParameterSet theParameterSet

Member Data Documentation

◆ theParameterSet

edm::ParameterSet Python11ParameterSet::theParameterSet
private

Definition at line 118 of file Python11ParameterSet.h.

Referenced by addParameter(), addPSet(), dump(), getParameter(), getVPSet(), and pset().