3 #include <boost/regex.hpp>
19 boost::regex reTau(
".*Tau.*");
20 std::map<std::string,HLTTauDQMFilter>
filters;
22 const std::vector<std::string>& triggerNames = HLTCP.
triggerNames();
23 for ( std::vector<std::string>::const_iterator ipath = triggerNames.begin(); ipath != triggerNames.end(); ++ipath ) {
24 if ( boost::regex_match(*ipath, reTau) && HLTCP.
prescaleValue(0,*ipath) > 0 ) {
32 boost::regex reMuTau(
"Mu(.+?)Tau");
34 std::map<std::string,HLTTauDQMFilter> pfTauFilters;
35 for ( std::map<std::string,HLTTauDQMFilter>::const_iterator ipath = filters.begin(); ipath != filters.end(); ++ipath ) {
36 std::string::const_iterator
start = ipath->first.begin();
37 std::string::const_iterator
end = ipath->first.end();
38 if ( boost::regex_match(start, end, what, reMuTau) ) {
43 filters.insert(pfTauFilters.begin(),pfTauFilters.end());
46 std::vector<edm::ParameterSet>::iterator lpsum = config.end();
47 std::vector<std::map<std::string,HLTTauDQMFilter>::iterator> selectedFilters;
48 for ( std::vector<edm::ParameterSet>::iterator iconfig = config.begin(); iconfig != config.end(); ++iconfig ) {
51 configtype = iconfig->getUntrackedParameter<
std::string>(
"ConfigType");
56 if (configtype ==
"Path") {
58 if ( iconfig->getUntrackedParameter<std::vector<edm::ParameterSet> >(
"Filters",std::vector<edm::ParameterSet>()).size() == 0 ) {
60 std::map<std::string,HLTTauDQMFilter>::iterator iter =
findFilter(filters,triggerName);
61 if ( iter != filters.end() ) {
62 iconfig->addUntrackedParameter<
std::string>(
"DQMFolder", iter->first);
63 iconfig->addUntrackedParameter<std::vector<edm::ParameterSet> >(
"Filters", iter->second.getPSets(HLTCP) );
64 iconfig->addUntrackedParameter<
edm::ParameterSet >(
"Reference", iter->second.getRefPSet());
65 selectedFilters.push_back(iter);
73 else if (configtype ==
"LitePath") {
75 if ( iconfig->getUntrackedParameter<std::vector<edm::ParameterSet> >(
"Filters",std::vector<edm::ParameterSet>()).size() == 0 ) {
77 if ( triggerName !=
"Summary" ) {
78 std::map<std::string,HLTTauDQMFilter>::iterator iter =
findFilter(filters,triggerName);
79 if ( iter != filters.end() ) {
80 iconfig->addUntrackedParameter<
std::string>(
"DQMFolder", iter->first);
81 iconfig->addUntrackedParameter<std::vector<edm::ParameterSet> >(
"Filters", iter->second.getPSets(HLTCP) );
82 selectedFilters.push_back(iter);
96 if ( lpsum != config.end() ) {
97 std::vector<edm::ParameterSet> filterSet;
98 for ( std::vector<std::map<std::string,HLTTauDQMFilter>::iterator>::iterator ifilter = selectedFilters.begin(); ifilter != selectedFilters.end(); ++ifilter ) {
99 if ( !((*ifilter)->second.getSummaryPSet(HLTCP).empty()) ) {
100 filterSet.push_back((*ifilter)->second.getSummaryPSet(HLTCP));
103 lpsum->addUntrackedParameter<std::vector<edm::ParameterSet> >(
"Filters", filterSet );
109 boost::regex reTau(
".*Tau.*");
110 std::map<std::string,HLTTauDQMFilter>
filters;
112 const std::vector<std::string>& triggerNames = HLTCP.
triggerNames();
113 for ( std::vector<std::string>::const_iterator ipath = triggerNames.begin(); ipath != triggerNames.end(); ++ipath ) {
114 if ( boost::regex_match(*ipath, reTau) && HLTCP.
prescaleValue(0,*ipath) > 0 ) {
123 std::vector<edm::ParameterSet> matchingFilters = config.
getUntrackedParameter<std::vector<edm::ParameterSet> >(
"matchFilters");
124 for ( std::vector<edm::ParameterSet>::iterator imatch = matchingFilters.begin(); imatch != matchingFilters.end(); ++imatch ) {
126 if ( autoFilterName !=
"" ) {
128 std::map<std::string,HLTTauDQMFilter>::iterator iter =
findFilter(filters,autoFilterName);
129 if ( iter != filters.end() ) {
130 std::map<int,std::string> modules = iter->second.interestingModules(HLTCP);
131 boost::regex exprEle(moduleType);
133 for ( std::map<int,std::string>::const_iterator imodule = modules.begin(); imodule != modules.end(); ++imodule ) {
135 std::string::const_iterator
start = mType.begin();
136 std::string::const_iterator
end = mType.end();
137 if ( boost::regex_match(start, end, exprEle) ) {
138 selectedModule = imodule->second;
158 bool inserted =
false;
159 std::map<std::string,HLTTauDQMFilter>::iterator iter = container.find(filter.
type());
160 if ( iter == container.end() ) {
161 container.insert(std::make_pair(filter.
type(),
filter));
164 iter->second = iter->second.select(filter,inserted);
170 boost::regex re(
"[a-zA-Z_]+");
171 std::map<std::string,HLTTauDQMFilter>::iterator iter;
172 if ( boost::regex_match(triggerName, re) ) {
173 iter = container.find(triggerName);
176 boost::regex tmpRe(triggerName);
177 for ( iter = container.begin(); iter != container.end(); ++iter ) {
178 if ( boost::regex_match(iter->first, tmpRe) ) {
183 return container.end();
virtual char const * what() const
virtual ~HLTTauDQMAutomation()
T getUntrackedParameter(std::string const &, T const &) const
tuple start
Check for commandline option errors.
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::map< std::string, HLTTauDQMFilter >::iterator findFilter(std::map< std::string, HLTTauDQMFilter > &container, std::string const &triggerName)
void AutoCompleteConfig(std::vector< edm::ParameterSet > &config, HLTConfigProvider const &HLTCP)
const std::vector< std::string > & triggerNames() const
names of trigger paths
void AutoCompleteMatching(edm::ParameterSet &config, HLTConfigProvider const &HLTCP, std::string moduleType)
std::vector< TPRegexp > filters
std::string hltProcessName_
bool inited() const
Accessors (const methods)
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
void addUntrackedParameter(std::string const &name, T const &value)
std::vector< std::vector< double > > tmp
bool selectHLTTauDQMFilter(std::map< std::string, HLTTauDQMFilter > &container, HLTTauDQMFilter const &filter)