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 
15 
16 #include <string>
17 #include <vector>
18 
20 public:
22 
24  : theParameterSet(p) {}
25 
26  template<typename T>
27  T
28  getParameter(bool tracked, std::string const& name) const {
29  T result;
30  if(tracked) {
31  result = theParameterSet.template getParameter<T>(name);
32  } else {
33  result = theParameterSet.template getUntrackedParameter<T>(name);
34  }
35  return result;
36  }
37 
38 
39  template<typename T>
40  void
41  addParameter(bool tracked, std::string const& name, T const& value) {
42  if(tracked) {
43  theParameterSet.template addParameter<T>(name, value);
44  } else {
45  theParameterSet.template addUntrackedParameter<T>(name, value);
46  }
47  }
48 
49 
51  template<typename T>
53  getParameters(bool tracked, std::string const& name) const {
54  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
55  return edm::toPythonList(v);
56  }
57 
59  template<typename T>
60  void
61  addParameters(bool tracked, std::string const& name,
63  std::vector<T> v = edm::toVector<T>(value);
64  addParameter(tracked, name, v);
65  }
66 
67 
71  void addPSet(bool tracked, std::string const& name,
72  PythonParameterSet const& ppset) {
73  addParameter(tracked, name, ppset.theParameterSet);
74  }
75 
76 
77  PythonParameterSet getPSet(bool tracked, std::string const& name) const {
78  return PythonParameterSet(getParameter<edm::ParameterSet>(tracked, name));
79  }
80 
81 
82  void addVPSet(bool tracked, std::string const& name,
84 
85  boost::python::list getVPSet(bool tracked, std::string const& name);
86 
87  // no way to interface straight into the other python InputTag
89  std::string const& instance,
90  std::string const& process) {
91  return edm::InputTag(label, instance, process);
92  }
93 
95  std::string const& data) {
96  return edm::ESInputTag(module, data);
97  }
98 
100  return edm::EventID(run, lumi, event);
101  }
102 
103  edm::LuminosityBlockID newLuminosityBlockID(unsigned int run, unsigned int lumi) {
104  return edm::LuminosityBlockID(run, lumi);
105  }
106 
107  edm::LuminosityBlockRange newLuminosityBlockRange(unsigned int start, unsigned int startSub,
108  unsigned int end, unsigned int endSub) {
109  return edm::LuminosityBlockRange(start, startSub, end, endSub);
110  }
111 
114  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
115  }
116 
117  void addNewFileInPath(bool tracked, std::string const& name, std::string const& value);
118 
120 
122 
123  edm::ParameterSet const& pset() const {return theParameterSet;}
124 
125  std::string dump() const {return theParameterSet.dump();}
126 
127 private:
129 };
130 
131 #endif
edm::ParameterSet theParameterSet
std::string dump() const
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
PythonParameterSet getPSet(bool tracked, std::string const &name) const
std::string dump(unsigned int indent=0) const
static PFTauRenderPlugin instance
PythonParameterSet newPSet() const
tuple lumi
Definition: fjr2json.py:35
unsigned long long EventNumber_t
PythonParameterSet(edm::ParameterSet const &p)
T getParameter(bool tracked, std::string const &name) const
edm::ParameterSet const & pset() const
unsigned int LuminosityBlockNumber_t
void addParameters(bool tracked, std::string const &name, boost::python::list value)
unfortunate side effect: destroys the original list!
tuple result
Definition: mps_fire.py:95
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)
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)
#define end
Definition: vmac.h:37
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::EventID newEventID(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
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)
unsigned int RunNumber_t
tuple process
Definition: LaserDQM_cfg.py:3
long double T
Definition: vlib.h:208
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)
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