CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PythonParameterSet Class Reference

#include <PythonParameterSet.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, boost::python::list value)
 unfortunate side effect: destroys the original list! More...
 
void addPSet (bool tracked, std::string const &name, PythonParameterSet const &ppset)
 
void addVPSet (bool tracked, std::string const &name, boost::python::list value)
 
std::string dump () const
 
template<typename T >
T getParameter (bool tracked, std::string const &name) const
 
template<typename T >
boost::python::list getParameters (bool tracked, std::string const &name) const
 templated on the type of the contained object More...
 
PythonParameterSet getPSet (bool tracked, std::string const &name) const
 
boost::python::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)
 
PythonParameterSet newPSet () const
 
edm::ParameterSetpset ()
 
edm::ParameterSet const & pset () const
 
 PythonParameterSet ()
 
 PythonParameterSet (edm::ParameterSet const &p)
 

Private Attributes

edm::ParameterSet theParameterSet
 

Detailed Description

Definition at line 19 of file PythonParameterSet.h.

Constructor & Destructor Documentation

PythonParameterSet::PythonParameterSet ( )

Definition at line 4 of file PythonParameterSet.cc.

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

6 {
7 }
edm::ParameterSet theParameterSet
PythonParameterSet::PythonParameterSet ( edm::ParameterSet const &  p)
inline

Definition at line 23 of file PythonParameterSet.h.

Member Function Documentation

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

Definition at line 43 of file PythonParameterSet.cc.

References addParameter().

Referenced by BOOST_PYTHON_MODULE().

44 {
46 }
void addParameter(bool tracked, std::string const &name, T const &value)
template<typename T >
void PythonParameterSet::addParameter ( bool  tracked,
std::string const &  name,
T const &  value 
)
inline

Definition at line 41 of file PythonParameterSet.h.

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

Referenced by editorTools.UserCodeTool::__init__(), metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), HiCoreTools.RestrictInputToAOD::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::__init__(), editorTools.ChangeSource::__init__(), HiCoreTools.RemoveMCMatching::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), HiCoreTools.RemoveAllPATObjectsBut::__init__(), HiCoreTools.RemoveSpecificPATObjects::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), trackTools.MakeTrackCandidates::__init__(), tauTools.AddTauCollection::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), HiCoreTools.RemoveCleaning::__init__(), jetTools.AddJetCollection::__init__(), HiCoreTools.AddCleaning::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), jetTools.SetTagInfos::__init__(), addNewFileInPath(), addParameters(), addPSet(), and addVPSet().

41  {
42  if(tracked) {
43  theParameterSet.template addParameter<T>(name, value);
44  } else {
45  theParameterSet.template addUntrackedParameter<T>(name, value);
46  }
47  }
edm::ParameterSet theParameterSet
template<typename T >
void PythonParameterSet::addParameters ( bool  tracked,
std::string const &  name,
boost::python::list  value 
)
inline

unfortunate side effect: destroys the original list!

Definition at line 61 of file PythonParameterSet.h.

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

62  {
63  std::vector<T> v = edm::toVector<T>(value);
64  addParameter(tracked, name, v);
65  }
void addParameter(bool tracked, std::string const &name, T const &value)
void PythonParameterSet::addPSet ( bool  tracked,
std::string const &  name,
PythonParameterSet 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 71 of file PythonParameterSet.h.

References addParameter(), and theParameterSet.

Referenced by BOOST_PYTHON_MODULE().

72  {
73  addParameter(tracked, name, ppset.theParameterSet);
74  }
void addParameter(bool tracked, std::string const &name, T const &value)
void PythonParameterSet::addVPSet ( bool  tracked,
std::string const &  name,
boost::python::list  value 
)

Definition at line 10 of file PythonParameterSet.cc.

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

Referenced by BOOST_PYTHON_MODULE().

12 {
13  std::vector<PythonParameterSet> v
14  = edm::toVector<PythonParameterSet>(value);
15  std::vector<edm::ParameterSet> v2;
16  v2.reserve(v.size());
17  for(std::vector<PythonParameterSet>::iterator ppsetItr = v.begin(), ppsetItrEnd = v.end();
18  ppsetItr != ppsetItrEnd; ++ppsetItr)
19  {
20  v2.push_back(ppsetItr->theParameterSet);
21  }
22  addParameter(tracked, name, v2);
23 }
void addParameter(bool tracked, std::string const &name, T const &value)
std::string PythonParameterSet::dump ( void  ) const
inline

Definition at line 125 of file PythonParameterSet.h.

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

Referenced by BOOST_PYTHON_MODULE(), and PythonProcessDesc::dump().

125 {return theParameterSet.dump();}
edm::ParameterSet theParameterSet
std::string dump(unsigned int indent=0) const
template<typename T >
T PythonParameterSet::getParameter ( bool  tracked,
std::string const &  name 
) const
inline

Definition at line 28 of file PythonParameterSet.h.

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

28  {
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  }
edm::ParameterSet theParameterSet
tuple result
Definition: mps_fire.py:95
long double T
template<typename T >
boost::python::list PythonParameterSet::getParameters ( bool  tracked,
std::string const &  name 
) const
inline

templated on the type of the contained object

Definition at line 53 of file PythonParameterSet.h.

References mergeVDriftHistosByStation::name, edm::toPythonList(), and findQualityFiles::v.

53  {
54  std::vector<T> v = getParameter<std::vector<T> >(tracked, name);
55  return edm::toPythonList(v);
56  }
boost::python::list toPythonList(const std::vector< T > &v)
Definition: PythonWrapper.h:16
PythonParameterSet PythonParameterSet::getPSet ( bool  tracked,
std::string const &  name 
) const
inline

Definition at line 77 of file PythonParameterSet.h.

References PythonParameterSet().

Referenced by BOOST_PYTHON_MODULE().

77  {
78  return PythonParameterSet(getParameter<edm::ParameterSet>(tracked, name));
79  }
boost::python::list PythonParameterSet::getVPSet ( bool  tracked,
std::string const &  name 
)

Definition at line 26 of file PythonParameterSet.cc.

References edm::ParameterSet::getParameterSetVector(), edm::ParameterSet::getUntrackedParameterSetVector(), cmsLHEtoEOSManager::l, list(), PythonParameterSet(), theParameterSet, and findQualityFiles::v.

Referenced by BOOST_PYTHON_MODULE().

27 {
28  std::vector<edm::ParameterSet> const& v =
30 
31  // convert to PythonParameterSets
33  for(std::vector<edm::ParameterSet>::const_iterator psetItr = v.begin(), psetItrEnd = v.end();
34  psetItr != psetItrEnd; ++psetItr)
35  {
36  l.append(PythonParameterSet(*psetItr));
37  }
38 
39  return l;
40 }
edm::ParameterSet theParameterSet
VParameterSet const & getParameterSetVector(std::string const &name) const
VParameterSet getUntrackedParameterSetVector(std::string const &name, VParameterSet const &defaultValue) const
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
edm::ESInputTag PythonParameterSet::newESInputTag ( std::string const &  module,
std::string const &  data 
)
inline

Definition at line 94 of file PythonParameterSet.h.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 99 of file PythonParameterSet.h.

Referenced by BOOST_PYTHON_MODULE().

99  {
100  return edm::EventID(run, lumi, event);
101  }
tuple lumi
Definition: fjr2json.py:35
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::EventRange PythonParameterSet::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 112 of file PythonParameterSet.h.

Referenced by BOOST_PYTHON_MODULE().

113  {
114  return edm::EventRange(start, startLumi, startSub, end, endLumi, endSub);
115  }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
#define end
Definition: vmac.h:37
edm::InputTag PythonParameterSet::newInputTag ( std::string const &  label,
std::string const &  instance,
std::string const &  process 
)
inline

Definition at line 88 of file PythonParameterSet.h.

References HLT_FULL_cff::InputTag.

Referenced by BOOST_PYTHON_MODULE().

90  {
92  }
static PFTauRenderPlugin instance
tuple process
Definition: LaserDQM_cfg.py:3
edm::LuminosityBlockID PythonParameterSet::newLuminosityBlockID ( unsigned int  run,
unsigned int  lumi 
)
inline

Definition at line 103 of file PythonParameterSet.h.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 107 of file PythonParameterSet.h.

Referenced by BOOST_PYTHON_MODULE().

108  {
109  return edm::LuminosityBlockRange(start, startSub, end, endSub);
110  }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
#define end
Definition: vmac.h:37
PythonParameterSet PythonParameterSet::newPSet ( ) const
inline

Definition at line 119 of file PythonParameterSet.h.

References PythonParameterSet().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 121 of file PythonParameterSet.h.

References theParameterSet.

Referenced by PythonProcessDesc::parameterSet(), and edm::readPSetsFrom().

121 {return theParameterSet;}
edm::ParameterSet theParameterSet
edm::ParameterSet const& PythonParameterSet::pset ( ) const
inline

Definition at line 123 of file PythonParameterSet.h.

References theParameterSet.

123 {return theParameterSet;}
edm::ParameterSet theParameterSet

Member Data Documentation

edm::ParameterSet PythonParameterSet::theParameterSet
private

Definition at line 128 of file PythonParameterSet.h.

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