28 if (colon == std::string::npos) {
29 output.first = trimmed_path_spec;
31 output.first = trimmed_path_spec.substr(0, colon);
32 output.second = trimmed_path_spec.substr(colon + 1, trimmed_path_spec.size());
45 std::vector<std::string>
const& iAllTriggerNames,
57 std::vector<std::string> path_specs = iPSet.
getParameter<std::vector<std::string> >(
"SelectEvents");
59 if (path_specs.empty()) {
66 std::vector<parsed_path_spec_t> parsed_paths(path_specs.size());
67 for (
size_t i = 0;
i < path_specs.size(); ++
i) {
70 oSelector.
setup(parsed_paths, iAllTriggerNames, iProcessName,
std::move(iC));
77 TriggerResultsBasedEventSelector::TriggerResultsBasedEventSelector() : selectors_(), wantAllEvents_(
false) {}
82 std::vector<std::string>
const& triggernames,
87 std::map<std::string, std::vector<std::string> > paths_for_process;
88 for (
auto const& path_spec : path_specs) {
90 if (path_spec.second.empty()) {
91 paths_for_process[process_name].push_back(path_spec.first);
93 paths_for_process[path_spec.second].push_back(path_spec.first);
98 for (
auto const&
path : paths_for_process) {
101 if (
path.first == process_name) {
130 bool anyProductProduced) {
133 selectEventsInfo.
addParameter<
bool>(
"InProcessHistory", anyProductProduced);
134 std::vector<std::string> endPaths;
135 std::vector<int> endPathPositions;
139 if (!iLabel.empty()) {
140 std::map<std::string, std::vector<std::pair<std::string, int> > >::const_iterator iter =
141 outputModulePathPositions.find(iLabel);
142 assert(iter != outputModulePathPositions.end());
143 for (
auto const&
item : iter->second) {
144 endPaths.push_back(
item.first);
145 endPathPositions.push_back(
item.second);
148 selectEventsInfo.
addParameter<std::vector<std::string> >(
"EndPaths", endPaths);
149 selectEventsInfo.
addParameter<std::vector<int> >(
"EndPathPositions", endPathPositions);
150 if (!selectEventsInfo.
exists(
"SelectEvents")) {
151 selectEventsInfo.
addParameter<std::vector<std::string> >(
"SelectEvents", std::vector<std::string>());
155 return selectEventsInfo.
id();
bool wantEvent(EventForOutput const &e)
T getParameter(std::string const &) const
static const edm::TypeID s_TrigResultsType(typeid(edm::TriggerResults))
bool exists(std::string const ¶meterName) const
checks if a parameter exists
ParameterSetID id() const
ParameterSet const & registerIt()
void addParameter(std::string const &name, T const &value)
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
void copyForModify(ParameterSet const &other)
std::pair< std::string, std::string > parsed_path_spec_t
def remove(d, key, TELL=False)
void parse_path_spec(std::string const &path_spec, parsed_path_spec_t &output)
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, std::string const &process_name, ConsumesCollector &&iC)
void remove_whitespace(std::string &s)
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)