diff --git a/DQMOffline/RecoB/interface/BTagDifferentialPlot.h b/DQMOffline/RecoB/interface/BTagDifferentialPlot.h index 224324c0f1a3f..832e6b9837307 100644 --- a/DQMOffline/RecoB/interface/BTagDifferentialPlot.h +++ b/DQMOffline/RecoB/interface/BTagDifferentialPlot.h @@ -11,6 +11,7 @@ #include "DQMOffline/RecoB/interface/EtaPtBin.h" #include "DQMOffline/RecoB/interface/JetTagPlotter.h" +#include "DQMServices/Core/interface/DQMStore.h" class BTagDifferentialPlot { @@ -18,7 +19,7 @@ class BTagDifferentialPlot { enum ConstVarType {constPT, constETA }; - BTagDifferentialPlot (const double& bEff, const ConstVarType& constVariable, const std::string & tagName) ; + BTagDifferentialPlot (const double& bEff, const ConstVarType& constVariable, const std::string & tagName, DQMStore::IBooker & ibook) ; ~BTagDifferentialPlot () ; @@ -81,7 +82,7 @@ class BTagDifferentialPlot { // the common name to describe histograms std::string commonName ; - + DQMStore::IBooker & ibook_; // the input std::vector theBinPlotters ; diff --git a/DQMOffline/RecoB/interface/EffPurFromHistos.h b/DQMOffline/RecoB/interface/EffPurFromHistos.h index a1dbf19219ac2..98f39f81e7c91 100644 --- a/DQMOffline/RecoB/interface/EffPurFromHistos.h +++ b/DQMOffline/RecoB/interface/EffPurFromHistos.h @@ -31,7 +31,7 @@ class EffPurFromHistos { ~EffPurFromHistos () ; // do the computation - void compute () ; + void compute (DQMStore::IBooker & ibook) ; // return the newly created histos TH1F * getEffFlavVsBEff_d () { return EffFlavVsBEff_d->getTH1F() ; }; diff --git a/DQMOffline/RecoB/interface/FlavourHistorgrams.h b/DQMOffline/RecoB/interface/FlavourHistorgrams.h index 25750f9afcf48..b5e306a9265c3 100644 --- a/DQMOffline/RecoB/interface/FlavourHistorgrams.h +++ b/DQMOffline/RecoB/interface/FlavourHistorgrams.h @@ -174,7 +174,7 @@ FlavourHistograms::FlavourHistograms (const std::string& baseNameTitle_ , con if (!update) { // book histos - HistoProviderDQM prov("Btag",folder); + HistoProviderDQM prov("Btag",folder,ibook); if(mcPlots_%2==0) theHisto_all = (prov.book1D( theBaseNameTitle + "ALL" , theBaseNameDescription + " all jets" , theNBins , theLowerBound , theUpperBound )) ; else theHisto_all = 0; if (mcPlots_) { @@ -229,7 +229,8 @@ FlavourHistograms::FlavourHistograms (const std::string& baseNameTitle_ , con } } } else { - HistoProviderDQM prov("Btag",folder); + //is it useful? anyway access function is deprecated... + HistoProviderDQM prov("Btag",folder,ibook); if(theHisto_all) theHisto_all = prov.access(theBaseNameTitle + "ALL" ) ; if (mcPlots_) { if (mcPlots_>2 ) { diff --git a/DQMOffline/RecoB/interface/FlavourHistorgrams2D.h b/DQMOffline/RecoB/interface/FlavourHistorgrams2D.h index 3a0c5a12c1a8f..8b963ab6b0809 100644 --- a/DQMOffline/RecoB/interface/FlavourHistorgrams2D.h +++ b/DQMOffline/RecoB/interface/FlavourHistorgrams2D.h @@ -190,7 +190,7 @@ FlavourHistograms2D::FlavourHistograms2D (TString baseNameTitle_ , TString if (!update) { // book histos - HistoProviderDQM prov("Btag",folder); + HistoProviderDQM prov("Btag",folder,ibook); if(mcPlots_%2 == 0) theHisto_all = (prov.book2D( theBaseNameTitle + "ALL" , theBaseNameDescription + " all jets" , theNBinsX , theLowerBoundX , theUpperBoundX , theNBinsY, theLowerBoundY, theUpperBoundY )) ; else theHisto_all = 0; if (mcPlots_) { @@ -310,7 +310,8 @@ FlavourHistograms2D::FlavourHistograms2D (TString baseNameTitle_ , TString } } } else { - HistoProviderDQM prov("Btag",folder); + //is it useful? anyway access function is deprecated... + HistoProviderDQM prov("Btag",folder,ibook); if(theHisto_all) theHisto_all = prov.access(theBaseNameTitle + "ALL" ) ; if (mcPlots_) { if (mcPlots_>2) { diff --git a/DQMOffline/RecoB/interface/HistoProviderDQM.h b/DQMOffline/RecoB/interface/HistoProviderDQM.h index c1723bf19a640..ea3f855c0d4c7 100644 --- a/DQMOffline/RecoB/interface/HistoProviderDQM.h +++ b/DQMOffline/RecoB/interface/HistoProviderDQM.h @@ -1,15 +1,15 @@ #ifndef HistoProviderDQM_H #define HistoProviderDQM_H +#include "DQMServices/Core/interface/DQMStore.h" -class DQMStore; class MonitorElement; #include class HistoProviderDQM { public: - HistoProviderDQM(const std::string& prefix, const std::string& label); + HistoProviderDQM(const std::string& prefix, const std::string& label, DQMStore::IBooker & ibook); virtual ~HistoProviderDQM(){} void show(); @@ -41,7 +41,8 @@ class HistoProviderDQM { virtual MonitorElement * access(const std::string &name); private: - DQMStore * dqmStore_; std::string label_; + //DQMStore * dqmStore_; + DQMStore::IBooker & ibook_; }; #endif diff --git a/DQMOffline/RecoB/interface/TrackCountingTagPlotter.h b/DQMOffline/RecoB/interface/TrackCountingTagPlotter.h index e034eaafc0dbf..ce42755a6daa9 100644 --- a/DQMOffline/RecoB/interface/TrackCountingTagPlotter.h +++ b/DQMOffline/RecoB/interface/TrackCountingTagPlotter.h @@ -44,6 +44,7 @@ class TrackCountingTagPlotter : public BaseTagInfoPlotter { EffPurFromHistos * effPurFromHistos[4] ; bool finalized; + DQMStore::IBooker & ibook_; } ; #endif diff --git a/DQMOffline/RecoB/interface/TrackIPHistograms.h b/DQMOffline/RecoB/interface/TrackIPHistograms.h index fe4c0386175c0..0a52a5f1663db 100644 --- a/DQMOffline/RecoB/interface/TrackIPHistograms.h +++ b/DQMOffline/RecoB/interface/TrackIPHistograms.h @@ -54,7 +54,7 @@ TrackIPHistograms::TrackIPHistograms (const std::string& baseNameTitle_, cons { if(quality_) { if(!update) { - HistoProviderDQM prov("Btag",folder); + HistoProviderDQM prov("Btag",folder,ibook); theQual_undefined = prov.book1D( baseNameTitle_ + "QualUnDef" , baseNameDescription_ + " Undefined Quality", nBins_, lowerBound_, upperBound_); theQual_loose = prov.book1D( baseNameTitle_ + "QualLoose" , baseNameDescription_ + " Loose Quality", nBins_, lowerBound_, upperBound_); theQual_tight = prov.book1D( baseNameTitle_ + "QualTight" , baseNameDescription_ + " Tight Quality", nBins_, lowerBound_, upperBound_); @@ -67,7 +67,8 @@ TrackIPHistograms::TrackIPHistograms (const std::string& baseNameTitle_, cons theQual_highpur->getTH1F()->Sumw2(); } } else { - HistoProviderDQM prov("Btag",folder); + //is it useful? anyway access function is deprecated... + HistoProviderDQM prov("Btag",folder,ibook); theQual_undefined = prov.access(baseNameTitle_ + "QualUnDef"); theQual_loose = prov.access(baseNameTitle_ + "QualLoose"); theQual_tight = prov.access(baseNameTitle_ + "QualTight"); diff --git a/DQMOffline/RecoB/interface/TrackProbabilityTagPlotter.h b/DQMOffline/RecoB/interface/TrackProbabilityTagPlotter.h index 939055f8dcbeb..b0a1589a61fa7 100644 --- a/DQMOffline/RecoB/interface/TrackProbabilityTagPlotter.h +++ b/DQMOffline/RecoB/interface/TrackProbabilityTagPlotter.h @@ -42,7 +42,7 @@ class TrackProbabilityTagPlotter : public BaseTagInfoPlotter { bool finalized; unsigned int mcPlots_; bool willFinalize_; - + DQMStore::IBooker & ibook_; } ; #endif diff --git a/DQMOffline/RecoB/plugins/BTagPerformanceAnalyzerOnData.cc b/DQMOffline/RecoB/plugins/BTagPerformanceAnalyzerOnData.cc index 2f38c1be022e2..ad75b3f7c0550 100644 --- a/DQMOffline/RecoB/plugins/BTagPerformanceAnalyzerOnData.cc +++ b/DQMOffline/RecoB/plugins/BTagPerformanceAnalyzerOnData.cc @@ -136,14 +136,14 @@ void BTagPerformanceAnalyzerOnData::bookHistograms(DQMStore::IBooker & ibook, ed // the objects for the differential plots vs. eta,pt for for ( int iEta = iEtaStart ; iEta < iEtaEnd ; ++iEta ) { BTagDifferentialPlot * etaConstDifferentialPlot = new BTagDifferentialPlot - (effBConst, BTagDifferentialPlot::constETA, moduleLabel.label()); + (effBConst, BTagDifferentialPlot::constETA, moduleLabel.label(), ibook); differentialPlotsConstantEta->push_back ( etaConstDifferentialPlot ); } for ( int iPt = iPtStart ; iPt < iPtEnd ; ++iPt ) { // differentialPlots for this pt bin BTagDifferentialPlot * ptConstDifferentialPlot = new BTagDifferentialPlot - (effBConst, BTagDifferentialPlot::constPT, moduleLabel.label()); + (effBConst, BTagDifferentialPlot::constPT, moduleLabel.label(), ibook); differentialPlotsConstantPt->push_back ( ptConstDifferentialPlot ); } } diff --git a/DQMOffline/RecoB/src/BTagDifferentialPlot.cc b/DQMOffline/RecoB/src/BTagDifferentialPlot.cc index 0268d825db97a..d79dc30be23a9 100644 --- a/DQMOffline/RecoB/src/BTagDifferentialPlot.cc +++ b/DQMOffline/RecoB/src/BTagDifferentialPlot.cc @@ -18,11 +18,11 @@ using namespace std ; BTagDifferentialPlot::BTagDifferentialPlot (const double& bEff, const ConstVarType& constVariable, - const std::string & tagName) : + const std::string & tagName, DQMStore::IBooker & ibook) : fixedBEfficiency ( bEff ) , noProcessing ( false ) , processed(false), constVar(constVariable), constVariableName ( "" ) , diffVariableName ( "" ) , - constVariableValue ( 999.9 , 999.9 ) , commonName( "MisidForBEff_" + tagName+"_") , + constVariableValue ( 999.9 , 999.9 ) , commonName( "MisidForBEff_" + tagName+"_") , ibook_(ibook), theDifferentialHistoB_d ( 0 ) , theDifferentialHistoB_u ( 0 ) , theDifferentialHistoB_s ( 0 ) , @@ -249,7 +249,7 @@ void BTagDifferentialPlot::bookHisto () { std::replace(commonName.begin(), commonName.end(), '.' , 'v' ) ; std::string label(commonName); - HistoProviderDQM prov ("Btag",label); + HistoProviderDQM prov ("Btag",label,ibook_); theDifferentialHistoB_d = (prov.book1D ( "D_" + commonName , "D_" + commonName , nBins , binArray )) ; theDifferentialHistoB_u = (prov.book1D ( "U_" + commonName , "U_" + commonName , nBins , binArray )) ; diff --git a/DQMOffline/RecoB/src/EffPurFromHistos.cc b/DQMOffline/RecoB/src/EffPurFromHistos.cc index 49de8dfc9661f..fde16ccc04ba2 100644 --- a/DQMOffline/RecoB/src/EffPurFromHistos.cc +++ b/DQMOffline/RecoB/src/EffPurFromHistos.cc @@ -452,7 +452,7 @@ void EffPurFromHistos::check () { } -void EffPurFromHistos::compute () +void EffPurFromHistos::compute (DQMStore::IBooker & ibook) { if (!mcPlots_) { @@ -479,7 +479,7 @@ void EffPurFromHistos::compute () // create histograms from base name and extension as given from user // BINNING MUST BE IDENTICAL FOR ALL OF THEM!! - HistoProviderDQM prov("Btag",label_); + HistoProviderDQM prov("Btag",label_,ibook); if(mcPlots_>2){ EffFlavVsBEff_d = (prov.book1D ( hB + "D" + hE , hB + "D" + hE , nBinOutput , startOutput , endOutput )); EffFlavVsBEff_u = (prov.book1D ( hB + "U" + hE , hB + "U" + hE , nBinOutput , startOutput , endOutput )) ; diff --git a/DQMOffline/RecoB/src/HistoProviderDQM.cc b/DQMOffline/RecoB/src/HistoProviderDQM.cc index f243c79af99cc..32b5c9a3297ce 100644 --- a/DQMOffline/RecoB/src/HistoProviderDQM.cc +++ b/DQMOffline/RecoB/src/HistoProviderDQM.cc @@ -5,26 +5,26 @@ #include "FWCore/ServiceRegistry/interface/Service.h" -HistoProviderDQM::HistoProviderDQM(const std::string& prefix, const std::string& label){ +HistoProviderDQM::HistoProviderDQM(const std::string& prefix, const std::string& label, DQMStore::IBooker & ibook): ibook_(ibook){ // get the store - dqmStore_ = edm::Service().operator->(); label_ =prefix+"/"+label; setDir(label_); } void HistoProviderDQM::show(){ - dqmStore_->showDirStructure(); + //ibook_.showDirStructure(); + std::cout<<"No showDirStructure() avaialble with DQMStore::IBooker: obsolete method!"<setCurrentFolder(name); + ibook_.setCurrentFolder(name); } MonitorElement* HistoProviderDQM::book1D(const std::string &name, const std::string &title, const int& nchX, const double& lowX, const double& highX) { - return (dqmStore_->book1D (name, title, nchX,lowX,highX)); + return (ibook_.book1D (name, title, nchX,lowX,highX)); } @@ -32,14 +32,14 @@ MonitorElement* HistoProviderDQM::book1D(const std::string &name, MonitorElement* HistoProviderDQM::book1D (const std::string &name, const std::string &title, const int& nchX, float *xbinsize){ - return (dqmStore_->book1D (name, title,nchX, xbinsize)); + return (ibook_.book1D (name, title,nchX, xbinsize)); } MonitorElement* HistoProviderDQM::book2D(const std::string &name, const std::string &title, const int& nchX, const double& lowX, const double& highX, const int& nchY, const double& lowY, const double& highY) { - return (dqmStore_->book2D (name, title, nchX,lowX,highX, nchY, lowY, highY)); + return (ibook_.book2D (name, title, nchX,lowX,highX, nchY, lowY, highY)); } @@ -48,18 +48,20 @@ MonitorElement* HistoProviderDQM::book2D (const std::string &name, const std::string &title, const int& nchX, float *xbinsize, const int& nchY, float *ybinsize){ - return (dqmStore_->book2D (name, title,nchX, xbinsize, nchY, ybinsize)); + return (ibook_.book2D (name, title,nchX, xbinsize, nchY, ybinsize)); } MonitorElement* HistoProviderDQM::bookProfile(const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY) { - return (dqmStore_->bookProfile (name,title, nchX,lowX,highX, nchY, lowY, highY)); + return (ibook_.bookProfile (name,title, nchX,lowX,highX, nchY, lowY, highY)); } MonitorElement * HistoProviderDQM::access(const std::string &name){ -return dqmStore_->get(label_+"/"+name); + //return ibook_.get(label_+"/"+name); + std::cout<<"'get' forbidden with DQMStore::IBooker: obsolete method!"<compute(); + effPurFromHistos->compute(ibook_); finalized = true; } diff --git a/DQMOffline/RecoB/src/TrackCountingTagPlotter.cc b/DQMOffline/RecoB/src/TrackCountingTagPlotter.cc index 6e7360585726b..7feff06435a80 100644 --- a/DQMOffline/RecoB/src/TrackCountingTagPlotter.cc +++ b/DQMOffline/RecoB/src/TrackCountingTagPlotter.cc @@ -12,7 +12,7 @@ TrackCountingTagPlotter::TrackCountingTagPlotter(const std::string & tagName, nBinEffPur_(pSet.getParameter("nBinEffPur")), startEffPur_(pSet.getParameter("startEffPur")), endEffPur_(pSet.getParameter("endEffPur")), - willFinalize_(wf), lowerIPSBound(-35.0), upperIPSBound(35.0), finalized(false) + willFinalize_(wf), lowerIPSBound(-35.0), upperIPSBound(35.0), finalized(false), ibook_(ibook) { const std::string dir(theExtensionString.substr(1)); @@ -148,7 +148,7 @@ void TrackCountingTagPlotter::createPlotsForFinalize (DQMStore::IBooker & ibook) void TrackCountingTagPlotter::finalize () { - for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(); + for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(ibook_); finalized = true; } diff --git a/DQMOffline/RecoB/src/TrackIPTagPlotter.cc b/DQMOffline/RecoB/src/TrackIPTagPlotter.cc index fb4b9abf045ad..1541d1f7a08ad 100644 --- a/DQMOffline/RecoB/src/TrackIPTagPlotter.cc +++ b/DQMOffline/RecoB/src/TrackIPTagPlotter.cc @@ -810,7 +810,7 @@ void TrackIPTagPlotter::finalize () effPurFromHistos[3] = new EffPurFromHistos (tkcntHistosSig2D[2],trackIPDir, mcPlots_, ibook_, nBinEffPur_, startEffPur_, endEffPur_); - for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(); + for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(ibook_); finalized = true; } diff --git a/DQMOffline/RecoB/src/TrackProbabilityTagPlotter.cc b/DQMOffline/RecoB/src/TrackProbabilityTagPlotter.cc index cca90045ba9dd..d6b7436118058 100644 --- a/DQMOffline/RecoB/src/TrackProbabilityTagPlotter.cc +++ b/DQMOffline/RecoB/src/TrackProbabilityTagPlotter.cc @@ -11,7 +11,7 @@ TrackProbabilityTagPlotter::TrackProbabilityTagPlotter(const std::string & tagNa nBinEffPur_(pSet.getParameter("nBinEffPur")), startEffPur_(pSet.getParameter("startEffPur")), endEffPur_(pSet.getParameter("endEffPur")), - finalized(false), mcPlots_(mc), willFinalize_(wf) + finalized(false), mcPlots_(mc), willFinalize_(wf), ibook_(ibook) { const std::string dir(theExtensionString.substr(1)); @@ -123,7 +123,7 @@ void TrackProbabilityTagPlotter::finalize () // final processing: // produce the misid. vs. eff histograms // - for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(); + for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(ibook_); finalized = true; } diff --git a/Validation/RecoB/plugins/BTagPerformanceAnalyzerMC.cc b/Validation/RecoB/plugins/BTagPerformanceAnalyzerMC.cc index fd6567f63037e..e72f27ad3b346 100644 --- a/Validation/RecoB/plugins/BTagPerformanceAnalyzerMC.cc +++ b/Validation/RecoB/plugins/BTagPerformanceAnalyzerMC.cc @@ -162,14 +162,14 @@ void BTagPerformanceAnalyzerMC::bookHistograms(DQMStore::IBooker & ibook, edm::R // the objects for the differential plots vs. eta,pt for for ( int iEta = iEtaStart ; iEta < iEtaEnd ; iEta++ ) { BTagDifferentialPlot * etaConstDifferentialPlot = new BTagDifferentialPlot - (effBConst, BTagDifferentialPlot::constETA, folderName); + (effBConst, BTagDifferentialPlot::constETA, folderName, ibook); differentialPlotsConstantEta->push_back ( etaConstDifferentialPlot ); } for ( int iPt = iPtStart ; iPt < iPtEnd ; iPt++ ) { // differentialPlots for this pt bin BTagDifferentialPlot * ptConstDifferentialPlot = new BTagDifferentialPlot - (effBConst, BTagDifferentialPlot::constPT, folderName); + (effBConst, BTagDifferentialPlot::constPT, folderName, ibook); differentialPlotsConstantPt->push_back ( ptConstDifferentialPlot ); } }