CMS 3D CMS Logo

Python11ParameterSet.h
Go to the documentation of this file.
1 #ifndef FWCore_PyDevParameterSet_Python11ParameterSet_h
2 #define FWCore_PyDevParameterSet_Python11ParameterSet_h
3 #include <pybind11/pybind11.h>
4 
7 
15 
16 #include <string>
17 #include <vector>
18 
19 namespace cmspython3 {
21  public:
23 
25 
26  template <typename T>
27  T getParameter(bool tracked, std::string const& name) const {
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  }
36 
37  template <typename T>
38  void addParameter(bool tracked, std::string const& name, T const& value) {
39  if (tracked) {
40  theParameterSet.template addParameter<T>(name, value);
41  } else {
42  theParameterSet.template addUntrackedParameter<T>(name, value);
43  }
44  }
45 
47  template <typename T>
48  pybind11::list getParameters(bool tracked, std::string const& name) const {
49  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
51  }
52 
54  template <typename T>
55  void addParameters(bool tracked, std::string const& name, pybind11::list value) {
56  std::vector<T> v = cmspython3::toVector<T>(value);
57  addParameter(tracked, name, v);
58  }
59 
63  void addPSet(bool tracked, std::string const& name, Python11ParameterSet const& ppset) {
64  addParameter(tracked, name, ppset.theParameterSet);
65  }
66 
67  Python11ParameterSet getPSet(bool tracked, std::string const& name) const {
68  return Python11ParameterSet(getParameter<edm::ParameterSet>(tracked, name));
69  }
70 
71  void addVPSet(bool tracked, std::string const& name, pybind11::list value);
72 
73  pybind11::list getVPSet(bool tracked, std::string const& name);
74 
75  // no way to interface straight into the other python InputTag
77  return edm::InputTag(label, instance, process);
78  }
79 
81  return edm::ESInputTag(module, data);
82  }
83 
85  return edm::EventID(run, lumi, event);
86  }
87 
88  edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi) {
89  return edm::LuminosityBlockID(run, lumi);
90  }
91 
93  unsigned int startSub,
94  unsigned int end,
95  unsigned int endSub) {
96  return edm::LuminosityBlockRange(start, startSub, end, endSub);
97  }
98 
101  edm::EventNumber_t startSub,
104  edm::EventNumber_t endSub) {
105  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
106  }
107 
108  void addNewFileInPath(bool tracked, std::string const& name, std::string const& value);
109 
111 
113 
114  edm::ParameterSet const& pset() const { return theParameterSet; }
115 
116  std::string dump() const { return theParameterSet.dump(); }
117 
118  private:
120  };
121 } // namespace cmspython3
122 #endif
Definition: start.py:1
pybind11::list getParameters(bool tracked, std::string const &name) const
templated on the type of the contained object
Python11ParameterSet newPSet() const
pybind11::list toPython11List(const std::vector< T > &v)
std::string dump(unsigned int indent=0) const
static PFTauRenderPlugin instance
void addVPSet(bool tracked, std::string const &name, pybind11::list value)
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
void addPSet(bool tracked, std::string const &name, Python11ParameterSet const &ppset)
char const * label
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
Python11ParameterSet getPSet(bool tracked, std::string const &name) const
#define end
Definition: vmac.h:39
Definition: value.py:1
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
Python11ParameterSet(edm::ParameterSet const &p)
void addParameters(bool tracked, std::string const &name, pybind11::list value)
unfortunate side effect: destroys the original list!
pybind11::list getVPSet(bool tracked, std::string const &name)
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::ESInputTag newESInputTag(std::string const &module, std::string const &data)
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)
unsigned int RunNumber_t
void addParameter(bool tracked, std::string const &name, T const &value)
edm::EventID newEventID(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
long double T
edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi)
Definition: vlib.h:208
edm::ParameterSet const & pset() const
Definition: event.py:1
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
T getParameter(bool tracked, std::string const &name) const