CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cmspython3::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 20 of file Python11ParameterSet.h.

Constructor & Destructor Documentation

◆ Python11ParameterSet() [1/2]

Python11ParameterSet::Python11ParameterSet ( )

Definition at line 5 of file Python11ParameterSet.cc.

5 : theParameterSet() {}

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

◆ Python11ParameterSet() [2/2]

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

Definition at line 24 of file Python11ParameterSet.h.

24 : theParameterSet(p) {}

Member Function Documentation

◆ addNewFileInPath()

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

Definition at line 34 of file Python11ParameterSet.cc.

34  {
36  }

References addParameter(), and Skims_PA_cff::name.

Referenced by PYBIND11_MODULE().

◆ addParameter()

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

◆ addParameters()

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

unfortunate side effect: destroys the original list!

Definition at line 55 of file Python11ParameterSet.h.

55  {
56  std::vector<T> v = cmspython3::toVector<T>(value);
57  addParameter(tracked, name, v);
58  }

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

◆ addPSet()

void cmspython3::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 63 of file Python11ParameterSet.h.

63  {
64  addParameter(tracked, name, ppset.theParameterSet);
65  }

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

Referenced by PYBIND11_MODULE().

◆ addVPSet()

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

Definition at line 7 of file Python11ParameterSet.cc.

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

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

Referenced by PYBIND11_MODULE().

◆ dump()

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

◆ getParameter()

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

Definition at line 27 of file Python11ParameterSet.h.

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

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

◆ getParameters()

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

templated on the type of the contained object

Definition at line 48 of file Python11ParameterSet.h.

48  {
49  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
51  }

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

◆ getPSet()

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

Definition at line 67 of file Python11ParameterSet.h.

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

References Skims_PA_cff::name, and Python11ParameterSet().

Referenced by PYBIND11_MODULE().

◆ getVPSet()

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

Definition at line 19 of file Python11ParameterSet.cc.

19  {
20  std::vector<edm::ParameterSet> const& v =
22 
23  // convert to Python11ParameterSets
24  pybind11::list l;
25  for (std::vector<edm::ParameterSet>::const_iterator psetItr = v.begin(), psetItrEnd = v.end();
26  psetItr != psetItrEnd;
27  ++psetItr) {
28  l.append(Python11ParameterSet(*psetItr));
29  }
30 
31  return l;
32  }

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

Referenced by PYBIND11_MODULE().

◆ newESInputTag()

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

Definition at line 80 of file Python11ParameterSet.h.

80  {
81  return edm::ESInputTag(module, data);
82  }

References data.

Referenced by PYBIND11_MODULE().

◆ newEventID()

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

Definition at line 84 of file Python11ParameterSet.h.

84  {
85  return edm::EventID(run, lumi, event);
86  }

References writedatasetfile::run.

Referenced by PYBIND11_MODULE().

◆ newEventRange()

edm::EventRange cmspython3::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 99 of file Python11ParameterSet.h.

104  {
105  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
106  }

References mps_fire::end.

Referenced by PYBIND11_MODULE().

◆ newInputTag()

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

Definition at line 76 of file Python11ParameterSet.h.

76  {
78  }

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

Referenced by PYBIND11_MODULE().

◆ newLuminosityBlockID()

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

Definition at line 88 of file Python11ParameterSet.h.

88  {
90  }

References writedatasetfile::run.

Referenced by PYBIND11_MODULE().

◆ newLuminosityBlockRange()

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

Definition at line 92 of file Python11ParameterSet.h.

95  {
96  return edm::LuminosityBlockRange(start, startSub, end, endSub);
97  }

References mps_fire::end.

Referenced by PYBIND11_MODULE().

◆ newPSet()

Python11ParameterSet cmspython3::Python11ParameterSet::newPSet ( ) const
inline

Definition at line 110 of file Python11ParameterSet.h.

110 { return Python11ParameterSet(); }

References Python11ParameterSet().

Referenced by PYBIND11_MODULE().

◆ pset() [1/2]

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

◆ pset() [2/2]

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

Definition at line 114 of file Python11ParameterSet.h.

114 { return theParameterSet; }

References theParameterSet.

Member Data Documentation

◆ theParameterSet

edm::ParameterSet cmspython3::Python11ParameterSet::theParameterSet
private

Definition at line 119 of file Python11ParameterSet.h.

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

edm::ESInputTag
Definition: ESInputTag.h:87
start
Definition: start.py:1
edm::ParameterSet::getUntrackedParameterSetVector
VParameterSet getUntrackedParameterSetVector(std::string const &name, VParameterSet const &defaultValue) const
Definition: ParameterSet.cc:2168
cmspython3::Python11ParameterSet::theParameterSet
edm::ParameterSet theParameterSet
Definition: Python11ParameterSet.h:119
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::FileInPath
Definition: FileInPath.h:64
edm::ParameterSet::dump
std::string dump(unsigned int indent=0) const
Definition: ParameterSet.cc:832
mps_fire.end
end
Definition: mps_fire.py:242
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
value
Definition: value.py:1
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
writedatasetfile.run
run
Definition: writedatasetfile.py:27
T
long double T
Definition: Basic3DVectorLD.h:48
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::ParameterSet::getParameterSetVector
VParameterSet const & getParameterSetVector(std::string const &name) const
Definition: ParameterSet.cc:2160
mps_fire.result
result
Definition: mps_fire.py:311
cmspython3::Python11ParameterSet::Python11ParameterSet
Python11ParameterSet()
Definition: Python11ParameterSet.cc:5
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31
edm::EventRange
Definition: EventRange.h:31
lumi
Definition: LumiSectionData.h:20
cmspython3::Python11ParameterSet::addParameter
void addParameter(bool tracked, std::string const &name, T const &value)
Definition: Python11ParameterSet.h:38
cmspython3::toPython11List
pybind11::list toPython11List(const std::vector< T > &v)
Definition: PyBind11Wrapper.h:17
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::LuminosityBlockRange
Definition: LuminosityBlockRange.h:32