65 |
|
// cout<<"-----------------------------"<<endl; |
66 |
|
// cout<<f->GetName()<<endl; |
67 |
|
string filename = f->GetName(); |
68 |
< |
// cout<<filename<<endl; |
68 |
> |
cout<<filename<<endl; |
69 |
|
return filename; |
70 |
|
} |
71 |
|
|
82 |
|
|
83 |
|
cout<<f->GetName()<<endl; |
84 |
|
TH1I *hlt_stats = (TH1I*)f->Get("analyze/HLTTriggerStats"); |
85 |
– |
cout<<"here 3"<<endl; |
85 |
|
|
86 |
|
// clear the map |
87 |
|
if(!HLTmap.empty()) { |
94 |
|
} |
95 |
|
} |
96 |
|
|
97 |
+ |
void baseClass::GetHLTNames(Int_t& run){ |
98 |
+ |
|
99 |
+ |
TFile *f = tree_->GetCurrentFile(); |
100 |
+ |
TTree* runTree = (TTree*)f->Get("analyze/RunInfo"); |
101 |
+ |
cout<<"here"<<endl; |
102 |
+ |
std::vector<std::string>* HLTNames; |
103 |
+ |
if ( !runTree ) { |
104 |
+ |
std::cerr << "!!! UserAnalysisBase::GetHLTNames " |
105 |
+ |
<< "Couldn't get analyze/RunInfo tree" << std::endl; |
106 |
+ |
return; |
107 |
+ |
} |
108 |
+ |
//TH1I *hlt_stats = (TH1I*)f->Get("analyze/HLTTriggerStats"); |
109 |
+ |
|
110 |
+ |
/*if ( fVerbose>0 ) */std::cout << "Retrieving HLTNames for run " << run << std::endl; |
111 |
+ |
runTree->SetBranchAddress("HLTNames",&HLTNames); |
112 |
+ |
runTree->GetEntryWithIndex(run); |
113 |
+ |
|
114 |
+ |
cout<<HLTNames->size()<<endl; |
115 |
+ |
|
116 |
+ |
for( int i=0; i < HLTNames->size(); i++ ) { |
117 |
+ |
HLTmap[(*HLTNames)[i]] = i; |
118 |
+ |
cout<<i<<": "<<(*HLTNames)[i]<<endl; |
119 |
+ |
} |
120 |
+ |
} |
121 |
+ |
|
122 |
+ |
|
123 |
|
int baseClass::getHLTtriggerBit(string triggerName) { |
124 |
|
if(HLTmap.empty()) { |
125 |
< |
cerr<<"HLTtrigger: no HLTmap available!"<<endl; |
125 |
> |
bool verbose = true; |
126 |
> |
if(verbose) cerr<<"HLTtrigger: no HLTmap available!"<<endl; |
127 |
|
return -1; |
128 |
|
} |
129 |
+ |
|
130 |
|
map<string, int>::iterator iter = HLTmap.find(triggerName); |
131 |
|
//cout<<"HLT bit: "<<iter->second<<endl; // iter->second is the HLT trigger bit |
132 |
|
if(iter==HLTmap.end()) { |
133 |
< |
cerr<<"HLTtrigger: trigger name "<<triggerName<< " not found!"<<endl; |
133 |
> |
//cerr<<"HLTtrigger: trigger name "<<triggerName<< " not found!"<<endl; |
134 |
|
return -1; |
135 |
|
} |
136 |
|
else { |