CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PythonParameterSet.h
Go to the documentation of this file.
1 #ifndef FWCore_PythonParameterSet_PythonParameterSet_h
2 #define FWCore_PythonParameterSet_PythonParameterSet_h
3 
7 
14 
15 #include <string>
16 #include <vector>
17 
19 public:
21 
23  : theParameterSet(p) {}
24 
25  template<typename T>
26  T
27  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 
38  template<typename T>
39  void
40  addParameter(bool tracked, std::string const& name, T const& value) {
41  if(tracked) {
42  theParameterSet.template addParameter<T>(name, value);
43  } else {
44  theParameterSet.template addUntrackedParameter<T>(name, value);
45  }
46  }
47 
48 
50  template<typename T>
52  getParameters(bool tracked, std::string const& name) const {
53  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
54  return edm::toPythonList(v);
55  }
56 
58  template<typename T>
59  void
60  addParameters(bool tracked, std::string const& name,
62  std::vector<T> v = edm::toVector<T>(value);
63  addParameter(tracked, name, v);
64  }
65 
66 
70  void addPSet(bool tracked, std::string const& name,
71  PythonParameterSet const& ppset) {
72  addParameter(tracked, name, ppset.theParameterSet);
73  }
74 
75 
76  PythonParameterSet getPSet(bool tracked, std::string const& name) const {
77  return PythonParameterSet(getParameter<edm::ParameterSet>(tracked, name));
78  }
79 
80 
81  void addVPSet(bool tracked, std::string const& name,
83 
84  boost::python::list getVPSet(bool tracked, std::string const& name);
85 
86  // no way to interface straight into the other python InputTag
87  edm::InputTag newInputTag(std::string const& label,
88  std::string const& instance,
89  std::string const& process) {
90  return edm::InputTag(label, instance, process);
91  }
92 
93  edm::ESInputTag newESInputTag(std::string const& module,
94  std::string const& data) {
95  return edm::ESInputTag(module, data);
96  }
97 
98  edm::EventID newEventID(unsigned int run, unsigned int lumi, unsigned int event) {
99  return edm::EventID(run, lumi, event);
100  }
101 
102  edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi) {
103  return edm::LuminosityBlockID(run, lumi);
104  }
105 
106  edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub,
107  unsigned int end, unsigned int endSub) {
108  return edm::LuminosityBlockRange(start, startSub, end, endSub);
109  }
110 
111  edm::EventRange newEventRange(unsigned int start, unsigned int startLumi, unsigned int startSub,
112  unsigned int end, unsigned int endLumi, unsigned int endSub) {
113  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
114  }
115 
116  void addNewFileInPath(bool tracked, std::string const& name, std::string const& value);
117 
119 
121 
122  edm::ParameterSet const& pset() const {return theParameterSet;}
123 
124  std::string dump() const {return theParameterSet.dump();}
125 
126 private:
128 };
129 
130 #endif
edm::ParameterSet theParameterSet
std::string dump() const
edm::EventID newEventID(unsigned int run, unsigned int lumi, unsigned int event)
PythonParameterSet getPSet(bool tracked, std::string const &name) const
static PFTauRenderPlugin instance
PythonParameterSet newPSet() const
tuple lumi
Definition: fjr2json.py:35
PythonParameterSet(edm::ParameterSet const &p)
T getParameter(bool tracked, std::string const &name) const
edm::ParameterSet const & pset() const
void addParameters(bool tracked, std::string const &name, boost::python::list value)
unfortunate side effect: destroys the original list!
boost::python::list getParameters(bool tracked, std::string const &name) const
templated on the type of the contained object
boost::python::list getVPSet(bool tracked, std::string const &name)
tuple result
Definition: query.py:137
void addParameter(bool tracked, std::string const &name, T const &value)
edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi)
edm::ESInputTag newESInputTag(std::string const &module, std::string const &data)
edm::EventRange newEventRange(unsigned int start, unsigned int startLumi, unsigned int startSub, unsigned int end, unsigned int endLumi, unsigned int endSub)
#define end
Definition: vmac.h:38
void addPSet(bool tracked, std::string const &name, PythonParameterSet const &ppset)
boost::python::list toPythonList(const std::vector< T > &v)
Definition: PythonWrapper.h:16
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 but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub, unsigned int end, unsigned int endSub)
edm::ParameterSet & pset()
edm::InputTag newInputTag(std::string const &label, std::string const &instance, std::string const &process)
void addNewFileInPath(bool tracked, std::string const &name, std::string const &value)
void addVPSet(bool tracked, std::string const &name, boost::python::list value)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple process
Definition: LaserDQM_cfg.py:3
long double T
Definition: vlib.h:209
std::string dump() const
mathSSE::Vec4< T > v
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