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::ProductSelectorRules Class Reference

#include <ProductSelectorRules.h>

Classes

struct  BranchSelectState
 
class  Rule
 

Public Member Functions

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

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 ProductSelectorRules.h.

Constructor & Destructor Documentation

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

Definition at line 232 of file ProductSelectorRules.cc.

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

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:37

Member Function Documentation

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

Definition at line 190 of file ProductSelectorRules.cc.

References end, and rules_.

Referenced by edm::ProductSelector::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:37
void edm::ProductSelectorRules::fillDescription ( ParameterSetDescription desc,
char const *  parameterName 
)
static

Definition at line 226 of file ProductSelectorRules.cc.

References edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::RootPrimaryFileSequence::fillDescription(), edm::RootEmbeddedFileSequence::fillDescription(), edm::OutputModule::fillDescription(), edm::global::OutputModuleBase::fillDescription(), and edm::one::OutputModuleBase::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::ProductSelectorRules::keepAll ( ) const
inline

Definition at line 44 of file ProductSelectorRules.h.

References keepAll_.

Member Data Documentation

bool edm::ProductSelectorRules::keepAll_
private

Definition at line 84 of file ProductSelectorRules.h.

Referenced by keepAll(), and ProductSelectorRules().

std::string edm::ProductSelectorRules::parameterName_
private

Definition at line 82 of file ProductSelectorRules.h.

std::string edm::ProductSelectorRules::parameterOwnerName_
private

Definition at line 83 of file ProductSelectorRules.h.

std::vector<Rule> edm::ProductSelectorRules::rules_
private

Definition at line 81 of file ProductSelectorRules.h.

Referenced by applyToAll(), and ProductSelectorRules().