CMS 3D CMS Logo

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

edm::GroupSelectorRules Class Reference

#include <GroupSelectorRules.h>

List of all members.

Classes

struct  BranchSelectState
class  Rule

Public Member Functions

void applyToAll (std::vector< BranchSelectState > &branchstates) const
 GroupSelectorRules (ParameterSet const &pset, std::string const &parameterName, std::string const &parameterOwnerName)
bool keepAll () const

Static Public Member Functions

static void fillDescription (ParameterSetDescription &desc, char const *parameterName)

Private Attributes

bool keepAll_
std::string parameterName_
std::string parameterOwnerName_
std::vector< Rulerules_

Detailed Description

Definition at line 24 of file GroupSelectorRules.h.


Constructor & Destructor Documentation

edm::GroupSelectorRules::GroupSelectorRules ( ParameterSet const &  pset,
std::string const &  parameterName,
std::string const &  parameterOwnerName 
)

Definition at line 232 of file GroupSelectorRules.cc.

References end, edm::ParameterSet::getUntrackedParameter(), keepAll_, and rules_.

                                                                    :
  rules_(),
  parameterName_(parameterName),
  parameterOwnerName_(parameterOwnerName)
  {
    // Fill the rules.
    // If there is no parameter whose name is parameterName_ in the
    // ParameterSet we are given, we use the following default.
    std::vector<std::string> defaultCommands(1U, std::string("keep *"));

    std::vector<std::string> commands = 
      pset.getUntrackedParameter<std::vector<std::string> >(parameterName,
                                                    defaultCommands);
    if (commands.empty()) {
      commands.push_back(defaultCommands[0]);
    }
    rules_.reserve(commands.size());
    for(std::vector<std::string>::const_iterator it = commands.begin(), end = commands.end();
        it != end; ++it) {
      rules_.push_back(Rule(*it, parameterName, parameterOwnerName));
    }
    keepAll_ = commands.size() == 1 && commands[0] == defaultCommands[0];
  }

Member Function Documentation

void edm::GroupSelectorRules::applyToAll ( std::vector< BranchSelectState > &  branchstates) const

Definition at line 190 of file GroupSelectorRules.cc.

References end, and rules_.

                                                                                 {
    std::vector<Rule>::const_iterator it = rules_.begin();
    std::vector<Rule>::const_iterator end = rules_.end();
    for (; it != end; ++it) it->applyToAll(branchstates);
  }
void edm::GroupSelectorRules::fillDescription ( ParameterSetDescription desc,
char const *  parameterName 
) [static]

Definition at line 226 of file GroupSelectorRules.cc.

References edm::ParameterSetDescription::addUntracked().

                                                                                              {
    std::vector<std::string> defaultStrings(1U, std::string("keep *"));
    desc.addUntracked<std::vector<std::string> >(parameterName, defaultStrings)
        ->setComment("Specifies which branches are kept or dropped.");
  }
bool edm::GroupSelectorRules::keepAll ( ) const [inline]

Definition at line 44 of file GroupSelectorRules.h.

References keepAll_.

{return keepAll_;}

Member Data Documentation

Definition at line 84 of file GroupSelectorRules.h.

Referenced by GroupSelectorRules(), and keepAll().

Definition at line 82 of file GroupSelectorRules.h.

Definition at line 83 of file GroupSelectorRules.h.

std::vector<Rule> edm::GroupSelectorRules::rules_ [private]

Definition at line 81 of file GroupSelectorRules.h.

Referenced by applyToAll(), and GroupSelectorRules().