CMS 3D CMS Logo

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

#include <ParameterSetDescription.h>

Classes

class  SetDescriptionEntry
 

Public Types

typedef
SetDescriptionEntries::const_iterator 
const_iterator
 
typedef std::vector
< SetDescriptionEntry
SetDescriptionEntries
 

Public Member Functions

template<typename T , typename U >
ParameterDescriptionBaseadd (U const &iLabel, T const &value)
 
template<typename T , typename U >
ParameterDescriptionBaseadd (U const &iLabel)
 
ParameterDescriptionNodeaddNode (ParameterDescriptionNode const &node)
 
ParameterDescriptionNodeaddNode (std::auto_ptr< ParameterDescriptionNode > node)
 
template<typename T , typename U >
ParameterDescriptionBaseaddOptional (U const &iLabel, T const &value)
 
template<typename T , typename U >
ParameterDescriptionBaseaddOptional (U const &iLabel)
 
ParameterDescriptionNodeaddOptionalNode (ParameterDescriptionNode const &node, bool writeToCfi)
 
ParameterDescriptionNodeaddOptionalNode (std::auto_ptr< ParameterDescriptionNode > node, bool writeToCfi)
 
template<typename T , typename U >
ParameterDescriptionBaseaddOptionalUntracked (U const &iLabel, T const &value)
 
template<typename T , typename U >
ParameterDescriptionBaseaddOptionalUntracked (U const &iLabel)
 
template<typename T , typename U >
ParameterDescriptionBaseaddUntracked (U const &iLabel, T const &value)
 
template<typename T , typename U >
ParameterDescriptionBaseaddUntracked (U const &iLabel)
 
template<typename U >
ParameterDescriptionBaseaddVPSet (U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
 
template<typename U >
ParameterDescriptionBaseaddVPSet (U const &iLabel, ParameterSetDescription const &validator)
 
template<typename U >
ParameterDescriptionBaseaddVPSetOptional (U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
 
template<typename U >
ParameterDescriptionBaseaddVPSetOptional (U const &iLabel, ParameterSetDescription const &validator)
 
template<typename U >
ParameterDescriptionBaseaddVPSetOptionalUntracked (U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
 
template<typename U >
ParameterDescriptionBaseaddVPSetOptionalUntracked (U const &iLabel, ParameterSetDescription const &validator)
 
template<typename U >
ParameterDescriptionBaseaddVPSetUntracked (U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
 
template<typename U >
ParameterDescriptionBaseaddVPSetUntracked (U const &iLabel, ParameterSetDescription const &validator)
 
template<typename T , typename U >
ParameterWildcardBaseaddWildcard (U const &pattern)
 
template<typename T , typename U >
ParameterWildcardBaseaddWildcardUntracked (U const &pattern)
 
bool anythingAllowed () const
 
const_iterator begin () const
 
std::string const & comment () const
 
const_iterator end () const
 
ParameterDescriptionNodeifExists (ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
 
ParameterDescriptionNodeifExistsOptional (ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2, bool writeToCfi)
 
template<typename T >
ParameterDescriptionNodeifValue (ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
 
template<typename T >
ParameterDescriptionNodeifValueOptional (ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases, bool writeToCfi)
 
bool isLabelUnused (std::string const &label) const
 
bool isUnknown () const
 
template<typename T , typename U >
ParameterDescriptionNodelabelsFrom (U const &iLabel)
 
template<typename T , typename U , typename V >
ParameterDescriptionNodelabelsFrom (U const &iLabel, V const &desc)
 
template<typename T , typename U >
ParameterDescriptionNodelabelsFromOptional (U const &iLabel, bool writeToCfi)
 
template<typename T , typename U , typename V >
ParameterDescriptionNodelabelsFromOptional (U const &iLabel, bool writeToCfi, V const &desc)
 
template<typename T , typename U >
ParameterDescriptionNodelabelsFromOptionalUntracked (U const &iLabel, bool writeToCfi)
 
template<typename T , typename U , typename V >
ParameterDescriptionNodelabelsFromOptionalUntracked (U const &iLabel, bool writeToCfi, V const &desc)
 
template<typename T , typename U >
ParameterDescriptionNodelabelsFromUntracked (U const &iLabel)
 
template<typename T , typename U , typename V >
ParameterDescriptionNodelabelsFromUntracked (U const &iLabel, V const &desc)
 
 ParameterSetDescription ()
 
void print (std::ostream &os, DocFormatHelper &dfh) const
 
void reserve (SetDescriptionEntries::size_type n)
 
void setAllowAnything ()
 allow any parameter label/value pairs More...
 
void setComment (std::string const &value)
 
void setComment (char const *value)
 
void setUnknown ()
 
void validate (ParameterSet &pset) const
 
void writeCfi (std::ostream &os, bool startWithComma, int indentation) const
 
virtual ~ParameterSetDescription ()
 

Private Member Functions

template<typename T , typename U >
ParameterDescriptionBaseadd (U const &iLabel, T const &value, bool isTracked, bool isOptional, bool writeToCfi)
 
template<typename T , typename U >
ParameterDescriptionBaseadd (U const &iLabel, bool isTracked, bool isOptional, bool writeToCfi)
 
ParameterDescriptionNodeaddNode (std::auto_ptr< ParameterDescriptionNode > node, bool optional, bool writeToCfi)
 
template<typename U >
ParameterDescriptionBaseaddVPSet (U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults, bool isTracked, bool isOptional, bool writeToCfi)
 
template<typename U >
ParameterDescriptionBaseaddVPSet (U const &iLabel, ParameterSetDescription const &validator, bool isTracked, bool isOptional, bool writeToCfi)
 
template<typename T , typename U >
ParameterWildcardBaseaddWildcard (U const &pattern, bool isTracked)
 
ParameterDescriptionNodeifExists (ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2, bool optional, bool writeToCfi)
 
template<typename T >
ParameterDescriptionNodeifValue (ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases, bool optional, bool writeToCfi)
 
template<typename T , typename U >
ParameterDescriptionNodelabelsFrom (U const &iLabel, bool isTracked, bool optional, bool writeToCfi)
 
template<typename T , typename U , typename V >
ParameterDescriptionNodelabelsFrom (U const &iLabel, bool isTracked, bool optional, bool writeToCfi, V const &desc)
 
void throwIfLabelsAlreadyUsed (std::set< std::string > const &nodeLabels)
 
void throwIfWildcardCollision (std::set< ParameterTypes > const &nodeParameterTypes, std::set< ParameterTypes > const &nodeWildcardTypes)
 

Static Private Member Functions

static void printNode (SetDescriptionEntry const &entry, std::ostream &os, DocFormatHelper &dfh)
 
static void throwIllegalParameters (std::vector< std::string > const &parameterNames, std::set< std::string > const &validatedNames)
 
static void validateNode (SetDescriptionEntry const &entry, ParameterSet &pset, std::set< std::string > &validatedNames)
 
static void writeNode (SetDescriptionEntry const &entry, std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething)
 

Private Attributes

bool anythingAllowed_
 
std::string comment_
 
SetDescriptionEntries entries_
 
std::set< ParameterTypestypesUsedForParameters_
 
std::set< ParameterTypestypesUsedForWildcards_
 
bool unknown_
 
std::set< std::string > usedLabels_
 

Detailed Description

Definition at line 50 of file ParameterSetDescription.h.

Member Typedef Documentation

typedef SetDescriptionEntries::const_iterator edm::ParameterSetDescription::const_iterator

Definition at line 67 of file ParameterSetDescription.h.

Definition at line 66 of file ParameterSetDescription.h.

Constructor & Destructor Documentation

ParameterSetDescription::ParameterSetDescription ( )

Definition at line 31 of file ParameterSetDescription.cc.

ParameterSetDescription::~ParameterSetDescription ( )
virtual

Definition at line 36 of file ParameterSetDescription.cc.

36  {
37  }

Member Function Documentation

template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::add ( U const &  iLabel,
T const &  value 
)
inline

Definition at line 89 of file ParameterSetDescription.h.

References relativeConstraints::value.

Referenced by edm::ConfigurationDescriptions::addDefault(), GsfElectronBaseProducer::fillDescription(), GsfElectronCoreBaseProducer::fillDescription(), pat::helper::KinResolutionsLoader::fillDescription(), pat::PATUserDataHelper< ObjectType >::fillDescription(), pat::PATUserDataMerger< ObjectType, Operation >::fillDescription(), edm::fillDescriptionFromPSet(), edm::Prescaler::fillDescriptions(), edm::EventAuxiliaryHistoryProducer::fillDescriptions(), HLTHPDFilter::fillDescriptions(), HLTHcalMETNoiseFilter::fillDescriptions(), HLTRFilter::fillDescriptions(), HLTRHemisphere::fillDescriptions(), HLTForwardBackwardJetsFilter::fillDescriptions(), HLTExclDiJetFilter::fillDescriptions(), HLTDiJetAveFilter::fillDescriptions(), HLTMhtHtFilter::fillDescriptions(), HLTBool::fillDescriptions(), HLT1CaloJetEnergy::fillDescriptions(), HLTLevel1Pattern::fillDescriptions(), LogErrorFilter::fillDescriptions(), PythonService::fillDescriptions(), HLTLevel1Activity::fillDescriptions(), pat::PATMETProducer::fillDescriptions(), pat::PATPhotonProducer::fillDescriptions(), edm::EventSetupRecordDataGetter::fillDescriptions(), pat::PATMuonProducer::fillDescriptions(), pat::PATJetProducer::fillDescriptions(), JetCollectionForEleHT::fillDescriptions(), pat::PATTauProducer::fillDescriptions(), edm::service::PrescaleService::fillDescriptions(), pat::PATElectronProducer::fillDescriptions(), and pat::JetCorrFactorsProducer::fillDescriptions().

89  {
90  return add<T, U>(iLabel, value, true, false, true);
91  }
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::add ( U const &  iLabel)
inline

Definition at line 112 of file ParameterSetDescription.h.

112  {
113  return add<T, U>(iLabel, true, false, false);
114  }
template<typename T , typename U >
ParameterDescriptionBase * ParameterSetDescription::add ( U const &  iLabel,
T const &  value,
bool  isTracked,
bool  isOptional,
bool  writeToCfi 
)
private

Definition at line 419 of file ParameterSetDescription.h.

References addNode(), and python.Node::node.

419  {
420 
421  std::auto_ptr<ParameterDescriptionBase> pdbase(new ParameterDescription<T>(iLabel, value, isTracked));
422  ParameterDescriptionBase* pdReturn = pdbase.get();
423  std::auto_ptr<ParameterDescriptionNode> node(pdbase);
424  addNode(node, isOptional, writeToCfi);
425 
426  return pdReturn;
427  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
template<typename T , typename U >
ParameterDescriptionBase * ParameterSetDescription::add ( U const &  iLabel,
bool  isTracked,
bool  isOptional,
bool  writeToCfi 
)
private

Definition at line 431 of file ParameterSetDescription.h.

References addNode(), and python.Node::node.

431  {
432 
433  std::auto_ptr<ParameterDescriptionBase> pdbase(new ParameterDescription<T>(iLabel, isTracked));
434  ParameterDescriptionBase* pdReturn = pdbase.get();
435  std::auto_ptr<ParameterDescriptionNode> node(pdbase);
436  addNode(node, isOptional, writeToCfi);
437 
438  return pdReturn;
439  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
ParameterDescriptionNode * ParameterSetDescription::addNode ( ParameterDescriptionNode const &  node)
ParameterDescriptionNode * ParameterSetDescription::addNode ( std::auto_ptr< ParameterDescriptionNode node)

Definition at line 68 of file ParameterSetDescription.cc.

References addNode().

68  {
69  return addNode(node, false, true);
70  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
ParameterDescriptionNode * ParameterSetDescription::addNode ( std::auto_ptr< ParameterDescriptionNode node,
bool  optional,
bool  writeToCfi 
)
private

Definition at line 87 of file ParameterSetDescription.cc.

References edm::ParameterDescriptionNode::checkAndGetLabelsAndTypes(), entries_, edm::ParameterSetDescription::SetDescriptionEntry::setOptional(), edm::ParameterSetDescription::SetDescriptionEntry::setWriteToCfi(), throwIfLabelsAlreadyUsed(), and throwIfWildcardCollision().

89  {
90 
91  std::set<std::string> nodeLabels;
92  std::set<ParameterTypes> nodeParameterTypes;
93  std::set<ParameterTypes> nodeWildcardTypes;
94  node->checkAndGetLabelsAndTypes(nodeLabels, nodeParameterTypes, nodeWildcardTypes);
95  throwIfLabelsAlreadyUsed(nodeLabels);
96  throwIfWildcardCollision(nodeParameterTypes, nodeWildcardTypes);
97 
98  SetDescriptionEntry entry;
99  entry.setOptional(optional);
100  entry.setWriteToCfi(writeToCfi);
101  entries_.push_back(entry);
102  ParameterDescriptionNode* returnValue = node.get();
103  entries_.back().setNode(node);
104  return returnValue;
105  }
void throwIfWildcardCollision(std::set< ParameterTypes > const &nodeParameterTypes, std::set< ParameterTypes > const &nodeWildcardTypes)
tuple node
Definition: Node.py:50
void throwIfLabelsAlreadyUsed(std::set< std::string > const &nodeLabels)
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addOptional ( U const &  iLabel,
T const &  value 
)
inline
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addOptional ( U const &  iLabel)
inline

Definition at line 122 of file ParameterSetDescription.h.

122  {
123  return add<T, U>(iLabel, true, true, false);
124  }
ParameterDescriptionNode * ParameterSetDescription::addOptionalNode ( ParameterDescriptionNode const &  node,
bool  writeToCfi 
)

Definition at line 74 of file ParameterSetDescription.cc.

References addNode(), and edm::ParameterDescriptionNode::clone().

74  {
75  std::auto_ptr<ParameterDescriptionNode> clonedNode(node.clone());
76  return addNode(clonedNode, true, writeToCfi);
77  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
ParameterDescriptionNode * ParameterSetDescription::addOptionalNode ( std::auto_ptr< ParameterDescriptionNode node,
bool  writeToCfi 
)

Definition at line 81 of file ParameterSetDescription.cc.

References addNode().

81  {
82  return addNode(node, true, writeToCfi);
83  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addOptionalUntracked ( U const &  iLabel,
T const &  value 
)
inline
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addOptionalUntracked ( U const &  iLabel)
inline

Definition at line 127 of file ParameterSetDescription.h.

127  {
128  return add<T, U>(iLabel, false, true, false);
129  }
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addUntracked ( U const &  iLabel,
T const &  value 
)
inline

Definition at line 94 of file ParameterSetDescription.h.

References relativeConstraints::value.

Referenced by edm::StreamerOutputModuleBase::fillDescription(), edm::EventSkipperByID::fillDescription(), edm::ExternalInputSource::fillDescription(), edm::ConfigurableInputSource::fillDescription(), edm::EDInputSource::fillDescription(), edm::GroupSelectorRules::fillDescription(), edm::StreamerFileWriter::fillDescription(), edm::DuplicateChecker::fillDescription(), edm::RootInputFileSequence::fillDescription(), edm::EventSelector::fillDescription(), edm::InputSource::fillDescription(), edm::fillDescriptionFromPSet(), edm::service::InitRootHandlers::fillDescriptions(), HLTForwardBackwardJetsFilter::fillDescriptions(), edm::AsciiOutputModule::fillDescriptions(), edm::service::UnixSignalService::fillDescriptions(), HLTDiJetAveFilter::fillDescriptions(), HLTExclDiJetFilter::fillDescriptions(), HLTMhtHtFilter::fillDescriptions(), edm::service::CPU::fillDescriptions(), edm::StreamerFileReader::fillDescriptions(), HLT1CaloJetEnergy::fillDescriptions(), edm::rootfix::LockService::fillDescriptions(), edm::service::Timing::fillDescriptions(), edm::service::Tracer::fillDescriptions(), edm::service::LoadAllDictionaries::fillDescriptions(), EventIDChecker::fillDescriptions(), edm::PrintEventSetupDataRetrieval::fillDescriptions(), edm::XMLOutputModule::fillDescriptions(), edm::PoolOutputModule::fillDescriptions(), edm::EventSetupRecordDataGetter::fillDescriptions(), edm::service::RandomNumberGeneratorService::fillDescriptions(), MulticoreRunLumiEventChecker::fillDescriptions(), edm::service::SimpleMemoryCheck::fillDescriptions(), edm::service::PrescaleService::fillDescriptions(), edm::service::EnableFloatingPointExceptions::fillDescriptions(), and DQMRootSource::fillDescriptions().

94  {
95  return add<T, U>(iLabel, value, false, false, true);
96  }
template<typename T , typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addUntracked ( U const &  iLabel)
inline

Definition at line 117 of file ParameterSetDescription.h.

117  {
118  return add<T, U>(iLabel, false, false, false);
119  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSet ( U const &  iLabel,
ParameterSetDescription const &  validator,
std::vector< ParameterSet > const &  defaults 
)
inline

Definition at line 143 of file ParameterSetDescription.h.

References l1GtPatternGenerator_cfi::defaults.

Referenced by edm::EventSetupRecordDataGetter::fillDescriptions(), and edm::service::PrescaleService::fillDescriptions().

145  {
146  return addVPSet<U>(iLabel, validator, defaults, true, false, true);
147  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSet ( U const &  iLabel,
ParameterSetDescription const &  validator 
)
inline

Definition at line 171 of file ParameterSetDescription.h.

172  {
173  return addVPSet<U>(iLabel, validator, true, false, false);
174  }
template<typename U >
ParameterDescriptionBase * ParameterSetDescription::addVPSet ( U const &  iLabel,
ParameterSetDescription const &  validator,
std::vector< ParameterSet > const &  defaults,
bool  isTracked,
bool  isOptional,
bool  writeToCfi 
)
private

Definition at line 443 of file ParameterSetDescription.h.

References addNode(), and python.Node::node.

446  {
447  std::auto_ptr<ParameterDescriptionBase> pdbase(
448  new ParameterDescription<std::vector<ParameterSet> >(iLabel, validator, isTracked, defaults));
449 
450  ParameterDescriptionBase* pdReturn = pdbase.get();
451  std::auto_ptr<ParameterDescriptionNode> node(pdbase);
452  addNode(node, isOptional, writeToCfi);
453 
454  return pdReturn;
455  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
template<typename U >
ParameterDescriptionBase * ParameterSetDescription::addVPSet ( U const &  iLabel,
ParameterSetDescription const &  validator,
bool  isTracked,
bool  isOptional,
bool  writeToCfi 
)
private

Definition at line 459 of file ParameterSetDescription.h.

References addNode(), and python.Node::node.

461  {
462  std::auto_ptr<ParameterDescriptionBase> pdbase(
463  new ParameterDescription<std::vector<ParameterSet> >(iLabel, validator, isTracked));
464 
465  ParameterDescriptionBase* pdReturn = pdbase.get();
466  std::auto_ptr<ParameterDescriptionNode> node(pdbase);
467  addNode(node, isOptional, writeToCfi);
468 
469  return pdReturn;
470  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetOptional ( U const &  iLabel,
ParameterSetDescription const &  validator,
std::vector< ParameterSet > const &  defaults 
)
inline

Definition at line 157 of file ParameterSetDescription.h.

References l1GtPatternGenerator_cfi::defaults.

159  {
160  return addVPSet<U>(iLabel, validator, defaults, true, true, true);
161  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetOptional ( U const &  iLabel,
ParameterSetDescription const &  validator 
)
inline

Definition at line 183 of file ParameterSetDescription.h.

184  {
185  return addVPSet<U>(iLabel, validator, true, true, false);
186  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetOptionalUntracked ( U const &  iLabel,
ParameterSetDescription const &  validator,
std::vector< ParameterSet > const &  defaults 
)
inline

Definition at line 164 of file ParameterSetDescription.h.

References l1GtPatternGenerator_cfi::defaults.

166  {
167  return addVPSet<U>(iLabel, validator, defaults, false, true, true);
168  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetOptionalUntracked ( U const &  iLabel,
ParameterSetDescription const &  validator 
)
inline

Definition at line 189 of file ParameterSetDescription.h.

190  {
191  return addVPSet<U>(iLabel, validator, false, true, false);
192  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetUntracked ( U const &  iLabel,
ParameterSetDescription const &  validator,
std::vector< ParameterSet > const &  defaults 
)
inline

Definition at line 150 of file ParameterSetDescription.h.

References l1GtPatternGenerator_cfi::defaults.

152  {
153  return addVPSet<U>(iLabel, validator, defaults, false, false, true);
154  }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSetUntracked ( U const &  iLabel,
ParameterSetDescription const &  validator 
)
inline

Definition at line 177 of file ParameterSetDescription.h.

178  {
179  return addVPSet<U>(iLabel, validator, false, false, false);
180  }
template<typename T , typename U >
ParameterWildcardBase* edm::ParameterSetDescription::addWildcard ( U const &  pattern)
inline

Definition at line 197 of file ParameterSetDescription.h.

References listBenchmarks::pattern.

197  {
198  return addWildcard<T, U>(pattern, true);
199  }
template<typename T , typename U >
ParameterWildcardBase * ParameterSetDescription::addWildcard ( U const &  pattern,
bool  isTracked 
)
private

Definition at line 474 of file ParameterSetDescription.h.

References addNode(), python.Node::node, and edm::RequireZeroOrMore.

474  {
475 
476  std::auto_ptr<ParameterWildcardBase> pdbase(new ParameterWildcard<T>(pattern, RequireZeroOrMore, isTracked));
477  ParameterWildcardBase * pdReturn = pdbase.get();
478  std::auto_ptr<ParameterDescriptionNode> node(pdbase);
479  addNode(node, true, false);
480 
481  return pdReturn;
482  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
template<typename T , typename U >
ParameterWildcardBase* edm::ParameterSetDescription::addWildcardUntracked ( U const &  pattern)
inline

Definition at line 202 of file ParameterSetDescription.h.

References listBenchmarks::pattern.

Referenced by edm::service::RandomNumberGeneratorService::fillDescriptions().

202  {
203  return addWildcard<T, U>(pattern, false);
204  }
bool edm::ParameterSetDescription::anythingAllowed ( ) const
inline

Definition at line 303 of file ParameterSetDescription.h.

References anythingAllowed_.

Referenced by print(), and validate().

const_iterator edm::ParameterSetDescription::begin ( void  ) const
inline

Definition at line 306 of file ParameterSetDescription.h.

References entries_.

306  {
307  return entries_.begin();
308  }
std::string const& edm::ParameterSetDescription::comment ( ) const
inline

Definition at line 72 of file ParameterSetDescription.h.

References comment_.

Referenced by edm::ConfigurationDescriptions::printForLabel().

72 { return comment_; }
const_iterator edm::ParameterSetDescription::end ( void  ) const
inline

Definition at line 310 of file ParameterSetDescription.h.

References entries_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

310  {
311  return entries_.end();
312  }
ParameterDescriptionNode* edm::ParameterSetDescription::ifExists ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2 
)
inline

Definition at line 234 of file ParameterSetDescription.h.

Referenced by ifExistsOptional().

235  {
236  return ifExists(node1, node2, false, true);
237  }
ParameterDescriptionNode * ifExists(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
ParameterDescriptionNode * ParameterSetDescription::ifExists ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2,
bool  optional,
bool  writeToCfi 
)
private

Definition at line 401 of file ParameterSetDescription.cc.

References addNode().

403  {
404  std::auto_ptr<ParameterDescriptionNode> pdIfExists(new IfExistsDescription(node1, node2));
405  return addNode(pdIfExists, optional, writeToCfi);
406  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
ParameterDescriptionNode* edm::ParameterSetDescription::ifExistsOptional ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2,
bool  writeToCfi 
)
inline

Definition at line 240 of file ParameterSetDescription.h.

References ifExists().

242  {
243  return ifExists(node1, node2, true, writeToCfi);
244  }
ParameterDescriptionNode * ifExists(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
template<typename T >
ParameterDescriptionNode* edm::ParameterSetDescription::ifValue ( ParameterDescription< T > const &  switchParameter,
std::auto_ptr< ParameterDescriptionCases< T > >  cases 
)
inline

Definition at line 219 of file ParameterSetDescription.h.

Referenced by reco::helper::JetIDHelper::fillDescription(), and pat::PATMuonProducer::fillDescriptions().

220  {
221  return ifValue<T>(switchParameter, cases, false, true);
222  }
template<typename T >
ParameterDescriptionNode * ParameterSetDescription::ifValue ( ParameterDescription< T > const &  switchParameter,
std::auto_ptr< ParameterDescriptionCases< T > >  cases,
bool  optional,
bool  writeToCfi 
)
private

Definition at line 486 of file ParameterSetDescription.h.

References addNode().

488  {
489  std::auto_ptr<ParameterDescriptionNode> pdswitch(new ParameterSwitch<T>(switchParameter, cases));
490  return addNode(pdswitch, optional, writeToCfi);
491  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
template<typename T >
ParameterDescriptionNode* edm::ParameterSetDescription::ifValueOptional ( ParameterDescription< T > const &  switchParameter,
std::auto_ptr< ParameterDescriptionCases< T > >  cases,
bool  writeToCfi 
)
inline

Definition at line 226 of file ParameterSetDescription.h.

228  {
229  return ifValue<T>(switchParameter, cases, true, writeToCfi);
230  }
bool ParameterSetDescription::isLabelUnused ( std::string const &  label) const

Definition at line 234 of file ParameterSetDescription.cc.

References usedLabels_.

Referenced by edm::ConfigurationDescriptions::addDefault().

234  {
235  return usedLabels_.find(label) == usedLabels_.end();
236  }
const std::string & label
Definition: MVAComputer.cc:186
std::set< std::string > usedLabels_
bool edm::ParameterSetDescription::isUnknown ( ) const
inline

Definition at line 304 of file ParameterSetDescription.h.

References unknown_.

Referenced by edm::ConfigurationDescriptions::print(), and print().

template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFrom ( U const &  iLabel)
inline

Definition at line 249 of file ParameterSetDescription.h.

249  {
250  return labelsFrom<T,U>(iLabel, true, false, true);
251  }
template<typename T , typename U , typename V >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFrom ( U const &  iLabel,
V const &  desc 
)
inline

Definition at line 281 of file ParameterSetDescription.h.

281  {
282  return labelsFrom<T,U,V>(iLabel, true, false, true, desc);
283  }
template<typename T , typename U >
ParameterDescriptionNode * ParameterSetDescription::labelsFrom ( U const &  iLabel,
bool  isTracked,
bool  optional,
bool  writeToCfi 
)
private

Definition at line 495 of file ParameterSetDescription.h.

References addNode().

495  {
496  std::auto_ptr<ParameterDescriptionNode> pd(new AllowedLabelsDescription<T>(iLabel, isTracked));
497  return addNode(pd, optional, writeToCfi);
498  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
template<typename T , typename U , typename V >
ParameterDescriptionNode * ParameterSetDescription::labelsFrom ( U const &  iLabel,
bool  isTracked,
bool  optional,
bool  writeToCfi,
V const &  desc 
)
private

Definition at line 502 of file ParameterSetDescription.h.

References addNode().

502  {
503  std::auto_ptr<ParameterDescriptionNode> pd(new AllowedLabelsDescription<T>(iLabel, desc, isTracked));
504  return addNode(pd, optional, writeToCfi);
505  }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromOptional ( U const &  iLabel,
bool  writeToCfi 
)
inline

Definition at line 261 of file ParameterSetDescription.h.

261  {
262  return labelsFrom<T,U>(iLabel, true, true, writeToCfi);
263  }
template<typename T , typename U , typename V >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromOptional ( U const &  iLabel,
bool  writeToCfi,
V const &  desc 
)
inline

Definition at line 293 of file ParameterSetDescription.h.

293  {
294  return labelsFrom<T,U,V>(iLabel, true, true, writeToCfi, desc);
295  }
template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromOptionalUntracked ( U const &  iLabel,
bool  writeToCfi 
)
inline

Definition at line 267 of file ParameterSetDescription.h.

267  {
268  return labelsFrom<T,U>(iLabel, false, true, writeToCfi);
269  }
template<typename T , typename U , typename V >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromOptionalUntracked ( U const &  iLabel,
bool  writeToCfi,
V const &  desc 
)
inline

Definition at line 299 of file ParameterSetDescription.h.

299  {
300  return labelsFrom<T,U,V>(iLabel, false, true, writeToCfi, desc);
301  }
template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromUntracked ( U const &  iLabel)
inline

Definition at line 255 of file ParameterSetDescription.h.

255  {
256  return labelsFrom<T,U>(iLabel, false, false, true);
257  }
template<typename T , typename U , typename V >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromUntracked ( U const &  iLabel,
V const &  desc 
)
inline

Definition at line 287 of file ParameterSetDescription.h.

287  {
288  return labelsFrom<T,U,V>(iLabel, false, false, true, desc);
289  }
void ParameterSetDescription::print ( std::ostream &  os,
DocFormatHelper dfh 
) const

Definition at line 181 of file ParameterSetDescription.cc.

References anythingAllowed(), edm::DocFormatHelper::brief(), entries_, edm::for_all(), edm::DocFormatHelper::indent(), isUnknown(), printNode(), edm::DocFormatHelper::setCounter(), and edm::DocFormatHelper::setPass().

Referenced by edm::ConfigurationDescriptions::printForLabel(), and edm::ParameterDescription< std::vector< ParameterSet > >::printNestedContent_().

181  {
182 
183  if (isUnknown()) {
184  dfh.indent(os);
185  os << "Description is unknown. The configured PSet will not be validated\n";
186  dfh.indent(os);
187  os << "because the plugin has not defined this parameter set description.\n";
188  if (!dfh.brief()) os << "\n";
189  }
190 
191  if (anythingAllowed()) {
192  dfh.indent(os);
193  os << "Description allows anything and requires nothing.\n";
194  dfh.indent(os);
195  os << "The configured PSet will not be validated.\n";
196  if (!dfh.brief()) os << "\n";
197  }
198 
199  if (entries_.empty()) {
200  dfh.indent(os);
201  os << "Description is empty\n";
202  if (!dfh.brief()) os << "\n";
203  return;
204  }
205 
206  // Zeroth pass is only to calculate column widths in advance of any printing
207  dfh.setPass(0);
208  dfh.setCounter(0);
210  _1,
211  boost::ref(os),
212  boost::ref(dfh)));
213 
214  // First pass prints top level parameters and references to structure
215  dfh.setPass(1);
216  dfh.setCounter(0);
218  _1,
219  boost::ref(os),
220  boost::ref(dfh)));
221 
222  // Second pass prints substructure that goes into different sections of the
223  // output document
224  dfh.setPass(2);
225  dfh.setCounter(0);
227  _1,
228  boost::ref(os),
229  boost::ref(dfh)));
230  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
static void printNode(SetDescriptionEntry const &entry, std::ostream &os, DocFormatHelper &dfh)
void ParameterSetDescription::printNode ( SetDescriptionEntry const &  entry,
std::ostream &  os,
DocFormatHelper dfh 
)
staticprivate

Definition at line 287 of file ParameterSetDescription.cc.

References edm::ParameterSetDescription::SetDescriptionEntry::node(), edm::ParameterSetDescription::SetDescriptionEntry::optional(), edm::DocFormatHelper::pass(), and edm::ParameterSetDescription::SetDescriptionEntry::writeToCfi().

Referenced by print().

289  {
290  if (dfh.pass() < 2) {
291  entry.node()->print(os, entry.optional(), entry.writeToCfi(), dfh);
292  }
293  else {
294  entry.node()->printNestedContent(os, entry.optional(), dfh);
295  }
296  }
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void edm::ParameterSetDescription::reserve ( SetDescriptionEntries::size_type  n)
inline

Definition at line 316 of file ParameterSetDescription.h.

References entries_.

316  {
317  entries_.reserve(n);
318  }
void ParameterSetDescription::setAllowAnything ( )
void ParameterSetDescription::setComment ( std::string const &  value)
void ParameterSetDescription::setComment ( char const *  value)
void ParameterSetDescription::setUnknown ( )
void ParameterSetDescription::throwIfLabelsAlreadyUsed ( std::set< std::string > const &  nodeLabels)
private

Definition at line 300 of file ParameterSetDescription.cc.

References edm::hlt::Exception, edm::errors::LogicError, and usedLabels_.

Referenced by addNode().

300  {
301 
302  std::set<std::string> duplicateLabels;
303  std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
304  std::set_intersection(nodeLabels.begin(), nodeLabels.end(),
305  usedLabels_.begin(), usedLabels_.end(),
306  insertIter);
307  if (duplicateLabels.empty()) {
308  usedLabels_.insert(nodeLabels.begin(), nodeLabels.end());
309  }
310  else {
311 
312  std::stringstream ss;
313  for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(),
314  iEnd = duplicateLabels.end();
315  iter != iEnd;
316  ++iter) {
317  ss << " \"" << *iter << "\"\n";
318  }
320  << "Labels used in different nodes of a ParameterSetDescription\n"
321  << "must be unique. The following duplicate labels were detected:\n"
322  << ss.str()
323  << "\n";
324  }
325  }
std::set< std::string > usedLabels_
void ParameterSetDescription::throwIfWildcardCollision ( std::set< ParameterTypes > const &  nodeParameterTypes,
std::set< ParameterTypes > const &  nodeWildcardTypes 
)
private

Definition at line 329 of file ParameterSetDescription.cc.

References edm::hlt::Exception, edm::errors::LogicError, edm::parameterTypeEnumToString(), typesUsedForParameters_, and typesUsedForWildcards_.

Referenced by addNode().

330  {
331 
332  // 1. Check that the new wildcard types do not collide with the existing
333  // parameter types.
334  // 2. Check that the new parameter types do not collide with the existing
335  // wildcard types.
336  // 3. Then insert them.
337  // The order of those steps is important because a wildcard with a default
338  // value could insert a type in both sets and this is OK.
339 
340  // We assume the node already checked for collisions between the new parameter
341  // types and the new wildcard types before passing the sets to this function.
342 
343  if (!nodeWildcardTypes.empty()) {
344 
345  std::set<ParameterTypes> duplicateTypes1;
346  std::insert_iterator<std::set<ParameterTypes> > insertIter1(duplicateTypes1, duplicateTypes1.begin());
347  std::set_intersection(typesUsedForParameters_.begin(), typesUsedForParameters_.end(),
348  nodeWildcardTypes.begin(), nodeWildcardTypes.end(),
349  insertIter1);
350 
351  if (!duplicateTypes1.empty()) {
352 
353  std::stringstream ss;
354  for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes1.begin(),
355  iEnd = duplicateTypes1.end();
356  iter != iEnd;
357  ++iter) {
358  ss << " \"" << parameterTypeEnumToString(*iter) << "\"\n";
359  }
361  << "Within a ParameterSetDescription, the type used for a wildcard must\n"
362  << "not be the same as the type used for other parameters. This rule\n"
363  << "is violated for the following types:\n"
364  << ss.str()
365  << "\n";
366  }
367  }
368 
369  if (!typesUsedForWildcards_.empty()) {
370 
371  std::set<ParameterTypes> duplicateTypes2;
372  std::insert_iterator<std::set<ParameterTypes> > insertIter2(duplicateTypes2, duplicateTypes2.begin());
373  std::set_intersection(typesUsedForWildcards_.begin(), typesUsedForWildcards_.end(),
374  nodeParameterTypes.begin(), nodeParameterTypes.end(),
375  insertIter2);
376 
377  if (!duplicateTypes2.empty()) {
378 
379  std::stringstream ss;
380  for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes2.begin(),
381  iEnd = duplicateTypes2.end();
382  iter != iEnd;
383  ++iter) {
384  ss << " \"" << parameterTypeEnumToString(*iter) << "\"\n";
385  }
387  << "Within a ParameterSetDescription, the type used for a wildcard must\n"
388  << "not be the same as the type used for other parameters. This rule is\n"
389  << "violated for the following types :\n"
390  << ss.str()
391  << "\n";
392  }
393  }
394 
395  typesUsedForParameters_.insert(nodeParameterTypes.begin(), nodeParameterTypes.end());
396  typesUsedForWildcards_.insert(nodeWildcardTypes.begin(), nodeWildcardTypes.end());
397  }
std::string parameterTypeEnumToString(ParameterTypes iType)
std::set< ParameterTypes > typesUsedForParameters_
std::set< ParameterTypes > typesUsedForWildcards_
void ParameterSetDescription::throwIllegalParameters ( std::vector< std::string > const &  parameterNames,
std::set< std::string > const &  validatedNames 
)
staticprivate

Definition at line 239 of file ParameterSetDescription.cc.

References edm::errors::Configuration, and edm::hlt::Exception.

Referenced by validate().

241  {
242 
243  std::set<std::string> parNames(parameterNames.begin(), parameterNames.end());
244 
245 
246  std::set<std::string> diffNames;
247  std::insert_iterator<std::set<std::string> > insertIter(diffNames, diffNames.begin());
248  std::set_difference(parNames.begin(), parNames.end(),
249  validatedLabels.begin(), validatedLabels.end(),
250  insertIter);
251 
252  std::stringstream ss;
253  for (std::set<std::string>::const_iterator iter = diffNames.begin(),
254  iEnd = diffNames.end();
255  iter != iEnd;
256  ++iter) {
257  ss << " \"" << *iter << "\"\n";
258  }
259  if (diffNames.size() == 1U) {
261  << "Illegal parameter found in configuration. The parameter is named:\n"
262  << ss.str()
263  << "You could be trying to use a parameter name that is not\n"
264  << "allowed for this plugin or it could be misspelled.\n";
265  }
266  else {
268  << "Illegal parameters found in configuration. The parameters are named:\n"
269  << ss.str()
270  << "You could be trying to use parameter names that are not\n"
271  << "allowed for this plugin or they could be misspelled.\n";
272  }
273  }
void ParameterSetDescription::validate ( ParameterSet pset) const

Definition at line 108 of file ParameterSetDescription.cc.

References anythingAllowed(), entries_, edm::ParameterSet::exists(), edm::for_all(), edm::ParameterSet::getParameterNames(), edm::IllegalParameters::throwAnException(), throwIllegalParameters(), unknown_, and validateNode().

Referenced by edm::ConfigurationDescriptions::validate().

109  {
110  if (unknown_ || anythingAllowed()) return;
111 
112  std::set<std::string> validatedLabels;
114  boost::bind(&ParameterSetDescription::validateNode, _1, boost::ref(pset), boost::ref(validatedLabels)));
115 
116  std::vector<std::string> parameterNames = pset.getParameterNames();
117  if (validatedLabels.size() != parameterNames.size()) {
118 
119  // Three labels will be magically inserted into the top level
120  // of a module ParameterSet even though they are not in the
121  // python configuration files. If these are present, then
122  // assume they are OK and count them as validated.
123 
124  std::string module_label("@module_label");
125  if (pset.exists(module_label)) {
126  validatedLabels.insert(module_label);
127  }
128 
129  std::string module_type("@module_type");
130  if (pset.exists(module_type)) {
131  validatedLabels.insert(module_type);
132  }
133 
134  std::string module_edm_type("@module_edm_type");
135  if (pset.exists(module_edm_type)) {
136  validatedLabels.insert(module_edm_type);
137  }
138 
139  std::string service_type("@service_type");
140  if (pset.exists(service_type)) {
141  validatedLabels.insert(service_type);
142  }
143 
144  // Try again
145  if (validatedLabels.size() != parameterNames.size()) {
147  throwIllegalParameters(parameterNames, validatedLabels);
148  }
149  }
150  }
151  }
static void throwIllegalParameters(std::vector< std::string > const &parameterNames, std::set< std::string > const &validatedNames)
static bool throwAnException()
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
static void validateNode(SetDescriptionEntry const &entry, ParameterSet &pset, std::set< std::string > &validatedNames)
void ParameterSetDescription::validateNode ( SetDescriptionEntry const &  entry,
ParameterSet pset,
std::set< std::string > &  validatedNames 
)
staticprivate

Definition at line 174 of file ParameterSetDescription.cc.

References edm::ParameterSetDescription::SetDescriptionEntry::node(), and edm::ParameterSetDescription::SetDescriptionEntry::optional().

Referenced by validate().

176  {
177  entry.node()->validate(pset, validatedLabels, entry.optional());
178  }
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void ParameterSetDescription::writeCfi ( std::ostream &  os,
bool  startWithComma,
int  indentation 
) const

Definition at line 154 of file ParameterSetDescription.cc.

References entries_, edm::for_all(), and writeNode().

Referenced by edm::ParameterDescription< std::vector< ParameterSet > >::writeOneElementToCfi().

156  {
157  bool wroteSomething = false;
158 
160  _1,
161  boost::ref(os),
162  boost::ref(startWithComma),
163  indentation,
164  boost::ref(wroteSomething)));
165 
166  if (wroteSomething) {
167  char oldFill = os.fill();
168  os << "\n" << std::setfill(' ') << std::setw(indentation - 2) << "";
169  os.fill(oldFill);
170  }
171  }
static void writeNode(SetDescriptionEntry const &entry, std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void ParameterSetDescription::writeNode ( SetDescriptionEntry const &  entry,
std::ostream &  os,
bool &  startWithComma,
int  indentation,
bool &  wroteSomething 
)
staticprivate

Definition at line 276 of file ParameterSetDescription.cc.

References edm::ParameterSetDescription::SetDescriptionEntry::node(), and edm::ParameterSetDescription::SetDescriptionEntry::writeToCfi().

Referenced by writeCfi().

280  {
281  if (entry.writeToCfi()) {
282  entry.node()->writeCfi(os, startWithComma, indentation, wroteSomething);
283  }
284  }
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8

Member Data Documentation

bool edm::ParameterSetDescription::anythingAllowed_
private

Definition at line 399 of file ParameterSetDescription.h.

Referenced by anythingAllowed(), and setAllowAnything().

std::string edm::ParameterSetDescription::comment_
private

Definition at line 407 of file ParameterSetDescription.h.

Referenced by comment(), and setComment().

SetDescriptionEntries edm::ParameterSetDescription::entries_
private

Definition at line 401 of file ParameterSetDescription.h.

Referenced by addNode(), begin(), end(), print(), reserve(), validate(), and writeCfi().

std::set<ParameterTypes> edm::ParameterSetDescription::typesUsedForParameters_
private

Definition at line 404 of file ParameterSetDescription.h.

Referenced by throwIfWildcardCollision().

std::set<ParameterTypes> edm::ParameterSetDescription::typesUsedForWildcards_
private

Definition at line 405 of file ParameterSetDescription.h.

Referenced by throwIfWildcardCollision().

bool edm::ParameterSetDescription::unknown_
private

Definition at line 400 of file ParameterSetDescription.h.

Referenced by isUnknown(), setUnknown(), and validate().

std::set<std::string> edm::ParameterSetDescription::usedLabels_
private

Definition at line 403 of file ParameterSetDescription.h.

Referenced by isLabelUnused(), and throwIfLabelsAlreadyUsed().