CMS 3D CMS Logo

HLTHighLevel.cc File Reference

#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#include <boost/algorithm/string.hpp>
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/TriggerResults.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h"

Go to the source code of this file.

Functions

std::string glob2reg (const std::string &pattern)
bool is_glob (const std::string &pattern)
std::vector< std::vector
< std::string >
::const_iterator > 
matching_triggers (const std::vector< std::string > &triggers, const std::string &pattern)


Function Documentation

std::string glob2reg ( const std::string &  pattern  ) 

Definition at line 204 of file HLTHighLevel.cc.

Referenced by edm::EventSelector::init(), HLTHighLevel::init(), matching_triggers(), and edm::EventSelector::matching_triggers().

00205 {
00206   std::string regexp = pattern;
00207   boost::replace_all(regexp, "*", ".*");
00208   boost::replace_all(regexp, "?", ".");
00209   return regexp;
00210 }

bool is_glob ( const std::string &  pattern  ) 

Definition at line 199 of file HLTHighLevel.cc.

Referenced by HLTHighLevel::init().

00200 {
00201   return (pattern.find_first_of("*?") != pattern.npos);
00202 }

std::vector< std::vector< std::string >::const_iterator > matching_triggers ( const std::vector< std::string > &  triggers,
const std::string &  pattern 
)

Definition at line 213 of file HLTHighLevel.cc.

References glob2reg(), and i.

Referenced by HLTHighLevel::init(), and edm::EventSelector::init().

00214 {
00215   std::vector< std::vector<std::string>::const_iterator > matches;
00216   boost::regex regexp( glob2reg(pattern) );
00217   for (std::vector<std::string>::const_iterator i = triggers.begin(); i != triggers.end(); ++i)
00218     if (boost::regex_match((*i), regexp)) 
00219       matches.push_back(i);
00220 
00221   return matches;
00222 }


Generated on Tue Jun 9 17:53:50 2009 for CMSSW by  doxygen 1.5.4