24 #include <boost/tokenizer.hpp>
31 TPRegexp
metacharacters(
"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]");
36 typedef std::vector<edm::ParameterSet> VPSet;
37 typedef std::vector<std::string>
vstring;
38 typedef boost::escaped_list_separator<char> elsc;
40 elsc commonEscapes(
"\\",
" \t",
"\'");
45 vstring effCmds = pset.
getParameter<vstring>(
"efficiency");
46 for ( vstring::const_iterator effCmd = effCmds.begin();
47 effCmd != effCmds.end(); ++effCmd )
49 if ( effCmd->empty() )
continue;
51 boost::tokenizer<elsc> tokens(*effCmd, commonEscapes);
54 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
55 iToken != tokens.end(); ++iToken) {
56 if ( iToken->empty() )
continue;
57 args.push_back(*iToken);
60 if ( args.size() < 4 ) {
61 LogInfo(
"DQMGenericClient") <<
"Wrong input to effCmds\n";
72 const string typeName = args.size() == 4 ?
"eff" : args[4];
73 if ( typeName ==
"eff" ) opt.
type = 1;
74 else if ( typeName ==
"fake" ) opt.
type = 2;
77 efficOptions_.push_back(opt);
81 for ( VPSet::const_iterator
efficSet = efficSets.begin();
85 opt.
name =
efficSet->getUntrackedParameter<
string>(
"name");
91 const string typeName =
efficSet->getUntrackedParameter<
string>(
"typeName",
"eff");
92 if ( typeName ==
"eff" ) opt.
type = 1;
93 else if ( typeName ==
"fake" ) opt.
type = 2;
96 efficOptions_.push_back(opt);
101 for ( vstring::const_iterator effProfileCmd = effProfileCmds.begin();
102 effProfileCmd != effProfileCmds.end(); ++effProfileCmd )
104 if ( effProfileCmd->empty() )
continue;
106 boost::tokenizer<elsc> tokens(*effProfileCmd, commonEscapes);
109 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
110 iToken != tokens.end(); ++iToken) {
111 if ( iToken->empty() )
continue;
112 args.push_back(*iToken);
115 if ( args.size() < 4 ) {
116 LogInfo(
"DQMGenericClient") <<
"Wrong input to effProfileCmds\n";
127 const string typeName = args.size() == 4 ?
"eff" : args[4];
128 if ( typeName ==
"eff" ) opt.
type = 1;
129 else if ( typeName ==
"fake" ) opt.
type = 2;
132 efficOptions_.push_back(opt);
136 for ( VPSet::const_iterator effProfileSet = effProfileSets.begin();
137 effProfileSet != effProfileSets.end(); ++effProfileSet )
140 opt.
name = effProfileSet->getUntrackedParameter<
string>(
"name");
141 opt.
title = effProfileSet->getUntrackedParameter<
string>(
"title");
142 opt.
numerator = effProfileSet->getUntrackedParameter<
string>(
"numerator");
143 opt.
denominator = effProfileSet->getUntrackedParameter<
string>(
"denominator");
146 const string typeName = effProfileSet->getUntrackedParameter<
string>(
"typeName",
"eff");
147 if ( typeName ==
"eff" ) opt.
type = 1;
148 else if ( typeName ==
"fake" ) opt.
type = 2;
151 efficOptions_.push_back(opt);
155 vstring resCmds = pset.
getParameter<vstring>(
"resolution");
156 for ( vstring::const_iterator resCmd = resCmds.begin();
157 resCmd != resCmds.end(); ++resCmd )
159 if ( resCmd->empty() )
continue;
160 boost::tokenizer<elsc> tokens(*resCmd, commonEscapes);
163 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
164 iToken != tokens.end(); ++iToken) {
165 if ( iToken->empty() )
continue;
166 args.push_back(*iToken);
169 if ( args.size() != 3 ) {
170 LogInfo(
"DQMGenericClient") <<
"Wrong input to resCmds\n";
179 resolOptions_.push_back(opt);
183 for ( VPSet::const_iterator resolSet = resolSets.begin();
184 resolSet != resolSets.end(); ++resolSet )
187 opt.
namePrefix = resolSet->getUntrackedParameter<
string>(
"namePrefix");
188 opt.
titlePrefix = resolSet->getUntrackedParameter<
string>(
"titlePrefix");
189 opt.
srcName = resolSet->getUntrackedParameter<
string>(
"srcName");
191 resolOptions_.push_back(opt);
196 for(
const auto& profileCmd: profileCmds) {
197 boost::tokenizer<elsc> tokens(profileCmd, commonEscapes);
200 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
201 iToken != tokens.end(); ++iToken) {
202 if ( iToken->empty() )
continue;
203 args.push_back(*iToken);
206 if ( args.size() != 3 ) {
207 LogInfo(
"DQMGenericClient") <<
"Wrong input to profileCmds\n";
216 profileOptions_.push_back(opt);
220 for(
const auto& profileSet: profileSets) {
222 opt.
name = profileSet.getUntrackedParameter<
string>(
"name");
223 opt.
title = profileSet.getUntrackedParameter<
string>(
"title");
224 opt.
srcName = profileSet.getUntrackedParameter<
string>(
"srcName");
226 profileOptions_.push_back(opt);
231 for ( vstring::const_iterator normCmd = normCmds.begin();
232 normCmd != normCmds.end(); ++normCmd )
234 if ( normCmd->empty() )
continue;
235 boost::tokenizer<elsc> tokens(*normCmd, commonEscapes);
238 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
239 iToken != tokens.end(); ++iToken) {
240 if ( iToken->empty() )
continue;
241 args.push_back(*iToken);
244 if ( args.empty()
or args.size() > 2 ) {
245 LogInfo(
"DQMGenericClient") <<
"Wrong input to normCmds\n";
251 opt.
normHistName = args.size() == 2 ? args[1] : args[0];
253 normOptions_.push_back(opt);
257 for ( VPSet::const_iterator normSet = normSets.begin();
258 normSet != normSets.end(); ++normSet )
261 opt.
name = normSet->getUntrackedParameter<
string>(
"name");
262 opt.
normHistName = normSet->getUntrackedParameter<
string>(
"normalizedTo", opt.
name);
264 normOptions_.push_back(opt);
269 for ( vstring::const_iterator cdCmd = cdCmds.begin();
270 cdCmd != cdCmds.end(); ++cdCmd )
272 if ( cdCmd->empty() )
continue;
273 boost::tokenizer<elsc> tokens(*cdCmd, commonEscapes);
276 for(boost::tokenizer<elsc>::const_iterator iToken = tokens.begin();
277 iToken != tokens.end(); ++iToken) {
278 if ( iToken->empty() )
continue;
279 args.push_back(*iToken);
282 if ( args.size() != 1 ) {
283 LogInfo(
"DQMGenericClient") <<
"Wrong input to cdCmds\n";
290 cdOptions_.push_back(opt);
294 for ( VPSet::const_iterator cdSet = cdSets.begin();
295 cdSet != cdSets.end(); ++cdSet )
298 opt.
name = cdSet->getUntrackedParameter<
string>(
"name");
300 cdOptions_.push_back(opt);
307 isWildcardUsed_ =
false;
312 typedef vector<string>
vstring;
333 set<string> subDirSet;
335 for(vstring::const_iterator iSubDir = subDirs_.begin();
336 iSubDir != subDirs_.end(); ++iSubDir) {
337 string subDir = *iSubDir;
339 if ( subDir[subDir.size()-1] ==
'/' ) subDir.erase(subDir.size()-1);
342 isWildcardUsed_ =
true;
345 const string searchPath = subDir.substr(0, shiftPos);
346 const string pattern = subDir.substr(shiftPos + 1, subDir.length());
349 findAllSubdirectories (ibooker, igetter, searchPath, &subDirSet, pattern);
353 subDirSet.insert(subDir);
357 for(set<string>::const_iterator iSubDir = subDirSet.begin();
358 iSubDir != subDirSet.end(); ++iSubDir) {
359 const string&
dirName = *iSubDir;
363 for ( vector<NormOption>::const_iterator normOption = normOptions_.begin();
364 normOption != normOptions_.end(); ++normOption )
366 normalizeToEntries(ibooker, igetter, dirName, normOption->name, normOption->normHistName);
369 for ( vector<CDOption>::const_iterator cdOption = cdOptions_.begin();
370 cdOption != cdOptions_.end(); ++cdOption )
372 makeCumulativeDist(ibooker, igetter, dirName, cdOption->name);
375 for ( vector<EfficOption>::const_iterator efficOption = efficOptions_.begin();
376 efficOption != efficOptions_.end(); ++efficOption )
378 computeEfficiency(ibooker, igetter, dirName, efficOption->name, efficOption->title,
379 efficOption->numerator, efficOption->denominator,
380 efficOption->type, efficOption->isProfile);
383 for ( vector<ResolOption>::const_iterator resolOption = resolOptions_.begin();
384 resolOption != resolOptions_.end(); ++resolOption )
386 computeResolution(ibooker, igetter, dirName, resolOption->namePrefix, resolOption->titlePrefix, resolOption->srcName);
389 for(
const auto& profileOption: profileOptions_) {
390 computeProfile(ibooker, igetter, dirName, profileOption.name, profileOption.title, profileOption.srcName);
395 if ( ! outputFileName_.empty() ) theDQM->save(outputFileName_);
400 const string& efficMETitle,
const string& recoMEName,
const string& simMEName,
const int type,
const bool makeProfile)
403 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
404 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
405 <<
"Cannot find sub-directory " << startDir << endl;
412 ME* simME = igetter.
get(startDir+
"/"+simMEName);
413 ME* recoME = igetter.
get(startDir+
"/"+recoMEName);
416 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
417 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
418 <<
"No sim-ME '" << simMEName <<
"' found\n";
424 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
425 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
426 <<
"No reco-ME '" << recoMEName <<
"' found\n";
433 TH1* hSim = simME ->getTH1();
434 TH1* hReco = recoME->getTH1();
436 if ( !hSim || !hReco ) {
437 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
438 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
439 <<
"Cannot create TH1 from ME\n";
444 string efficDir = startDir;
445 string newEfficMEName = efficMEName;
447 if ( string::npos != (shiftPos = efficMEName.rfind(
'/')) ) {
448 efficDir +=
"/"+efficMEName.substr(0, shiftPos);
449 newEfficMEName.erase(0, shiftPos+1);
454 TProfile * efficHist = (hReco->GetXaxis()->GetXbins()->GetSize()==0) ?
455 new TProfile(newEfficMEName.c_str(), efficMETitle.c_str(),
456 hReco->GetXaxis()->GetNbins(),
457 hReco->GetXaxis()->GetXmin(),
458 hReco->GetXaxis()->GetXmax()) :
459 new TProfile(newEfficMEName.c_str(), efficMETitle.c_str(),
460 hReco->GetXaxis()->GetNbins(),
461 hReco->GetXaxis()->GetXbins()->GetArray());
463 efficHist->GetXaxis()->SetTitle(hSim->GetXaxis()->GetTitle());
464 efficHist->GetYaxis()->SetTitle(hSim->GetYaxis()->GetTitle());
466 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
467 for (
int i=1;
i <= hReco->GetNbinsX();
i++) {
469 const double nReco = hReco->GetBinContent(
i);
470 const double nSim = hSim->GetBinContent(
i);
471 if(nSim > INT_MAX || nSim < INT_MIN || nReco > INT_MAX || nReco < INT_MIN)
473 LogError(
"DQMGenericClient") <<
"computeEfficiency() : "
474 <<
"Overflow: bin content either too large or too small to be casted to int";
479 efficHist->GetXaxis()->SetBinLabel(
i, hSim->GetXaxis()->GetBinLabel(
i));
481 if ( nSim == 0 || nReco > nSim )
continue;
482 const double effVal = nReco/nSim;
484 const double errLo = TEfficiency::ClopperPearson((
int)nSim,
487 const double errUp = TEfficiency::ClopperPearson((
int)nSim,
490 const double errVal = (effVal - errLo > errUp - effVal) ? effVal - errLo : errUp - effVal;
491 efficHist->SetBinContent(
i, effVal);
492 efficHist->SetBinEntries(
i, 1);
493 efficHist->SetBinError(
i,
sqrt(effVal * effVal + errVal * errVal));
496 for (
int i=1;
i <= hReco->GetNbinsX();
i++) {
498 const double nReco = hReco->GetBinContent(
i);
499 const double nSim = hSim->GetBinContent(
i);
500 if(nSim > INT_MAX || nSim < INT_MIN || nReco > INT_MAX || nReco < INT_MIN)
502 LogError(
"DQMGenericClient") <<
"computeEfficiency() : "
503 <<
"Overflow: bin content either too large or too small to be casted to int";
507 TGraphAsymmErrorsWrapper asymm;
508 std::pair<double, double> efficiencyWithError;
509 efficiencyWithError = asymm.efficiency((
int)nReco,
511 double effVal = efficiencyWithError.first;
512 double errVal = efficiencyWithError.second;
514 efficHist->SetBinContent(
i, effVal);
515 efficHist->SetBinEntries(
i, 1);
516 efficHist->SetBinError(
i,
sqrt(effVal * effVal + errVal * errVal));
519 efficHist->GetXaxis()->SetBinLabel(
i, hSim->GetXaxis()->GetBinLabel(
i));
522 ibooker.
bookProfile(newEfficMEName.c_str(),efficHist);
528 TH1* efficHist = (TH1*)hSim->Clone(newEfficMEName.c_str());
529 efficHist->SetTitle(efficMETitle.c_str());
538 TClass * myHistClass = efficHist->IsA();
539 TString histClassName = myHistClass->GetName();
541 if (histClassName ==
"TH1F"){
542 efficME = ibooker.
book1D(newEfficMEName, (TH1F*)efficHist);
543 }
else if (histClassName ==
"TH2F"){
544 efficME = ibooker.
book2D(newEfficMEName, (TH2F*)efficHist);
545 }
else if (histClassName ==
"TH3F"){
546 efficME = ibooker.
book3D(newEfficMEName, (TH3F*)efficHist);
551 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
552 <<
"Cannot book effic-ME from the DQM\n";
560 generic_eff (hSim, hReco, efficME, type);
573 efficME->setEntries(simME->getEntries());
578 ME* globalEfficME = igetter.
get(efficDir+
"/globalEfficiencies");
579 if ( !globalEfficME ) globalEfficME = ibooker.
book1D(
"globalEfficiencies",
"Global efficiencies", 1, 0, 1);
580 if ( !globalEfficME ) {
581 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
582 <<
"Cannot book globalEffic-ME from the DQM\n";
585 globalEfficME->setEfficiencyFlag();
586 TH1F* hGlobalEffic = globalEfficME->getTH1F();
587 if ( !hGlobalEffic ) {
588 LogInfo(
"DQMGenericClient") <<
"computeEfficiency() : "
589 <<
"Cannot create TH1F from ME, globalEfficME\n";
593 const float nSimAll = hSim->GetEntries();
594 const float nRecoAll = hReco->GetEntries();
596 if ( type == 1 ) efficAll = nSimAll ? nRecoAll/nSimAll : 0;
597 else if ( type == 2 ) efficAll = nSimAll ? 1-nRecoAll/nSimAll : 0;
598 const float errorAll = nSimAll && efficAll < 1 ?
sqrt(efficAll*(1-efficAll)/nSimAll) : 0;
600 const int iBin = hGlobalEffic->Fill(newEfficMEName.c_str(), 0);
601 hGlobalEffic->SetBinContent(iBin, efficAll);
602 hGlobalEffic->SetBinError(iBin, errorAll);
609 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
610 LogInfo(
"DQMGenericClient") <<
"computeResolution() : "
611 <<
"Cannot find sub-directory " << startDir << endl;
618 ME* srcME = igetter.
get(startDir+
"/"+srcName);
620 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
621 LogInfo(
"DQMGenericClient") <<
"computeResolution() : "
622 <<
"No source ME '" << srcName <<
"' found\n";
627 TH2F* hSrc = srcME->getTH2F();
629 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
630 LogInfo(
"DQMGenericClient") <<
"computeResolution() : "
631 <<
"Cannot create TH2F from source-ME\n";
636 const int nBin = hSrc->GetNbinsX();
638 string newDir = startDir;
639 string newPrefix = namePrefix;
641 if ( string::npos != (shiftPos = namePrefix.rfind(
'/')) ) {
642 newDir +=
"/"+namePrefix.substr(0, shiftPos);
643 newPrefix.erase(0, shiftPos+1);
648 float * lowedgesfloats =
new float[nBin+1];
651 if (hSrc->GetXaxis()->GetXbins()->GetSize())
653 for (
int j=0;
j<nBin+1; ++
j)
654 lowedgesfloats[
j] = (
float)hSrc->GetXaxis()->GetXbins()->GetAt(
j);
655 meanME = ibooker.
book1D(newPrefix+
"_Mean", titlePrefix+
" Mean", nBin, lowedgesfloats);
656 sigmaME = ibooker.
book1D(newPrefix+
"_Sigma", titlePrefix+
" Sigma", nBin, lowedgesfloats);
660 meanME = ibooker.
book1D(newPrefix+
"_Mean", titlePrefix+
" Mean", nBin,
661 hSrc->GetXaxis()->GetXmin(),
662 hSrc->GetXaxis()->GetXmax());
663 sigmaME = ibooker.
book1D(newPrefix+
"_Sigma", titlePrefix+
" Sigma", nBin,
664 hSrc->GetXaxis()->GetXmin(),
665 hSrc->GetXaxis()->GetXmax());
668 if (meanME && sigmaME)
670 meanME->setEfficiencyFlag();
671 sigmaME->setEfficiencyFlag();
673 if (! resLimitedFit_ ) {
679 limitedFit(srcME,meanME,sigmaME);
682 delete[] lowedgesfloats;
687 if(verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
688 LogInfo(
"DQMGenericClient") <<
"computeProfile() : "
689 <<
"Cannot find sub-directory " << startDir << endl;
696 ME* srcME = igetter.
get(startDir+
"/"+srcMEName);
698 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
699 LogInfo(
"DQMGenericClient") <<
"computeProfile() : "
700 <<
"No source ME '" << srcMEName <<
"' found\n";
705 TH2F* hSrc = srcME->getTH2F();
707 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
708 LogInfo(
"DQMGenericClient") <<
"computeProfile() : "
709 <<
"Cannot create TH2F from source-ME\n";
714 string profileDir = startDir;
715 string newProfileMEName = profileMEName;
717 if ( string::npos != (shiftPos = profileMEName.rfind(
'/')) ) {
718 profileDir +=
"/"+profileMEName.substr(0, shiftPos);
719 newProfileMEName.erase(0, shiftPos+1);
723 std::unique_ptr<TProfile> profile(hSrc->ProfileX());
724 profile->SetTitle(profileMETitle.c_str());
733 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
734 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
735 <<
"Cannot find sub-directory " << startDir << endl;
742 ME* element = igetter.
get(startDir+
"/"+histName);
743 ME* normME = igetter.
get(startDir+
"/"+normHistName);
746 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
747 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
748 <<
"No such element '" << histName <<
"' found\n";
754 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
755 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
756 <<
"No such element '" << normHistName <<
"' found\n";
761 TH1F*
hist = element->getTH1F();
763 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
764 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
765 <<
"Cannot create TH1F from ME\n";
770 TH1F* normHist = normME->getTH1F();
772 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
773 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
774 <<
"Cannot create TH1F from ME\n";
779 const double entries = normHist->GetEntries();
780 if ( entries != 0 ) {
781 hist->Scale(1./entries);
784 LogInfo(
"DQMGenericClient") <<
"normalizeToEntries() : "
785 <<
"Zero entries in histogram\n";
794 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
795 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : "
796 <<
"Cannot find sub-directory " << startDir << endl;
803 ME* element_cd = igetter.
get(startDir+
"/"+cdName);
806 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
807 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : "
808 <<
"No such element '" << cdName <<
"' found\n";
813 TH1F* cd = element_cd->getTH1F();
816 if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
817 LogInfo(
"DQMGenericClient") <<
"makeCumulativeDist() : "
818 <<
"Cannot create TH1F from ME\n";
823 int n_bins = cd->GetNbinsX() + 1;
825 for (
int i = 1;
i <= n_bins;
i++) {
826 cd->SetBinContent(
i,cd->GetBinContent(
i) + cd->GetBinContent(
i-1));
840 double cont_min = 100;
841 Int_t binx = histo->GetXaxis()->GetNbins();
843 for (
int i = 1; i <= binx ; i++) {
845 TH1 *histoY = histo->ProjectionY(
" ", i, i);
846 double cont = histoY->GetEntries();
848 if (cont >= cont_min) {
849 float minfit = histoY->GetMean() - histoY->GetRMS();
850 float maxfit = histoY->GetMean() + histoY->GetRMS();
852 TF1 *fitFcn =
new TF1(TString(
"g")+histo->GetName()+iString,
"gaus",minfit,maxfit);
854 fitFcn->GetRange(x1,x2);
856 histoY->Fit(fitFcn,
"QR0",
"",x1,x2);
859 double *par = fitFcn->GetParameters();
860 const double *err = fitFcn->GetParErrors();
872 if(fitFcn)
delete fitFcn;
873 if(histoY)
delete histoY;
876 if(histoY)
delete histoY;
885 const TString& _pattern = TString(
"")) {
888 LogError(
"DQMGenericClient") <<
" DQMGenericClient::findAllSubdirectories ==> Missing folder " << dir <<
" !!!";
893 TPRegexp regexp(pattern);
895 vector <string> foundDirs = igetter.
getSubdirs();
896 for(vector<string>::const_iterator iDir = foundDirs.begin();
897 iDir != foundDirs.end(); ++iDir) {
898 TString
dirName = iDir->substr(iDir->rfind(
'/') + 1, iDir->length());
899 if (dirName.Contains(regexp))
900 findAllSubdirectories (ibooker, igetter, *iDir, myList);
909 findAllSubdirectories (ibooker, igetter, dir, myList,
"*");
913 LogInfo (
"DQMGenericClient") <<
"Trying to find sub-directories of " << dir
914 <<
" failed because " << dir <<
" does not exist";
922 for (
int iBinX = 1; iBinX < denom->GetNbinsX()+1; iBinX++){
923 for (
int iBinY = 1; iBinY < denom->GetNbinsY()+1; iBinY++){
924 for (
int iBinZ = 1; iBinZ < denom->GetNbinsZ()+1; iBinZ++){
926 int globalBinNum = denom->GetBin(iBinX, iBinY, iBinZ);
928 float numerVal = numer->GetBinContent(globalBinNum);
929 float denomVal = denom->GetBinContent(globalBinNum);
935 effVal = denomVal ? (1 - numerVal / denomVal) : 0;
937 effVal = denomVal ? numerVal / denomVal : 0;
940 float errVal = (denomVal && (effVal <=1)) ?
sqrt(effVal*(1-effVal)/denomVal) : 0;
942 LogDebug (
"DQMGenericClient") <<
"(iBinX, iBinY, iBinZ) = "
945 << iBinZ <<
"), global bin = " << globalBinNum
946 <<
"eff = " << numerVal <<
" / " << denomVal
948 <<
" ... setting the error for that bin ... " << endl
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void setBinContent(int binx, double content)
set content of bin (1-D)
tuple cont
load Luminosity info ##
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
MonitorElement * bookProfile(Args &&...args)
MonitorElement * get(const std::string &path)
TPRegexp metacharacters("[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]")
void normalizeToEntries(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &histName, const std::string &normHistName)
MonitorElement * book1D(Args &&...args)
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 setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
bool dirExists(const std::string &path)
void findAllSubdirectories(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string dir, std::set< std::string > *myList, const TString &pattern)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< std::string > getSubdirs(void)
TPRegexp nonPerlWildcard("\\w\\*|^\\*")
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 int type=1, const bool makeProfile=false)
void makeCumulativeDist(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &cdName)
void setEfficiencyFlag(void)
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)
TH2F * getTH2F(void) const
MonitorElement * book3D(Args &&...args)
void limitedFit(MonitorElement *srcME, MonitorElement *meanME, MonitorElement *sigmaME)
void generic_eff(TH1 *denom, TH1 *numer, MonitorElement *efficiencyHist, const int type=1)