CMS 3D CMS Logo

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 const std::vector< std::string > & defaultSelectionStrings ()
 
static void fillDescription (ParameterSetDescription &desc, char const *parameterName, std::vector< std::string > const &defaultStrings=defaultSelectionStrings())
 

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 210 of file ProductSelectorRules.cc.

References TrackerTrackHitFilter_cff::commands, end, edm::ParameterSet::getUntrackedParameter(), keepAll_, rules_, AlCaHLTBitMon_QueryRunRegistry::string, and mitigatedMETSequence_cff::U.

213  : rules_(), parameterName_(parameterName), parameterOwnerName_(parameterOwnerName) {
214  // Fill the rules.
215  // If there is no parameter whose name is parameterName_ in the
216  // ParameterSet we are given, we use the following default.
217  std::vector<std::string> defaultCommands(1U, std::string("keep *"));
218 
219  std::vector<std::string> commands =
220  pset.getUntrackedParameter<std::vector<std::string> >(parameterName, defaultCommands);
221  if (commands.empty()) {
222  commands.push_back(defaultCommands[0]);
223  }
224  rules_.reserve(commands.size());
225  for (std::vector<std::string>::const_iterator it = commands.begin(), end = commands.end(); it != end; ++it) {
226  rules_.push_back(Rule(*it, parameterName, parameterOwnerName));
227  }
228  keepAll_ = commands.size() == 1 && commands[0] == defaultCommands[0];
229  }
commands
min number of hits for refit layers to remove
#define end
Definition: vmac.h:39

Member Function Documentation

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

Definition at line 166 of file ProductSelectorRules.cc.

References end, and rules_.

Referenced by edm::ProductSelectorRules::BranchSelectState::BranchSelectState(), and edm::ProductSelector::initialize().

166  {
167  std::vector<Rule>::const_iterator it = rules_.begin();
168  std::vector<Rule>::const_iterator end = rules_.end();
169  for (; it != end; ++it)
170  it->applyToAll(branchstates);
171  }
#define end
Definition: vmac.h:39
const std::vector< std::string > & edm::ProductSelectorRules::defaultSelectionStrings ( )
static

Definition at line 197 of file ProductSelectorRules.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and mitigatedMETSequence_cff::U.

Referenced by edm::OutputModule::hasNewlyDroppedBranch(), and keepAll().

197  {
198  static const std::vector<std::string> s_defaultStrings(1U, std::string("keep *"));
199  return s_defaultStrings;
200  }
void edm::ProductSelectorRules::fillDescription ( ParameterSetDescription desc,
char const *  parameterName,
std::vector< std::string > const &  defaultStrings = defaultSelectionStrings() 
)
static

Definition at line 202 of file ProductSelectorRules.cc.

References edm::ParameterSetDescription::addUntracked().

Referenced by edm::OutputModule::fillDescription(), edm::global::OutputModuleBase::fillDescription(), edm::limited::OutputModuleBase::fillDescription(), edm::one::OutputModuleBase::fillDescription(), edm::PoolSource::fillDescriptions(), edm::EmbeddedRootSource::fillDescriptions(), and keepAll().

204  {
205  ;
206  desc.addUntracked<std::vector<std::string> >(parameterName, defaultStrings)
207  ->setComment("Specifies which branches are kept or dropped.");
208  }
bool edm::ProductSelectorRules::keepAll ( ) const
inline

Member Data Documentation

bool edm::ProductSelectorRules::keepAll_
private

Definition at line 88 of file ProductSelectorRules.h.

Referenced by keepAll(), and ProductSelectorRules().

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

Definition at line 86 of file ProductSelectorRules.h.

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

Definition at line 87 of file ProductSelectorRules.h.

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

Definition at line 85 of file ProductSelectorRules.h.

Referenced by applyToAll(), and ProductSelectorRules().