22 #include <TDirectory.h> 23 #include <TEfficiency.h> 30 #include <boost/tokenizer.hpp> 87 const bool makeProfile =
false);
110 bool ascending =
true);
144 std::set<std::string>*
myList,
156 const bool oldAddDir = TH1::AddDirectoryStatus();
157 TH1::AddDirectory(
true);
159 TH2F*
h =
me->getTH2F();
160 TF1 fgaus(
"fgaus",
"gaus",
h->GetYaxis()->GetXmin(),
h->GetYaxis()->GetXmax(), TF1::EAddToList::kNo);
161 h->FitSlicesY(&fgaus, 0, -1, 0,
"QNR SERIAL");
162 string name(
h->GetName());
163 h0 = (TH1*)gDirectory->Get((
name +
"_0").c_str());
164 h1 = (TH1*)gDirectory->Get((
name +
"_1").c_str());
165 h2 = (TH1*)gDirectory->Get((
name +
"_2").c_str());
166 h3 = (TH1*)gDirectory->Get((
name +
"_chi2").c_str());
167 TH1::AddDirectory(oldAddDir);
180 throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" <<
me;
181 if (h1->GetNbinsX() ==
me->getNbinsX()) {
182 for (
int bin = 0;
bin != h1->GetNbinsX();
bin++) {
183 me->setBinContent(
bin + 1, h1->GetBinContent(
bin + 1));
187 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
193 throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" <<
me;
194 if (h2->GetNbinsX() ==
me->getNbinsX()) {
195 for (
int bin = 0;
bin != h2->GetNbinsX();
bin++) {
196 me->setBinContent(
bin + 1, h2->GetBinContent(
bin + 1));
200 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
206 throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" <<
me;
207 if (h1->GetNbinsX() ==
me->getNbinsX()) {
208 for (
int bin = 0;
bin != h1->GetNbinsX();
bin++) {
209 me->setBinContent(
bin + 1, h1->GetBinContent(
bin + 1));
211 me->setBinError(
bin + 1, h1->GetBinError(
bin + 1));
214 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
220 throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" <<
me;
221 if (h2->GetNbinsX() ==
me->getNbinsX()) {
222 for (
int bin = 0;
bin != h2->GetNbinsX();
bin++) {
223 me->setBinContent(
bin + 1, h2->GetBinContent(
bin + 1));
225 me->setBinError(
bin + 1, h2->GetBinError(
bin + 1));
228 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
242 : metacharacters_(
"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]"), nonPerlWildcard_(
"\\w\\*|^\\*") {
243 typedef std::vector<edm::ParameterSet>
VPSet;
244 typedef std::vector<std::string>
vstring;
245 typedef boost::escaped_list_separator<char> elsc;
247 elsc commonEscapes(
"\\",
" \t",
"\'");
249 verbose_ =
pset.getUntrackedParameter<
unsigned int>(
"verbose", 0);
256 for (vstring::const_iterator effCmd = effCmds.begin(); effCmd != effCmds.end(); ++effCmd) {
260 boost::tokenizer<elsc> tokens(*effCmd, commonEscapes);
263 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
266 args.push_back(*iToken);
269 if (
args.size() < 4) {
270 LogInfo(
"DQMGenericClient") <<
"Wrong input to effCmds\n";
279 opt.isProfile =
false;
297 opt.name =
efficSet->getUntrackedParameter<
string>(
"name");
298 opt.title =
efficSet->getUntrackedParameter<
string>(
"title");
299 opt.numerator =
efficSet->getUntrackedParameter<
string>(
"numerator");
300 opt.denominator =
efficSet->getUntrackedParameter<
string>(
"denominator");
301 opt.isProfile =
false;
303 const string typeName =
efficSet->getUntrackedParameter<
string>(
"typeName",
"eff");
318 for (vstring::const_iterator effProfileCmd = effProfileCmds.begin(); effProfileCmd != effProfileCmds.end();
320 if (effProfileCmd->empty())
323 boost::tokenizer<elsc> tokens(*effProfileCmd, commonEscapes);
326 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
329 args.push_back(*iToken);
332 if (
args.size() < 4) {
333 LogInfo(
"DQMGenericClient") <<
"Wrong input to effProfileCmds\n";
342 opt.isProfile =
true;
357 VPSet effProfileSets =
pset.getUntrackedParameter<
VPSet>(
"efficiencyProfileSets",
VPSet());
358 for (VPSet::const_iterator effProfileSet = effProfileSets.begin(); effProfileSet != effProfileSets.end();
361 opt.name = effProfileSet->getUntrackedParameter<
string>(
"name");
362 opt.title = effProfileSet->getUntrackedParameter<
string>(
"title");
363 opt.numerator = effProfileSet->getUntrackedParameter<
string>(
"numerator");
364 opt.denominator = effProfileSet->getUntrackedParameter<
string>(
"denominator");
365 opt.isProfile =
true;
367 const string typeName = effProfileSet->getUntrackedParameter<
string>(
"typeName",
"eff");
382 for (vstring::const_iterator resCmd = resCmds.begin(); resCmd != resCmds.end(); ++resCmd) {
385 boost::tokenizer<elsc> tokens(*resCmd, commonEscapes);
388 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
391 args.push_back(*iToken);
394 if (
args.size() != 3) {
395 LogInfo(
"DQMGenericClient") <<
"Wrong input to resCmds\n";
408 for (VPSet::const_iterator resolSet = resolSets.begin(); resolSet != resolSets.end(); ++resolSet) {
410 opt.namePrefix = resolSet->getUntrackedParameter<
string>(
"namePrefix");
411 opt.titlePrefix = resolSet->getUntrackedParameter<
string>(
"titlePrefix");
412 opt.srcName = resolSet->getUntrackedParameter<
string>(
"srcName");
419 for (
const auto& profileCmd : profileCmds) {
420 boost::tokenizer<elsc> tokens(profileCmd, commonEscapes);
423 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
426 args.push_back(*iToken);
429 if (
args.size() != 3) {
430 LogInfo(
"DQMGenericClient") <<
"Wrong input to profileCmds\n";
443 for (
const auto& profileSet : profileSets) {
445 opt.name = profileSet.getUntrackedParameter<
string>(
"name");
446 opt.title = profileSet.getUntrackedParameter<
string>(
"title");
447 opt.srcName = profileSet.getUntrackedParameter<
string>(
"srcName");
454 for (vstring::const_iterator normCmd = normCmds.begin(); normCmd != normCmds.end(); ++normCmd) {
455 if (normCmd->empty())
457 boost::tokenizer<elsc> tokens(*normCmd, commonEscapes);
460 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
463 args.push_back(*iToken);
467 LogInfo(
"DQMGenericClient") <<
"Wrong input to normCmds\n";
479 for (VPSet::const_iterator normSet = normSets.begin(); normSet != normSets.end(); ++normSet) {
481 opt.name = normSet->getUntrackedParameter<
string>(
"name");
482 opt.normHistName = normSet->getUntrackedParameter<
string>(
"normalizedTo",
opt.name);
489 for (vstring::const_iterator cdCmd = cdCmds.begin(); cdCmd != cdCmds.end(); ++cdCmd) {
492 boost::tokenizer<elsc> tokens(*cdCmd, commonEscapes);
495 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
498 args.push_back(*iToken);
501 if (
args.empty() ||
args.size() > 2) {
502 LogInfo(
"DQMGenericClient") <<
"Wrong input to cdCmds\n";
508 opt.ascending =
args.size() == 2 ? (
args[1] !=
"descending") :
true;
514 for (VPSet::const_iterator cdSet = cdSets.begin(); cdSet != cdSets.end(); ++cdSet) {
516 opt.name = cdSet->getUntrackedParameter<
string>(
"name");
517 opt.ascending = cdSet->getUntrackedParameter<
bool>(
"ascending",
true);
524 for (vstring::const_iterator noFlowCmd = noFlowCmds.begin(); noFlowCmd != noFlowCmds.end(); ++noFlowCmd) {
525 if (noFlowCmd->empty())
527 boost::tokenizer<elsc> tokens(*noFlowCmd, commonEscapes);
530 for (boost::tokenizer<elsc>::const_iterator iToken = tokens.begin(); iToken != tokens.end(); ++iToken) {
533 args.push_back(*iToken);
536 if (
args.empty() ||
args.size() > 2) {
537 LogInfo(
"DQMGenericClient") <<
"Wrong input to noFlowCmds\n";
548 for (VPSet::const_iterator noFlowSet = noFlowSets.begin(); noFlowSet != noFlowSets.end(); ++noFlowSet) {
550 opt.name = noFlowSet->getUntrackedParameter<
string>(
"name");
600 typedef vector<string>
vstring;
603 set<string> subDirSet;
605 for (vstring::const_iterator iSubDir =
subDirs_.begin(); iSubDir !=
subDirs_.end(); ++iSubDir) {
615 const string searchPath =
subDir.substr(0, shiftPos);
626 for (set<string>::const_iterator iSubDir = subDirSet.begin(); iSubDir != subDirSet.end(); ++iSubDir) {
627 const string&
dirName = *iSubDir;
637 for (vector<NoFlowOption>::const_iterator noFlowOption =
noFlowOptions_.begin();
643 for (vector<CDOption>::const_iterator cdOption =
cdOptions_.begin(); cdOption !=
cdOptions_.end(); ++cdOption) {
654 efficOption->numerator,
655 efficOption->denominator,
657 efficOption->isProfile);
660 ME* globalEfficME = igetter.
get(
dirName +
"/globalEfficiencies");
662 globalEfficME->getTH1F()->LabelsDeflate(
"X");
668 ibooker, igetter,
dirName, resolOption->namePrefix, resolOption->titlePrefix, resolOption->srcName);
672 computeProfile(ibooker, igetter,
dirName, profileOption.name, profileOption.title, profileOption.srcName);
679 const string& startDir,
680 const string& efficMEName,
681 const string& efficMETitle,
682 const string& recoMEName,
683 const string& simMEName,
685 const bool makeProfile) {
688 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 689 <<
"Cannot find sub-directory " << startDir << endl;
696 ME* simME = igetter.
get(startDir +
"/" + simMEName);
697 ME* recoME = igetter.
get(startDir +
"/" + recoMEName);
701 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 702 <<
"No sim-ME '" << simMEName <<
"' found\n";
709 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 710 <<
"No reco-ME '" << recoMEName <<
"' found\n";
717 TH1* hSim = simME->getTH1();
718 TH1* hReco = recoME->getTH1();
720 if (!hSim || !hReco) {
722 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 723 <<
"Cannot create TH1 from ME\n";
728 string efficDir = startDir;
729 string newEfficMEName = efficMEName;
731 if (string::npos != (shiftPos = efficMEName.rfind(
'/'))) {
732 efficDir +=
"/" + efficMEName.substr(0, shiftPos);
733 newEfficMEName.erase(0, shiftPos + 1);
738 TProfile* efficHist = (hReco->GetXaxis()->GetXbins()->GetSize() == 0)
739 ?
new TProfile(newEfficMEName.c_str(),
740 efficMETitle.c_str(),
741 hReco->GetXaxis()->GetNbins(),
742 hReco->GetXaxis()->GetXmin(),
743 hReco->GetXaxis()->GetXmax())
744 :
new TProfile(newEfficMEName.c_str(),
745 efficMETitle.c_str(),
746 hReco->GetXaxis()->GetNbins(),
747 hReco->GetXaxis()->GetXbins()->GetArray());
749 efficHist->GetXaxis()->SetTitle(hSim->GetXaxis()->GetTitle());
750 efficHist->GetYaxis()->SetTitle(hSim->GetYaxis()->GetTitle());
752 for (
int i = 1;
i <= hReco->GetNbinsX();
i++) {
753 const double nReco = hReco->GetBinContent(
i);
754 const double nSim = hSim->GetBinContent(
i);
757 efficHist->GetXaxis()->SetBinLabel(
i, hSim->GetXaxis()->GetBinLabel(
i));
759 if (nSim == 0
or nReco < 0 or nReco > nSim)
761 const double effVal = nReco / nSim;
762 const double errLo = TEfficiency::ClopperPearson(nSim, nReco, 0.683,
false);
763 const double errUp = TEfficiency::ClopperPearson(nSim, nReco, 0.683,
true);
764 const double errVal = (effVal - errLo > errUp - effVal) ? effVal - errLo : errUp - effVal;
765 efficHist->SetBinContent(
i, effVal);
766 efficHist->SetBinEntries(
i, 1);
767 efficHist->SetBinError(
i, std::hypot(effVal, errVal));
774 TH1* efficHist = (TH1*)hSim->Clone(newEfficMEName.c_str());
775 efficHist->SetTitle(efficMETitle.c_str());
780 ME* efficME =
nullptr;
784 TClass* myHistClass = efficHist->IsA();
785 TString histClassName = myHistClass->GetName();
787 if (histClassName ==
"TH1F") {
788 efficME = ibooker.
book1D(newEfficMEName, (TH1F*)efficHist);
789 }
else if (histClassName ==
"TH2F") {
790 efficME = ibooker.
book2D(newEfficMEName, (TH2F*)efficHist);
791 }
else if (histClassName ==
"TH3F") {
792 efficME = ibooker.
book3D(newEfficMEName, (TH3F*)efficHist);
798 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 799 <<
"Cannot book effic-ME from the DQM\n";
820 efficME->setEntries(simME->getEntries());
825 ME* globalEfficME = igetter.
get(efficDir +
"/globalEfficiencies");
827 globalEfficME = ibooker.
book1D(
"globalEfficiencies",
"Global efficiencies", 1, 0, 1);
828 if (!globalEfficME) {
829 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 830 <<
"Cannot book globalEffic-ME from the DQM\n";
833 globalEfficME->setEfficiencyFlag();
834 TH1F* hGlobalEffic = globalEfficME->getTH1F();
836 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : " 837 <<
"Cannot create TH1F from ME, globalEfficME\n";
841 const float nSimAll = hSim->GetEntries();
842 const float nRecoAll = hReco->GetEntries();
845 efficAll = nSimAll ? nRecoAll / nSimAll : 0;
847 efficAll = nSimAll ? 1 - nRecoAll / nSimAll : 0;
851 const float x = nRecoAll / nSimAll;
855 errorAll = nSimAll && efficAll < 1 ?
sqrt(efficAll * (1 - efficAll) / nSimAll) : 0;
857 const int iBin = hGlobalEffic->Fill(newEfficMEName.c_str(), 0);
858 hGlobalEffic->SetBinContent(iBin, efficAll);
859 hGlobalEffic->SetBinError(iBin, errorAll);
865 const string& startDir,
871 LogInfo(
"DQMGenericClient") <<
"computeResolution() : " 872 <<
"Cannot find sub-directory " << startDir << endl;
882 LogInfo(
"DQMGenericClient") <<
"computeResolution() : " 883 <<
"No source ME '" <<
srcName <<
"' found\n";
888 TH2F* hSrc = srcME->getTH2F();
891 LogInfo(
"DQMGenericClient") <<
"computeResolution() : " 892 <<
"Cannot create TH2F from source-ME\n";
897 const int nBin = hSrc->GetNbinsX();
899 string newDir = startDir;
902 if (string::npos != (shiftPos =
namePrefix.rfind(
'/'))) {
903 newDir +=
"/" +
namePrefix.substr(0, shiftPos);
904 newPrefix.erase(0, shiftPos + 1);
909 float* lowedgesfloats =
new float[
nBin + 1];
912 if (hSrc->GetXaxis()->GetXbins()->GetSize()) {
913 for (
int j = 0;
j <
nBin + 1; ++
j)
914 lowedgesfloats[
j] = (
float)hSrc->GetXaxis()->GetXbins()->GetAt(
j);
919 newPrefix +
"_Mean",
titlePrefix +
" Mean",
nBin, hSrc->GetXaxis()->GetXmin(), hSrc->GetXaxis()->GetXmax());
921 newPrefix +
"_Sigma",
titlePrefix +
" Sigma",
nBin, hSrc->GetXaxis()->GetXmin(), hSrc->GetXaxis()->GetXmax());
924 if (meanME && sigmaME) {
925 meanME->setEfficiencyFlag();
926 sigmaME->setEfficiencyFlag();
937 delete[] lowedgesfloats;
948 LogInfo(
"DQMGenericClient") <<
"computeProfile() : " 949 <<
"Cannot find sub-directory " << startDir << endl;
956 ME* srcME = igetter.
get(startDir +
"/" + srcMEName);
959 LogInfo(
"DQMGenericClient") <<
"computeProfile() : " 960 <<
"No source ME '" << srcMEName <<
"' found\n";
965 TH2F* hSrc = srcME->getTH2F();
968 LogInfo(
"DQMGenericClient") <<
"computeProfile() : " 969 <<
"Cannot create TH2F from source-ME\n";
974 string profileDir = startDir;
975 string newProfileMEName = profileMEName;
977 if (string::npos != (shiftPos = profileMEName.rfind(
'/'))) {
978 profileDir +=
"/" + profileMEName.substr(0, shiftPos);
979 newProfileMEName.erase(0, shiftPos + 1);
983 std::unique_ptr<TProfile>
profile(hSrc->ProfileX());
984 profile->SetTitle(profileMETitle.c_str());
995 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 996 <<
"Cannot find sub-directory " << startDir << endl;
1003 ME* element = igetter.
get(startDir +
"/" + histName);
1004 ME* normME = igetter.
get(startDir +
"/" + normHistName);
1008 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 1009 <<
"No such element '" << histName <<
"' found\n";
1016 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 1017 <<
"No such element '" << normHistName <<
"' found\n";
1022 TH1F*
hist = element->getTH1F();
1025 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 1026 <<
"Cannot create TH1F from ME\n";
1031 TH1F* normHist = normME->getTH1F();
1034 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 1035 <<
"Cannot create TH1F from ME\n";
1040 const double entries = normHist->GetEntries();
1042 hist->Scale(1. / entries);
1044 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : " 1045 <<
"Zero entries in histogram\n";
1058 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : " 1059 <<
"Cannot find sub-directory " << startDir << endl;
1066 ME* element_cd = igetter.
get(startDir +
"/" + cdName);
1070 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : " 1071 <<
"No such element '" << cdName <<
"' found\n";
1076 TH1F*
cd = element_cd->getTH1F();
1080 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : " 1081 <<
"Cannot create TH1F from ME\n";
1086 int n_bins =
cd->GetNbinsX() + 1;
1089 for (
int i = 1;
i <= n_bins;
i++) {
1090 cd->SetBinContent(
i,
cd->GetBinContent(
i) +
cd->GetBinContent(
i - 1));
1093 for (
int i = n_bins - 1;
i >= 0;
i--) {
1094 cd->SetBinContent(
i,
cd->GetBinContent(
i) +
cd->GetBinContent(
i + 1));
1107 LogInfo(
"DQMGenericClient") <<
"makeNoFlowDist() : " 1108 <<
"Cannot find sub-directory " << startDir << endl;
1115 ME* element_noFlow = igetter.
get(startDir +
"/" + noFlowName);
1117 if (!element_noFlow) {
1119 LogInfo(
"DQMGenericClient") <<
"makeNoFlowDist() : " 1120 <<
"No such element '" << noFlowName <<
"' found\n";
1125 TH1F* noFlow = element_noFlow->getTH1F();
1129 LogInfo(
"DQMGenericClient") <<
"makeNoFlowDist() : " 1130 <<
"Cannot create TH1F from ME\n";
1135 noFlow->AddBinContent(1, noFlow->GetBinContent(0));
1136 noFlow->SetBinContent(0, 0.);
1138 const auto lastBin = noFlow->GetNbinsX();
1139 noFlow->AddBinContent(lastBin, noFlow->GetBinContent(lastBin + 1));
1140 noFlow->SetBinContent(lastBin + 1, 0.);
1147 double cont_min = 100;
1148 Int_t binx =
histo->GetXaxis()->GetNbins();
1150 for (
int i = 1;
i <= binx;
i++) {
1152 TH1* histoY =
histo->ProjectionY(
" ",
i,
i);
1153 double cont = histoY->GetEntries();
1155 if (
cont >= cont_min) {
1156 float minfit = histoY->GetMean() - histoY->GetRMS();
1157 float maxfit = histoY->GetMean() + histoY->GetRMS();
1159 TF1* fitFcn =
new TF1(TString(
"g") +
histo->GetName() + iString,
"gaus", minfit, maxfit);
1161 fitFcn->GetRange(
x1,
x2);
1163 fitFcn->SetParameters(histoY->Integral(), histoY->GetMean(), histoY->GetRMS());
1165 histoY->Fit(fitFcn,
"QR0 SERIAL",
"",
x1,
x2);
1168 double* par = fitFcn->GetParameters();
1169 const double*
err = fitFcn->GetParErrors();
1198 std::set<std::string>*
myList,
1199 const TString& _pattern = TString(
"")) {
1202 LogError(
"DQMGenericClient") <<
" DQMGenericClient::findAllSubdirectories ==> Missing folder " <<
dir <<
" !!!";
1207 pattern.ReplaceAll(
"*",
".*");
1210 vector<string> foundDirs = igetter.
getSubdirs();
1211 for (vector<string>::const_iterator iDir = foundDirs.begin(); iDir != foundDirs.end(); ++iDir) {
1212 TString
dirName = iDir->substr(iDir->rfind(
'/') + 1, iDir->length());
1227 LogInfo(
"DQMGenericClient") <<
"Trying to find sub-directories of " <<
dir <<
" failed because " <<
dir 1228 <<
" does not exist";
1234 for (
int iBinX = 1; iBinX <
denom->GetNbinsX() + 1; iBinX++) {
1235 for (
int iBinY = 1; iBinY <
denom->GetNbinsY() + 1; iBinY++) {
1236 for (
int iBinZ = 1; iBinZ <
denom->GetNbinsZ() + 1; iBinZ++) {
1237 int globalBinNum =
denom->GetBin(iBinX, iBinY, iBinZ);
1239 float numerVal = numer->GetBinContent(globalBinNum);
1240 float denomVal =
denom->GetBinContent(globalBinNum);
1246 effVal = denomVal ? (1 - numerVal / denomVal) : 0;
1248 effVal = denomVal ? numerVal / denomVal : 0;
1254 float numerErr = numer->GetBinError(globalBinNum);
1255 float denomErr =
denom->GetBinError(globalBinNum);
1256 float denomsq = denomVal * denomVal;
1257 errVal = denomVal ?
sqrt(
pow(1.
f / denomVal * numerErr, 2.0) +
pow(numerVal / denomsq * denomErr, 2)) : 0;
1259 errVal = (denomVal && (effVal <= 1)) ?
sqrt(effVal * (1 - effVal) / denomVal) : 0;
1262 LogDebug(
"DQMGenericClient") <<
"(iBinX, iBinY, iBinZ) = " << iBinX <<
", " << iBinY <<
", " << iBinZ
1263 <<
"), global bin = " << globalBinNum <<
"eff = " << numerVal <<
" / " 1264 << denomVal <<
" = " << effVal <<
" ... setting the error for that bin ... " 1269 efficiencyHist->
setBinError(globalBinNum, errVal);
std::vector< EfficOption > efficOptions_
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
std::vector< ProfileOption > profileOptions_
void dqmEndRun(DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
virtual bool dirExists(std::string const &path) const
void makeCumulativeDist(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &cdName, bool ascending=true)
Log< level::Error, false > LogError
TPRegexp nonPerlWildcard_
std::vector< ResolOption > resolOptions_
virtual TH2F * getTH2F() const
DQMGenericClient::MonitorElement ME
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
std::vector< std::string > subDirs_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void makeAllPlots(DQMStore::IBooker &, DQMStore::IGetter &)
void normalizeToEntries(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &histName, const std::string &normHistName)
#define DEFINE_FWK_MODULE(type)
void computeResolution(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &fitMEPrefix, const std::string &fitMETitlePrefix, const std::string &srcMEName)
void makeNoFlowDist(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &cdName)
def efficSet(nameIn, titleIn, numeratorIn, denominatorIn, typeIn="eff")
std::string outputFileName_
Log< level::Info, false > LogInfo
void findAllSubdirectories(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string dir, std::set< std::string > *myList, const TString &pattern)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
dqm::legacy::MonitorElement MonitorElement
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
std::vector< CDOption > cdOptions_
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
void computeEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &efficMEName, const std::string &efficMETitle, const std::string &recoMEName, const std::string &simMEName, const EfficType type=EfficType::efficiency, const bool makeProfile=false)
std::vector< NoFlowOption > noFlowOptions_
~DQMGenericClient() override
DQMGenericClient(const edm::ParameterSet &pset)
void computeProfile(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &profileMEName, const std::string &profileMETitle, const std::string &srcMEName)
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
void limitedFit(MonitorElement *srcME, MonitorElement *meanME, MonitorElement *sigmaME)
cont
load Luminosity info ##
void generic_eff(TH1 *denom, TH1 *numer, MonitorElement *efficiencyHist, const EfficType type=EfficType::efficiency)
std::vector< NormOption > normOptions_
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const