-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_confdb_query_log.cc
More file actions
42 lines (31 loc) · 1.19 KB
/
parse_confdb_query_log.cc
File metadata and controls
42 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//this macro finds trigger menus that have a given trigger in them
//you can use a trigger name with or without a version number
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
//std::string trigger_name = "HLT_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL";
std::string trigger_name = "HLT_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL";
std::vector<std::string> trigger_menus;
int main()
{
std::vector<std::string> lines;
std::string line;
std::fstream f("log_query_confdb_2011.dat");
while(!f.eof()){
f >> line;
lines.push_back(line);
if(line.find(trigger_name) != std::string::npos){
int line_number = lines.size() - 2;
while(lines[line_number].find("cdaq") == std::string::npos) line_number--;
//std::cout << "lines[line_number] = " << lines[line_number] << std::endl
//return 1;
if(trigger_menus.size()== 0)
trigger_menus.push_back(lines[line_number]);
else if(lines[line_number] != trigger_menus[trigger_menus.size()-1])
trigger_menus.push_back(lines[line_number]);
}
}
for(int i = 0; i < trigger_menus.size(); i++)
std::cout << "trigger_menus[" << i << "] = " << trigger_menus[i] << std::endl;
}