CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

edm::ParameterSetDescription Class Reference

#include <ParameterSetDescription.h>

List of all members.

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 , typename V >
ParameterDescriptionNodelabelsFromOptionalUntracked (U const &iLabel, bool writeToCfi, V const &desc)
template<typename T , typename U >
ParameterDescriptionNodelabelsFromOptionalUntracked (U const &iLabel, bool writeToCfi)
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
void setComment (char const *value)
void setComment (std::string 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, bool isTracked, bool isOptional, 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 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 , typename V >
ParameterDescriptionNodelabelsFrom (U const &iLabel, bool isTracked, bool optional, bool writeToCfi, V const &desc)
template<typename T , typename U >
ParameterDescriptionNodelabelsFrom (U const &iLabel, bool isTracked, bool optional, bool writeToCfi)
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.

                                                  :
  anythingAllowed_(false),
  unknown_(false) {
  }
ParameterSetDescription::~ParameterSetDescription ( ) [virtual]

Definition at line 36 of file ParameterSetDescription.cc.

                                                    {
  }

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

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

Definition at line 112 of file ParameterSetDescription.h.

                                                    {
      return add<T, U>(iLabel, true, false, false);
    }
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.

                                                                                                                {

    std::auto_ptr<ParameterDescriptionBase> pdbase(new ParameterDescription<T>(iLabel, value, isTracked));
    ParameterDescriptionBase* pdReturn = pdbase.get();
    std::auto_ptr<ParameterDescriptionNode> node(pdbase);
    addNode(node, isOptional, writeToCfi);

    return pdReturn;
  }
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.

                                                                                                {

    std::auto_ptr<ParameterDescriptionBase> pdbase(new ParameterDescription<T>(iLabel, isTracked));
    ParameterDescriptionBase* pdReturn = pdbase.get();
    std::auto_ptr<ParameterDescriptionNode> node(pdbase);
    addNode(node, isOptional, writeToCfi);

    return pdReturn;
  }
ParameterDescriptionNode * ParameterSetDescription::addNode ( ParameterDescriptionNode const &  node)
ParameterDescriptionNode * ParameterSetDescription::addNode ( std::auto_ptr< ParameterDescriptionNode node)

Definition at line 68 of file ParameterSetDescription.cc.

References addNode().

                                                      {
    return addNode(node, false, true);
  }
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().

                       {
  
    std::set<std::string> nodeLabels;
    std::set<ParameterTypes> nodeParameterTypes;
    std::set<ParameterTypes> nodeWildcardTypes;
    node->checkAndGetLabelsAndTypes(nodeLabels, nodeParameterTypes, nodeWildcardTypes);
    throwIfLabelsAlreadyUsed(nodeLabels);
    throwIfWildcardCollision(nodeParameterTypes, nodeWildcardTypes);

    SetDescriptionEntry entry;
    entry.setOptional(optional);
    entry.setWriteToCfi(writeToCfi);
    entries_.push_back(entry);
    ParameterDescriptionNode* returnValue = node.get();
    entries_.back().setNode(node);
    return returnValue;
  }
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.

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

Definition at line 74 of file ParameterSetDescription.cc.

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

                                                                         {
    std::auto_ptr<ParameterDescriptionNode> clonedNode(node.clone());
    return addNode(clonedNode, true, writeToCfi);
  }
ParameterDescriptionNode * ParameterSetDescription::addOptionalNode ( std::auto_ptr< ParameterDescriptionNode node,
bool  writeToCfi 
)

Definition at line 81 of file ParameterSetDescription.cc.

References addNode().

                                                                               {
    return addNode(node, true, writeToCfi);
  }
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.

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

Definition at line 117 of file ParameterSetDescription.h.

                                                             {
      return add<T, U>(iLabel, false, false, false);
    }
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::ConfigurableInputSource::fillDescription(), edm::RootInputFileSequence::fillDescription(), edm::EDInputSource::fillDescription(), edm::StreamerOutputModuleBase::fillDescription(), edm::InputSource::fillDescription(), edm::GroupSelectorRules::fillDescription(), edm::ExternalInputSource::fillDescription(), edm::EventSkipperByID::fillDescription(), edm::DuplicateChecker::fillDescription(), edm::EventSelector::fillDescription(), edm::StreamerFileWriter::fillDescription(), edm::fillDescriptionFromPSet(), edm::service::UnixSignalService::fillDescriptions(), edm::XMLOutputModule::fillDescriptions(), edm::PoolOutputModule::fillDescriptions(), EventIDChecker::fillDescriptions(), edm::StreamerFileReader::fillDescriptions(), edm::service::LoadAllDictionaries::fillDescriptions(), HLTExclDiJetFilter::fillDescriptions(), edm::PrintEventSetupDataRetrieval::fillDescriptions(), edm::service::SimpleMemoryCheck::fillDescriptions(), edm::rootfix::LockService::fillDescriptions(), edm::service::PrescaleService::fillDescriptions(), HLTForwardBackwardJetsFilter::fillDescriptions(), edm::AsciiOutputModule::fillDescriptions(), edm::service::Timing::fillDescriptions(), edm::service::InitRootHandlers::fillDescriptions(), HLTDiJetAveFilter::fillDescriptions(), edm::service::RandomNumberGeneratorService::fillDescriptions(), edm::service::EnableFloatingPointExceptions::fillDescriptions(), DQMRootSource::fillDescriptions(), HLT1CaloJetEnergy::fillDescriptions(), MulticoreRunLumiEventChecker::fillDescriptions(), HLTMhtHtFilter::fillDescriptions(), edm::service::Tracer::fillDescriptions(), edm::service::CPU::fillDescriptions(), and edm::EventSetupRecordDataGetter::fillDescriptions().

                                                                             {
      return add<T, U>(iLabel, value, false, false, true);
    }
template<typename U >
ParameterDescriptionBase* edm::ParameterSetDescription::addVPSet ( U const &  iLabel,
ParameterSetDescription const &  validator 
) [inline]

Definition at line 171 of file ParameterSetDescription.h.

                                                                                  {
      return addVPSet<U>(iLabel, validator, true, false, false);
    }
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.

                                                                                      {
    std::auto_ptr<ParameterDescriptionBase> pdbase(
        new ParameterDescription<std::vector<ParameterSet> >(iLabel, validator, isTracked, defaults));

    ParameterDescriptionBase* pdReturn = pdbase.get();
    std::auto_ptr<ParameterDescriptionNode> node(pdbase);
    addNode(node, isOptional, writeToCfi);

    return pdReturn;
  }
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.

                                                                                      {
    std::auto_ptr<ParameterDescriptionBase> pdbase(
        new ParameterDescription<std::vector<ParameterSet> >(iLabel, validator, isTracked));

    ParameterDescriptionBase* pdReturn = pdbase.get();
    std::auto_ptr<ParameterDescriptionNode> node(pdbase);
    addNode(node, isOptional, writeToCfi);

    return pdReturn;
  }
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::service::PrescaleService::fillDescriptions(), and edm::EventSetupRecordDataGetter::fillDescriptions().

                                                                                 {
      return addVPSet<U>(iLabel, validator, defaults, true, false, true);
    }
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.

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

Definition at line 183 of file ParameterSetDescription.h.

                                                                                  {
      return addVPSet<U>(iLabel, validator, true, true, false);
    }
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.

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

Definition at line 189 of file ParameterSetDescription.h.

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

Definition at line 177 of file ParameterSetDescription.h.

                                                                                  {
      return addVPSet<U>(iLabel, validator, false, false, false);
    }
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.

                                                                                 {
      return addVPSet<U>(iLabel, validator, defaults, false, false, true);
    }
template<typename T , typename U >
ParameterWildcardBase* edm::ParameterSetDescription::addWildcard ( U const &  pattern) [inline]

Definition at line 197 of file ParameterSetDescription.h.

References listBenchmarks::pattern.

                                                          {
      return addWildcard<T, U>(pattern, true);
    }
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.

                                                                       {
    
    std::auto_ptr<ParameterWildcardBase> pdbase(new ParameterWildcard<T>(pattern, RequireZeroOrMore, isTracked));
    ParameterWildcardBase * pdReturn = pdbase.get();
    std::auto_ptr<ParameterDescriptionNode> node(pdbase);
    addNode(node, true, false);

    return pdReturn;
  }
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().

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

Definition at line 303 of file ParameterSetDescription.h.

References anythingAllowed_.

Referenced by print(), and validate().

{ return anythingAllowed_; }
const_iterator edm::ParameterSetDescription::begin ( void  ) const [inline]

Definition at line 306 of file ParameterSetDescription.h.

References entries_.

                                 {
      return entries_.begin();
    }
std::string const& edm::ParameterSetDescription::comment ( ) const [inline]

Definition at line 72 of file ParameterSetDescription.h.

References comment_.

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

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

Definition at line 310 of file ParameterSetDescription.h.

References entries_.

                               {
      return entries_.end();
    }
ParameterDescriptionNode * ParameterSetDescription::ifExists ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2,
bool  optional,
bool  writeToCfi 
) [private]

Definition at line 401 of file ParameterSetDescription.cc.

References addNode().

                                           {
    std::auto_ptr<ParameterDescriptionNode> pdIfExists(new IfExistsDescription(node1, node2));
    return addNode(pdIfExists, optional, writeToCfi);
  }
ParameterDescriptionNode* edm::ParameterSetDescription::ifExists ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2 
) [inline]

Definition at line 234 of file ParameterSetDescription.h.

Referenced by ifExistsOptional().

                                                    {
      return ifExists(node1, node2, false, true);
    }
ParameterDescriptionNode* edm::ParameterSetDescription::ifExistsOptional ( ParameterDescriptionNode const &  node1,
ParameterDescriptionNode const &  node2,
bool  writeToCfi 
) [inline]

Definition at line 240 of file ParameterSetDescription.h.

References ifExists().

                                           {
      return ifExists(node1, node2, true, writeToCfi);
    }
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().

                                                              {
      return ifValue<T>(switchParameter, cases, false, true);
    }
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().

                                          {
    std::auto_ptr<ParameterDescriptionNode> pdswitch(new ParameterSwitch<T>(switchParameter, cases));
    return addNode(pdswitch, optional, writeToCfi);
  }
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.

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

Definition at line 234 of file ParameterSetDescription.cc.

References usedLabels_.

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

                                              {
    return usedLabels_.find(label) == usedLabels_.end();
  }
bool edm::ParameterSetDescription::isUnknown ( ) const [inline]

Definition at line 304 of file ParameterSetDescription.h.

References unknown_.

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

{ return unknown_; }
template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFrom ( U const &  iLabel) [inline]

Definition at line 249 of file ParameterSetDescription.h.

                                {
      return labelsFrom<T,U>(iLabel, true, false, true);
    }
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().

                                                                                                     {
    std::auto_ptr<ParameterDescriptionNode> pd(new AllowedLabelsDescription<T>(iLabel, isTracked));
    return addNode(pd, optional, writeToCfi);
  }
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.

                                               {
      return labelsFrom<T,U,V>(iLabel, true, false, true, desc);
    }
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().

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

Definition at line 261 of file ParameterSetDescription.h.

                                                         {
      return labelsFrom<T,U>(iLabel, true, true, writeToCfi);
    }
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.

                                                                        {
      return labelsFrom<T,U,V>(iLabel, true, true, writeToCfi, desc);
    }
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.

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

Definition at line 267 of file ParameterSetDescription.h.

                                                                  {
      return labelsFrom<T,U>(iLabel, false, true, writeToCfi);
    }
template<typename T , typename U >
ParameterDescriptionNode* edm::ParameterSetDescription::labelsFromUntracked ( U const &  iLabel) [inline]

Definition at line 255 of file ParameterSetDescription.h.

                                         {
      return labelsFrom<T,U>(iLabel, false, false, true);
    }
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.

                                                        {
      return labelsFrom<T,U,V>(iLabel, false, false, true, desc);
    }
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_().

                                                      {

    if (isUnknown()) {
      dfh.indent(os);
      os << "Description is unknown.  The configured PSet will not be validated\n";
      dfh.indent(os);
      os << "because the plugin has not defined this parameter set description.\n";
      if (!dfh.brief()) os << "\n";
    }

    if (anythingAllowed()) {
      dfh.indent(os);
      os << "Description allows anything and requires nothing.\n";
      dfh.indent(os);
      os << "The configured PSet will not be validated.\n";
      if (!dfh.brief()) os << "\n";
    }

    if (entries_.empty()) {
      dfh.indent(os);
      os << "Description is empty\n";
      if (!dfh.brief()) os << "\n";
      return;
    }

    // Zeroth pass is only to calculate column widths in advance of any printing
    dfh.setPass(0);
    dfh.setCounter(0);
    for_all(entries_, boost::bind(&ParameterSetDescription::printNode,
                                  _1,
                                  boost::ref(os),
                                  boost::ref(dfh)));

    // First pass prints top level parameters and references to structure
    dfh.setPass(1);
    dfh.setCounter(0);
    for_all(entries_, boost::bind(&ParameterSetDescription::printNode,
                                  _1,
                                  boost::ref(os),
                                  boost::ref(dfh)));

    // Second pass prints substructure that goes into different sections of the
    // output document
    dfh.setPass(2);
    dfh.setCounter(0);
    for_all(entries_, boost::bind(&ParameterSetDescription::printNode,
                                  _1,
                                  boost::ref(os),
                                  boost::ref(dfh)));
  }
void ParameterSetDescription::printNode ( SetDescriptionEntry const &  entry,
std::ostream &  os,
DocFormatHelper dfh 
) [static, private]

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().

                                                            {
    if (dfh.pass() < 2) {
      entry.node()->print(os, entry.optional(), entry.writeToCfi(), dfh);
    }
    else {
      entry.node()->printNestedContent(os, entry.optional(), dfh);
    }
  }
void edm::ParameterSetDescription::reserve ( SetDescriptionEntries::size_type  n) [inline]

Definition at line 316 of file ParameterSetDescription.h.

References entries_.

                                                   {
      entries_.reserve(n);
    }
void ParameterSetDescription::setAllowAnything ( )
void ParameterSetDescription::setComment ( char const *  value)

Definition at line 44 of file ParameterSetDescription.cc.

References comment_, and relativeConstraints::value.

  { comment_ = value; }
void ParameterSetDescription::setComment ( std::string const &  value)
void ParameterSetDescription::setUnknown ( )
void ParameterSetDescription::throwIfLabelsAlreadyUsed ( std::set< std::string > const &  nodeLabels) [private]

Definition at line 300 of file ParameterSetDescription.cc.

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

Referenced by addNode().

                                                                {

    std::set<std::string> duplicateLabels;
    std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
    std::set_intersection(nodeLabels.begin(), nodeLabels.end(),
                          usedLabels_.begin(), usedLabels_.end(),
                          insertIter);
    if (duplicateLabels.empty()) {
      usedLabels_.insert(nodeLabels.begin(), nodeLabels.end());
    }
    else {

      std::stringstream ss;
      for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(),
                                                 iEnd = duplicateLabels.end();
           iter != iEnd;
           ++iter) {
        ss << " \"" << *iter <<  "\"\n";
      }
      throw edm::Exception(errors::LogicError)
        << "Labels used in different nodes of a ParameterSetDescription\n"
        << "must be unique.  The following duplicate labels were detected:\n"
        << ss.str()
        << "\n";
    }
  }
void ParameterSetDescription::throwIfWildcardCollision ( std::set< ParameterTypes > const &  nodeParameterTypes,
std::set< ParameterTypes > const &  nodeWildcardTypes 
) [private]

Definition at line 329 of file ParameterSetDescription.cc.

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

Referenced by addNode().

                                                                            {

    // 1. Check that the new wildcard types do not collide with the existing
    // parameter types.
    // 2. Check that the new parameter types do not collide with the existing
    // wildcard types.
    // 3. Then insert them.
    // The order of those steps is important because a wildcard with a default
    // value could insert a type in both sets and this is OK.

    // We assume the node already checked for collisions between the new parameter
    // types and the new wildcard types before passing the sets to this function.

    if (!nodeWildcardTypes.empty()) {

      std::set<ParameterTypes> duplicateTypes1;
      std::insert_iterator<std::set<ParameterTypes> > insertIter1(duplicateTypes1, duplicateTypes1.begin());
      std::set_intersection(typesUsedForParameters_.begin(), typesUsedForParameters_.end(),
                            nodeWildcardTypes.begin(), nodeWildcardTypes.end(),
                            insertIter1);

      if (!duplicateTypes1.empty()) {

        std::stringstream ss;
        for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes1.begin(),
                                                      iEnd = duplicateTypes1.end();
             iter != iEnd;
             ++iter) {
          ss << " \"" << parameterTypeEnumToString(*iter) <<  "\"\n";
        }
        throw edm::Exception(errors::LogicError)
          << "Within a ParameterSetDescription, the type used for a wildcard must\n"
          << "not be the same as the type used for other parameters. This rule\n"
          << "is violated for the following types:\n"
          << ss.str()
          << "\n";
      }
    }

    if (!typesUsedForWildcards_.empty()) {

      std::set<ParameterTypes> duplicateTypes2;
      std::insert_iterator<std::set<ParameterTypes> > insertIter2(duplicateTypes2, duplicateTypes2.begin());
      std::set_intersection(typesUsedForWildcards_.begin(), typesUsedForWildcards_.end(),
                            nodeParameterTypes.begin(), nodeParameterTypes.end(),
                            insertIter2);

      if (!duplicateTypes2.empty()) {

        std::stringstream ss;
        for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes2.begin(),
                                                      iEnd = duplicateTypes2.end();
             iter != iEnd;
             ++iter) {
          ss << " \"" << parameterTypeEnumToString(*iter) <<  "\"\n";
        }
        throw edm::Exception(errors::LogicError)
          << "Within a ParameterSetDescription, the type used for a wildcard must\n"
          << "not be the same as the type used for other parameters. This rule is\n"
          << "violated for the following types :\n"
          << ss.str()
          << "\n";
      }
    }

    typesUsedForParameters_.insert(nodeParameterTypes.begin(), nodeParameterTypes.end());
    typesUsedForWildcards_.insert(nodeWildcardTypes.begin(), nodeWildcardTypes.end());
  }
void ParameterSetDescription::throwIllegalParameters ( std::vector< std::string > const &  parameterNames,
std::set< std::string > const &  validatedNames 
) [static, private]

Definition at line 239 of file ParameterSetDescription.cc.

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

Referenced by validate().

                                              {

    std::set<std::string> parNames(parameterNames.begin(), parameterNames.end());


    std::set<std::string> diffNames;
    std::insert_iterator<std::set<std::string> > insertIter(diffNames, diffNames.begin());
    std::set_difference(parNames.begin(), parNames.end(),
                        validatedLabels.begin(), validatedLabels.end(),
                        insertIter);

    std::stringstream ss;
    for (std::set<std::string>::const_iterator iter = diffNames.begin(),
                                               iEnd = diffNames.end();
         iter != iEnd;
         ++iter) {
      ss << " \"" << *iter <<  "\"\n";
    }
    if (diffNames.size() == 1U) {
      throw edm::Exception(errors::Configuration)
        << "Illegal parameter found in configuration.  The parameter is named:\n" 
        << ss.str()
        << "You could be trying to use a parameter name that is not\n"
        << "allowed for this plugin or it could be misspelled.\n";
    }
    else {
      throw edm::Exception(errors::Configuration)
        << "Illegal parameters found in configuration.  The parameters are named:\n" 
        << ss.str()
        << "You could be trying to use parameter names that are not\n"
        << "allowed for this plugin or they could be misspelled.\n";
    }
  }
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().

  {
    if (unknown_ || anythingAllowed()) return;

    std::set<std::string> validatedLabels;
    for_all(entries_,
            boost::bind(&ParameterSetDescription::validateNode, _1, boost::ref(pset), boost::ref(validatedLabels)));

    std::vector<std::string> parameterNames = pset.getParameterNames();
    if (validatedLabels.size() != parameterNames.size()) {

      // Three labels will be magically inserted into the top level
      // of a module ParameterSet even though they are not in the
      // python configuration files.  If these are present, then
      // assume they are OK and count them as validated.

      std::string module_label("@module_label");
      if (pset.exists(module_label)) {
        validatedLabels.insert(module_label);
      }

      std::string module_type("@module_type");
      if (pset.exists(module_type)) {
        validatedLabels.insert(module_type);
      }

      std::string module_edm_type("@module_edm_type");
      if (pset.exists(module_edm_type)) {
        validatedLabels.insert(module_edm_type);
      }

      std::string service_type("@service_type");
      if (pset.exists(service_type)) {
        validatedLabels.insert(service_type);
      }

      // Try again
      if (validatedLabels.size() != parameterNames.size()) {
        if (IllegalParameters::throwAnException()) {
          throwIllegalParameters(parameterNames, validatedLabels);
        }
      }
    }
  }
void ParameterSetDescription::validateNode ( SetDescriptionEntry const &  entry,
ParameterSet pset,
std::set< std::string > &  validatedNames 
) [static, private]

Definition at line 174 of file ParameterSetDescription.cc.

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

Referenced by validate().

                                                    {
    entry.node()->validate(pset, validatedLabels, entry.optional());
  }
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().

                                                           {
    bool wroteSomething = false;

    for_all(entries_, boost::bind(&ParameterSetDescription::writeNode,
                                  _1,
                                  boost::ref(os),
                                  boost::ref(startWithComma),
                                  indentation,
                                  boost::ref(wroteSomething)));

    if (wroteSomething) {
      char oldFill = os.fill();
      os << "\n" << std::setfill(' ') << std::setw(indentation - 2) << "";
      os.fill(oldFill);
    }
  }
void ParameterSetDescription::writeNode ( SetDescriptionEntry const &  entry,
std::ostream &  os,
bool &  startWithComma,
int  indentation,
bool &  wroteSomething 
) [static, private]

Definition at line 276 of file ParameterSetDescription.cc.

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

Referenced by writeCfi().

                                                            {
    if (entry.writeToCfi()) {
      entry.node()->writeCfi(os, startWithComma, indentation, wroteSomething);
    }
  }

Member Data Documentation

Definition at line 399 of file ParameterSetDescription.h.

Referenced by anythingAllowed(), and setAllowAnything().

Definition at line 407 of file ParameterSetDescription.h.

Referenced by comment(), and setComment().

Definition at line 401 of file ParameterSetDescription.h.

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

Definition at line 404 of file ParameterSetDescription.h.

Referenced by throwIfWildcardCollision().

Definition at line 405 of file ParameterSetDescription.h.

Referenced by throwIfWildcardCollision().

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().