CMS 3D CMS Logo

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

#include <GroupSelectorRules.h>

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_.

234  :
235  rules_(),
236  parameterName_(parameterName),
237  parameterOwnerName_(parameterOwnerName)
238  {
239  // Fill the rules.
240  // If there is no parameter whose name is parameterName_ in the
241  // ParameterSet we are given, we use the following default.
242  std::vector<std::string> defaultCommands(1U, std::string("keep *"));
243 
244  std::vector<std::string> commands =
245  pset.getUntrackedParameter<std::vector<std::string> >(parameterName,
246  defaultCommands);
247  if (commands.empty()) {
248  commands.push_back(defaultCommands[0]);
249  }
250  rules_.reserve(commands.size());
251  for(std::vector<std::string>::const_iterator it = commands.begin(), end = commands.end();
252  it != end; ++it) {
253  rules_.push_back(Rule(*it, parameterName, parameterOwnerName));
254  }
255  keepAll_ = commands.size() == 1 && commands[0] == defaultCommands[0];
256  }
#define end
Definition: vmac.h:38
std::vector< Rule > rules_

Member Function Documentation

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

Definition at line 190 of file GroupSelectorRules.cc.

References end, and rules_.

Referenced by edm::GroupSelector::initialize().

190  {
191  std::vector<Rule>::const_iterator it = rules_.begin();
192  std::vector<Rule>::const_iterator end = rules_.end();
193  for (; it != end; ++it) it->applyToAll(branchstates);
194  }
#define end
Definition: vmac.h:38
std::vector< Rule > rules_
void edm::GroupSelectorRules::fillDescription ( ParameterSetDescription desc,
char const *  parameterName 
)
static

Definition at line 226 of file GroupSelectorRules.cc.

References edm::ParameterSetDescription::addUntracked().

Referenced by edm::OutputModule::fillDescription(), and edm::RootInputFileSequence::fillDescription().

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

Definition at line 44 of file GroupSelectorRules.h.

References keepAll_.

Member Data Documentation

bool edm::GroupSelectorRules::keepAll_
private

Definition at line 84 of file GroupSelectorRules.h.

Referenced by GroupSelectorRules(), and keepAll().

std::string edm::GroupSelectorRules::parameterName_
private

Definition at line 82 of file GroupSelectorRules.h.

std::string edm::GroupSelectorRules::parameterOwnerName_
private

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