CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
cms::DDAlgoArguments Class Reference

#include <DDAlgoArguments.h>

Public Member Functions

std::string childName () const
 Access value of child'name from the xml element. More...
 
double dble (const std::string &nam) const
 Shortcut to access double arguments. More...
 
 DDAlgoArguments (cms::DDParsingContext &, xml_h algorithm)
 
 DDAlgoArguments ()=delete
 
 DDAlgoArguments (const DDAlgoArguments &copy)=delete
 
bool find (const std::string &name) const
 Check the existence of an argument by name. More...
 
int integer (const std::string &nam) const
 Shortcut to access integer arguments. More...
 
DDAlgoArgumentsoperator= (const DDAlgoArguments &copy)=delete
 
std::string parentName () const
 Access value of rParent child node. More...
 
std::string str (const std::string &nam) const
 Shortcut to access string arguments. More...
 
template<typename T >
T value (const std::string &name) const
 
template<typename T >
T value (const string &nam) const
 Access typed argument by name. More...
 
template<>
vector< int > value (const string &nam) const
 Access typed vector<int> argument by name. More...
 
template<>
vector< string > value (const string &nam) const
 Access typed vector<string> argument by name. More...
 
template<>
vector< long > value (const string &nam) const
 Access typed vector<long> argument by name. More...
 
template<>
vector< float > value (const string &nam) const
 Access typed vector<float> argument by name. More...
 
template<>
vector< double > value (const string &nam) const
 Access typed vector<double> argument by name. More...
 
std::vector< double > vecDble (const std::string &nam) const
 Shortcut to access vector<double> arguments. More...
 
std::vector< int > vecInt (const std::string &nam) const
 Shortcut to access vector<int> arguments. More...
 
std::vector< std::string > vecStr (const std::string &nam) const
 Shortcut to access vector<string> arguments. More...
 
 ~DDAlgoArguments ()=default
 

Public Attributes

cms::DDParsingContextcontext
 
xml_h element
 
std::string name
 

Private Member Functions

xml_h rawArgument (const std::string &name) const
 Access raw argument as a string by name. More...
 
std::string resolved_scalar_arg (const std::string &name) const
 Access namespace resolved argument as a string by name. More...
 

Detailed Description

Definition at line 40 of file DDAlgoArguments.h.

Constructor & Destructor Documentation

DDAlgoArguments::DDAlgoArguments ( cms::DDParsingContext ctxt,
xml_h  algorithm 
)

Definition at line 79 of file DDAlgoArguments.cc.

References element, and name.

80  : context( ctxt ),
81  element( elt )
82 {
83  name = xml_dim_t( element ).nameStr();
84 }
cms::DDParsingContext & context
cms::DDAlgoArguments::DDAlgoArguments ( )
delete
cms::DDAlgoArguments::DDAlgoArguments ( const DDAlgoArguments copy)
delete
cms::DDAlgoArguments::~DDAlgoArguments ( )
default

Member Function Documentation

string DDAlgoArguments::childName ( ) const

Access value of child'name from the xml element.

Definition at line 96 of file DDAlgoArguments.cc.

References context, gen::n, and cms::DDNamespace::realName().

Referenced by algorithm().

96  {
98  return n.realName(value<string>("ChildName"));
99 }
cms::DDParsingContext & context
double DDAlgoArguments::dble ( const std::string &  nam) const

Shortcut to access double arguments.

Definition at line 239 of file DDAlgoArguments.cc.

Referenced by algorithm().

240 { return this->value<double>(nam); }
bool DDAlgoArguments::find ( const std::string &  name) const

Check the existence of an argument by name.

Definition at line 102 of file DDAlgoArguments.cc.

References element, gen::n, name, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.Tag::__getattr__(), algorithm(), and BeautifulSoup.Tag::firstText().

102  {
103  for(xml_coll_t p(element,_U(star)); p; ++p) {
104  string n = p.attr<string>(_U(name));
105  if ( n == nam ) {
106  return true;
107  }
108  }
109  return false;
110 }
int DDAlgoArguments::integer ( const std::string &  nam) const

Shortcut to access integer arguments.

Definition at line 243 of file DDAlgoArguments.cc.

Referenced by algorithm().

244 { return this->value<int>(nam); }
DDAlgoArguments& cms::DDAlgoArguments::operator= ( const DDAlgoArguments copy)
delete
string DDAlgoArguments::parentName ( ) const

Access value of rParent child node.

Definition at line 88 of file DDAlgoArguments.cc.

References context, DD_CMU, MillePedeFileConverter_cfg::e, element, gen::n, cms::DDNamespace::realName(), and heppy_batch::val.

Referenced by algorithm().

88  {
90  xml_dim_t e( element );
91  string val = n.realName(xml_dim_t(e.child(DD_CMU(rParent))).nameStr());
92  return val;
93 }
#define DD_CMU(a)
Definition: DDXMLTags.h:188
cms::DDParsingContext & context
xml_h DDAlgoArguments::rawArgument ( const std::string &  name) const
private

Access raw argument as a string by name.

Definition at line 113 of file DDAlgoArguments.cc.

References element, eostools::move(), gen::n, name, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by resolved_scalar_arg(), and value().

113  {
114  for(xml_coll_t p(element,_U(star)); p; ++p) {
115  string n = p.attr<string>(_U(name));
116  if ( n == nam ) {
117  return std::move( p );
118  }
119  }
120  except("DD4CMS","+++ Attempt to access non-existing algorithm option %s[%s]",name.c_str(),nam.c_str());
121  throw runtime_error("DDCMS: Attempt to access non-existing algorithm option.");
122 }
def move(src, dest)
Definition: eostools.py:511
string DDAlgoArguments::resolved_scalar_arg ( const std::string &  name) const
private

Access namespace resolved argument as a string by name.

Definition at line 125 of file DDAlgoArguments.cc.

References a, context, edmIntegrityCheck::d, data, DD_CMU, DEBUG, training_settings::idx, name, pileupDistInMC::num, rawArgument(), cms::DDNamespace::realName(), and heppy_batch::val.

Referenced by value().

125  {
127  xml_h arg = rawArgument(nam);
128  string val = arg.attr<string>(_U(value));
129  return ns.realName(val);
130 }
A arg
Definition: Factorize.h:38
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
Definition: value.py:1
cms::DDParsingContext & context
string DDAlgoArguments::str ( const std::string &  nam) const

Shortcut to access string arguments.

Definition at line 235 of file DDAlgoArguments.cc.

Referenced by algorithm().

236 { return this->value<string>(nam); }
template<typename T >
T cms::DDAlgoArguments::value ( const std::string &  name) const
template<typename T >
T cms::DDAlgoArguments::value ( const string &  nam) const

Access typed argument by name.

Definition at line 203 of file DDAlgoArguments.cc.

References resolved_scalar_arg().

203  {
204  return __cnv<T>(resolved_scalar_arg(nam));
205  }
std::string resolved_scalar_arg(const std::string &name) const
Access namespace resolved argument as a string by name.
template<>
vector<long> cms::DDAlgoArguments::value ( const string &  nam) const

Access typed vector<long> argument by name.

Definition at line 226 of file DDAlgoArguments.cc.

References rawArgument().

227  { return __cnvVect<long>(this,"numeric",rawArgument(nam)); }
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
template<>
vector<float> cms::DDAlgoArguments::value ( const string &  nam) const

Access typed vector<float> argument by name.

Definition at line 222 of file DDAlgoArguments.cc.

References rawArgument().

223  { return __cnvVect<float>(this,"numeric",rawArgument(nam)); }
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
template<>
vector<double> cms::DDAlgoArguments::value ( const string &  nam) const

Access typed vector<double> argument by name.

Definition at line 218 of file DDAlgoArguments.cc.

References rawArgument().

219  { return __cnvVect<double>(this,"numeric",rawArgument(nam)); }
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
template<>
vector<string> cms::DDAlgoArguments::value ( const string &  nam) const

Access typed vector<string> argument by name.

Definition at line 214 of file DDAlgoArguments.cc.

References rawArgument().

215  { return raw_vector(this,rawArgument(nam)); }
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
template<>
vector<int> cms::DDAlgoArguments::value ( const string &  nam) const

Access typed vector<int> argument by name.

Definition at line 230 of file DDAlgoArguments.cc.

References rawArgument().

231  { return __cnvVect<int>(this,"numeric",rawArgument(nam)); }
xml_h rawArgument(const std::string &name) const
Access raw argument as a string by name.
vector< double > DDAlgoArguments::vecDble ( const std::string &  nam) const

Shortcut to access vector<double> arguments.

Definition at line 247 of file DDAlgoArguments.cc.

Referenced by algorithm().

248 { return this->value<vector<double> >(nam); }
vector< int > DDAlgoArguments::vecInt ( const std::string &  nam) const

Shortcut to access vector<int> arguments.

Definition at line 251 of file DDAlgoArguments.cc.

252 { return this->value<vector<int> >(nam); }
vector< string > DDAlgoArguments::vecStr ( const std::string &  nam) const

Shortcut to access vector<string> arguments.

Definition at line 255 of file DDAlgoArguments.cc.

Referenced by algorithm().

256 { return this->value<vector<string> >(nam); }

Member Data Documentation

cms::DDParsingContext& cms::DDAlgoArguments::context

Definition at line 51 of file DDAlgoArguments.h.

Referenced by childName(), parentName(), and resolved_scalar_arg().

xml_h cms::DDAlgoArguments::element

Definition at line 52 of file DDAlgoArguments.h.

Referenced by DDAlgoArguments(), find(), parentName(), and rawArgument().

std::string cms::DDAlgoArguments::name

Definition at line 50 of file DDAlgoArguments.h.

Referenced by ElectronMVAID.ElectronMVAID::__call__(), FWLite.ElectronMVAID::__call__(), dirstructure.Directory::__create_pie_image(), DisplayManager.DisplayManager::__del__(), dqm_interfaces.DirID::__eq__(), BeautifulSoup.Tag::__eq__(), dirstructure.Directory::__get_full_path(), dirstructure.Comparison::__get_img_name(), dataset.Dataset::__getDataType(), dataset.Dataset::__getFileInfoList(), dirstructure.Comparison::__make_image(), core.autovars.NTupleVariable::__repr__(), core.autovars.NTupleObjectType::__repr__(), core.autovars.NTupleObject::__repr__(), core.autovars.NTupleCollection::__repr__(), dirstructure.Directory::__repr__(), dqm_interfaces.DirID::__repr__(), dirstructure.Comparison::__repr__(), config.Service::__setattr__(), config.CFG::__str__(), counter.Counter::__str__(), average.Average::__str__(), BeautifulSoup.Tag::__str__(), BeautifulSoup.SoupStrainer::__str__(), FWLite.WorkingPoints::_reformat_cut_definitions(), core.autovars.NTupleObjectType::addSubObjects(), core.autovars.NTupleObjectType::addVariables(), algorithm(), core.autovars.NTupleObjectType::allVars(), dirstructure.Directory::calcStats(), DDAlgoArguments(), validation.Sample::digest(), python.rootplot.utilities.Hist::divide(), python.rootplot.utilities.Hist::divide_wilson(), DisplayManager.DisplayManager::Draw(), TreeCrawler.Package::dump(), core.autovars.NTupleVariable::fillBranch(), core.autovars.NTupleObject::fillBranches(), core.autovars.NTupleCollection::fillBranchesScalar(), core.autovars.NTupleCollection::fillBranchesVector(), find(), core.autovars.NTupleCollection::get_cpp_declaration(), core.autovars.NTupleCollection::get_cpp_wrapper_class(), core.autovars.NTupleCollection::get_py_wrapper_class(), utils.StatisticalTest::get_status(), production_tasks.Task::getname(), dataset.CMSDataset::getPrimaryDatasetEntries(), dataset.PrivateDataset::getPrimaryDatasetEntries(), VIDSelectorBase.VIDSelectorBase::initialize(), personalPlayback.Applet::log(), core.autovars.NTupleVariable::makeBranch(), core.autovars.NTupleObject::makeBranches(), core.autovars.NTupleCollection::makeBranchesScalar(), core.autovars.NTupleCollection::makeBranchesVector(), dirstructure.Directory::print_report(), dataset.BaseDataset::printInfo(), dataset.Dataset::printInfo(), cms::DDDetector::process(), rawArgument(), resolved_scalar_arg(), production_tasks.MonitorJobs::run(), BeautifulSoup.SoupStrainer::searchTag(), python.rootplot.utilities.Hist::TGraph(), python.rootplot.utilities.Hist::TH1F(), Vispa.Views.PropertyView.Property::valueChanged(), counter.Counter::write(), and average.Average::write().