91 using vstring = std::vector<std::string>;
92 boost::regex
metacharacters{
"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]"};
99 set<string> subDirSet;
101 for(
auto iSubDir =
subDirs_.begin();
102 iSubDir !=
subDirs_.end(); ++iSubDir) {
105 if ( subDir[subDir.size()-1] ==
'/' ) subDir.erase(subDir.size()-1);
109 const string searchPath = subDir.substr(0, shiftPos);
110 const string pattern = subDir.substr(shiftPos + 1, subDir.length());
117 subDirSet.insert(subDir);
121 for(
auto const & subDir : subDirSet) {
122 for (
unsigned int iEff = 0; iEff !=
efficiency_.size(); ++iEff){
128 if (!refEff)
continue;
134 string trig = *iTrigger;
136 if (!trigEff)
continue;
137 TH1* hRef = refEff -> getTH1();
138 TH1* hTrig = trigEff -> getTH1();
139 TH1* hEff = (TH1*) hTrig->Clone( (
"eff_" + eff +
"_ref").c_str() );
140 hEff->SetTitle(
"Efficiency obtained with reference method");
141 TClass* myHistClass = hTrig->IsA();
142 TString histClassName = myHistClass->GetName();
144 if (histClassName ==
"TH1F"){
145 for (
int bin = 0;
bin < hEff->GetNbinsX(); ++
bin){
146 hEff->SetBinContent(
bin+1, hEff->GetBinContent(
bin+1)*hRef->GetBinContent(
bin+1));
147 hEff->SetBinError (
bin+1, hEff->GetBinContent(
bin+1)*hRef->GetBinError(
bin+1)+hEff->GetBinError(
bin+1)*hRef->GetBinContent(
bin+1));
149 ibooker.
cd(subDir +
"/" + trig);
150 ibooker.
book1D( hEff->GetName(), (TH1F*) hEff);
153 else if (histClassName ==
"TH2F"){
154 for (
int i = 0;
i < hRef->GetXaxis()->GetNbins(); ++
i){
155 for (
int j = 0; j < hRef->GetYaxis()->GetNbins(); ++j){
156 int bin = hEff->GetBin(
i+1,j+1);
157 hEff -> SetBinContent( bin, hRef->GetBinContent(
i+1,j+1) * hTrig->GetBinContent(
i+1) );
160 ibooker.
cd(subDir +
"/" + trig);
161 ibooker.
book2D( hEff->GetName(), (TH2F*) hEff);
164 LogInfo (
"HLTMuonRefMethod") <<
"Histo class type << " << histClassName <<
" not implemented";
std::vector< std::string > efficiency_
MonitorElement * get(const std::string &path)
TPRegexp metacharacters("[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]")
std::vector< std::string > subDirs_
MonitorElement * book1D(Args &&...args)
bin
set the eta bin as selection string.
MonitorElement * book2D(Args &&...args)
std::vector< std::string > refEff_
std::vector< std::string > hltTriggers_
void findAllSubdirectories(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &dir, std::set< std::string > *myList, const TString &pattern)