diff --git a/DQMOffline/Muon/interface/DiMuonHistograms.h b/DQMOffline/Muon/interface/DiMuonHistograms.h index 443d80b82fe5f..f4a86db9cdfe2 100644 --- a/DQMOffline/Muon/interface/DiMuonHistograms.h +++ b/DQMOffline/Muon/interface/DiMuonHistograms.h @@ -13,13 +13,14 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" + #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "DataFormats/MuonReco/interface/Muon.h" @@ -29,7 +30,7 @@ #include "DataFormats/VertexReco/interface/VertexFwd.h" -class DiMuonHistograms : public edm::EDAnalyzer { +class DiMuonHistograms : public DQMEDAnalyzer { public: /* Constructor */ DiMuonHistograms(const edm::ParameterSet& pset); @@ -38,13 +39,11 @@ class DiMuonHistograms : public edm::EDAnalyzer { virtual ~DiMuonHistograms() ; /* Operations */ - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - void analyze (const edm::Event &, const edm::EventSetup&); + void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: MuonServiceProxy* theService; - DQMStore* theDbe; edm::ParameterSet parameters; // Switch for verbosity diff --git a/DQMOffline/Muon/interface/EfficiencyAnalyzer.h b/DQMOffline/Muon/interface/EfficiencyAnalyzer.h index f032cc0bae71f..6466466838c3b 100644 --- a/DQMOffline/Muon/interface/EfficiencyAnalyzer.h +++ b/DQMOffline/Muon/interface/EfficiencyAnalyzer.h @@ -13,13 +13,13 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "DataFormats/MuonReco/interface/Muon.h" @@ -34,7 +34,7 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" -class EfficiencyAnalyzer : public edm::EDAnalyzer { +class EfficiencyAnalyzer : public thread_unsafe::DQMEDAnalyzer { public: /* Constructor */ @@ -44,16 +44,11 @@ class EfficiencyAnalyzer : public edm::EDAnalyzer { virtual ~EfficiencyAnalyzer() ; /* Operations */ - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - - void analyze(const edm::Event & event, const edm::EventSetup& eventSetup); - // void endJob (); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: edm::ParameterSet parameters; - DQMStore* theDbe; MuonServiceProxy *theService; // Switch for verbosity diff --git a/DQMOffline/Muon/interface/EfficiencyPlotter.h b/DQMOffline/Muon/interface/EfficiencyPlotter.h index fc5e66f2260d4..27d2a397225c1 100644 --- a/DQMOffline/Muon/interface/EfficiencyPlotter.h +++ b/DQMOffline/Muon/interface/EfficiencyPlotter.h @@ -3,7 +3,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include +#include "DQMServices/Core/interface/DQMEDHarvester.h" #include "DataFormats/Common/interface/Handle.h" #include #include @@ -23,7 +23,7 @@ #include #include "TH1F.h" -class EfficiencyPlotter: public edm::EDAnalyzer{ +class EfficiencyPlotter: public DQMEDHarvester { public: @@ -35,21 +35,8 @@ class EfficiencyPlotter: public edm::EDAnalyzer{ protected: - /// BeginJob - void beginJob(void); - - /// Analyze - void analyze(const edm::Event& e, const edm::EventSetup& c); - - /// Endjob - void endJob(); - - void beginRun(edm::Run const& run, edm::EventSetup const& eSetup); - void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ; - /// DQM Client Diagnostic - void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); - void endRun(edm::Run const& run, edm::EventSetup const& eSetup); + void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; //performed in the endJob private: diff --git a/DQMOffline/Muon/interface/MuonEnergyDepositAnalyzer.h b/DQMOffline/Muon/interface/MuonEnergyDepositAnalyzer.h index 1d0dfdecdb875..6561f7dd838f7 100644 --- a/DQMOffline/Muon/interface/MuonEnergyDepositAnalyzer.h +++ b/DQMOffline/Muon/interface/MuonEnergyDepositAnalyzer.h @@ -18,18 +18,18 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "DataFormats/MuonReco/interface/Muon.h" #include "DataFormats/MuonReco/interface/MuonFwd.h" #include "DataFormats/MuonReco/interface/MuonEnergy.h" -class MuonEnergyDepositAnalyzer : public edm::EDAnalyzer{ +class MuonEnergyDepositAnalyzer : public DQMEDAnalyzer{ public: /// Constructor @@ -38,23 +38,20 @@ class MuonEnergyDepositAnalyzer : public edm::EDAnalyzer{ /// Destructor virtual ~MuonEnergyDepositAnalyzer(); - /// Inizialize parameters for histo binning - void beginJob(); - void beginRun(const edm::Run& run, const edm::EventSetup& iSetup); - - /// Get the analysis + /* Operations */ void analyze(const edm::Event&, const edm::EventSetup&); - + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + private: // ----------member data --------------------------- - DQMStore* theDbe; edm::ParameterSet parameters; MuonServiceProxy *theService; edm::EDGetTokenT theMuonCollectionLabel_; // Switch for verbosity std::string metname; - + std::string AlgoName; + //histo binning parameters int emNoBin; double emNoMin; diff --git a/DQMOffline/Muon/interface/MuonIdDQM.h b/DQMOffline/Muon/interface/MuonIdDQM.h index 9b36e641d7111..1d09c44ddc847 100644 --- a/DQMOffline/Muon/interface/MuonIdDQM.h +++ b/DQMOffline/Muon/interface/MuonIdDQM.h @@ -33,8 +33,8 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Frameworkfwd.h" @@ -47,20 +47,18 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h" -class MuonIdDQM : public edm::EDAnalyzer { +class MuonIdDQM : public thread_unsafe::DQMEDAnalyzer { public: explicit MuonIdDQM(const edm::ParameterSet&); ~MuonIdDQM(); + /* Operations */ + void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + private: - virtual void beginJob(); - virtual void beginRun(const edm::Run&, const edm::EventSetup&); - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob(); virtual void Fill(MonitorElement*, float); - DQMStore* dbe_; - // ----------member data --------------------------- edm::EDGetTokenT inputMuonCollection_; edm::EDGetTokenT inputDTRecSegment4DCollection_; diff --git a/DQMOffline/Muon/interface/MuonIsolationDQM.h b/DQMOffline/Muon/interface/MuonIsolationDQM.h index de304a0b08c0a..20c2256895f48 100644 --- a/DQMOffline/Muon/interface/MuonIsolationDQM.h +++ b/DQMOffline/Muon/interface/MuonIsolationDQM.h @@ -27,7 +27,7 @@ method, even the simple types. // //Base class -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" //Member types #include "FWCore/Utilities/interface/InputTag.h" @@ -57,7 +57,7 @@ class TProfile; //------------------------------------------ // Class Declaration: MuonIsolationDQM //-------------------------------------- -class MuonIsolationDQM : public edm::EDAnalyzer { +class MuonIsolationDQM : public DQMEDAnalyzer { //---------namespace and typedefs-------------- typedef edm::View::const_iterator MuonIterator; typedef edm::RefToBase MuonBaseRef; @@ -69,13 +69,11 @@ class MuonIsolationDQM : public edm::EDAnalyzer { explicit MuonIsolationDQM(const edm::ParameterSet&); ~MuonIsolationDQM(); - + void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + private: //---------methods---------------------------- - virtual void beginJob(void) ; - virtual void beginRun(void) ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; void InitStatics(); void RecordData(const reco::Muon& muon);//Fills Histograms with info from single muo // void doPFIsoPlots(MuonIterator muon); //Fills Histograms with PF info from single muo (only for GLB) @@ -131,9 +129,6 @@ class MuonIsolationDQM : public edm::EDAnalyzer { std::vector axis_titles_NVtxs; //---------------Dynamic Variables--------------------- - //MonitorElement - DQMStore* dbe; - //The Data double theData[NUM_VARS]; double theData2D[NUM_VARS_2D]; diff --git a/DQMOffline/Muon/interface/MuonKinVsEtaAnalyzer.h b/DQMOffline/Muon/interface/MuonKinVsEtaAnalyzer.h index 54d9841650ed4..5f73f1a734fef 100644 --- a/DQMOffline/Muon/interface/MuonKinVsEtaAnalyzer.h +++ b/DQMOffline/Muon/interface/MuonKinVsEtaAnalyzer.h @@ -15,9 +15,9 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/MuonReco/interface/Muon.h" @@ -31,7 +31,7 @@ #include "DataFormats/MuonReco/interface/MuonSelectors.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" -class MuonKinVsEtaAnalyzer : public edm::EDAnalyzer { +class MuonKinVsEtaAnalyzer : public thread_unsafe::DQMEDAnalyzer { public: /// Constructor @@ -39,14 +39,10 @@ class MuonKinVsEtaAnalyzer : public edm::EDAnalyzer { /// Destructor ~MuonKinVsEtaAnalyzer(); - - /// Initialize parameters for histo binning - void beginJob(void); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - /// Get the analysis void analyze(const edm::Event&, const edm::EventSetup&); - + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + private: // ----------member data --------------------------- diff --git a/DQMOffline/Muon/interface/MuonPFAnalyzer.h b/DQMOffline/Muon/interface/MuonPFAnalyzer.h index a726ac041ea96..69093eb960210 100644 --- a/DQMOffline/Muon/interface/MuonPFAnalyzer.h +++ b/DQMOffline/Muon/interface/MuonPFAnalyzer.h @@ -11,7 +11,7 @@ //Base class -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DQMServices/Core/interface/DQMStore.h" @@ -31,7 +31,7 @@ #include #include -class MuonPFAnalyzer : public edm::EDAnalyzer { +class MuonPFAnalyzer : public DQMEDAnalyzer { public: @@ -44,16 +44,13 @@ class MuonPFAnalyzer : public edm::EDAnalyzer { /// Destructor ~MuonPFAnalyzer(); - /// Initialize an book plots - virtual void beginRun(edm::Run const &, edm::EventSetup const &); - - /// Perform the PF - TUNEP muon analysis - virtual void analyze(const edm::Event&, const edm::EventSetup&); + void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // Book histos for a given group of plots (e.g. for Tight TUNEP muons) - void bookHistos(const std::string & group); + void bookHistos(DQMStore::IBooker &, const std::string &); // Get a specific plot for a given group MonitorElement* getPlot(const std::string & group, const std::string & type); @@ -89,7 +86,6 @@ class MuonPFAnalyzer : public edm::EDAnalyzer { std::vector theMuonKinds; - DQMStore *theDbe; std::map > thePlots; RecoGenCollection theRecoGen; diff --git a/DQMOffline/Muon/interface/MuonRecoAnalyzer.h b/DQMOffline/Muon/interface/MuonRecoAnalyzer.h index 57c40dd515eb9..f1196e5c4242a 100644 --- a/DQMOffline/Muon/interface/MuonRecoAnalyzer.h +++ b/DQMOffline/Muon/interface/MuonRecoAnalyzer.h @@ -11,7 +11,6 @@ #include #include #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/Event.h" @@ -20,13 +19,14 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "DataFormats/MuonReco/interface/Muon.h" #include "DataFormats/MuonReco/interface/MuonFwd.h" -class MuonRecoAnalyzer : public edm::EDAnalyzer { +class MuonRecoAnalyzer : public thread_unsafe::DQMEDAnalyzer { public: /// Constructor @@ -36,19 +36,15 @@ class MuonRecoAnalyzer : public edm::EDAnalyzer { virtual ~MuonRecoAnalyzer(); /// Inizialize parameters for histo binning - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - - /// Get the analysis void analyze(const edm::Event&, const edm::EventSetup&); - + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + //calculate residual & pull: void GetRes( reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull); private: // ----------member data --------------------------- - DQMStore *theDbe; - MuonServiceProxy *theService; + MuonServiceProxy *theService; edm::ParameterSet parameters; edm::EDGetTokenT theMuonCollectionLabel_; diff --git a/DQMOffline/Muon/interface/MuonRecoOneHLT.h b/DQMOffline/Muon/interface/MuonRecoOneHLT.h index 32a081dc2ceb6..47c355b9333cf 100644 --- a/DQMOffline/Muon/interface/MuonRecoOneHLT.h +++ b/DQMOffline/Muon/interface/MuonRecoOneHLT.h @@ -11,6 +11,7 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "DataFormats/Common/interface/TriggerResults.h" @@ -18,7 +19,6 @@ #include "DataFormats/HLTReco/interface/TriggerObject.h" #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h" #include "DataFormats/Common/interface/Handle.h" @@ -44,27 +44,20 @@ #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -class MuonRecoOneHLT : public edm::EDAnalyzer { //MuonAnalyzerBase { +class MuonRecoOneHLT : public thread_unsafe::DQMEDAnalyzer { public: /// Constructor - MuonRecoOneHLT(const edm::ParameterSet&); //, MuonServiceProxy *theService); + MuonRecoOneHLT(const edm::ParameterSet&); /// Destructor ~MuonRecoOneHLT(); - /// Inizialize parameters for histo binning - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - - /// Get the analysis - // void analyze(const edm::Event&, const edm::EventSetup&, const reco::Muon&, const edm::TriggerResults&); - // void analyze(const edm::Event&, const edm::EventSetup&, const edm::TriggerResults&, const reco::Vertex&); void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // ----------member data --------------------------- - DQMStore* dbe; edm::ParameterSet parameters; MuonServiceProxy *theService; diff --git a/DQMOffline/Muon/interface/MuonRecoTest.h b/DQMOffline/Muon/interface/MuonRecoTest.h index bdac36627051c..1961e25c032bc 100644 --- a/DQMOffline/Muon/interface/MuonRecoTest.h +++ b/DQMOffline/Muon/interface/MuonRecoTest.h @@ -10,10 +10,7 @@ * \author G. Mila - INFN Torino * */ - - #include "FWCore/Framework/interface/Frameworkfwd.h" -#include #include "DataFormats/Common/interface/Handle.h" #include #include @@ -23,6 +20,8 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDHarvester.h" + #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/Run.h" @@ -34,7 +33,7 @@ -class MuonRecoTest: public edm::EDAnalyzer{ +class MuonRecoTest: public DQMEDHarvester{ public: @@ -42,26 +41,12 @@ class MuonRecoTest: public edm::EDAnalyzer{ MuonRecoTest(const edm::ParameterSet& ps); /// Destructor - virtual ~MuonRecoTest(); + virtual ~MuonRecoTest() {}; protected: - /// BeginJob - void beginJob(void); - - /// Analyze - void analyze(const edm::Event& e, const edm::EventSetup& c); - /// Endjob - void endJob(); - - void beginRun(edm::Run const& run, edm::EventSetup const& eSetup); - void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ; - - /// DQM Client Diagnostic - void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); - void endRun(edm::Run const& run, edm::EventSetup const& eSetup); - + void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; //performed in the endJob private: @@ -72,11 +57,10 @@ class MuonRecoTest: public edm::EDAnalyzer{ int run; // Switch for verbosity std::string metname; - - DQMStore* theDbe; edm::ParameterSet parameters; //histo binning parameters + std::string EfficiencyCriterionName; int etaBin; double etaMin; double etaMax; diff --git a/DQMOffline/Muon/interface/MuonSeedsAnalyzer.h b/DQMOffline/Muon/interface/MuonSeedsAnalyzer.h index b768fb6d77e6e..7314d3f3ef7b5 100644 --- a/DQMOffline/Muon/interface/MuonSeedsAnalyzer.h +++ b/DQMOffline/Muon/interface/MuonSeedsAnalyzer.h @@ -17,7 +17,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" @@ -29,7 +29,7 @@ class TrajectoryStateOnSurface; class TrajectorySeed; class MuonServiceProxy; -class MuonSeedsAnalyzer : public edm::EDAnalyzer { +class MuonSeedsAnalyzer : public DQMEDAnalyzer { public: /// Constructor @@ -38,17 +38,9 @@ class MuonSeedsAnalyzer : public edm::EDAnalyzer { /// Destructor virtual ~MuonSeedsAnalyzer(); - /// Inizialize parameters for histo binning - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - - /// Get the analysis void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - /// Get the TrajectoryStateOnSurface - /// TrajectoryStateOnSurface getSeedTSOS(const TrajectorySeed& seed); - - private: // ----------member data --------------------------- DQMStore *theDbe; diff --git a/DQMOffline/Muon/interface/MuonTestSummary.h b/DQMOffline/Muon/interface/MuonTestSummary.h index de516e4eedc76..84bbfe1b39322 100644 --- a/DQMOffline/Muon/interface/MuonTestSummary.h +++ b/DQMOffline/Muon/interface/MuonTestSummary.h @@ -23,13 +23,15 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDHarvester.h" + #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/Run.h" #include #include -class MuonTestSummary: public edm::EDAnalyzer{ +class MuonTestSummary: public DQMEDHarvester{ public: @@ -41,27 +43,16 @@ class MuonTestSummary: public edm::EDAnalyzer{ protected: - /// BeginJob - void beginJob(void); - - /// Analyze - void analyze(const edm::Event& e, const edm::EventSetup& c){} - - /// Histograms initialisation - void beginRun(edm::Run const& run, edm::EventSetup const& eSetup); - void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); - - /// Diagnostic - void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); - void endRun(edm::Run const& run, edm::EventSetup const& eSetup); - + void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; //performed in the endJob + /// test operations - void doKinematicsTests(std::string muonType, int bin); - void doResidualsTests(std::string type, std::string parameter, int bin); - void doMuonIDTests(); - void doEnergyTests(std::string nameHisto, std::string muonType, int bin); - void doMultiplicityTests(); - void ResidualCheck(std::string muType, const std::vector& resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err); + void doKinematicsTests(DQMStore::IGetter &, std::string, int); + void doResidualsTests(DQMStore::IGetter &, std::string, std::string, int); + + void doMuonIDTests(DQMStore::IGetter &); + void doEnergyTests(DQMStore::IGetter &, std::string nameHisto, std::string muonType, int bin); + void doMultiplicityTests(DQMStore::IGetter &); + void ResidualCheck(DQMStore::IGetter &, std::string muType, const std::vector& resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err); void GaussFit(std::string type, std::string parameter, MonitorElement * Histo, float &mean, float &mean_err, float &sigma, float &sigma_err); diff --git a/DQMOffline/Muon/interface/MuonTrackResidualsTest.h b/DQMOffline/Muon/interface/MuonTrackResidualsTest.h index a74cf801966b6..c4e9244e6f44a 100644 --- a/DQMOffline/Muon/interface/MuonTrackResidualsTest.h +++ b/DQMOffline/Muon/interface/MuonTrackResidualsTest.h @@ -13,7 +13,6 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include #include "DataFormats/Common/interface/Handle.h" #include #include @@ -23,6 +22,8 @@ #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDHarvester.h" + #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/Run.h" @@ -32,9 +33,7 @@ #include #include - - -class MuonTrackResidualsTest: public edm::EDAnalyzer{ +class MuonTrackResidualsTest: public DQMEDHarvester { public: @@ -42,41 +41,24 @@ class MuonTrackResidualsTest: public edm::EDAnalyzer{ MuonTrackResidualsTest(const edm::ParameterSet& ps); /// Destructor - virtual ~MuonTrackResidualsTest(); + virtual ~MuonTrackResidualsTest() {}; protected: - - /// BeginJob - void beginJob(void); - - /// Analyze - void analyze(const edm::Event& e, const edm::EventSetup& c); - - /// Endjob - void endJob(); - - void beginRun(edm::Run const& run, edm::EventSetup const& eSetup); - void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ; - - /// DQM Client Diagnostic - void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); - void endRun(edm::Run const& run, edm::EventSetup const& eSetup); - - + + void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; //performed in the endJob + private: - // counters - int nevents; - unsigned int nLumiSegs; - int prescaleFactor; - int run; // Switch for verbosity std::string metname; - - DQMStore* theDbe; edm::ParameterSet parameters; // source residuals histograms + int prescaleFactor; + std::string GaussianCriterionName; + std::string MeanCriterionName; + std::string SigmaCriterionName; + std::map< std::string, std::vector > histoNames; // test histograms diff --git a/DQMOffline/Muon/interface/SegmentTrackAnalyzer.h b/DQMOffline/Muon/interface/SegmentTrackAnalyzer.h index ae1c11ecc3ec5..a866b6d73b5ca 100644 --- a/DQMOffline/Muon/interface/SegmentTrackAnalyzer.h +++ b/DQMOffline/Muon/interface/SegmentTrackAnalyzer.h @@ -17,9 +17,9 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "RecoMuon/TrackingTools/interface/SegmentsTrackAssociator.h" #include "DataFormats/TrackReco/interface/Track.h" @@ -29,7 +29,7 @@ class MuonServiceProxy; -class SegmentTrackAnalyzer : public edm::EDAnalyzer { +class SegmentTrackAnalyzer : public thread_unsafe::DQMEDAnalyzer { public: /// Constructor @@ -38,25 +38,31 @@ class SegmentTrackAnalyzer : public edm::EDAnalyzer { /// Destructor virtual ~SegmentTrackAnalyzer() {}; - /// Inizialize parameters for histo binning - void beginJob(); - void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); - - /// Get the analysis void analyze(const edm::Event&, const edm::EventSetup&); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; private: // ----------member data --------------------------- - DQMStore *theDbe; MuonServiceProxy *theService; edm::ParameterSet parameters; edm::EDGetTokenT theMuTrackCollectionLabel_; // Switch for verbosity std::string metname; + std::string trackCollection; // Find the segments associated to the track SegmentsTrackAssociator* theSegmentsAssociator; + int etaBin; + double etaMin; + double etaMax; + int phiBin; + double phiMin; + double phiMax; + int ptBin; + double ptMin; + double ptMax; + // the histos MonitorElement* hitsNotUsed; MonitorElement* hitsNotUsedPercentual; diff --git a/DQMOffline/Muon/src/DiMuonHistograms.cc b/DQMOffline/Muon/src/DiMuonHistograms.cc index d4e7dfd5814ec..3153cc3879ea2 100644 --- a/DQMOffline/Muon/src/DiMuonHistograms.cc +++ b/DQMOffline/Muon/src/DiMuonHistograms.cc @@ -34,27 +34,11 @@ DiMuonHistograms::DiMuonHistograms(const edm::ParameterSet& pSet){ // initialise parameters: parameters = pSet; - theDbe = edm::Service().operator->(); // declare consumes: theMuonCollectionLabel_ = consumes (parameters.getParameter("MuonCollection")); theBeamSpotLabel_ = mayConsume (parameters.getParameter("BeamSpotLabel")); theVertexLabel_ = consumes(parameters.getParameter("VertexLabel")); -} - -DiMuonHistograms::~DiMuonHistograms() { } - -void DiMuonHistograms::beginJob(){ - metname = "DiMuonhistograms"; - LogTrace(metname)<<"[DiMuonHistograms] beginJob()"; - -} - -void DiMuonHistograms::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { - LogTrace(metname)<<"[DiMuonHistograms] beginRun()"; - - theDbe->cd(); - theDbe->setCurrentFolder("Muons/DiMuonHistograms"); etaBin = parameters.getParameter("etaBin"); etaBBin = parameters.getParameter("etaBBin"); @@ -70,25 +54,36 @@ void DiMuonHistograms::beginRun(const edm::Run& iRun, const edm::EventSetup& iSe HighMassMin = parameters.getParameter("HighMassMin"); HighMassMax = parameters.getParameter("HighMassMax"); +} + +DiMuonHistograms::~DiMuonHistograms() { } + +void DiMuonHistograms::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ + + ibooker.cd(); + ibooker.setCurrentFolder("Muons/DiMuonHistograms"); + int nBin = 0; for (unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){ if (iEtaRegion==0) { EtaName = ""; nBin = etaBin;} if (iEtaRegion==1) { EtaName = "_Barrel"; nBin = etaBBin;} if (iEtaRegion==2) { EtaName = "_EndCap"; nBin = etaEBin;} - GlbGlbMuon_LM.push_back(theDbe->book1D("GlbGlbMuon_LM"+EtaName,"InvMass_{GLB,GLB}"+EtaName,nBin, LowMassMin, LowMassMax)); - TrkTrkMuon_LM.push_back(theDbe->book1D("TrkTrkMuon_LM"+EtaName,"InvMass_{TRK,TRK}"+EtaName,nBin, LowMassMin, LowMassMax)); - StaTrkMuon_LM.push_back(theDbe->book1D("StaTrkMuon_LM"+EtaName,"InvMass_{STA,TRK}"+EtaName,nBin, LowMassMin, LowMassMax)); + GlbGlbMuon_LM.push_back(ibooker.book1D("GlbGlbMuon_LM"+EtaName,"InvMass_{GLB,GLB}"+EtaName,nBin, LowMassMin, LowMassMax)); + TrkTrkMuon_LM.push_back(ibooker.book1D("TrkTrkMuon_LM"+EtaName,"InvMass_{TRK,TRK}"+EtaName,nBin, LowMassMin, LowMassMax)); + StaTrkMuon_LM.push_back(ibooker.book1D("StaTrkMuon_LM"+EtaName,"InvMass_{STA,TRK}"+EtaName,nBin, LowMassMin, LowMassMax)); - GlbGlbMuon_HM.push_back(theDbe->book1D("GlbGlbMuon_HM"+EtaName,"InvMass_{GLB,GLB}"+EtaName,nBin, HighMassMin, HighMassMax)); - TrkTrkMuon_HM.push_back(theDbe->book1D("TrkTrkMuon_HM"+EtaName,"InvMass_{TRK,TRK}"+EtaName,nBin, HighMassMin, HighMassMax)); - StaTrkMuon_HM.push_back(theDbe->book1D("StaTrkMuon_HM"+EtaName,"InvMass_{STA,TRK}"+EtaName,nBin, HighMassMin, HighMassMax)); + GlbGlbMuon_HM.push_back(ibooker.book1D("GlbGlbMuon_HM"+EtaName,"InvMass_{GLB,GLB}"+EtaName,nBin, HighMassMin, HighMassMax)); + TrkTrkMuon_HM.push_back(ibooker.book1D("TrkTrkMuon_HM"+EtaName,"InvMass_{TRK,TRK}"+EtaName,nBin, HighMassMin, HighMassMax)); + StaTrkMuon_HM.push_back(ibooker.book1D("StaTrkMuon_HM"+EtaName,"InvMass_{STA,TRK}"+EtaName,nBin, HighMassMin, HighMassMax)); // arround the Z peak - TightTightMuon.push_back(theDbe->book1D("TightTightMuon"+EtaName,"InvMass_{Tight,Tight}"+EtaName,nBin, 55.0, 125.0)); + TightTightMuon.push_back(ibooker.book1D("TightTightMuon"+EtaName,"InvMass_{Tight,Tight}"+EtaName,nBin, 55.0, 125.0)); // low-mass resonances - SoftSoftMuon.push_back(theDbe->book1D("SoftSoftMuon"+EtaName,"InvMass_{Soft,Soft}"+EtaName,nBin, 5.0, 55.0)); + SoftSoftMuon.push_back(ibooker.book1D("SoftSoftMuon"+EtaName,"InvMass_{Soft,Soft}"+EtaName,nBin, 5.0, 55.0)); } } diff --git a/DQMOffline/Muon/src/EfficiencyAnalyzer.cc b/DQMOffline/Muon/src/EfficiencyAnalyzer.cc index bdfc5b1a546d4..876e3884b9758 100644 --- a/DQMOffline/Muon/src/EfficiencyAnalyzer.cc +++ b/DQMOffline/Muon/src/EfficiencyAnalyzer.cc @@ -30,7 +30,6 @@ EfficiencyAnalyzer::EfficiencyAnalyzer(const edm::ParameterSet& pSet){ parameters = pSet; theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); - theDbe = edm::Service().operator->(); // DATA theMuonCollectionLabel_ = consumes (parameters.getParameter("MuonCollection")); @@ -38,23 +37,6 @@ EfficiencyAnalyzer::EfficiencyAnalyzer(const edm::ParameterSet& pSet){ theVertexLabel_ = consumes(parameters.getParameter("VertexLabel")); theBeamSpotLabel_ = mayConsume (parameters.getParameter("BeamSpotLabel")); -} - -EfficiencyAnalyzer::~EfficiencyAnalyzer() { - delete theService; -} - -void EfficiencyAnalyzer::beginJob(){ - metname = "EfficiencyAnalyzer"; - LogTrace(metname)<<"[EfficiencyAnalyzer] Parameters initialization"; -} - -void EfficiencyAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - metname = "EfficiencyAnalyzer"; - - theDbe->cd(); - theDbe->setCurrentFolder("Muons/EfficiencyAnalyzer"); - //Vertex requirements doPVCheck_ = parameters.getParameter("doPrimaryVertexCheck"); @@ -74,55 +56,67 @@ void EfficiencyAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& i vtxMin_ = parameters.getParameter("vtxMin"); vtxMax_ = parameters.getParameter("vtxMax"); - test_TightMu_Minv = theDbe->book1D("test_TightMu_Minv" ,"Minv",50,70,110); +} - h_allProbes_pt = theDbe->book1D("allProbes_pt","All Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_EB_pt = theDbe->book1D("allProbes_EB_pt","Barrel: all Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_EE_pt = theDbe->book1D("allProbes_EE_pt","Endcap: all Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_eta = theDbe->book1D("allProbes_eta","All Probes Eta", etaBin_, etaMin_, etaMax_); - h_allProbes_hp_eta = theDbe->book1D("allProbes_hp_eta","High Pt all Probes Eta", etaBin_, etaMin_, etaMax_); - h_allProbes_phi = theDbe->book1D("allProbes_phi","All Probes Phi", phiBin_, phiMin_, phiMax_); +EfficiencyAnalyzer::~EfficiencyAnalyzer() { + delete theService; +} + +void EfficiencyAnalyzer::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ + + ibooker.cd(); + ibooker.setCurrentFolder("Muons/EfficiencyAnalyzer"); + + + test_TightMu_Minv = ibooker.book1D("test_TightMu_Minv" ,"Minv",50,70,110); + + h_allProbes_pt = ibooker.book1D("allProbes_pt","All Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_EB_pt = ibooker.book1D("allProbes_EB_pt","Barrel: all Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_EE_pt = ibooker.book1D("allProbes_EE_pt","Endcap: all Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_eta = ibooker.book1D("allProbes_eta","All Probes Eta", etaBin_, etaMin_, etaMax_); + h_allProbes_hp_eta = ibooker.book1D("allProbes_hp_eta","High Pt all Probes Eta", etaBin_, etaMin_, etaMax_); + h_allProbes_phi = ibooker.book1D("allProbes_phi","All Probes Phi", phiBin_, phiMin_, phiMax_); - h_allProbes_TightMu_pt = theDbe->book1D("allProbes_TightMu_pt","All TightMu Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_EB_TightMu_pt = theDbe->book1D("allProbes_EB_TightMu_pt","Barrel: all TightMu Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_EE_TightMu_pt = theDbe->book1D("allProbes_EE_TightMu_pt","Endcap: all TightMu Probes Pt", ptBin_, ptMin_, ptMax_); - h_allProbes_TightMu_nVtx = theDbe->book1D("allProbes_TightMu_nVtx","All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); - h_allProbes_EB_TightMu_nVtx = theDbe->book1D("allProbes_EB_TightMu_nVtx","Barrel: All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); - h_allProbes_EE_TightMu_nVtx = theDbe->book1D("allProbes_EE_TightMu_nVtx","Endcap: All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); - - h_passProbes_TightMu_pt = theDbe->book1D("passProbes_TightMu_pt","TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); - h_passProbes_TightMu_EB_pt = theDbe->book1D("passProbes_TightMu_EB_pt","Barrel: TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); - h_passProbes_TightMu_EE_pt = theDbe->book1D("passProbes_TightMu_EE_pt","Endcap: TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); - h_passProbes_TightMu_eta = theDbe->book1D("passProbes_TightMu_eta","TightMu Passing Probes #eta", etaBin_, etaMin_, etaMax_); - h_passProbes_TightMu_hp_eta = theDbe->book1D("passProbes_TightMu_hp_eta","High Pt TightMu Passing Probes #eta", etaBin_, etaMin_, etaMax_); - h_passProbes_TightMu_phi = theDbe->book1D("passProbes_TightMu_phi","TightMu Passing Probes #phi", phiBin_, phiMin_, phiMax_); - - h_passProbes_detIsoTightMu_pt = theDbe->book1D("passProbes_detIsoTightMu_pt","detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - h_passProbes_EB_detIsoTightMu_pt = theDbe->book1D("passProbes_EB_detIsoTightMu_pt","Barrel: detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - h_passProbes_EE_detIsoTightMu_pt = theDbe->book1D("passProbes_EE_detIsoTightMu_pt","Endcap: detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - - h_passProbes_pfIsoTightMu_pt = theDbe->book1D("passProbes_pfIsoTightMu_pt","pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - h_passProbes_EB_pfIsoTightMu_pt = theDbe->book1D("passProbes_EB_pfIsoTightMu_pt","Barrel: pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - h_passProbes_EE_pfIsoTightMu_pt = theDbe->book1D("passProbes_EE_pfIsoTightMu_pt","Endcap: pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); - - h_passProbes_detIsoTightMu_nVtx = theDbe->book1D("passProbes_detIsoTightMu_nVtx", "detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_pfIsoTightMu_nVtx = theDbe->book1D("passProbes_pfIsoTightMu_nVtx", "pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_EB_detIsoTightMu_nVtx = theDbe->book1D("passProbes_EB_detIsoTightMu_nVtx","Barrel: detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_EE_detIsoTightMu_nVtx = theDbe->book1D("passProbes_EE_detIsoTightMu_nVtx","Endcap: detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_EB_pfIsoTightMu_nVtx = theDbe->book1D("passProbes_EB_pfIsoTightMu_nVtx", "Barrel: pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_EE_pfIsoTightMu_nVtx = theDbe->book1D("passProbes_EE_pfIsoTightMu_nVtx", "Endcap: pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); + h_allProbes_TightMu_pt = ibooker.book1D("allProbes_TightMu_pt","All TightMu Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_EB_TightMu_pt = ibooker.book1D("allProbes_EB_TightMu_pt","Barrel: all TightMu Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_EE_TightMu_pt = ibooker.book1D("allProbes_EE_TightMu_pt","Endcap: all TightMu Probes Pt", ptBin_, ptMin_, ptMax_); + h_allProbes_TightMu_nVtx = ibooker.book1D("allProbes_TightMu_nVtx","All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); + h_allProbes_EB_TightMu_nVtx = ibooker.book1D("allProbes_EB_TightMu_nVtx","Barrel: All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); + h_allProbes_EE_TightMu_nVtx = ibooker.book1D("allProbes_EE_TightMu_nVtx","Endcap: All Probes (TightMu) nVtx", vtxBin_, vtxMin_, vtxMax_); + + h_passProbes_TightMu_pt = ibooker.book1D("passProbes_TightMu_pt","TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); + h_passProbes_TightMu_EB_pt = ibooker.book1D("passProbes_TightMu_EB_pt","Barrel: TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); + h_passProbes_TightMu_EE_pt = ibooker.book1D("passProbes_TightMu_EE_pt","Endcap: TightMu Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ ); + h_passProbes_TightMu_eta = ibooker.book1D("passProbes_TightMu_eta","TightMu Passing Probes #eta", etaBin_, etaMin_, etaMax_); + h_passProbes_TightMu_hp_eta = ibooker.book1D("passProbes_TightMu_hp_eta","High Pt TightMu Passing Probes #eta", etaBin_, etaMin_, etaMax_); + h_passProbes_TightMu_phi = ibooker.book1D("passProbes_TightMu_phi","TightMu Passing Probes #phi", phiBin_, phiMin_, phiMax_); + + h_passProbes_detIsoTightMu_pt = ibooker.book1D("passProbes_detIsoTightMu_pt","detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + h_passProbes_EB_detIsoTightMu_pt = ibooker.book1D("passProbes_EB_detIsoTightMu_pt","Barrel: detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + h_passProbes_EE_detIsoTightMu_pt = ibooker.book1D("passProbes_EE_detIsoTightMu_pt","Endcap: detIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + + h_passProbes_pfIsoTightMu_pt = ibooker.book1D("passProbes_pfIsoTightMu_pt","pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + h_passProbes_EB_pfIsoTightMu_pt = ibooker.book1D("passProbes_EB_pfIsoTightMu_pt","Barrel: pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + h_passProbes_EE_pfIsoTightMu_pt = ibooker.book1D("passProbes_EE_pfIsoTightMu_pt","Endcap: pfIsoTightMu Passing Probes Pt", ptBin_, ptMin_, ptMax_); + + h_passProbes_detIsoTightMu_nVtx = ibooker.book1D("passProbes_detIsoTightMu_nVtx", "detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_pfIsoTightMu_nVtx = ibooker.book1D("passProbes_pfIsoTightMu_nVtx", "pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_EB_detIsoTightMu_nVtx = ibooker.book1D("passProbes_EB_detIsoTightMu_nVtx","Barrel: detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_EE_detIsoTightMu_nVtx = ibooker.book1D("passProbes_EE_detIsoTightMu_nVtx","Endcap: detIsoTightMu Passing Probes nVtx (R03)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_EB_pfIsoTightMu_nVtx = ibooker.book1D("passProbes_EB_pfIsoTightMu_nVtx", "Barrel: pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_EE_pfIsoTightMu_nVtx = ibooker.book1D("passProbes_EE_pfIsoTightMu_nVtx", "Endcap: pfIsoTightMu Passing Probes nVtx (R04)", vtxBin_, vtxMin_, vtxMax_); // Apply deltaBeta PU corrections to the PF isolation eficiencies. - h_passProbes_pfIsodBTightMu_pt = theDbe->book1D("passProbes_pfIsodBTightMu_pt","pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); - h_passProbes_EB_pfIsodBTightMu_pt = theDbe->book1D("passProbes_EB_pfIsodBTightMu_pt","Barrel: pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); - h_passProbes_EE_pfIsodBTightMu_pt = theDbe->book1D("passProbes_EE_pfIsodBTightMu_pt","Endcap: pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); - h_passProbes_pfIsodBTightMu_nVtx = theDbe->book1D("passProbes_pfIsodBTightMu_nVtx", "pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); -h_passProbes_EB_pfIsodBTightMu_nVtx = theDbe->book1D("passProbes_EB_pfIsodBTightMu_nVtx", "Barrel: pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); - h_passProbes_EE_pfIsodBTightMu_nVtx = theDbe->book1D("passProbes_EE_pfIsodBTightMu_nVtx", "Endcap: pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); - - + h_passProbes_pfIsodBTightMu_pt = ibooker.book1D("passProbes_pfIsodBTightMu_pt","pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); + h_passProbes_EB_pfIsodBTightMu_pt = ibooker.book1D("passProbes_EB_pfIsodBTightMu_pt","Barrel: pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); + h_passProbes_EE_pfIsodBTightMu_pt = ibooker.book1D("passProbes_EE_pfIsodBTightMu_pt","Endcap: pfIsoTightMu Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_); + h_passProbes_pfIsodBTightMu_nVtx = ibooker.book1D("passProbes_pfIsodBTightMu_nVtx", "pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); +h_passProbes_EB_pfIsodBTightMu_nVtx = ibooker.book1D("passProbes_EB_pfIsodBTightMu_nVtx", "Barrel: pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); + h_passProbes_EE_pfIsodBTightMu_nVtx = ibooker.book1D("passProbes_EE_pfIsodBTightMu_nVtx", "Endcap: pfIsoTightMu Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_); #ifdef DEBUG cout << "[EfficiencyAnalyzer] Parameters initialization DONE" <().operator->(); -} -EfficiencyPlotter::~EfficiencyPlotter(){} -void EfficiencyPlotter::beginJob(void){ -#ifdef DEBUG - cout << "EfficiencyPlotter::beginJob " << endl; -#endif - - theDbe->setCurrentFolder("Muons/EfficiencyAnalyzer"); - - metname = "EfficiencyAnalyzer"; - LogTrace(metname)<<"[EfficiencyPlotter] beginJob: Parameters initialization"; - - // efficiency plot etaBin = parameters.getParameter("etaBin"); etaMin = parameters.getParameter("etaMin"); etaMax = parameters.getParameter("etaMax"); @@ -62,31 +48,39 @@ void EfficiencyPlotter::beginJob(void){ vtxMin = parameters.getParameter("vtxMin"); vtxMax = parameters.getParameter("vtxMax"); - h_eff_eta_TightMu = theDbe->book1D("Eff_eta_TightMu", "TightMu Eff. vs #eta", etaBin, etaMin, etaMax); - h_eff_hp_eta_TightMu = theDbe->book1D("Eff_hp_eta_TightMu", "High Pt TightMu Eff. vs #eta", etaBin, etaMin, etaMax); - h_eff_phi_TightMu = theDbe->book1D("Eff_phi_TightMu", "TightMu Eff. vs #phi", phiBin, phiMin, phiMax); - h_eff_pt_TightMu = theDbe->book1D("Eff_pt_TightMu", "TightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EB_TightMu = theDbe->book1D("Eff_pt_EB_TightMu", "Barrel: TightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EE_TightMu = theDbe->book1D("Eff_pt_EE_TightMu", "Endcap: TightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_detIsoTightMu = theDbe->book1D("Eff_pt_detIsoTightMu", "detIsoTightMu Efficiency vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EB_detIsoTightMu = theDbe->book1D("Eff_pt_EB_detIsoTightMu", "Barrel: detIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EE_detIsoTightMu = theDbe->book1D("Eff_pt_EE_detIsoTightMu", "Endcap: detIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_pfIsoTightMu = theDbe->book1D("Eff_pt_pfIsoTightMu", "pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EB_pfIsoTightMu = theDbe->book1D("Eff_pt_EB_pfIsoTightMu", "Barrel: pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EE_pfIsoTightMu = theDbe->book1D("Eff_pt_EE_pfIsoTightMu", "Endcap: pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_vtx_detIsoTightMu = theDbe->book1D("Eff_vtx_detIsoTightMu", "detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_pfIsoTightMu = theDbe->book1D("Eff_vtx_pfIsoTightMu", "pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EB_detIsoTightMu = theDbe->book1D("Eff_vtx_EB_detIsoTightMu", "Barrel: detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EB_pfIsoTightMu = theDbe->book1D("Eff_vtx_EB_pfIsoTightMu", "Barrel: pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EE_detIsoTightMu = theDbe->book1D("Eff_vtx_EE_detIsoTightMu", "Endcap: detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EE_pfIsoTightMu = theDbe->book1D("Eff_vtx_EE_pfIsoTightMu", "Endcap: pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - - h_eff_pt_pfIsodBTightMu = theDbe->book1D("Eff_pt_pfIsodBTightMu", "pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EB_pfIsodBTightMu = theDbe->book1D("Eff_pt_EB_pfIsodBTightMu", "Barrel: pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_pt_EE_pfIsodBTightMu = theDbe->book1D("Eff_pt_EE_pfIsodBTightMu", "Endcap: pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); - h_eff_vtx_pfIsodBTightMu = theDbe->book1D("Eff_vtx_pfIsodBTightMu", "pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EB_pfIsodBTightMu = theDbe->book1D("Eff_vtx_EB_pfIsodBTightMu", "Barrel: pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); - h_eff_vtx_EE_pfIsodBTightMu = theDbe->book1D("Eff_vtx_EE_pfIsodBTightMu", "Endcap: pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); +} +EfficiencyPlotter::~EfficiencyPlotter(){} + +void EfficiencyPlotter::dqmEndJob(DQMStore::IBooker & ibooker, DQMStore::IGetter & igetter) { + + ibooker.setCurrentFolder("Muons/EfficiencyAnalyzer"); + + // efficiency plot + h_eff_eta_TightMu = ibooker.book1D("Eff_eta_TightMu", "TightMu Eff. vs #eta", etaBin, etaMin, etaMax); + h_eff_hp_eta_TightMu = ibooker.book1D("Eff_hp_eta_TightMu", "High Pt TightMu Eff. vs #eta", etaBin, etaMin, etaMax); + h_eff_phi_TightMu = ibooker.book1D("Eff_phi_TightMu", "TightMu Eff. vs #phi", phiBin, phiMin, phiMax); + h_eff_pt_TightMu = ibooker.book1D("Eff_pt_TightMu", "TightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EB_TightMu = ibooker.book1D("Eff_pt_EB_TightMu", "Barrel: TightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EE_TightMu = ibooker.book1D("Eff_pt_EE_TightMu", "Endcap: TightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_detIsoTightMu = ibooker.book1D("Eff_pt_detIsoTightMu", "detIsoTightMu Efficiency vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EB_detIsoTightMu = ibooker.book1D("Eff_pt_EB_detIsoTightMu", "Barrel: detIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EE_detIsoTightMu = ibooker.book1D("Eff_pt_EE_detIsoTightMu", "Endcap: detIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_pfIsoTightMu = ibooker.book1D("Eff_pt_pfIsoTightMu", "pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EB_pfIsoTightMu = ibooker.book1D("Eff_pt_EB_pfIsoTightMu", "Barrel: pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EE_pfIsoTightMu = ibooker.book1D("Eff_pt_EE_pfIsoTightMu", "Endcap: pfIsoTightMu Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_vtx_detIsoTightMu = ibooker.book1D("Eff_vtx_detIsoTightMu", "detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_pfIsoTightMu = ibooker.book1D("Eff_vtx_pfIsoTightMu", "pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EB_detIsoTightMu = ibooker.book1D("Eff_vtx_EB_detIsoTightMu", "Barrel: detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EB_pfIsoTightMu = ibooker.book1D("Eff_vtx_EB_pfIsoTightMu", "Barrel: pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EE_detIsoTightMu = ibooker.book1D("Eff_vtx_EE_detIsoTightMu", "Endcap: detIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EE_pfIsoTightMu = ibooker.book1D("Eff_vtx_EE_pfIsoTightMu", "Endcap: pfIsoTightMu Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + + h_eff_pt_pfIsodBTightMu = ibooker.book1D("Eff_pt_pfIsodBTightMu", "pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EB_pfIsodBTightMu = ibooker.book1D("Eff_pt_EB_pfIsodBTightMu", "Barrel: pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_pt_EE_pfIsodBTightMu = ibooker.book1D("Eff_pt_EE_pfIsodBTightMu", "Endcap: pfIsoTightMu (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax); + h_eff_vtx_pfIsodBTightMu = ibooker.book1D("Eff_vtx_pfIsodBTightMu", "pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EB_pfIsodBTightMu = ibooker.book1D("Eff_vtx_EB_pfIsodBTightMu", "Barrel: pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); + h_eff_vtx_EE_pfIsodBTightMu = ibooker.book1D("Eff_vtx_EE_pfIsodBTightMu", "Endcap: pfIsoTightMu (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax); @@ -147,54 +141,12 @@ void EfficiencyPlotter::beginJob(void){ h_eff_vtx_EE_pfIsodBTightMu ->setAxisTitle("Number of PV", 1); -// h_eff_eta_TightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_hp_eta_TightMu ->setAxisTitle("High p_{T} Mu Eff.", 2); -// h_eff_phi_TightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_TightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EB_TightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EE_TightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_detIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EB_detIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EE_detIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EB_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_pt_EE_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_detIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_EB_detIsoTightMu->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_EB_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_EE_detIsoTightMu->setAxisTitle("Tight Mu Eff.", 2); -// h_eff_vtx_EE_pfIsoTightMu ->setAxisTitle("Tight Mu Eff.", 2); -} - - -void EfficiencyPlotter::beginRun(Run const& run, EventSetup const& eSetup) { - LogTrace(metname)<<"[EfficiencyPlotter]: beginRun"; -} -void EfficiencyPlotter::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) { - LogTrace(metname)<<"[EfficiencyPlotter]: beginLuminosityBlock"; - // Get the run number - run = lumiSeg.run(); -} -void EfficiencyPlotter::analyze(const edm::Event& e, const edm::EventSetup& context){ - nevents++; - LogTrace(metname)<< "[EfficiencyPlotter]: "<get(numpath_pt); - MonitorElement *Denominator_pt = theDbe->get(denpath_pt); + MonitorElement *Numerator_pt = igetter.get(numpath_pt); + MonitorElement *Denominator_pt = igetter.get(denpath_pt); if (Numerator_pt && Denominator_pt){ TH1F *h_numerator_pt = Numerator_pt->getTH1F(); @@ -209,8 +161,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_EB_pt = "Muons/EfficiencyAnalyzer/passProbes_TightMu_EB_pt"; string denpath_EB_pt = "Muons/EfficiencyAnalyzer/allProbes_EB_pt"; - MonitorElement *Numerator_EB_pt = theDbe->get(numpath_EB_pt); - MonitorElement *Denominator_EB_pt = theDbe->get(denpath_EB_pt); + MonitorElement *Numerator_EB_pt = igetter.get(numpath_EB_pt); + MonitorElement *Denominator_EB_pt = igetter.get(denpath_EB_pt); if (Numerator_EB_pt && Denominator_EB_pt){ TH1F *h_numerator_EB_pt = Numerator_EB_pt->getTH1F(); @@ -225,8 +177,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_EE_pt = "Muons/EfficiencyAnalyzer/passProbes_TightMu_EE_pt"; string denpath_EE_pt = "Muons/EfficiencyAnalyzer/allProbes_EE_pt"; - MonitorElement *Numerator_EE_pt = theDbe->get(numpath_EE_pt); - MonitorElement *Denominator_EE_pt = theDbe->get(denpath_EE_pt); + MonitorElement *Numerator_EE_pt = igetter.get(numpath_EE_pt); + MonitorElement *Denominator_EE_pt = igetter.get(denpath_EE_pt); if (Numerator_EE_pt && Denominator_EE_pt){ TH1F *h_numerator_EE_pt = Numerator_EE_pt->getTH1F(); @@ -241,8 +193,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_eta = "Muons/EfficiencyAnalyzer/passProbes_TightMu_eta"; string denpath_eta = "Muons/EfficiencyAnalyzer/allProbes_eta"; - MonitorElement *Numerator_eta = theDbe->get(numpath_eta); - MonitorElement *Denominator_eta = theDbe->get(denpath_eta); + MonitorElement *Numerator_eta = igetter.get(numpath_eta); + MonitorElement *Denominator_eta = igetter.get(denpath_eta); if (Numerator_eta && Denominator_eta){ @@ -262,8 +214,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_hp_eta = "Muons/EfficiencyAnalyzer/passProbes_TightMu_hp_eta"; string denpath_hp_eta = "Muons/EfficiencyAnalyzer/allProbes_hp_eta"; - MonitorElement *Numerator_hp_eta = theDbe->get(numpath_hp_eta); - MonitorElement *Denominator_hp_eta = theDbe->get(denpath_hp_eta); + MonitorElement *Numerator_hp_eta = igetter.get(numpath_hp_eta); + MonitorElement *Denominator_hp_eta = igetter.get(denpath_hp_eta); if (Numerator_hp_eta && Denominator_hp_eta){ @@ -283,8 +235,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_phi = "Muons/EfficiencyAnalyzer/passProbes_TightMu_phi"; string denpath_phi = "Muons/EfficiencyAnalyzer/allProbes_phi"; - MonitorElement *Numerator_phi = theDbe->get(numpath_phi); - MonitorElement *Denominator_phi = theDbe->get(denpath_phi); + MonitorElement *Numerator_phi = igetter.get(numpath_phi); + MonitorElement *Denominator_phi = igetter.get(denpath_phi); if (Numerator_phi && Denominator_phi){ @@ -304,8 +256,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_detIso_pt = "Muons/EfficiencyAnalyzer/passProbes_detIsoTightMu_pt"; string denpath_detIso_pt = "Muons/EfficiencyAnalyzer/allProbes_TightMu_pt"; - MonitorElement *Numerator_detIso_pt = theDbe->get(numpath_detIso_pt); - MonitorElement *Denominator_detIso_pt = theDbe->get(denpath_detIso_pt); + MonitorElement *Numerator_detIso_pt = igetter.get(numpath_detIso_pt); + MonitorElement *Denominator_detIso_pt = igetter.get(denpath_detIso_pt); if (Numerator_detIso_pt && Denominator_detIso_pt){ @@ -324,8 +276,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_detIso_EB_pt = "Muons/EfficiencyAnalyzer/passProbes_EB_detIsoTightMu_pt"; string denpath_detIso_EB_pt = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_pt"; - MonitorElement *Numerator_detIso_EB_pt = theDbe->get(numpath_detIso_EB_pt); - MonitorElement *Denominator_detIso_EB_pt = theDbe->get(denpath_detIso_EB_pt); + MonitorElement *Numerator_detIso_EB_pt = igetter.get(numpath_detIso_EB_pt); + MonitorElement *Denominator_detIso_EB_pt = igetter.get(denpath_detIso_EB_pt); if (Numerator_detIso_EB_pt && Denominator_detIso_EB_pt){ @@ -345,8 +297,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_detIso_EE_pt = "Muons/EfficiencyAnalyzer/passProbes_EE_detIsoTightMu_pt"; string denpath_detIso_EE_pt = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_pt"; - MonitorElement *Numerator_detIso_EE_pt = theDbe->get(numpath_detIso_EE_pt); - MonitorElement *Denominator_detIso_EE_pt = theDbe->get(denpath_detIso_EE_pt); + MonitorElement *Numerator_detIso_EE_pt = igetter.get(numpath_detIso_EE_pt); + MonitorElement *Denominator_detIso_EE_pt = igetter.get(denpath_detIso_EE_pt); if (Numerator_detIso_EE_pt && Denominator_detIso_EE_pt){ @@ -366,8 +318,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIso_pt = "Muons/EfficiencyAnalyzer/passProbes_pfIsoTightMu_pt"; string denpath_pfIso_pt = "Muons/EfficiencyAnalyzer/allProbes_TightMu_pt"; - MonitorElement *Numerator_pfIso_pt = theDbe->get(numpath_pfIso_pt); - MonitorElement *Denominator_pfIso_pt = theDbe->get(denpath_pfIso_pt); + MonitorElement *Numerator_pfIso_pt = igetter.get(numpath_pfIso_pt); + MonitorElement *Denominator_pfIso_pt = igetter.get(denpath_pfIso_pt); if (Numerator_pfIso_pt && Denominator_pfIso_pt){ @@ -387,8 +339,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIso_EB_pt = "Muons/EfficiencyAnalyzer/passProbes_EB_pfIsoTightMu_pt"; string denpath_pfIso_EB_pt = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_pt"; - MonitorElement *Numerator_pfIso_EB_pt = theDbe->get(numpath_pfIso_EB_pt); - MonitorElement *Denominator_pfIso_EB_pt = theDbe->get(denpath_pfIso_EB_pt); + MonitorElement *Numerator_pfIso_EB_pt = igetter.get(numpath_pfIso_EB_pt); + MonitorElement *Denominator_pfIso_EB_pt = igetter.get(denpath_pfIso_EB_pt); if (Numerator_pfIso_EB_pt && Denominator_pfIso_EB_pt){ @@ -407,8 +359,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIso_EE_pt = "Muons/EfficiencyAnalyzer/passProbes_EE_pfIsoTightMu_pt"; string denpath_pfIso_EE_pt = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_pt"; - MonitorElement *Numerator_pfIso_EE_pt = theDbe->get(numpath_pfIso_EE_pt); - MonitorElement *Denominator_pfIso_EE_pt = theDbe->get(denpath_pfIso_EE_pt); + MonitorElement *Numerator_pfIso_EE_pt = igetter.get(numpath_pfIso_EE_pt); + MonitorElement *Denominator_pfIso_EE_pt = igetter.get(denpath_pfIso_EE_pt); if (Numerator_pfIso_EE_pt && Denominator_pfIso_EE_pt){ @@ -429,8 +381,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_pfIsoTightMu_nVtx"; string denpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_TightMu_nVtx"; - MonitorElement *Numerator_pfIso_nvtx = theDbe->get(numpath_pfIso_nvtx); - MonitorElement *Denominator_pfIso_nvtx = theDbe->get(denpath_pfIso_nvtx); + MonitorElement *Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx); + MonitorElement *Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx); if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx){ @@ -451,8 +403,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_detIsoTightMu_nVtx"; string denpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_TightMu_nVtx"; - MonitorElement *Numerator_detIso_nvtx = theDbe->get(numpath_detIso_nvtx); - MonitorElement *Denominator_detIso_nvtx = theDbe->get(denpath_detIso_nvtx); + MonitorElement *Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx); + MonitorElement *Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx); if (Numerator_detIso_nvtx && Denominator_detIso_nvtx){ @@ -472,8 +424,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EB_detIsoTightMu_nVtx"; denpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_nVtx"; - Numerator_detIso_nvtx = theDbe->get(numpath_detIso_nvtx); - Denominator_detIso_nvtx = theDbe->get(denpath_detIso_nvtx); + Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx); + Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx); if (Numerator_detIso_nvtx && Denominator_detIso_nvtx){ TH1F *h_numerator_detIso_nvtx = Numerator_detIso_nvtx->getTH1F(); @@ -489,8 +441,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EE_detIsoTightMu_nVtx"; denpath_detIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_nVtx"; - Numerator_detIso_nvtx = theDbe->get(numpath_detIso_nvtx); - Denominator_detIso_nvtx = theDbe->get(denpath_detIso_nvtx); + Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx); + Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx); if (Numerator_detIso_nvtx && Denominator_detIso_nvtx){ @@ -510,8 +462,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EB_pfIsoTightMu_nVtx"; denpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_nVtx"; - Numerator_pfIso_nvtx = theDbe->get(numpath_pfIso_nvtx); - Denominator_pfIso_nvtx = theDbe->get(denpath_pfIso_nvtx); + Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx); + Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx); if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx){ @@ -529,8 +481,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EE_pfIsoTightMu_nVtx"; denpath_pfIso_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_nVtx"; - Numerator_pfIso_nvtx = theDbe->get(numpath_pfIso_nvtx); - Denominator_pfIso_nvtx = theDbe->get(denpath_pfIso_nvtx); + Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx); + Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx); if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx){ @@ -551,8 +503,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIsodB_pt = "Muons/EfficiencyAnalyzer/passProbes_pfIsodBTightMu_pt"; string denpath_pfIsodB_pt = "Muons/EfficiencyAnalyzer/allProbes_TightMu_pt"; - MonitorElement *Numerator_pfIsodB_pt = theDbe->get(numpath_pfIsodB_pt); - MonitorElement *Denominator_pfIsodB_pt = theDbe->get(denpath_pfIsodB_pt); + MonitorElement *Numerator_pfIsodB_pt = igetter.get(numpath_pfIsodB_pt); + MonitorElement *Denominator_pfIsodB_pt = igetter.get(denpath_pfIsodB_pt); if (Numerator_pfIsodB_pt && Denominator_pfIsodB_pt){ @@ -572,8 +524,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIsodB_EB_pt = "Muons/EfficiencyAnalyzer/passProbes_EB_pfIsodBTightMu_pt"; string denpath_pfIsodB_EB_pt = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_pt"; - MonitorElement *Numerator_pfIsodB_EB_pt = theDbe->get(numpath_pfIsodB_EB_pt); - MonitorElement *Denominator_pfIsodB_EB_pt = theDbe->get(denpath_pfIsodB_EB_pt); + MonitorElement *Numerator_pfIsodB_EB_pt = igetter.get(numpath_pfIsodB_EB_pt); + MonitorElement *Denominator_pfIsodB_EB_pt = igetter.get(denpath_pfIsodB_EB_pt); if (Numerator_pfIsodB_EB_pt && Denominator_pfIsodB_EB_pt){ @@ -592,8 +544,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIsodB_EE_pt = "Muons/EfficiencyAnalyzer/passProbes_EE_pfIsodBTightMu_pt"; string denpath_pfIsodB_EE_pt = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_pt"; - MonitorElement *Numerator_pfIsodB_EE_pt = theDbe->get(numpath_pfIsodB_EE_pt); - MonitorElement *Denominator_pfIsodB_EE_pt = theDbe->get(denpath_pfIsodB_EE_pt); + MonitorElement *Numerator_pfIsodB_EE_pt = igetter.get(numpath_pfIsodB_EE_pt); + MonitorElement *Denominator_pfIsodB_EE_pt = igetter.get(denpath_pfIsodB_EE_pt); if (Numerator_pfIsodB_EE_pt && Denominator_pfIsodB_EE_pt){ @@ -614,8 +566,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { string numpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/passProbes_pfIsodBTightMu_nVtx"; string denpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/allProbes_TightMu_nVtx"; - MonitorElement *Numerator_pfIsodB_nvtx = theDbe->get(numpath_pfIsodB_nvtx); - MonitorElement *Denominator_pfIsodB_nvtx = theDbe->get(denpath_pfIsodB_nvtx); + MonitorElement *Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx); + MonitorElement *Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx); if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx){ @@ -635,8 +587,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EB_pfIsodBTightMu_nVtx"; denpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EB_TightMu_nVtx"; - Numerator_pfIsodB_nvtx = theDbe->get(numpath_pfIsodB_nvtx); - Denominator_pfIsodB_nvtx = theDbe->get(denpath_pfIsodB_nvtx); + Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx); + Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx); if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx){ @@ -655,8 +607,8 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { numpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/passProbes_EE_pfIsodBTightMu_nVtx"; denpath_pfIsodB_nvtx = "Muons/EfficiencyAnalyzer/allProbes_EE_TightMu_nVtx"; - Numerator_pfIsodB_nvtx = theDbe->get(numpath_pfIsodB_nvtx); - Denominator_pfIsodB_nvtx = theDbe->get(denpath_pfIsodB_nvtx); + Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx); + Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx); if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx){ @@ -673,10 +625,4 @@ void EfficiencyPlotter::endRun(Run const& run, EventSetup const& eSetup) { } - - -void EfficiencyPlotter::endJob(){ - LogTrace(metname)<< "[EfficiencyPlotter] endJob called!"; - theDbe->rmdir("Muons/EfficiencyAnalyzer"); -} diff --git a/DQMOffline/Muon/src/MuonEnergyDepositAnalyzer.cc b/DQMOffline/Muon/src/MuonEnergyDepositAnalyzer.cc index e7f006352f473..e97aaf785b177 100644 --- a/DQMOffline/Muon/src/MuonEnergyDepositAnalyzer.cc +++ b/DQMOffline/Muon/src/MuonEnergyDepositAnalyzer.cc @@ -23,34 +23,13 @@ using namespace edm; MuonEnergyDepositAnalyzer::MuonEnergyDepositAnalyzer(const edm::ParameterSet& pSet){ parameters = pSet; - - theDbe = edm::Service().operator->(); // the services theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); theMuonCollectionLabel_ = consumes(parameters.getParameter("MuonCollection")); -} - - -MuonEnergyDepositAnalyzer::~MuonEnergyDepositAnalyzer() { - delete theService; -} - - -void MuonEnergyDepositAnalyzer::beginJob(){ - metname = "muEnergyDepositAnalyzer"; -} - -void MuonEnergyDepositAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - std::string AlgoName = parameters.getParameter("AlgoName"); - - theDbe->cd(); - theDbe->setCurrentFolder("Muons/MuonEnergyDepositAnalyzer"); - - LogTrace(metname)<<"[MuonEnergyDepositAnalyzer] Parameters initialization"; - LogTrace(metname)<<"[MuonEnergyDepositAnalyzer] Run, Event" << iRun << " , "<< iSetup; + AlgoName = parameters.getParameter("AlgoName"); emNoBin = parameters.getParameter("emSizeBin"); emNoMin = parameters.getParameter("emSizeMin"); emNoMax = parameters.getParameter("emSizeMax"); @@ -74,71 +53,79 @@ void MuonEnergyDepositAnalyzer::beginRun(const edm::Run& iRun, const edm::EventS hoS9NoBin = parameters.getParameter("hoS9SizeBin"); hoS9NoMin = parameters.getParameter("hoS9SizeMin"); hoS9NoMax = parameters.getParameter("hoS9SizeMax"); +} +MuonEnergyDepositAnalyzer::~MuonEnergyDepositAnalyzer() { + delete theService; +} +void MuonEnergyDepositAnalyzer::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ + ibooker.cd(); + ibooker.setCurrentFolder("Muons/MuonEnergyDepositAnalyzer"); std::string histname = "ecalDepositedEnergyBarrel_"; - ecalDepEnergyBarrel = theDbe->book1D(histname+AlgoName, "Energy deposited in the ECAL barrel cells", emNoBin, emNoMin, emNoMax); + ecalDepEnergyBarrel = ibooker.book1D(histname+AlgoName, "Energy deposited in the ECAL barrel cells", emNoBin, emNoMin, emNoMax); ecalDepEnergyBarrel->setAxisTitle("GeV"); histname = "ecalDepositedEnergyEndcap_"; - ecalDepEnergyEndcap = theDbe->book1D(histname+AlgoName, "Energy deposited in the ECAL endcap cells", emNoBin, emNoMin, emNoMax); + ecalDepEnergyEndcap = ibooker.book1D(histname+AlgoName, "Energy deposited in the ECAL endcap cells", emNoBin, emNoMin, emNoMax); ecalDepEnergyEndcap->setAxisTitle("GeV"); histname = "ecalS9DepositedEnergyBarrel_"; - ecalS9DepEnergyBarrel = theDbe->book1D(histname+AlgoName, "Energy deposited in the ECAL barrel 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); + ecalS9DepEnergyBarrel = ibooker.book1D(histname+AlgoName, "Energy deposited in the ECAL barrel 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); ecalS9DepEnergyBarrel->setAxisTitle("GeV"); histname = "ecalS9DepositedEnergyEndcap_"; - ecalS9DepEnergyEndcap = theDbe->book1D(histname+AlgoName, "Energy deposited in the ECAL endcap 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); + ecalS9DepEnergyEndcap = ibooker.book1D(histname+AlgoName, "Energy deposited in the ECAL endcap 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); ecalS9DepEnergyEndcap->setAxisTitle("GeV"); histname = "ecalS9PointingMuDepositedEnergy_Glb_"; - ecalS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); + ecalS9PointingMuDepEnergy_Glb = ibooker.book1D(histname+AlgoName, "Pointing glb muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); ecalS9PointingMuDepEnergy_Glb->setAxisTitle("GeV"); histname = "ecalS9PointingMuDepositedEnergy_Tk_"; - ecalS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); + ecalS9PointingMuDepEnergy_Tk = ibooker.book1D(histname+AlgoName, "Pointing tk muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); ecalS9PointingMuDepEnergy_Tk->setAxisTitle("GeV"); histname = "ecalS9PointingMuDepositedEnergy_Sta_"; - ecalS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); + ecalS9PointingMuDepEnergy_Sta = ibooker.book1D(histname+AlgoName, "Pointing sta muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax); ecalS9PointingMuDepEnergy_Sta->setAxisTitle("GeV"); histname = "hadDepositedEnergyBarrel_"; - hcalDepEnergyBarrel = theDbe->book1D(histname+AlgoName, "Energy deposited in the HCAL barrel cells", hadNoBin, hadNoMin, hadNoMax); + hcalDepEnergyBarrel = ibooker.book1D(histname+AlgoName, "Energy deposited in the HCAL barrel cells", hadNoBin, hadNoMin, hadNoMax); hcalDepEnergyBarrel->setAxisTitle("GeV"); histname = "hadDepositedEnergyEndcap_"; - hcalDepEnergyEndcap = theDbe->book1D(histname+AlgoName, "Energy deposited in the HCAL endcap cells", hadNoBin, hadNoMin, hadNoMax); + hcalDepEnergyEndcap = ibooker.book1D(histname+AlgoName, "Energy deposited in the HCAL endcap cells", hadNoBin, hadNoMin, hadNoMax); hcalDepEnergyEndcap->setAxisTitle("GeV"); histname = "hadS9DepositedEnergyBarrel_"; - hcalS9DepEnergyBarrel = theDbe->book1D(histname+AlgoName, "Energy deposited in the HCAL barrel 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); + hcalS9DepEnergyBarrel = ibooker.book1D(histname+AlgoName, "Energy deposited in the HCAL barrel 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); hcalS9DepEnergyBarrel->setAxisTitle("GeV"); histname = "hadS9DepositedEnergyEndcap_"; - hcalS9DepEnergyEndcap = theDbe->book1D(histname+AlgoName, "Energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); + hcalS9DepEnergyEndcap = ibooker.book1D(histname+AlgoName, "Energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); hcalS9DepEnergyEndcap->setAxisTitle("GeV"); histname = "hadS9PointingMuDepositedEnergy_Glb_"; - hcalS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); + hcalS9PointingMuDepEnergy_Glb = ibooker.book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); hcalS9PointingMuDepEnergy_Glb->setAxisTitle("GeV"); histname = "hadS9PointingMuDepositedEnergy_Tk_"; - hcalS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); + hcalS9PointingMuDepEnergy_Tk = ibooker.book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); hcalS9PointingMuDepEnergy_Tk->setAxisTitle("GeV"); histname = "hadS9PointingMuDepositedEnergy_Sta_"; - hcalS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); + hcalS9PointingMuDepEnergy_Sta = ibooker.book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax); hcalS9PointingMuDepEnergy_Sta->setAxisTitle("GeV"); histname = "hoDepositedEnergy_"; - hoDepEnergy = theDbe->book1D(histname+AlgoName, "Energy deposited in the HO cells", hoNoBin, hoNoMin, hoNoMax); + hoDepEnergy = ibooker.book1D(histname+AlgoName, "Energy deposited in the HO cells", hoNoBin, hoNoMin, hoNoMax); hoDepEnergy->setAxisTitle("GeV"); histname = "hoS9DepositedEnergy_"; - hoS9DepEnergy = theDbe->book1D(histname+AlgoName, "Energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); + hoS9DepEnergy = ibooker.book1D(histname+AlgoName, "Energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); hoS9DepEnergy->setAxisTitle("GeV"); histname = "hoS9PointingMuDepositedEnergy_Glb_"; - hoS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); + hoS9PointingMuDepEnergy_Glb = ibooker.book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); hoS9PointingMuDepEnergy_Glb->setAxisTitle("GeV"); histname = "hoS9PointingMuDepositedEnergy_Tk_"; - hoS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); + hoS9PointingMuDepEnergy_Tk = ibooker.book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); hoS9PointingMuDepEnergy_Tk->setAxisTitle("GeV"); histname = "hoS9PointingMuDepositedEnergy_Sta_"; - hoS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); + hoS9PointingMuDepEnergy_Sta = ibooker.book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax); hoS9PointingMuDepEnergy_Sta->setAxisTitle("GeV"); - } void MuonEnergyDepositAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ LogTrace(metname)<<"[MuonEnergyDepositAnalyzer] Filling the histos"; diff --git a/DQMOffline/Muon/src/MuonIdDQM.cc b/DQMOffline/Muon/src/MuonIdDQM.cc index 0f0dd28070c17..c18eba77a4e9e 100644 --- a/DQMOffline/Muon/src/MuonIdDQM.cc +++ b/DQMOffline/Muon/src/MuonIdDQM.cc @@ -10,113 +10,111 @@ MuonIdDQM::MuonIdDQM(const edm::ParameterSet& iConfig){ useGlobalMuonsNotTrackerMuons_ = iConfig.getUntrackedParameter("useGlobalMuonsNotTrackerMuons"); baseFolder_ = iConfig.getUntrackedParameter("baseFolder"); - dbe_ = 0; - dbe_ = edm::Service().operator->(); } MuonIdDQM::~MuonIdDQM() {} -void MuonIdDQM::beginJob() { -} -void MuonIdDQM::beginRun(const edm::Run& irun, const edm::EventSetup& isetup){ +void MuonIdDQM::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ char name[100], title[200]; - dbe_->cd(); - dbe_->setCurrentFolder(baseFolder_); + ibooker.cd(); + ibooker.setCurrentFolder(baseFolder_); // trackerMuon == 0; globalMuon == 1; trackerMuon && !globalMuon == 2; globalMuon && !trackerMuon == 3 - hSegmentIsAssociatedBool = dbe_->book1D("hSegmentIsAssociatedBool", "Segment Is Associated Boolean", 2, -0.5, 1.5); + hSegmentIsAssociatedBool = ibooker.book1D("hSegmentIsAssociatedBool", "Segment Is Associated Boolean", 2, -0.5, 1.5); for (unsigned int i = 0; i < 4; i++) { if ((i == 0 && ! useTrackerMuons_) || (i == 1 && ! useGlobalMuons_)) continue; if ((i == 2 && ! useTrackerMuonsNotGlobalMuons_) || (i == 3 && ! useGlobalMuonsNotTrackerMuons_)) continue; - if (i == 0) dbe_->setCurrentFolder(baseFolder_+"/TrackerMuons"); - if (i == 1) dbe_->setCurrentFolder(baseFolder_+"/GlobalMuons"); - if (i == 2) dbe_->setCurrentFolder(baseFolder_+"/TrackerMuonsNotGlobalMuons"); - if (i == 3) dbe_->setCurrentFolder(baseFolder_+"/GlobalMuonsNotTrackerMuons"); + if (i == 0) ibooker.setCurrentFolder(baseFolder_+"/TrackerMuons"); + if (i == 1) ibooker.setCurrentFolder(baseFolder_+"/GlobalMuons"); + if (i == 2) ibooker.setCurrentFolder(baseFolder_+"/TrackerMuonsNotGlobalMuons"); + if (i == 3) ibooker.setCurrentFolder(baseFolder_+"/GlobalMuonsNotTrackerMuons"); - hNumChambers[i] = dbe_->book1D("hNumChambers", "Number of Chambers", 17, -0.5, 16.5); - hNumMatches[i] = dbe_->book1D("hNumMatches", "Number of Matches", 11, -0.5, 10.5); - hNumChambersNoRPC[i] = dbe_->book1D("hNumChambersNoRPC", "Number of Chambers No RPC", 11, -0.5, 10.5); + hNumChambers[i] = ibooker.book1D("hNumChambers", "Number of Chambers", 17, -0.5, 16.5); + hNumMatches[i] = ibooker.book1D("hNumMatches", "Number of Matches", 11, -0.5, 10.5); + hNumChambersNoRPC[i] = ibooker.book1D("hNumChambersNoRPC", "Number of Chambers No RPC", 11, -0.5, 10.5); // by station for(int station = 0; station < 4; ++station) { sprintf(name, "hDT%iNumSegments", station+1); sprintf(title, "DT Station %i Number of Segments (No Arbitration)", station+1); - hDTNumSegments[i][station] = dbe_->book1D(name, title, 11, -0.5, 10.5); + hDTNumSegments[i][station] = ibooker.book1D(name, title, 11, -0.5, 10.5); sprintf(name, "hDT%iDx", station+1); sprintf(title, "DT Station %i Delta X", station+1); - hDTDx[i][station] = dbe_->book1D(name, title, 100, -100., 100.); + hDTDx[i][station] = ibooker.book1D(name, title, 100, -100., 100.); sprintf(name, "hDT%iPullx", station+1); sprintf(title, "DT Station %i Pull X", station+1); - hDTPullx[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hDTPullx[i][station] = ibooker.book1D(name, title, 100, -20., 20.); sprintf(name, "hDT%iDdXdZ", station+1); sprintf(title, "DT Station %i Delta DxDz", station+1); - hDTDdXdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); + hDTDdXdZ[i][station] = ibooker.book1D(name, title, 100, -1., 1.); sprintf(name, "hDT%iPulldXdZ", station+1); sprintf(title, "DT Station %i Pull DxDz", station+1); - hDTPulldXdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hDTPulldXdZ[i][station] = ibooker.book1D(name, title, 100, -20., 20.); if (station < 3) { sprintf(name, "hDT%iDy", station+1); sprintf(title, "DT Station %i Delta Y", station+1); - hDTDy[i][station] = dbe_->book1D(name, title, 100, -150., 150.); + hDTDy[i][station] = ibooker.book1D(name, title, 100, -150., 150.); sprintf(name, "hDT%iPully", station+1); sprintf(title, "DT Station %i Pull Y", station+1); - hDTPully[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hDTPully[i][station] = ibooker.book1D(name, title, 100, -20., 20.); sprintf(name, "hDT%iDdYdZ", station+1); sprintf(title, "DT Station %i Delta DyDz", station+1); - hDTDdYdZ[i][station] = dbe_->book1D(name, title, 100, -2., 2.); + hDTDdYdZ[i][station] = ibooker.book1D(name, title, 100, -2., 2.); sprintf(name, "hDT%iPulldYdZ", station+1); sprintf(title, "DT Station %i Pull DyDz", station+1); - hDTPulldYdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hDTPulldYdZ[i][station] = ibooker.book1D(name, title, 100, -20., 20.); } sprintf(name, "hCSC%iNumSegments", station+1); sprintf(title, "CSC Station %i Number of Segments (No Arbitration)", station+1); - hCSCNumSegments[i][station] = dbe_->book1D(name, title, 11, -0.5, 10.5); + hCSCNumSegments[i][station] = ibooker.book1D(name, title, 11, -0.5, 10.5); sprintf(name, "hCSC%iDx", station+1); sprintf(title, "CSC Station %i Delta X", station+1); - hCSCDx[i][station] = dbe_->book1D(name, title, 100, -50., 50.); + hCSCDx[i][station] = ibooker.book1D(name, title, 100, -50., 50.); sprintf(name, "hCSC%iPullx", station+1); sprintf(title, "CSC Station %i Pull X", station+1); - hCSCPullx[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hCSCPullx[i][station] = ibooker.book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDdXdZ", station+1); sprintf(title, "CSC Station %i Delta DxDz", station+1); - hCSCDdXdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); + hCSCDdXdZ[i][station] = ibooker.book1D(name, title, 100, -1., 1.); sprintf(name, "hCSC%iPulldXdZ", station+1); sprintf(title, "CSC Station %i Pull DxDz", station+1); - hCSCPulldXdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hCSCPulldXdZ[i][station] = ibooker.book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDy", station+1); sprintf(title, "CSC Station %i Delta Y", station+1); - hCSCDy[i][station] = dbe_->book1D(name, title, 100, -50., 50.); + hCSCDy[i][station] = ibooker.book1D(name, title, 100, -50., 50.); sprintf(name, "hCSC%iPully", station+1); sprintf(title, "CSC Station %i Pull Y", station+1); - hCSCPully[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hCSCPully[i][station] = ibooker.book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDdYdZ", station+1); sprintf(title, "CSC Station %i Delta DyDz", station+1); - hCSCDdYdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); + hCSCDdYdZ[i][station] = ibooker.book1D(name, title, 100, -1., 1.); sprintf(name, "hCSC%iPulldYdZ", station+1); sprintf(title, "CSC Station %i Pull DyDz", station+1); - hCSCPulldYdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); + hCSCPulldYdZ[i][station] = ibooker.book1D(name, title, 100, -20., 20.); }// station } @@ -267,9 +265,6 @@ void MuonIdDQM::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) }// csc segment } -void -MuonIdDQM::endJob() {} - void MuonIdDQM::Fill(MonitorElement* me, float f) { if (fabs(f) > 900000) return; //if (fabs(f) < 1E-8) return; diff --git a/DQMOffline/Muon/src/MuonIsolationDQM.cc b/DQMOffline/Muon/src/MuonIsolationDQM.cc index 5107cf01d374f..b81acd482da56 100644 --- a/DQMOffline/Muon/src/MuonIsolationDQM.cc +++ b/DQMOffline/Muon/src/MuonIsolationDQM.cc @@ -73,19 +73,13 @@ MuonIsolationDQM::MuonIsolationDQM(const edm::ParameterSet& iConfig){ InitStatics(); - //Set up DAQ - dbe = 0; - dbe = edm::Service().operator->(); - dbe->setCurrentFolder(dirName.c_str()); - dbe->cd(); //------"allocate" space for the data vectors------- - + h_1D.resize(NUM_VARS); h_2D.resize(NUM_VARS_2D); h_1D_NVTX.resize(NUM_VARS_NVTX); - dbe->cd(); } // @@ -562,7 +556,6 @@ void MuonIsolationDQM::analyze(const edm::Event& iEvent, const edm::EventSetup& // Get Muon Collection //Fill historgams concerning muon isolation - dbe->setCurrentFolder(dirName.c_str()); for (reco::MuonCollection::const_iterator muon = muons->begin(); muon!=muons->end(); ++muon){ if (requireSTAMuon && muon->isStandAloneMuon()) { ++nSTAMuons; @@ -581,7 +574,6 @@ void MuonIsolationDQM::analyze(const edm::Event& iEvent, const edm::EventSetup& FillNVtxHistos(_numPV); } } - dbe->cd(); } @@ -681,81 +673,41 @@ void MuonIsolationDQM::RecordData(const reco::Muon& muon){ theDataNVtx[4] = theDataNVtx[3]; theDataNVtx[5] = theDataNVtx[3]; } +void MuonIsolationDQM::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ -// ------------ method called once each job just before starting event loop ------------ -void MuonIsolationDQM::beginJob(void) { - edm::LogInfo("Tutorial") << "\n#########################################\n\n" - << "Lets get started! " - << "\n\n#########################################\n"; -#ifdef DEBUG - cout << "[MuonIsolationDQM]: beginJob" << endl; -#endif - dbe->setCurrentFolder(dirName.c_str()); - InitHistos(); - dbe->cd(); -} - -// ------------ method called once each run just before starting the event loop ---------- -void MuonIsolationDQM::beginRun(void) { -#ifdef DEBUG - cout << "[MuonIsolationDQM]: beginRun" << endl; -#endif - // InitHistos(); -} - -// ------------ method called once each job just after ending the event loop ------------ -void MuonIsolationDQM::endJob() { - // check if ME still there (and not killed by MEtoEDM for memory saving) - if( dbe ) { - // check existence of first histo in the list - if (! dbe->get(dirName+"/nMuons")) return; - } - else - return; - - edm::LogInfo("Tutorial") << "\n#########################################\n\n" - << "Total Number of Events: " << nEvents - << "\n\n#########################################\n" - << "\nInitializing Histograms...\n"; - - edm::LogInfo("Tutorial") << "\nIntializing Finished. Filling...\n"; - //NormalizeHistos(); - edm::LogInfo("Tutorial") << "\nFilled. Saving...\n"; - // dbe->save(rootfilename); // comment out for incorporation - edm::LogInfo("Tutorial") << "\nSaved. Peace, homie, I'm out.\n"; -} -void MuonIsolationDQM::InitHistos(){ //---initialize number of muons histogram--- - h_nMuons = dbe->book1D("nMuons", title_sam + "Number of Muons", 20, 0., 20.); + h_nMuons = ibooker.book1D("nMuons", title_sam + "Number of Muons", 20, 0., 20.); h_nMuons->setAxisTitle("Number of Muons",XAXIS); h_nMuons->setAxisTitle("Fraction of Events",YAXIS); //---Initialize 1D Histograms--- for(int var = 0; var < NUM_VARS; var++){ - h_1D[var] = dbe->book1D(names[var], + h_1D[var] = ibooker.book1D(names[var], title_sam + main_titles[var] + title_cone, (int)param[var][0], param[var][1], param[var][2] ); h_1D[var]->setAxisTitle(axis_titles[var],XAXIS); - GetTH1FromMonitorElement(h_1D[var])->Sumw2(); + // GetTH1FromMonitorElement(h_1D[var])->Sumw2(); }//Finish 1D //----Initialize 2D Histograms for (int var = 0; varbookProfile(names_2D[var] + "_VsPV", titles_2D[var] + " Vs PV", 50, 0.5, 50.5, 20, 0.0, 20.0); + h_2D[var] = ibooker.bookProfile(names_2D[var] + "_VsPV", titles_2D[var] + " Vs PV", 50, 0.5, 50.5, 20, 0.0, 20.0); h_2D[var]->setAxisTitle("Number of PV", XAXIS); h_2D[var]->setAxisTitle(titles_2D[var] + " (GeV)" ,YAXIS); - h_2D[var]->getTH1()->Sumw2(); + // h_2D[var]->getTH1()->Sumw2(); } //-----Initialise PU-Binned histograms for (int var=0; varbook1D(names_NVtxs[var], main_titles_NVtxs[var], 50, 0.0, 10.0); + h_1D_NVTX[var] = ibooker.book1D(names_NVtxs[var], main_titles_NVtxs[var], 50, 0.0, 10.0); h_1D_NVTX[var]->setAxisTitle(axis_titles_NVtxs[var],XAXIS); - GetTH1FromMonitorElement(h_1D_NVTX[var])->Sumw2(); + /// GetTH1FromMonitorElement(h_1D_NVTX[var])->Sumw2(); } } diff --git a/DQMOffline/Muon/src/MuonKinVsEtaAnalyzer.cc b/DQMOffline/Muon/src/MuonKinVsEtaAnalyzer.cc index 43e08456dbe66..2d6b61c6c0c9a 100644 --- a/DQMOffline/Muon/src/MuonKinVsEtaAnalyzer.cc +++ b/DQMOffline/Muon/src/MuonKinVsEtaAnalyzer.cc @@ -29,20 +29,8 @@ MuonKinVsEtaAnalyzer::MuonKinVsEtaAnalyzer(const edm::ParameterSet& pSet) { theMuonCollectionLabel_ = consumes(parameters.getParameter("MuonCollection")); theVertexLabel_ = consumes(parameters.getParameter("VertexLabel")); theBeamSpotLabel_ = mayConsume (parameters.getParameter("BeamSpotLabel")); -} -MuonKinVsEtaAnalyzer::~MuonKinVsEtaAnalyzer() { - delete theService; -} - -void MuonKinVsEtaAnalyzer::beginJob(){ - metname = "muonKinVsEta"; -} - -void MuonKinVsEtaAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - metname = "muonKinVsEta"; - theDbe->cd(); - theDbe->setCurrentFolder("Muons/MuonKinVsEtaAnalyzer"); + // Parameters etaBin = parameters.getParameter("etaBin"); etaMin = parameters.getParameter("etaMin"); etaMax = parameters.getParameter("etaMax"); @@ -72,6 +60,18 @@ void MuonKinVsEtaAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& etaOvlpMin = parameters.getParameter("etaOvlpMin"); etaOvlpMax = parameters.getParameter("etaOvlpMax"); +} +MuonKinVsEtaAnalyzer::~MuonKinVsEtaAnalyzer() { + delete theService; +} + +void MuonKinVsEtaAnalyzer::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const& /*iSetup*/){ + ibooker.cd(); + ibooker.setCurrentFolder("Muons/MuonKinVsEtaAnalyzer"); + + std::string EtaName; for(unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){ if (iEtaRegion==0) EtaName = "Barrel"; @@ -80,56 +80,56 @@ void MuonKinVsEtaAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& if (iEtaRegion==3) EtaName = ""; // monitoring of eta parameter - etaGlbTrack.push_back(theDbe->book1D("GlbMuon_eta_"+EtaName, "#eta_{GLB} "+EtaName, etaBin, etaMin, etaMax)); - etaTrack.push_back(theDbe->book1D("TkMuon_eta_"+EtaName, "#eta_{TK} "+EtaName, etaBin, etaMin, etaMax)); - etaStaTrack.push_back(theDbe->book1D("StaMuon_eta_"+EtaName, "#eta_{STA} "+EtaName, etaBin, etaMin, etaMax)); - etaTightTrack.push_back(theDbe->book1D("TightMuon_eta_"+EtaName, "#eta_{Tight} "+EtaName, etaBin, etaMin, etaMax)); - etaLooseTrack.push_back(theDbe->book1D("LooseMuon_eta_"+EtaName, "#eta_{Loose} "+EtaName, etaBin, etaMin, etaMax)); - etaSoftTrack.push_back(theDbe->book1D("SoftMuon_eta_"+EtaName, "#eta_{Soft} "+EtaName, etaBin, etaMin, etaMax)); - etaHighPtTrack.push_back(theDbe->book1D("HighPtMuon_eta_"+EtaName, "#eta_{HighPt} "+EtaName, etaBin, etaMin, etaMax)); + etaGlbTrack.push_back(ibooker.book1D("GlbMuon_eta_"+EtaName, "#eta_{GLB} "+EtaName, etaBin, etaMin, etaMax)); + etaTrack.push_back(ibooker.book1D("TkMuon_eta_"+EtaName, "#eta_{TK} "+EtaName, etaBin, etaMin, etaMax)); + etaStaTrack.push_back(ibooker.book1D("StaMuon_eta_"+EtaName, "#eta_{STA} "+EtaName, etaBin, etaMin, etaMax)); + etaTightTrack.push_back(ibooker.book1D("TightMuon_eta_"+EtaName, "#eta_{Tight} "+EtaName, etaBin, etaMin, etaMax)); + etaLooseTrack.push_back(ibooker.book1D("LooseMuon_eta_"+EtaName, "#eta_{Loose} "+EtaName, etaBin, etaMin, etaMax)); + etaSoftTrack.push_back(ibooker.book1D("SoftMuon_eta_"+EtaName, "#eta_{Soft} "+EtaName, etaBin, etaMin, etaMax)); + etaHighPtTrack.push_back(ibooker.book1D("HighPtMuon_eta_"+EtaName, "#eta_{HighPt} "+EtaName, etaBin, etaMin, etaMax)); // monitoring of phi paramater - phiGlbTrack.push_back(theDbe->book1D("GlbMuon_phi_"+EtaName, "#phi_{GLB} "+EtaName+ "(rad)", phiBin, phiMin, phiMax)); - phiTrack.push_back(theDbe->book1D("TkMuon_phi_"+EtaName, "#phi_{TK}" +EtaName +"(rad)", phiBin, phiMin, phiMax)); - phiStaTrack.push_back(theDbe->book1D("StaMuon_phi_"+EtaName, "#phi_{STA}"+EtaName+" (rad)", phiBin, phiMin, phiMax)); - phiTightTrack.push_back(theDbe->book1D("TightMuon_phi_"+EtaName, "#phi_{Tight}_"+EtaName, phiBin, phiMin, phiMax)); - phiLooseTrack.push_back(theDbe->book1D("LooseMuon_phi_"+EtaName, "#phi_{Loose}_"+EtaName, phiBin, phiMin, phiMax)); - phiSoftTrack.push_back(theDbe->book1D("SoftMuon_phi_"+EtaName, "#phi_{Soft}_"+EtaName, phiBin, phiMin, phiMax)); - phiHighPtTrack.push_back(theDbe->book1D("HighPtMuon_phi_"+EtaName, "#phi_{HighPt}_"+EtaName, phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D("GlbMuon_phi_"+EtaName, "#phi_{GLB} "+EtaName+ "(rad)", phiBin, phiMin, phiMax)); + phiTrack.push_back(ibooker.book1D("TkMuon_phi_"+EtaName, "#phi_{TK}" +EtaName +"(rad)", phiBin, phiMin, phiMax)); + phiStaTrack.push_back(ibooker.book1D("StaMuon_phi_"+EtaName, "#phi_{STA}"+EtaName+" (rad)", phiBin, phiMin, phiMax)); + phiTightTrack.push_back(ibooker.book1D("TightMuon_phi_"+EtaName, "#phi_{Tight}_"+EtaName, phiBin, phiMin, phiMax)); + phiLooseTrack.push_back(ibooker.book1D("LooseMuon_phi_"+EtaName, "#phi_{Loose}_"+EtaName, phiBin, phiMin, phiMax)); + phiSoftTrack.push_back(ibooker.book1D("SoftMuon_phi_"+EtaName, "#phi_{Soft}_"+EtaName, phiBin, phiMin, phiMax)); + phiHighPtTrack.push_back(ibooker.book1D("HighPtMuon_phi_"+EtaName, "#phi_{HighPt}_"+EtaName, phiBin, phiMin, phiMax)); // monitoring of the momentum - pGlbTrack.push_back(theDbe->book1D("GlbMuon_p_"+EtaName, "p_{GLB} "+EtaName, pBin, pMin, pMax)); - pTrack.push_back(theDbe->book1D("TkMuon_p"+EtaName, "p_{TK} "+EtaName, pBin, pMin, pMax)); - pStaTrack.push_back(theDbe->book1D("StaMuon_p"+EtaName, "p_{STA} "+EtaName, pBin, pMin, pMax)); - pTightTrack.push_back(theDbe->book1D("TightMuon_p_"+EtaName, "p_{Tight} "+EtaName, pBin, pMin, pMax)); - pLooseTrack.push_back(theDbe->book1D("LooseMuon_p_"+EtaName, "p_{Loose} "+EtaName, pBin, pMin, pMax)); - pSoftTrack.push_back(theDbe->book1D("SoftMuon_p_"+EtaName, "p_{Soft} "+EtaName, pBin, pMin, pMax)); - pHighPtTrack.push_back(theDbe->book1D("HighPtMuon_p_"+EtaName, "p_{HighPt} "+EtaName, pBin, pMin, pMax)); + pGlbTrack.push_back(ibooker.book1D("GlbMuon_p_"+EtaName, "p_{GLB} "+EtaName, pBin, pMin, pMax)); + pTrack.push_back(ibooker.book1D("TkMuon_p"+EtaName, "p_{TK} "+EtaName, pBin, pMin, pMax)); + pStaTrack.push_back(ibooker.book1D("StaMuon_p"+EtaName, "p_{STA} "+EtaName, pBin, pMin, pMax)); + pTightTrack.push_back(ibooker.book1D("TightMuon_p_"+EtaName, "p_{Tight} "+EtaName, pBin, pMin, pMax)); + pLooseTrack.push_back(ibooker.book1D("LooseMuon_p_"+EtaName, "p_{Loose} "+EtaName, pBin, pMin, pMax)); + pSoftTrack.push_back(ibooker.book1D("SoftMuon_p_"+EtaName, "p_{Soft} "+EtaName, pBin, pMin, pMax)); + pHighPtTrack.push_back(ibooker.book1D("HighPtMuon_p_"+EtaName, "p_{HighPt} "+EtaName, pBin, pMin, pMax)); // monitoring of the transverse momentum - ptGlbTrack.push_back(theDbe->book1D("GlbMuon_pt_" +EtaName, "pt_{GLB} "+EtaName, ptBin, ptMin, ptMax)); - ptTrack.push_back(theDbe->book1D("TkMuon_pt_"+EtaName, "pt_{TK} "+EtaName, ptBin, ptMin, ptMax)); - ptStaTrack.push_back(theDbe->book1D("StaMuon_pt_"+EtaName, "pt_{STA} "+EtaName, ptBin, ptMin, pMax)); - ptTightTrack.push_back(theDbe->book1D("TightMuon_pt_"+EtaName, "pt_{Tight} "+EtaName, ptBin, ptMin, ptMax)); - ptLooseTrack.push_back(theDbe->book1D("LooseMuon_pt_"+EtaName, "pt_{Loose} "+EtaName, ptBin, ptMin, ptMax)); - ptSoftTrack.push_back(theDbe->book1D("SoftMuon_pt_"+EtaName, "pt_{Soft} "+EtaName, ptBin, ptMin, ptMax)); - ptHighPtTrack.push_back(theDbe->book1D("HighPtMuon_pt_"+EtaName, "pt_{HighPt} "+EtaName, ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D("GlbMuon_pt_" +EtaName, "pt_{GLB} "+EtaName, ptBin, ptMin, ptMax)); + ptTrack.push_back(ibooker.book1D("TkMuon_pt_"+EtaName, "pt_{TK} "+EtaName, ptBin, ptMin, ptMax)); + ptStaTrack.push_back(ibooker.book1D("StaMuon_pt_"+EtaName, "pt_{STA} "+EtaName, ptBin, ptMin, pMax)); + ptTightTrack.push_back(ibooker.book1D("TightMuon_pt_"+EtaName, "pt_{Tight} "+EtaName, ptBin, ptMin, ptMax)); + ptLooseTrack.push_back(ibooker.book1D("LooseMuon_pt_"+EtaName, "pt_{Loose} "+EtaName, ptBin, ptMin, ptMax)); + ptSoftTrack.push_back(ibooker.book1D("SoftMuon_pt_"+EtaName, "pt_{Soft} "+EtaName, ptBin, ptMin, ptMax)); + ptHighPtTrack.push_back(ibooker.book1D("HighPtMuon_pt_"+EtaName, "pt_{HighPt} "+EtaName, ptBin, ptMin, ptMax)); // monitoring chi2 and Prob.Chi2 - chi2GlbTrack.push_back(theDbe->book1D("GlbMuon_chi2_"+EtaName, "#chi^{2}_{GLB} " + EtaName, chiBin, chiMin, chiMax)); - chi2probGlbTrack.push_back(theDbe->book1D("GlbMuon_chi2prob_"+EtaName, "#chi^{2}_{GLB} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2Track.push_back(theDbe->book1D("TkMuon_chi2_"+EtaName, "#chi^{2}_{TK} " + EtaName, chiBin, chiMin, chiMax)); - chi2probTrack.push_back(theDbe->book1D("TkMuon_chi2prob_"+EtaName, "#chi^{2}_{TK} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2StaTrack.push_back(theDbe->book1D("StaMuon_chi2_"+EtaName, "#chi^{2}_{STA} " + EtaName, chiBin, chiMin, chiMax)); - chi2probStaTrack.push_back(theDbe->book1D("StaMuon_chi2prob_"+EtaName, "#chi^{2}_{STA} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2TightTrack.push_back(theDbe->book1D("TightMuon_chi2_"+EtaName, "#chi^{2}_{Tight} " + EtaName, chiBin, chiMin, chiMax)); - chi2probTightTrack.push_back(theDbe->book1D("TightMuon_chi2prob_"+EtaName, "#chi^{2}_{Tight} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2LooseTrack.push_back(theDbe->book1D("LooseMuon_chi2_"+EtaName, "#chi^{2}_{Loose} " + EtaName, chiBin, chiMin, chiMax)); - chi2probLooseTrack.push_back(theDbe->book1D("LooseMuon_chi2prob_"+EtaName, "#chi^{2}_{Loose} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2SoftTrack.push_back(theDbe->book1D("SoftMuon_chi2_"+EtaName, "#chi^{2}_{Soft} " + EtaName, chiBin, chiMin, chiMax)); - chi2probSoftTrack.push_back(theDbe->book1D("SoftMuon_chi2prob_"+EtaName, "#chi^{2}_{Soft} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); - chi2HighPtTrack.push_back(theDbe->book1D("HighPtMuon_chi2_"+EtaName, "#chi^{2}_{HighPt} " + EtaName, chiBin, chiMin, chiMax)); - chi2probHighPtTrack.push_back(theDbe->book1D("HighPtMuon_chi2prob_"+EtaName, "#chi^{2}_{HighPt} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2GlbTrack.push_back(ibooker.book1D("GlbMuon_chi2_"+EtaName, "#chi^{2}_{GLB} " + EtaName, chiBin, chiMin, chiMax)); + chi2probGlbTrack.push_back(ibooker.book1D("GlbMuon_chi2prob_"+EtaName, "#chi^{2}_{GLB} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2Track.push_back(ibooker.book1D("TkMuon_chi2_"+EtaName, "#chi^{2}_{TK} " + EtaName, chiBin, chiMin, chiMax)); + chi2probTrack.push_back(ibooker.book1D("TkMuon_chi2prob_"+EtaName, "#chi^{2}_{TK} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2StaTrack.push_back(ibooker.book1D("StaMuon_chi2_"+EtaName, "#chi^{2}_{STA} " + EtaName, chiBin, chiMin, chiMax)); + chi2probStaTrack.push_back(ibooker.book1D("StaMuon_chi2prob_"+EtaName, "#chi^{2}_{STA} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2TightTrack.push_back(ibooker.book1D("TightMuon_chi2_"+EtaName, "#chi^{2}_{Tight} " + EtaName, chiBin, chiMin, chiMax)); + chi2probTightTrack.push_back(ibooker.book1D("TightMuon_chi2prob_"+EtaName, "#chi^{2}_{Tight} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2LooseTrack.push_back(ibooker.book1D("LooseMuon_chi2_"+EtaName, "#chi^{2}_{Loose} " + EtaName, chiBin, chiMin, chiMax)); + chi2probLooseTrack.push_back(ibooker.book1D("LooseMuon_chi2prob_"+EtaName, "#chi^{2}_{Loose} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2SoftTrack.push_back(ibooker.book1D("SoftMuon_chi2_"+EtaName, "#chi^{2}_{Soft} " + EtaName, chiBin, chiMin, chiMax)); + chi2probSoftTrack.push_back(ibooker.book1D("SoftMuon_chi2prob_"+EtaName, "#chi^{2}_{Soft} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); + chi2HighPtTrack.push_back(ibooker.book1D("HighPtMuon_chi2_"+EtaName, "#chi^{2}_{HighPt} " + EtaName, chiBin, chiMin, chiMax)); + chi2probHighPtTrack.push_back(ibooker.book1D("HighPtMuon_chi2prob_"+EtaName, "#chi^{2}_{HighPt} prob." + EtaName, chiBin, chiprobMin, chiprobMax)); } } void MuonKinVsEtaAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ diff --git a/DQMOffline/Muon/src/MuonPFAnalyzer.cc b/DQMOffline/Muon/src/MuonPFAnalyzer.cc index dc8fe37f49049..9a8be9045b06e 100644 --- a/DQMOffline/Muon/src/MuonPFAnalyzer.cc +++ b/DQMOffline/Muon/src/MuonPFAnalyzer.cc @@ -5,7 +5,6 @@ * \author C. Battilana - CIEMAT */ //Base class -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "DQMOffline/Muon/interface/MuonPFAnalyzer.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" @@ -64,41 +63,28 @@ MuonPFAnalyzer::MuonPFAnalyzer(const ParameterSet& pSet){ } -MuonPFAnalyzer::~MuonPFAnalyzer() -{ - - LogTrace("MuonPFAnalyzer") << - "[MuonPFAnalyzer] Destructor called.\n"; - +MuonPFAnalyzer::~MuonPFAnalyzer() { + LogTrace("MuonPFAnalyzer") << "[MuonPFAnalyzer] Destructor called.\n"; } - - // ------------ method called when starting to processes a run ------------ - -void MuonPFAnalyzer::beginRun(edm::Run const &, edm::EventSetup const &) { - - LogTrace("MuonPFAnalyzer") << - "[MuonPFAnalyzer] Booking histograms.\n"; - - //Set up DAQ - theDbe = 0; - theDbe = edm::Service().operator->(); - theDbe->cd(); - +void MuonPFAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, + edm::Run const &, + edm::EventSetup const &) { + if(theRunOnMC) { - bookHistos("PF"); - bookHistos("PFTight"); - bookHistos("PFTightIso"); - bookHistos("TUNEP"); - bookHistos("TUNEPTight"); - bookHistos("TUNEPTightIso"); + bookHistos(ibooker, "PF"); + bookHistos(ibooker, "PFTight"); + bookHistos(ibooker, "PFTightIso"); + bookHistos(ibooker, "TUNEP"); + bookHistos(ibooker, "TUNEPTight"); + bookHistos(ibooker, "TUNEPTightIso"); } - bookHistos("PFvsTUNEP"); - bookHistos("PFvsTUNEPTight"); - bookHistos("PFvsTUNEPTightIso"); + bookHistos(ibooker,"PFvsTUNEP"); + bookHistos(ibooker,"PFvsTUNEPTight"); + bookHistos(ibooker,"PFvsTUNEPTightIso"); } @@ -288,14 +274,15 @@ void MuonPFAnalyzer::analyze(const Event& event, -void MuonPFAnalyzer::bookHistos(const string & group) { +void MuonPFAnalyzer::bookHistos(DQMStore::IBooker & ibooker, + const string & group) { LogTrace("MuonPFAnalyzer") << "[MuonPFAnalyzer] Booking histos for group :" << group << "\n"; - theDbe->setCurrentFolder(string(theFolder) + group); + ibooker.setCurrentFolder(string(theFolder) + group); bool isPFvsTUNEP = group.find("PFvsTUNEP") != string::npos; @@ -304,19 +291,19 @@ void MuonPFAnalyzer::bookHistos(const string & group) { hName = "deltaPtOverPt" + group; - thePlots[group]["deltaPtOverPt"] = theDbe->book1D(hName.c_str(),hName.c_str(),101,-1.01,1.01); + thePlots[group]["deltaPtOverPt"] = ibooker.book1D(hName.c_str(),hName.c_str(),101,-1.01,1.01); hName = "deltaPtOverPtHighPt" + group; - thePlots[group]["deltaPtOverPtHighPt"] = theDbe->book1D(hName.c_str(),hName.c_str(),101,-1.01,1.01); + thePlots[group]["deltaPtOverPtHighPt"] = ibooker.book1D(hName.c_str(),hName.c_str(),101,-1.01,1.01); hName = "deltaPt" + group; - thePlots[group]["deltaPt"] = theDbe->book1D(hName.c_str(),hName.c_str(),201.,-10.25,10.25); + thePlots[group]["deltaPt"] = ibooker.book1D(hName.c_str(),hName.c_str(),201.,-10.25,10.25); hName = "deltaPhi"+group; - thePlots[group]["deltaPhi"] = theDbe->book1D(hName.c_str(),hName.c_str(),51.,0,.0102); + thePlots[group]["deltaPhi"] = ibooker.book1D(hName.c_str(),hName.c_str(),51.,0,.0102); hName = "deltaEta"+group; - thePlots[group]["deltaEta"] = theDbe->book1D(hName.c_str(),hName.c_str(),101.,-.00505,.00505); + thePlots[group]["deltaEta"] = ibooker.book1D(hName.c_str(),hName.c_str(),101.,-.00505,.00505); @@ -324,13 +311,13 @@ void MuonPFAnalyzer::bookHistos(const string & group) { hName = "code"+group; - MonitorElement * plot = theDbe->book2D(hName.c_str(),hName.c_str(),7,-.5,6.5,7,-.5,6.5); + MonitorElement * plot = ibooker.book2D(hName.c_str(),hName.c_str(),7,-.5,6.5,7,-.5,6.5); thePlots[group]["code"] = plot; setCodeLabels(plot,1); setCodeLabels(plot,2); hName = "codeHighPt"+group; - plot = theDbe->book2D(hName.c_str(),hName.c_str(),7,-.5,6.5,7,-.5,6.5); + plot = ibooker.book2D(hName.c_str(),hName.c_str(),7,-.5,6.5,7,-.5,6.5); thePlots[group]["codeHighPt"] = plot; setCodeLabels(plot,1); setCodeLabels(plot,2); @@ -340,22 +327,22 @@ void MuonPFAnalyzer::bookHistos(const string & group) { { hName = "deltaPtOverPtPFvsTUNEP" + group; thePlots[group]["deltaPtOverPtPFvsTUNEP"] = - theDbe->book2D(hName.c_str(),hName.c_str(), + ibooker.book2D(hName.c_str(),hName.c_str(), 101,-1.01,1.01,101,-1.01,1.01); hName = "deltaPtOverPtHighPtPFvsTUNEP" + group; thePlots[group]["deltaPtOverPtHighPtPFvsTUNEP"] = - theDbe->book2D(hName.c_str(),hName.c_str(), + ibooker.book2D(hName.c_str(),hName.c_str(), 101,-1.01,1.01,101,-1.01,1.01); } } else { hName = "code"+group; - MonitorElement * plot = theDbe->book1D(hName.c_str(),hName.c_str(),7,-.5,6.5); + MonitorElement * plot = ibooker.book1D(hName.c_str(),hName.c_str(),7,-.5,6.5); thePlots[group]["code"] = plot; setCodeLabels(plot,1); hName = "codeHighPt"+group; - plot = theDbe->book1D(hName.c_str(),hName.c_str(),7,-.5,6.5); + plot = ibooker.book1D(hName.c_str(),hName.c_str(),7,-.5,6.5); thePlots[group]["codeHighPt"] = plot; setCodeLabels(plot,1); } diff --git a/DQMOffline/Muon/src/MuonRecoAnalyzer.cc b/DQMOffline/Muon/src/MuonRecoAnalyzer.cc index c5c7177c3c4e0..9cc4b3d19d2d7 100644 --- a/DQMOffline/Muon/src/MuonRecoAnalyzer.cc +++ b/DQMOffline/Muon/src/MuonRecoAnalyzer.cc @@ -22,29 +22,50 @@ MuonRecoAnalyzer::MuonRecoAnalyzer(const edm::ParameterSet& pSet) { // the services: theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); - theDbe = edm::Service().operator->(); theMuonCollectionLabel_ = consumes(parameters.getParameter("MuonCollection")); + + ptBin = parameters.getParameter("ptBin"); + ptMin = parameters.getParameter("ptMin"); + ptMax = parameters.getParameter("ptMax"); + pResBin = parameters.getParameter("pResBin"); + pResMin = parameters.getParameter("pResMin"); + pResMax = parameters.getParameter("pResMax"); + rhBin=parameters.getParameter("rhBin"); + rhMin=parameters.getParameter("rhMin"); + rhMax=parameters.getParameter("rhMax"); + pBin = parameters.getParameter("pBin"); + pMin = parameters.getParameter("pMin"); + pMax = parameters.getParameter("pMax"); + chi2Bin = parameters.getParameter("chi2Bin"); + chi2Min = parameters.getParameter("chi2Min"); + chi2Max = parameters.getParameter("chi2Max"); + phiBin = parameters.getParameter("phiBin"); + phiMin = parameters.getParameter("phiMin"); + phiMax = parameters.getParameter("phiMax"); + tunePBin= parameters.getParameter("tunePBin"); + tunePMax= parameters.getParameter("tunePMax"); + tunePMin= parameters.getParameter("tunePMin"); + thetaBin = parameters.getParameter("thetaBin"); + thetaMin = parameters.getParameter("thetaMin"); + thetaMax = parameters.getParameter("thetaMax"); + etaBin = parameters.getParameter("etaBin"); + etaMin = parameters.getParameter("etaMin"); + etaMax = parameters.getParameter("etaMax"); } MuonRecoAnalyzer::~MuonRecoAnalyzer() { delete theService; } - - -void MuonRecoAnalyzer::beginJob(){ - metname = "muRecoAnalyzer"; - - LogTrace(metname)<<"[MuonRecoAnalyzer] Parameters initialization"; - -} -void MuonRecoAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - - theDbe->cd(); - theDbe->setCurrentFolder("Muons/MuonRecoAnalyzer"); +void MuonRecoAnalyzer::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & /*iRun*/, + edm::EventSetup const & /* iSetup */){ - muReco = theDbe->book1D("muReco", "muon reconstructed tracks", 6, 1, 7); + ibooker.cd(); + ibooker.setCurrentFolder("Muons/MuonRecoAnalyzer"); + + muReco = ibooker.book1D("muReco", "muon reconstructed tracks", 6, 1, 7); muReco->setBinLabel(1,"glb+tk+sta"); muReco->setBinLabel(2,"glb+sta"); muReco->setBinLabel(3,"tk+sta"); @@ -57,148 +78,125 @@ void MuonRecoAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSe ///////////////////////////////////////////////////// // monitoring of eta parameter ///////////////////////////////////////////////////// - etaBin = parameters.getParameter("etaBin"); - etaMin = parameters.getParameter("etaMin"); - etaMax = parameters.getParameter("etaMax"); - std::string histname = "GlbMuon_"; - etaGlbTrack .push_back(theDbe->book1D(histname+"Glb_eta", "#eta_{GLB}", etaBin, etaMin, etaMax)); - etaGlbTrack .push_back(theDbe->book1D(histname+"Tk_eta", "#eta_{TKfromGLB}", etaBin, etaMin, etaMax)); - etaGlbTrack .push_back(theDbe->book1D(histname+"Sta_eta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); - etaResolution.push_back(theDbe->book1D("Res_TkGlb_eta", "#eta_{TKfromGLB} - #eta_{GLB}", etaBin*binFactor, etaMin/3000, etaMax/3000)); - etaResolution.push_back(theDbe->book1D("Res_GlbSta_eta", "#eta_{GLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100)); - etaResolution.push_back(theDbe->book1D("Res_TkSta_eta", "#eta_{TKfromGLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100)); - etaResolution.push_back(theDbe->book2D("ResVsEta_TkGlb_eta", "(#eta_{TKfromGLB} - #eta_{GLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/3000, etaMax/3000)); - etaResolution.push_back(theDbe->book2D("ResVsEta_GlbSta_eta", "(#eta_{GLB} - #eta_{STAfromGLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100)); - etaResolution.push_back(theDbe->book2D("ResVsEta_TkSta_eta", "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs #eta_{TKfromGLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100)); - etaPull = theDbe->book1D("Pull_TkSta_eta", "#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10); - etaTrack = theDbe->book1D("TkMuon_eta", "#eta_{TK}", etaBin, etaMin, etaMax); - etaStaTrack = theDbe->book1D("StaMuon_eta", "#eta_{STA}", etaBin, etaMin, etaMax); - etaEfficiency.push_back(theDbe->book1D("StaEta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); - etaEfficiency.push_back(theDbe->book1D("StaEta_ifCombinedAlso", "#eta_{STAfromGLB} if isGlb=true", etaBin, etaMin, etaMax)); + etaGlbTrack .push_back(ibooker.book1D(histname+"Glb_eta", "#eta_{GLB}", etaBin, etaMin, etaMax)); + etaGlbTrack .push_back(ibooker.book1D(histname+"Tk_eta", "#eta_{TKfromGLB}", etaBin, etaMin, etaMax)); + etaGlbTrack .push_back(ibooker.book1D(histname+"Sta_eta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); + etaResolution.push_back(ibooker.book1D("Res_TkGlb_eta", "#eta_{TKfromGLB} - #eta_{GLB}", etaBin*binFactor, etaMin/3000, etaMax/3000)); + etaResolution.push_back(ibooker.book1D("Res_GlbSta_eta", "#eta_{GLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100)); + etaResolution.push_back(ibooker.book1D("Res_TkSta_eta", "#eta_{TKfromGLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100)); + etaResolution.push_back(ibooker.book2D("ResVsEta_TkGlb_eta", "(#eta_{TKfromGLB} - #eta_{GLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/3000, etaMax/3000)); + etaResolution.push_back(ibooker.book2D("ResVsEta_GlbSta_eta", "(#eta_{GLB} - #eta_{STAfromGLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100)); + etaResolution.push_back(ibooker.book2D("ResVsEta_TkSta_eta", "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs #eta_{TKfromGLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100)); + etaPull = ibooker.book1D("Pull_TkSta_eta", "#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10); + etaTrack = ibooker.book1D("TkMuon_eta", "#eta_{TK}", etaBin, etaMin, etaMax); + etaStaTrack = ibooker.book1D("StaMuon_eta", "#eta_{STA}", etaBin, etaMin, etaMax); + etaEfficiency.push_back(ibooker.book1D("StaEta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); + etaEfficiency.push_back(ibooker.book1D("StaEta_ifCombinedAlso", "#eta_{STAfromGLB} if isGlb=true", etaBin, etaMin, etaMax)); ////////////////////////////////////////////////////// // monitoring of theta parameter ///////////////////////////////////////////////////// - thetaBin = parameters.getParameter("thetaBin"); - thetaMin = parameters.getParameter("thetaMin"); - thetaMax = parameters.getParameter("thetaMax"); - thetaGlbTrack.push_back(theDbe->book1D(histname+"Glb_theta", "#theta_{GLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[0]->setAxisTitle("rad"); - thetaGlbTrack.push_back(theDbe->book1D(histname+"Tk_theta", "#theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[1]->setAxisTitle("rad"); - thetaGlbTrack.push_back(theDbe->book1D(histname+"Sta_theta", "#theta_{STAfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[2]->setAxisTitle("rad"); - thetaResolution.push_back(theDbe->book1D("Res_TkGlb_theta", "#theta_{TKfromGLB} - #theta_{GLB}", thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[0]->setAxisTitle("rad"); - thetaResolution.push_back(theDbe->book1D("Res_GlbSta_theta", "#theta_{GLB} - #theta_{STAfromGLB}", thetaBin*binFactor,-(thetaMax/100), thetaMax/100)); + thetaGlbTrack.push_back(ibooker.book1D(histname+"Glb_theta", "#theta_{GLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[0]->setAxisTitle("rad"); + thetaGlbTrack.push_back(ibooker.book1D(histname+"Tk_theta", "#theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[1]->setAxisTitle("rad"); + thetaGlbTrack.push_back(ibooker.book1D(histname+"Sta_theta", "#theta_{STAfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[2]->setAxisTitle("rad"); + thetaResolution.push_back(ibooker.book1D("Res_TkGlb_theta", "#theta_{TKfromGLB} - #theta_{GLB}", thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[0]->setAxisTitle("rad"); + thetaResolution.push_back(ibooker.book1D("Res_GlbSta_theta", "#theta_{GLB} - #theta_{STAfromGLB}", thetaBin*binFactor,-(thetaMax/100), thetaMax/100)); thetaResolution[1]->setAxisTitle("rad"); - thetaResolution.push_back(theDbe->book1D("Res_TkSta_theta", "#theta_{TKfromGLB} - #theta_{STAfromGLB}", thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); + thetaResolution.push_back(ibooker.book1D("Res_TkSta_theta", "#theta_{TKfromGLB} - #theta_{STAfromGLB}", thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); thetaResolution[2]->setAxisTitle("rad"); - thetaResolution.push_back(theDbe->book2D("ResVsTheta_TkGlb_theta", "(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); + thetaResolution.push_back(ibooker.book2D("ResVsTheta_TkGlb_theta", "(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[3]->setAxisTitle("rad",1); thetaResolution[3]->setAxisTitle("rad",2); - thetaResolution.push_back(theDbe->book2D("ResVsTheta_GlbSta_theta", "(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); + thetaResolution.push_back(ibooker.book2D("ResVsTheta_GlbSta_theta", "(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); thetaResolution[4]->setAxisTitle("rad",1); thetaResolution[4]->setAxisTitle("rad",2); - thetaResolution.push_back(theDbe->book2D("ResVsTheta_TkSta_theta", "(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); + thetaResolution.push_back(ibooker.book2D("ResVsTheta_TkSta_theta", "(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100)); thetaResolution[5]->setAxisTitle("rad",1); thetaResolution[5]->setAxisTitle("rad",2); - thetaPull = theDbe->book1D("Pull_TkSta_theta", "#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100,-10,10); - thetaTrack = theDbe->book1D("TkMuon_theta", "#theta_{TK}", thetaBin, thetaMin, thetaMax); + thetaPull = ibooker.book1D("Pull_TkSta_theta", "#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100,-10,10); + thetaTrack = ibooker.book1D("TkMuon_theta", "#theta_{TK}", thetaBin, thetaMin, thetaMax); thetaTrack->setAxisTitle("rad"); - thetaStaTrack = theDbe->book1D("StaMuon_theta", "#theta_{STA}", thetaBin, thetaMin, thetaMax); + thetaStaTrack = ibooker.book1D("StaMuon_theta", "#theta_{STA}", thetaBin, thetaMin, thetaMax); thetaStaTrack->setAxisTitle("rad"); // monitoring tunePMuonBestTrack Pt - tunePBin= parameters.getParameter("tunePBin"); - tunePMax= parameters.getParameter("tunePMax"); - tunePMin= parameters.getParameter("tunePMin"); - - tunePResolution = theDbe->book1D("Res_TuneP_pt", "Pt_{MuonBestTrack}-Pt_{tunePMuonBestTrack}/Pt_{MuonBestTrack}", tunePBin, tunePMin, tunePMax); + tunePResolution = ibooker.book1D("Res_TuneP_pt", "Pt_{MuonBestTrack}-Pt_{tunePMuonBestTrack}/Pt_{MuonBestTrack}", tunePBin, tunePMin, tunePMax); // monitoring of phi paramater - phiBin = parameters.getParameter("phiBin"); - phiMin = parameters.getParameter("phiMin"); - phiMax = parameters.getParameter("phiMax"); - phiGlbTrack.push_back(theDbe->book1D(histname+"Glb_phi", "#phi_{GLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Glb_phi", "#phi_{GLB}", phiBin, phiMin, phiMax)); phiGlbTrack[0]->setAxisTitle("rad"); - phiGlbTrack.push_back(theDbe->book1D(histname+"Tk_phi", "#phi_{TKfromGLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Tk_phi", "#phi_{TKfromGLB}", phiBin, phiMin, phiMax)); phiGlbTrack[1]->setAxisTitle("rad"); - phiGlbTrack.push_back(theDbe->book1D(histname+"Sta_phi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Sta_phi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); phiGlbTrack[2]->setAxisTitle("rad"); - phiResolution.push_back(theDbe->book1D("Res_TkGlb_phi", "#phi_{TKfromGLB} - #phi_{GLB}", phiBin*binFactor, phiMin/3000, phiMax/3000)); + phiResolution.push_back(ibooker.book1D("Res_TkGlb_phi", "#phi_{TKfromGLB} - #phi_{GLB}", phiBin*binFactor, phiMin/3000, phiMax/3000)); phiResolution[0]->setAxisTitle("rad"); - phiResolution.push_back(theDbe->book1D("Res_GlbSta_phi", "#phi_{GLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100)); + phiResolution.push_back(ibooker.book1D("Res_GlbSta_phi", "#phi_{GLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100)); phiResolution[1]->setAxisTitle("rad"); - phiResolution.push_back(theDbe->book1D("Res_TkSta_phi", "#phi_{TKfromGLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100)); + phiResolution.push_back(ibooker.book1D("Res_TkSta_phi", "#phi_{TKfromGLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100)); phiResolution[2]->setAxisTitle("rad"); - phiResolution.push_back(theDbe->book2D("ResVsPhi_TkGlb_phi", "(#phi_{TKfromGLB} - #phi_{GLB}) vs #phi_GLB", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/3000, phiMax/3000)); + phiResolution.push_back(ibooker.book2D("ResVsPhi_TkGlb_phi", "(#phi_{TKfromGLB} - #phi_{GLB}) vs #phi_GLB", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/3000, phiMax/3000)); phiResolution[3]->setAxisTitle("rad",1); phiResolution[3]->setAxisTitle("rad",2); - phiResolution.push_back(theDbe->book2D("ResVsPhi_GlbSta_phi", "(#phi_{GLB} - #phi_{STAfromGLB}) vs #phi_{GLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100)); + phiResolution.push_back(ibooker.book2D("ResVsPhi_GlbSta_phi", "(#phi_{GLB} - #phi_{STAfromGLB}) vs #phi_{GLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100)); phiResolution[4]->setAxisTitle("rad",1); phiResolution[4]->setAxisTitle("rad",2); - phiResolution.push_back(theDbe->book2D("ResVsPhi_TkSta_phi", "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs #phi_{TKfromGLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100)); + phiResolution.push_back(ibooker.book2D("ResVsPhi_TkSta_phi", "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs #phi_{TKfromGLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100)); phiResolution[5]->setAxisTitle("rad",1); phiResolution[5]->setAxisTitle("rad",2); - phiPull = theDbe->book1D("Pull_TkSta_phi", "#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100,-10,10); - phiTrack = theDbe->book1D("TkMuon_phi", "#phi_{TK}", phiBin, phiMin, phiMax); + phiPull = ibooker.book1D("Pull_TkSta_phi", "#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100,-10,10); + phiTrack = ibooker.book1D("TkMuon_phi", "#phi_{TK}", phiBin, phiMin, phiMax); phiTrack->setAxisTitle("rad"); - phiStaTrack = theDbe->book1D("StaMuon_phi", "#phi_{STA}", phiBin, phiMin, phiMax); + phiStaTrack = ibooker.book1D("StaMuon_phi", "#phi_{STA}", phiBin, phiMin, phiMax); phiStaTrack->setAxisTitle("rad"); - phiEfficiency.push_back(theDbe->book1D("StaPhi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); + phiEfficiency.push_back(ibooker.book1D("StaPhi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); phiEfficiency[0]->setAxisTitle("rad"); - phiEfficiency.push_back(theDbe->book1D("StaPhi_ifCombinedAlso", "#phi_{STAfromGLB} if the isGlb=true", phiBin, phiMin, phiMax)); + phiEfficiency.push_back(ibooker.book1D("StaPhi_ifCombinedAlso", "#phi_{STAfromGLB} if the isGlb=true", phiBin, phiMin, phiMax)); phiEfficiency[1]->setAxisTitle("rad"); // monitoring of the chi2 parameter - chi2Bin = parameters.getParameter("chi2Bin"); - chi2Min = parameters.getParameter("chi2Min"); - chi2Max = parameters.getParameter("chi2Max"); - chi2OvDFGlbTrack.push_back(theDbe->book1D(histname+"Glb_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max)); - chi2OvDFGlbTrack.push_back(theDbe->book1D(histname+"Tk_chi2OverDf", "#chi_{2}OverDF_{TKfromGLB}", phiBin, chi2Min, chi2Max)); - chi2OvDFGlbTrack.push_back(theDbe->book1D(histname+"Sta_chi2OverDf", "#chi_{2}OverDF_{STAfromGLB}", chi2Bin, chi2Min, chi2Max)); - chi2OvDFTrack = theDbe->book1D("TkMuon_chi2OverDf", "#chi_{2}OverDF_{TK}", chi2Bin, chi2Min, chi2Max); - chi2OvDFStaTrack = theDbe->book1D("StaMuon_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Glb_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max)); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Tk_chi2OverDf", "#chi_{2}OverDF_{TKfromGLB}", phiBin, chi2Min, chi2Max)); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Sta_chi2OverDf", "#chi_{2}OverDF_{STAfromGLB}", chi2Bin, chi2Min, chi2Max)); + chi2OvDFTrack = ibooker.book1D("TkMuon_chi2OverDf", "#chi_{2}OverDF_{TK}", chi2Bin, chi2Min, chi2Max); + chi2OvDFStaTrack = ibooker.book1D("StaMuon_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max); //-------------------------- - probchi2GlbTrack.push_back(theDbe->book1D(histname+"Glb_probchi", "Prob #chi_{GLB}", 120, chi2Min, 1.20)); - probchi2GlbTrack.push_back(theDbe->book1D(histname+"Tk_probchi", "Prob #chi_{TKfromGLB}", 120, chi2Min, 1.20)); - probchi2GlbTrack.push_back(theDbe->book1D(histname+"Sta_probchi", "Prob #chi_{STAfromGLB}", 120, chi2Min, 1.20)); - probchi2Track=theDbe->book1D("TkMuon_probchi", "Prob #chi_{TK}", 120, chi2Min, 1.20); - probchi2StaTrack=theDbe->book1D("StaMuon_probchi", "Prob #chi_{STA}", 120, chi2Min, 1.20); + probchi2GlbTrack.push_back(ibooker.book1D(histname+"Glb_probchi", "Prob #chi_{GLB}", 120, chi2Min, 1.20)); + probchi2GlbTrack.push_back(ibooker.book1D(histname+"Tk_probchi", "Prob #chi_{TKfromGLB}", 120, chi2Min, 1.20)); + probchi2GlbTrack.push_back(ibooker.book1D(histname+"Sta_probchi", "Prob #chi_{STAfromGLB}", 120, chi2Min, 1.20)); + probchi2Track=ibooker.book1D("TkMuon_probchi", "Prob #chi_{TK}", 120, chi2Min, 1.20); + probchi2StaTrack=ibooker.book1D("StaMuon_probchi", "Prob #chi_{STA}", 120, chi2Min, 1.20); // monitoring of the momentum - pBin = parameters.getParameter("pBin"); - pMin = parameters.getParameter("pMin"); - pMax = parameters.getParameter("pMax"); - pGlbTrack.push_back(theDbe->book1D(histname+"Glb_p", "p_{GLB}", pBin, pMin, pMax)); + pGlbTrack.push_back(ibooker.book1D(histname+"Glb_p", "p_{GLB}", pBin, pMin, pMax)); pGlbTrack[0]->setAxisTitle("GeV"); - pGlbTrack.push_back(theDbe->book1D(histname+"Tk_p", "p_{TKfromGLB}", pBin, pMin, pMax)); + pGlbTrack.push_back(ibooker.book1D(histname+"Tk_p", "p_{TKfromGLB}", pBin, pMin, pMax)); pGlbTrack[1]->setAxisTitle("GeV"); - pGlbTrack.push_back(theDbe->book1D(histname+"Sta_p", "p_{STAfromGLB}", pBin, pMin, pMax)); + pGlbTrack.push_back(ibooker.book1D(histname+"Sta_p", "p_{STAfromGLB}", pBin, pMin, pMax)); pGlbTrack[2]->setAxisTitle("GeV"); - pTrack = theDbe->book1D("TkMuon_p", "p_{TK}", pBin, pMin, pMax); + pTrack = ibooker.book1D("TkMuon_p", "p_{TK}", pBin, pMin, pMax); pTrack->setAxisTitle("GeV"); - pStaTrack = theDbe->book1D("StaMuon_p", "p_{STA}", pBin, pMin, pMax); + pStaTrack = ibooker.book1D("StaMuon_p", "p_{STA}", pBin, pMin, pMax); pStaTrack->setAxisTitle("GeV"); // monitoring of the transverse momentum - ptBin = parameters.getParameter("ptBin"); - ptMin = parameters.getParameter("ptMin"); - ptMax = parameters.getParameter("ptMax"); - ptGlbTrack.push_back(theDbe->book1D(histname+"Glb_pt", "pt_{GLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Glb_pt", "pt_{GLB}", ptBin, ptMin, ptMax)); ptGlbTrack[0]->setAxisTitle("GeV"); - ptGlbTrack.push_back(theDbe->book1D(histname+"Tk_pt", "pt_{TKfromGLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Tk_pt", "pt_{TKfromGLB}", ptBin, ptMin, ptMax)); ptGlbTrack[1]->setAxisTitle("GeV"); - ptGlbTrack.push_back(theDbe->book1D(histname+"Sta_pt", "pt_{STAfromGLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Sta_pt", "pt_{STAfromGLB}", ptBin, ptMin, ptMax)); ptGlbTrack[2]->setAxisTitle("GeV"); - ptTrack = theDbe->book1D("TkMuon_pt", "pt_{TK}", ptBin, ptMin, ptMax); + ptTrack = ibooker.book1D("TkMuon_pt", "pt_{TK}", ptBin, ptMin, ptMax); ptTrack->setAxisTitle("GeV"); - ptStaTrack = theDbe->book1D("StaMuon_pt", "pt_{STA}", ptBin, ptMin, pMax); + ptStaTrack = ibooker.book1D("StaMuon_pt", "pt_{STA}", ptBin, ptMin, pMax); ptStaTrack->setAxisTitle("GeV"); // monitoring of the muon charge - qGlbTrack.push_back(theDbe->book1D(histname+"Glb_q", "q_{GLB}", 5, -2.5, 2.5)); - qGlbTrack.push_back(theDbe->book1D(histname+"Tk_q", "q_{TKfromGLB}", 5, -2.5, 2.5)); - qGlbTrack.push_back(theDbe->book1D(histname+"Sta_q", "q_{STAformGLB}", 5, -2.5, 2.5)); - qGlbTrack.push_back(theDbe->book1D(histname+"qComparison", "comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5)); + qGlbTrack.push_back(ibooker.book1D(histname+"Glb_q", "q_{GLB}", 5, -2.5, 2.5)); + qGlbTrack.push_back(ibooker.book1D(histname+"Tk_q", "q_{TKfromGLB}", 5, -2.5, 2.5)); + qGlbTrack.push_back(ibooker.book1D(histname+"Sta_q", "q_{STAformGLB}", 5, -2.5, 2.5)); + qGlbTrack.push_back(ibooker.book1D(histname+"qComparison", "comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5)); qGlbTrack[3]->setBinLabel(1,"qGlb=qSta"); qGlbTrack[3]->setBinLabel(2,"qGlb!=qSta"); qGlbTrack[3]->setBinLabel(3,"qGlb=qTk"); @@ -207,87 +205,81 @@ void MuonRecoAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSe qGlbTrack[3]->setBinLabel(6,"qSta!=qTk"); qGlbTrack[3]->setBinLabel(7,"qGlb!=qSta,qGlb!=Tk"); qGlbTrack[3]->setBinLabel(8,"qGlb=qSta,qGlb=Tk"); - qTrack = theDbe->book1D("TkMuon_q", "q_{TK}", 5, -2.5, 2.5); - qStaTrack = theDbe->book1D("StaMuon_q", "q_{STA}", 5, -2.5, 2.5); + qTrack = ibooker.book1D("TkMuon_q", "q_{TK}", 5, -2.5, 2.5); + qStaTrack = ibooker.book1D("StaMuon_q", "q_{STA}", 5, -2.5, 2.5); ////////////////////////////////////////////////////////////// // monitoring of the momentum resolution - pResBin = parameters.getParameter("pResBin"); - pResMin = parameters.getParameter("pResMin"); - pResMax = parameters.getParameter("pResMax"); - qOverpResolution.push_back(theDbe->book1D("Res_TkGlb_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); + qOverpResolution.push_back(ibooker.book1D("Res_TkGlb_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); qOverpResolution[0]->setAxisTitle("GeV^{-1}"); - qOverpResolution.push_back(theDbe->book1D("Res_GlbSta_qOverp", "(q/p)_{GLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + qOverpResolution.push_back(ibooker.book1D("Res_GlbSta_qOverp", "(q/p)_{GLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); qOverpResolution[1]->setAxisTitle("GeV^{-1}"); - qOverpResolution.push_back(theDbe->book1D("Res_TkSta_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + qOverpResolution.push_back(ibooker.book1D("Res_TkSta_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); qOverpResolution[2]->setAxisTitle("GeV^{-1}"); - qOverpPull = theDbe->book1D("Pull_TkSta_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100,-10,10); + qOverpPull = ibooker.book1D("Pull_TkSta_qOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100,-10,10); - oneOverpResolution.push_back(theDbe->book1D("Res_TkGlb_oneOverp", "(1/p)_{TKfromGLB} - (1/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); + oneOverpResolution.push_back(ibooker.book1D("Res_TkGlb_oneOverp", "(1/p)_{TKfromGLB} - (1/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); oneOverpResolution[0]->setAxisTitle("GeV^{-1}"); - oneOverpResolution.push_back(theDbe->book1D("Res_GlbSta_oneOverp", "(1/p)_{GLB} - (1/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + oneOverpResolution.push_back(ibooker.book1D("Res_GlbSta_oneOverp", "(1/p)_{GLB} - (1/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); oneOverpResolution[1]->setAxisTitle("GeV^{-1}"); - oneOverpResolution.push_back(theDbe->book1D("Res_TkSta_oneOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + oneOverpResolution.push_back(ibooker.book1D("Res_TkSta_oneOverp", "(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); oneOverpResolution[2]->setAxisTitle("GeV^{-1}"); - oneOverpPull = theDbe->book1D("Pull_TkSta_oneOverp", "(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100,-10,10); + oneOverpPull = ibooker.book1D("Pull_TkSta_oneOverp", "(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100,-10,10); - qOverptResolution.push_back(theDbe->book1D("Res_TkGlb_qOverpt", "(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); + qOverptResolution.push_back(ibooker.book1D("Res_TkGlb_qOverpt", "(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); qOverptResolution[0]->setAxisTitle("GeV^{-1}"); - qOverptResolution.push_back(theDbe->book1D("Res_GlbSta_qOverpt", "(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + qOverptResolution.push_back(ibooker.book1D("Res_GlbSta_qOverpt", "(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); qOverptResolution[1]->setAxisTitle("GeV^{-1}"); - qOverptResolution.push_back(theDbe->book1D("Res_TkSta_qOverpt", "(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + qOverptResolution.push_back(ibooker.book1D("Res_TkSta_qOverpt", "(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); qOverptResolution[2]->setAxisTitle("GeV^{-1}"); - qOverptPull = theDbe->book1D("Pull_TkSta_qOverpt", "(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100,-10,10); + qOverptPull = ibooker.book1D("Pull_TkSta_qOverpt", "(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100,-10,10); - oneOverptResolution.push_back(theDbe->book1D("Res_TkGlb_oneOverpt", "(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); + oneOverptResolution.push_back(ibooker.book1D("Res_TkGlb_oneOverpt", "(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10)); oneOverptResolution[0]->setAxisTitle("GeV^{-1}"); - oneOverptResolution.push_back(theDbe->book1D("Res_GlbSta_oneOverpt", "(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book1D("Res_GlbSta_oneOverpt", "(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[1]->setAxisTitle("GeV^{-1}"); - oneOverptResolution.push_back(theDbe->book1D("Res_TkSta_oneOverpt", "(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book1D("Res_TkSta_oneOverpt", "(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[2]->setAxisTitle("GeV^{-1}"); - oneOverptResolution.push_back(theDbe->book2D("ResVsEta_TkGlb_oneOverpt", "(#eta_{TKfromGLB} - #eta_{GLB}) vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor*2, pResMin/10, pResMax/10)); + oneOverptResolution.push_back(ibooker.book2D("ResVsEta_TkGlb_oneOverpt", "(#eta_{TKfromGLB} - #eta_{GLB}) vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor*2, pResMin/10, pResMax/10)); oneOverptResolution[3]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsEta_GlbSta_oneOverpt", "(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsEta_GlbSta_oneOverpt", "(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[4]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsEta_TkSta_oneOverpt", "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsEta_TkSta_oneOverpt", "(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[5]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPhi_TkGlb_oneOverpt", "(#phi_{TKfromGLB} - #phi_{GLB}) vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor*2, pResMin/10, pResMax/10)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPhi_TkGlb_oneOverpt", "(#phi_{TKfromGLB} - #phi_{GLB}) vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor*2, pResMin/10, pResMax/10)); oneOverptResolution[6]->setAxisTitle("rad",1); oneOverptResolution[6]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPhi_GlbSta_oneOverpt", "(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPhi_GlbSta_oneOverpt", "(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[7]->setAxisTitle("rad",1); oneOverptResolution[7]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPhi_TkSta_oneOverpt", "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPhi_TkSta_oneOverpt", "(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[8]->setAxisTitle("rad",1); oneOverptResolution[8]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPt_TkGlb_oneOverpt", "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}) vs (1/p_{t})_{GLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor*2, pResMin/10, pResMax/10)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPt_TkGlb_oneOverpt", "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}) vs (1/p_{t})_{GLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor*2, pResMin/10, pResMax/10)); oneOverptResolution[9]->setAxisTitle("GeV^{-1}",1); oneOverptResolution[9]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPt_GlbSta_oneOverpt", "((1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB} vs (1/p_{t})_{GLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPt_GlbSta_oneOverpt", "((1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB} vs (1/p_{t})_{GLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[10]->setAxisTitle("GeV^{-1}",1); oneOverptResolution[10]->setAxisTitle("GeV^{-1}",2); - oneOverptResolution.push_back(theDbe->book2D("ResVsPt_TkSta_oneOverpt", "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax)); + oneOverptResolution.push_back(ibooker.book2D("ResVsPt_TkSta_oneOverpt", "((1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", ptBin/5, ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax)); oneOverptResolution[11]->setAxisTitle("GeV^{-1}",1); oneOverptResolution[11]->setAxisTitle("GeV^{-1}",2); - oneOverptPull = theDbe->book1D("Pull_TkSta_oneOverpt", "(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100,-10,10); + oneOverptPull = ibooker.book1D("Pull_TkSta_oneOverpt", "(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100,-10,10); ////////////////////////////////////////////////////////////// // monitoring of the recHits provenance - rhBin=parameters.getParameter("rhBin"); - rhMin=parameters.getParameter("rhMin"); - rhMax=parameters.getParameter("rhMax"); - rhAnalysis.push_back(theDbe->book1D("StaRh_Frac_inGlb", "recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax)); - rhAnalysis.push_back(theDbe->book1D("TkRh_Frac_inGlb", "recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax)); - rhAnalysis.push_back(theDbe->book1D("StaRh_inGlb_Div_RhAssoSta", "recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax)); - rhAnalysis.push_back(theDbe->book1D("TkRh_inGlb_Div_RhAssoTk", "recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax)); - rhAnalysis.push_back(theDbe->book1D("GlbRh_Div_RhAssoStaTk", "recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax)); - rhAnalysis.push_back(theDbe->book1D("invalidRh_Frac_inTk", "Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("StaRh_Frac_inGlb", "recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("TkRh_Frac_inGlb", "recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("StaRh_inGlb_Div_RhAssoSta", "recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("TkRh_inGlb_Div_RhAssoTk", "recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("GlbRh_Div_RhAssoStaTk", "recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax)); + rhAnalysis.push_back(ibooker.book1D("invalidRh_Frac_inTk", "Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax)); ////////////////////////////////////////////////////////////// // monitoring of the muon system rotation w.r.t. tracker - muVStkSytemRotation.push_back(theDbe->book2D("muVStkSytemRotation_posMu", "pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2)); - muVStkSytemRotation.push_back(theDbe->book2D("muVStkSytemRotation_negMu", "pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2)); + muVStkSytemRotation.push_back(ibooker.book2D("muVStkSytemRotation_posMu", "pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2)); + muVStkSytemRotation.push_back(ibooker.book2D("muVStkSytemRotation_negMu", "pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2)); } diff --git a/DQMOffline/Muon/src/MuonRecoOneHLT.cc b/DQMOffline/Muon/src/MuonRecoOneHLT.cc index 69957d3828605..81aa7df050ca2 100644 --- a/DQMOffline/Muon/src/MuonRecoOneHLT.cc +++ b/DQMOffline/Muon/src/MuonRecoOneHLT.cc @@ -16,7 +16,6 @@ MuonRecoOneHLT::MuonRecoOneHLT(const edm::ParameterSet& pSet) { //, MuonServiceP // the services theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); - dbe = edm::Service().operator->(); ParameterSet muonparms = parameters.getParameter("SingleMuonTrigger"); ParameterSet dimuonparms = parameters.getParameter("DoubleMuonTrigger"); @@ -31,30 +30,37 @@ MuonRecoOneHLT::MuonRecoOneHLT(const edm::ParameterSet& pSet) { //, MuonServiceP theVertexLabel_ = consumes(parameters.getParameter("VertexLabel")); theBeamSpotLabel_ = mayConsume(parameters.getParameter("BeamSpotLabel")); theTriggerResultsLabel_ = consumes(parameters.getParameter("TriggerResultsLabel")); -} - + // Parameters + etaBin = parameters.getParameter("etaBin"); + etaMin = parameters.getParameter("etaMin"); + etaMax = parameters.getParameter("etaMax"); + ptBin = parameters.getParameter("ptBin"); + ptMin = parameters.getParameter("ptMin"); + ptMax = parameters.getParameter("ptMax"); + chi2Bin = parameters.getParameter("chi2Bin"); + chi2Min = parameters.getParameter("chi2Min"); + chi2Max = parameters.getParameter("chi2Max"); + phiBin = parameters.getParameter("phiBin"); + phiMin = parameters.getParameter("phiMin"); + phiMax = parameters.getParameter("phiMax"); +} MuonRecoOneHLT::~MuonRecoOneHLT() { delete _SingleMuonEventFlag; delete _DoubleMuonEventFlag; } -void MuonRecoOneHLT::beginJob() { -#ifdef DEBUG - cout << "[MuonRecoOneHLT] beginJob " << endl; -#endif - - } - -void MuonRecoOneHLT::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ +void MuonRecoOneHLT::bookHistograms(DQMStore::IBooker & ibooker, + edm::Run const & iRun, + edm::EventSetup const & iSetup) { #ifdef DEBUG cout << "[MuonRecoOneHLT] beginRun " << endl; cout << "[MuonRecoOneHLT] Is MuonEventFlag On? "<< _SingleMuonEventFlag->on() << endl; #endif - dbe->cd(); - dbe->setCurrentFolder("Muons/MuonRecoOneHLT"); + ibooker.cd(); + ibooker.setCurrentFolder("Muons/MuonRecoOneHLT"); - muReco = dbe->book1D("Muon_Reco", "Muon Reconstructed Tracks", 6, 1, 7); + muReco = ibooker.book1D("Muon_Reco", "Muon Reconstructed Tracks", 6, 1, 7); muReco->setBinLabel(1,"glb+tk+sta"); muReco->setBinLabel(2,"glb+sta"); muReco->setBinLabel(3,"tk+sta"); @@ -63,60 +69,47 @@ void MuonRecoOneHLT::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetu muReco->setBinLabel(6,"calo"); // monitoring of eta parameter - etaBin = parameters.getParameter("etaBin"); - etaMin = parameters.getParameter("etaMin"); - etaMax = parameters.getParameter("etaMax"); - std::string histname = "GlbMuon_"; - etaGlbTrack.push_back(dbe->book1D(histname+"Glb_eta", "#eta_{GLB}", etaBin, etaMin, etaMax)); - etaGlbTrack.push_back(dbe->book1D(histname+"Tk_eta", "#eta_{TKfromGLB}", etaBin, etaMin, etaMax)); - etaGlbTrack.push_back(dbe->book1D(histname+"Sta_eta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); - etaTight = dbe->book1D("TightMuon_eta", "#eta_{GLB}", etaBin, etaMin, etaMax); - etaTrack = dbe->book1D("TkMuon_eta", "#eta_{TK}", etaBin, etaMin, etaMax); - etaStaTrack = dbe->book1D("StaMuon_eta", "#eta_{STA}", etaBin, etaMin, etaMax); + etaGlbTrack.push_back(ibooker.book1D(histname+"Glb_eta", "#eta_{GLB}", etaBin, etaMin, etaMax)); + etaGlbTrack.push_back(ibooker.book1D(histname+"Tk_eta", "#eta_{TKfromGLB}", etaBin, etaMin, etaMax)); + etaGlbTrack.push_back(ibooker.book1D(histname+"Sta_eta", "#eta_{STAfromGLB}", etaBin, etaMin, etaMax)); + etaTight = ibooker.book1D("TightMuon_eta", "#eta_{GLB}", etaBin, etaMin, etaMax); + etaTrack = ibooker.book1D("TkMuon_eta", "#eta_{TK}", etaBin, etaMin, etaMax); + etaStaTrack = ibooker.book1D("StaMuon_eta", "#eta_{STA}", etaBin, etaMin, etaMax); // monitoring of phi paramater - phiBin = parameters.getParameter("phiBin"); - phiMin = parameters.getParameter("phiMin"); - phiMax = parameters.getParameter("phiMax"); - phiGlbTrack.push_back(dbe->book1D(histname+"Glb_phi", "#phi_{GLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Glb_phi", "#phi_{GLB}", phiBin, phiMin, phiMax)); phiGlbTrack[0]->setAxisTitle("rad"); - phiGlbTrack.push_back(dbe->book1D(histname+"Tk_phi", "#phi_{TKfromGLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Tk_phi", "#phi_{TKfromGLB}", phiBin, phiMin, phiMax)); phiGlbTrack[1]->setAxisTitle("rad"); - phiGlbTrack.push_back(dbe->book1D(histname+"Sta_phi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); + phiGlbTrack.push_back(ibooker.book1D(histname+"Sta_phi", "#phi_{STAfromGLB}", phiBin, phiMin, phiMax)); phiGlbTrack[2]->setAxisTitle("rad"); - phiTight = dbe->book1D("TightMuon_phi", "#phi_{GLB}", phiBin, phiMin, phiMax); - phiTrack = dbe->book1D("TkMuon_phi", "#phi_{TK}", phiBin, phiMin, phiMax); + phiTight = ibooker.book1D("TightMuon_phi", "#phi_{GLB}", phiBin, phiMin, phiMax); + phiTrack = ibooker.book1D("TkMuon_phi", "#phi_{TK}", phiBin, phiMin, phiMax); phiTrack->setAxisTitle("rad"); - phiStaTrack = dbe->book1D("StaMuon_phi", "#phi_{STA}", phiBin, phiMin, phiMax); + phiStaTrack = ibooker.book1D("StaMuon_phi", "#phi_{STA}", phiBin, phiMin, phiMax); phiStaTrack->setAxisTitle("rad"); // monitoring of the chi2 parameter - chi2Bin = parameters.getParameter("chi2Bin"); - chi2Min = parameters.getParameter("chi2Min"); - chi2Max = parameters.getParameter("chi2Max"); - chi2OvDFGlbTrack.push_back(dbe->book1D(histname+"Glb_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max)); - chi2OvDFGlbTrack.push_back(dbe->book1D(histname+"Tk_chi2OverDf", "#chi_{2}OverDF_{TKfromGLB}", phiBin, chi2Min, chi2Max)); - chi2OvDFGlbTrack.push_back(dbe->book1D(histname+"Sta_chi2OverDf", "#chi_{2}OverDF_{STAfromGLB}", chi2Bin, chi2Min, chi2Max)); - chi2OvDFTight = dbe->book1D("TightMuon_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max); - chi2OvDFTrack = dbe->book1D("TkMuon_chi2OverDf", "#chi_{2}OverDF_{TK}", chi2Bin, chi2Min, chi2Max); - chi2OvDFStaTrack = dbe->book1D("StaMuon_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Glb_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max)); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Tk_chi2OverDf", "#chi_{2}OverDF_{TKfromGLB}", phiBin, chi2Min, chi2Max)); + chi2OvDFGlbTrack.push_back(ibooker.book1D(histname+"Sta_chi2OverDf", "#chi_{2}OverDF_{STAfromGLB}", chi2Bin, chi2Min, chi2Max)); + chi2OvDFTight = ibooker.book1D("TightMuon_chi2OverDf", "#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max); + chi2OvDFTrack = ibooker.book1D("TkMuon_chi2OverDf", "#chi_{2}OverDF_{TK}", chi2Bin, chi2Min, chi2Max); + chi2OvDFStaTrack = ibooker.book1D("StaMuon_chi2OverDf", "#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max); // monitoring of the transverse momentum - ptBin = parameters.getParameter("ptBin"); - ptMin = parameters.getParameter("ptMin"); - ptMax = parameters.getParameter("ptMax"); - ptGlbTrack.push_back(dbe->book1D(histname+"Glb_pt", "pt_{GLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Glb_pt", "pt_{GLB}", ptBin, ptMin, ptMax)); ptGlbTrack[0]->setAxisTitle("GeV"); - ptGlbTrack.push_back(dbe->book1D(histname+"Tk_pt", "pt_{TKfromGLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Tk_pt", "pt_{TKfromGLB}", ptBin, ptMin, ptMax)); ptGlbTrack[1]->setAxisTitle("GeV"); - ptGlbTrack.push_back(dbe->book1D(histname+"Sta_pt", "pt_{STAfromGLB}", ptBin, ptMin, ptMax)); + ptGlbTrack.push_back(ibooker.book1D(histname+"Sta_pt", "pt_{STAfromGLB}", ptBin, ptMin, ptMax)); ptGlbTrack[2]->setAxisTitle("GeV"); - ptTight = dbe->book1D("TightMuon_pt", "pt_{GLB}", ptBin, ptMin, ptMax); + ptTight = ibooker.book1D("TightMuon_pt", "pt_{GLB}", ptBin, ptMin, ptMax); ptTight->setAxisTitle("GeV"); - ptTrack = dbe->book1D("TkMuon_pt", "pt_{TK}", ptBin, ptMin, ptMax); + ptTrack = ibooker.book1D("TkMuon_pt", "pt_{TK}", ptBin, ptMin, ptMax); ptTrack->setAxisTitle("GeV"); - ptStaTrack = dbe->book1D("StaMuon_pt", "pt_{STA}", ptBin, ptMin, ptMax); + ptStaTrack = ibooker.book1D("StaMuon_pt", "pt_{STA}", ptBin, ptMin, ptMax); ptStaTrack->setAxisTitle("GeV"); if ( _SingleMuonEventFlag->on() ) _SingleMuonEventFlag->initRun( iRun, iSetup ); diff --git a/DQMOffline/Muon/src/MuonRecoTest.cc b/DQMOffline/Muon/src/MuonRecoTest.cc index d6571676b6a9e..b111c780a340d 100644 --- a/DQMOffline/Muon/src/MuonRecoTest.cc +++ b/DQMOffline/Muon/src/MuonRecoTest.cc @@ -36,91 +36,38 @@ MuonRecoTest::MuonRecoTest(const edm::ParameterSet& ps){ parameters = ps; - theDbe = edm::Service().operator->(); - prescaleFactor = parameters.getUntrackedParameter("diagnosticPrescale", 1); -} - - -MuonRecoTest::~MuonRecoTest(){ - - LogTrace(metname) << "MuonRecoTest: analyzed " << nevents << " events"; - -} - - -void MuonRecoTest::beginJob(void){ - - metname = "muonRecoTest"; - theDbe->setCurrentFolder("Muons/Tests/muonRecoTest"); - - LogTrace(metname)<<"[MuonRecoTest] beginJob: Parameters initialization"; - - // efficiency plot - + // Parameters etaBin = parameters.getParameter("etaBin"); etaMin = parameters.getParameter("etaMin"); etaMax = parameters.getParameter("etaMax"); - etaEfficiency = theDbe->book1D("etaEfficiency_staMuon", "#eta_{STA} efficiency", etaBin, etaMin, etaMax); phiBin = parameters.getParameter("phiBin"); phiMin = parameters.getParameter("phiMin"); phiMax = parameters.getParameter("phiMax"); - phiEfficiency = theDbe->book1D("phiEfficiency_staMuon", "#phi_{STA} efficiency", phiBin, phiMin, phiMax); - - // alignment plots - globalRotation.push_back(theDbe->book1D("muVStkSytemRotation_posMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}",50,0,200)); - globalRotation.push_back(theDbe->book1D("muVStkSytemRotation_negMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{-}",50,0,200)); - globalRotation.push_back(theDbe->book1D("muVStkSytemRotation_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}-#mu^{-}",50,0,200)); - -} - -void MuonRecoTest::beginRun(Run const& run, EventSetup const& eSetup) { - - LogTrace(metname)<<"[MuonRecoTest]: beginRun"; - -} - -void MuonRecoTest::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) { - - // LogTrace(metname)<<"[MuonRecoTest]: beginLuminosityBlock"; - - // Get the run number - run = lumiSeg.run(); + EfficiencyCriterionName = parameters.getUntrackedParameter("efficiencyTestName","EfficiencyInRange"); } - - -void MuonRecoTest::analyze(const edm::Event& e, const edm::EventSetup& context){ - - nevents++; - LogTrace(metname)<< "[MuonRecoTest]: "<get(path); + MonitorElement * staEtaIfComb_histo = igetter.get(path); path = "Muons/MuonRecoAnalyzer/StaEta"; - MonitorElement * staEta_histo = theDbe->get(path); + MonitorElement * staEta_histo = igetter.get(path); if(staEtaIfComb_histo && staEta_histo){ TH1F * staEtaIfComb_root = staEtaIfComb_histo->getTH1F(); @@ -142,9 +89,9 @@ void MuonRecoTest::endRun(Run const& run, EventSetup const& eSetup) { } path = "Muons/MuonRecoAnalyzer/StaPhi_ifCombinedAlso"; - MonitorElement * staPhiIfComb_histo = theDbe->get(path); + MonitorElement * staPhiIfComb_histo = igetter.get(path); path = "Muons/MuonRecoAnalyzer/StaPhi"; - MonitorElement * staPhi_histo = theDbe->get(path); + MonitorElement * staPhi_histo = igetter.get(path); if(staPhiIfComb_histo && staPhi_histo){ @@ -168,7 +115,7 @@ void MuonRecoTest::endRun(Run const& run, EventSetup const& eSetup) { // efficiency test - string EfficiencyCriterionName = parameters.getUntrackedParameter("efficiencyTestName","EfficiencyInRange"); + // eta efficiency const QReport * theEtaQReport = etaEfficiency->getQReport(EfficiencyCriterionName); @@ -193,9 +140,9 @@ void MuonRecoTest::endRun(Run const& run, EventSetup const& eSetup) { //alignment plot string pathPos = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_posMu"; - MonitorElement * muVStkSytemRotation_posMu_histo = theDbe->get(pathPos); + MonitorElement * muVStkSytemRotation_posMu_histo = igetter.get(pathPos); string pathNeg = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_negMu"; - MonitorElement * muVStkSytemRotation_negMu_histo = theDbe->get(pathNeg); + MonitorElement * muVStkSytemRotation_negMu_histo = igetter.get(pathNeg); if(muVStkSytemRotation_posMu_histo && muVStkSytemRotation_negMu_histo){ TH2F * muVStkSytemRotation_posMu_root = muVStkSytemRotation_posMu_histo->getTH2F(); @@ -215,11 +162,4 @@ void MuonRecoTest::endRun(Run const& run, EventSetup const& eSetup) { } } - -void MuonRecoTest::endJob(){ - - LogTrace(metname)<< "[MuonRecoTest] endJob called!"; - theDbe->rmdir("Muons/Tests/muonRecoTest"); - -} diff --git a/DQMOffline/Muon/src/MuonSeedsAnalyzer.cc b/DQMOffline/Muon/src/MuonSeedsAnalyzer.cc index 5d71ef248923b..26387a055fe39 100644 --- a/DQMOffline/Muon/src/MuonSeedsAnalyzer.cc +++ b/DQMOffline/Muon/src/MuonSeedsAnalyzer.cc @@ -38,124 +38,113 @@ MuonSeedsAnalyzer::MuonSeedsAnalyzer(const edm::ParameterSet& pSet) { parameters = pSet; theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); - theDbe = edm::Service().operator->(); - theSeedsCollectionLabel_ = consumes(parameters.getParameter("SeedCollection")); -} - - -MuonSeedsAnalyzer::~MuonSeedsAnalyzer() { - delete theService; -} - -void MuonSeedsAnalyzer::beginJob(){ - metname = "seedsAnalyzer"; - LogTrace(metname)<<"[MuonSeedsAnalyzer] Parameters initialization"; - -} - -void MuonSeedsAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - - theDbe->cd(); - theDbe->setCurrentFolder("Muons/MuonSeedsAnalyzer"); - seedHitBin = parameters.getParameter("RecHitBin"); seedHitMin = parameters.getParameter("RecHitMin"); seedHitMax = parameters.getParameter("RecHitMax"); - string histname = "NumberOfRecHitsPerSeed_"; - NumberOfRecHitsPerSeed = theDbe->book1D(histname, "Number of seed recHits", seedHitBin, seedHitMin, seedHitMax); - PhiBin = parameters.getParameter("PhiBin"); PhiMin = parameters.getParameter("PhiMin"); PhiMax = parameters.getParameter("PhiMax"); - histname = "seedPhi_"; - seedPhi = theDbe->book1D(histname, "Seed #phi", PhiBin, PhiMin, PhiMax); - seedPhi->setAxisTitle("rad"); - EtaBin = parameters.getParameter("EtaBin"); EtaMin = parameters.getParameter("EtaMin"); EtaMax = parameters.getParameter("EtaMax"); - histname = "seedEta_"; - seedEta = theDbe->book1D(histname, "Seed #eta", EtaBin, EtaMin, EtaMax); - ThetaBin = parameters.getParameter("ThetaBin"); ThetaMin = parameters.getParameter("ThetaMin"); ThetaMax = parameters.getParameter("ThetaMax"); - histname = "seedTheta_"; - seedTheta = theDbe->book1D(histname, "Seed #theta", ThetaBin, ThetaMin, ThetaMax); - seedTheta->setAxisTitle("rad"); - seedPtBin = parameters.getParameter("seedPtBin"); seedPtMin = parameters.getParameter("seedPtMin"); seedPtMax = parameters.getParameter("seedPtMax"); - histname = "seedPt_"; - seedPt = theDbe->book1D(histname, "Seed p_{t}", seedPtBin, seedPtMin, seedPtMax); - seedPt->setAxisTitle("GeV"); - seedPxyzBin = parameters.getParameter("seedPxyzBin"); seedPxyzMin = parameters.getParameter("seedPxyzMin"); seedPxyzMax = parameters.getParameter("seedPxyzMax"); + pErrBin = parameters.getParameter("pErrBin"); + pErrMin = parameters.getParameter("pErrMin"); + pErrMax = parameters.getParameter("pErrMax"); + pxyzErrBin = parameters.getParameter("pxyzErrBin"); + pxyzErrMin = parameters.getParameter("pxyzErrMin"); + pxyzErrMax = parameters.getParameter("pxyzErrMax"); + phiErrBin = parameters.getParameter("phiErrBin"); + phiErrMin = parameters.getParameter("phiErrMin"); + phiErrMax = parameters.getParameter("phiErrMax"); + etaErrBin = parameters.getParameter("etaErrBin"); + etaErrMin = parameters.getParameter("etaErrMin"); + etaErrMax = parameters.getParameter("etaErrMax"); +} +MuonSeedsAnalyzer::~MuonSeedsAnalyzer() { + delete theService; +} +void MuonSeedsAnalyzer::bookHistograms(DQMStore::IBooker & ibooker, edm::Run const &, edm::EventSetup const &) { + + ibooker.cd(); + ibooker.setCurrentFolder("Muons/MuonSeedsAnalyzer"); + + string histname = "NumberOfRecHitsPerSeed_"; + NumberOfRecHitsPerSeed = ibooker.book1D(histname, "Number of seed recHits", seedHitBin, seedHitMin, seedHitMax); + + histname = "seedPhi_"; + seedPhi = ibooker.book1D(histname, "Seed #phi", PhiBin, PhiMin, PhiMax); + seedPhi->setAxisTitle("rad"); + + histname = "seedEta_"; + seedEta = ibooker.book1D(histname, "Seed #eta", EtaBin, EtaMin, EtaMax); + + histname = "seedTheta_"; + seedTheta = ibooker.book1D(histname, "Seed #theta", ThetaBin, ThetaMin, ThetaMax); + seedTheta->setAxisTitle("rad"); + + histname = "seedPt_"; + seedPt = ibooker.book1D(histname, "Seed p_{t}", seedPtBin, seedPtMin, seedPtMax); + seedPt->setAxisTitle("GeV"); + histname = "seedPx_"; - seedPx = theDbe->book1D(histname, "Seed p_{x}", seedPxyzBin, seedPxyzMin, seedPxyzMax); + seedPx = ibooker.book1D(histname, "Seed p_{x}", seedPxyzBin, seedPxyzMin, seedPxyzMax); seedPx->setAxisTitle("GeV"); histname = "seedPy_"; - seedPy = theDbe->book1D(histname, "Seed p_{y}", seedPxyzBin, seedPxyzMin, seedPxyzMax); + seedPy = ibooker.book1D(histname, "Seed p_{y}", seedPxyzBin, seedPxyzMin, seedPxyzMax); seedPy->setAxisTitle("GeV"); histname = "seedPz_"; - seedPz = theDbe->book1D(histname, "Seed p_{z}", seedPxyzBin, seedPxyzMin, seedPxyzMax); + seedPz = ibooker.book1D(histname, "Seed p_{z}", seedPxyzBin, seedPxyzMin, seedPxyzMax); seedPz->setAxisTitle("GeV"); - - pErrBin = parameters.getParameter("pErrBin"); - pErrMin = parameters.getParameter("pErrMin"); - pErrMax = parameters.getParameter("pErrMax"); + histname = "seedPtErrOverPt_"; - seedPtErr = theDbe->book1D(histname, "Seed p_{t}Err/p_{t}", pErrBin, pErrMin, pErrMax); + seedPtErr = ibooker.book1D(histname, "Seed p_{t}Err/p_{t}", pErrBin, pErrMin, pErrMax); histname = "seedPtErrOverPtVsPhi_"; - seedPtErrVsPhi = theDbe->book2D(histname, "Seed p_{t}Err/p_{t} vs #phi", PhiBin, PhiMin, PhiMax, pErrBin, pErrMin, pErrMax); + seedPtErrVsPhi = ibooker.book2D(histname, "Seed p_{t}Err/p_{t} vs #phi", PhiBin, PhiMin, PhiMax, pErrBin, pErrMin, pErrMax); seedPtErrVsPhi->setAxisTitle("rad",2); histname = "seedPtErrOverPtVsEta_"; - seedPtErrVsEta = theDbe->book2D(histname, "Seed p_{t}Err/p_{t} vs #eta", EtaBin, EtaMin, EtaMax, pErrBin, pErrMin, pErrMax); + seedPtErrVsEta = ibooker.book2D(histname, "Seed p_{t}Err/p_{t} vs #eta", EtaBin, EtaMin, EtaMax, pErrBin, pErrMin, pErrMax); histname = "seedPtErrOverPtVsPt_"; - seedPtErrVsPt = theDbe->book2D(histname, "Seed p_{t}Err/p_{t} vs p_{t}", seedPtBin/5, seedPtMin, seedPtMax, pErrBin, pErrMin, pErrMax); + seedPtErrVsPt = ibooker.book2D(histname, "Seed p_{t}Err/p_{t} vs p_{t}", seedPtBin/5, seedPtMin, seedPtMax, pErrBin, pErrMin, pErrMax); seedPtErrVsPt->setAxisTitle("GeV",2); histname = "seedPErrOverP_"; - seedPErr = theDbe->book1D(histname, "Seed pErr/p", pErrBin, pErrMin, pErrMax); + seedPErr = ibooker.book1D(histname, "Seed pErr/p", pErrBin, pErrMin, pErrMax); histname = "seedPErrOverPVsPhi_"; - seedPErrVsPhi = theDbe->book2D(histname, "Seed pErr/p vs #phi", PhiBin, PhiMin, PhiMax, pErrBin, pErrMin, pErrMax); + seedPErrVsPhi = ibooker.book2D(histname, "Seed pErr/p vs #phi", PhiBin, PhiMin, PhiMax, pErrBin, pErrMin, pErrMax); seedPErrVsPhi->setAxisTitle("rad",2); histname = "seedPErrOverPVsEta_"; - seedPErrVsEta = theDbe->book2D(histname, "Seed pErr/p vs #eta", EtaBin, EtaMin, EtaMax, pErrBin, pErrMin, pErrMax); + seedPErrVsEta = ibooker.book2D(histname, "Seed pErr/p vs #eta", EtaBin, EtaMin, EtaMax, pErrBin, pErrMin, pErrMax); histname = "seedPErrOverPVsPt_"; - seedPErrVsPt = theDbe->book2D(histname, "Seed pErr/p vs p_{t}", seedPtBin/5, seedPtMin, seedPtMax, pErrBin, pErrMin, pErrMax); + seedPErrVsPt = ibooker.book2D(histname, "Seed pErr/p vs p_{t}", seedPtBin/5, seedPtMin, seedPtMax, pErrBin, pErrMin, pErrMax); seedPErrVsPt->setAxisTitle("GeV",2); - pxyzErrBin = parameters.getParameter("pxyzErrBin"); - pxyzErrMin = parameters.getParameter("pxyzErrMin"); - pxyzErrMax = parameters.getParameter("pxyzErrMax"); histname = "seedPxErrOverPx_"; - seedPxErr = theDbe->book1D(histname, "Seed p_{x}Err/p_{x}", pxyzErrBin, pxyzErrMin, pxyzErrMax); + seedPxErr = ibooker.book1D(histname, "Seed p_{x}Err/p_{x}", pxyzErrBin, pxyzErrMin, pxyzErrMax); histname = "seedPyErrOverPy_"; - seedPyErr = theDbe->book1D(histname, "Seed p_{y}Err/p_{y}", pxyzErrBin, pxyzErrMin, pxyzErrMax); + seedPyErr = ibooker.book1D(histname, "Seed p_{y}Err/p_{y}", pxyzErrBin, pxyzErrMin, pxyzErrMax); histname = "seedPzErrOverPz_"; - seedPzErr = theDbe->book1D(histname, "Seed p_{z}Err/p_{z}", pxyzErrBin, pxyzErrMin, pxyzErrMax); + seedPzErr = ibooker.book1D(histname, "Seed p_{z}Err/p_{z}", pxyzErrBin, pxyzErrMin, pxyzErrMax); - phiErrBin = parameters.getParameter("phiErrBin"); - phiErrMin = parameters.getParameter("phiErrMin"); - phiErrMax = parameters.getParameter("phiErrMax"); + histname = "seedPhiErr_"; - seedPhiErr = theDbe->book1D(histname, "Seed #phi error", phiErrBin, phiErrMin, phiErrMax); + seedPhiErr = ibooker.book1D(histname, "Seed #phi error", phiErrBin, phiErrMin, phiErrMax); - etaErrBin = parameters.getParameter("etaErrBin"); - etaErrMin = parameters.getParameter("etaErrMin"); - etaErrMax = parameters.getParameter("etaErrMax"); histname = "seedEtaErr_"; - seedEtaErr = theDbe->book1D(histname, "Seed #eta error", etaErrBin, etaErrMin, etaErrMax); + seedEtaErr = ibooker.book1D(histname, "Seed #eta error", etaErrBin, etaErrMin, etaErrMax); } - void MuonSeedsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ theService->update(iSetup); @@ -263,19 +252,4 @@ void MuonSeedsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& } } - -//TrajectoryStateOnSurface MuonSeedsAnalyzer::getSeedTSOS(const TrajectorySeed& seed){ -// -// // Get the Trajectory State on Det (persistent version of a TSOS) from the seed -// PTrajectoryStateOnDet pTSOD = seed.startingState(); -// // Transform it in a TrajectoryStateOnSurface -// -// DetId seedDetId(pTSOD.detId()); -// const GeomDet* gdet = service()->trackingGeometry()->idToDet( seedDetId ); -// TrajectoryStateOnSurface initialState = trajectoryStateTransform::transientState(pTSOD, &(gdet->surface()), &*(service())->magneticField()); -// -// return initialState; -// -//} -// diff --git a/DQMOffline/Muon/src/MuonTestSummary.cc b/DQMOffline/Muon/src/MuonTestSummary.cc index ad77a8ef93456..5ca5f1b81b0ca 100644 --- a/DQMOffline/Muon/src/MuonTestSummary.cc +++ b/DQMOffline/Muon/src/MuonTestSummary.cc @@ -27,10 +27,6 @@ using namespace std; MuonTestSummary::MuonTestSummary(const edm::ParameterSet& ps){ - dbe = Service().operator->(); - dbe->cd(); - dbe->setCurrentFolder("Muons/TestSummary"); - // parameter initialization for kinematics test etaExpected = ps.getParameter("etaExpected"); phiExpected = ps.getParameter("phiExpected"); @@ -73,24 +69,13 @@ MuonTestSummary::MuonTestSummary(const edm::ParameterSet& ps){ MuonTestSummary::~MuonTestSummary(){} -void MuonTestSummary::beginJob(void){ - - metname = "muonTestSummary"; - LogTrace(metname)<<"[MuonTestSummary] beginJob: Histo booking"; - dbe->cd(); - dbe->setCurrentFolder("Muons/TestSummary"); - - // book the summary histos -} -void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { - - LogTrace(metname)<<"[MuonTestSummary]: beginRun"; - - dbe->cd(); - dbe->setCurrentFolder("Muons/TestSummary"); +void MuonTestSummary::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter){ + // BOOKING NEW HISTOGRAMS + ibooker.cd(); + ibooker.setCurrentFolder("Muons/TestSummary"); // kinematics test report - kinematicsSummaryMap = dbe->book2D("kinematicsSummaryMap","Kinematics test summary",5,1,6,3,1,4); + kinematicsSummaryMap = ibooker.book2D("kinematicsSummaryMap","Kinematics test summary",5,1,6,3,1,4); kinematicsSummaryMap->setAxisTitle("track monitored",1); kinematicsSummaryMap->setBinLabel(1,"GLB",1); kinematicsSummaryMap->setBinLabel(2,"TKfromGLB",1); @@ -103,7 +88,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { kinematicsSummaryMap->setBinLabel(3,"#phi",2); //chi2 kinematics quality test report - chi2TestSummaryMap = dbe->book2D("chi2TestSummaryMap","#chi2 quality test summary",5,1,6,5,1,6); + chi2TestSummaryMap = ibooker.book2D("chi2TestSummaryMap","#chi2 quality test summary",5,1,6,5,1,6); chi2TestSummaryMap->setAxisTitle("track monitored",1); chi2TestSummaryMap->setBinLabel(1,"GLB",1); chi2TestSummaryMap->setBinLabel(2,"TKfromGLB",1); @@ -118,7 +103,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { chi2TestSummaryMap->setBinLabel(5,"#q",2); //Kolmogorov kinematics quality test report - KolmogorovTestSummaryMap = dbe->book2D("KolmogorovTestSummaryMap","Kolmogorov quality test summary",5,1,6,5,1,6); + KolmogorovTestSummaryMap = ibooker.book2D("KolmogorovTestSummaryMap","Kolmogorov quality test summary",5,1,6,5,1,6); KolmogorovTestSummaryMap->setAxisTitle("track monitored",1); KolmogorovTestSummaryMap->setBinLabel(1,"GLB",1); KolmogorovTestSummaryMap->setBinLabel(2,"TKfromGLB",1); @@ -134,7 +119,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { // residuals test report - residualsSummaryMap = dbe->book2D("residualsSummaryMap","Residuals test summary",4,1,5,4,1,5); + residualsSummaryMap = ibooker.book2D("residualsSummaryMap","Residuals test summary",4,1,5,4,1,5); residualsSummaryMap->setAxisTitle("residuals",1); residualsSummaryMap->setBinLabel(1,"TK-GLB",1); residualsSummaryMap->setBinLabel(2,"GLB-STA",1); @@ -147,7 +132,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { residualsSummaryMap->setBinLabel(4,"q",2); // muonId test report - muonIdSummaryMap = dbe->book2D("muonIdSummaryMap","muonId test summary",4,1,5, 5,1,6); + muonIdSummaryMap = ibooker.book2D("muonIdSummaryMap","muonId test summary",4,1,5, 5,1,6); muonIdSummaryMap->setAxisTitle("muons",1); muonIdSummaryMap->setBinLabel(1,"GLB DT",1); muonIdSummaryMap->setBinLabel(2,"GLB CSC",1); @@ -161,7 +146,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { muonIdSummaryMap->setBinLabel(5,"y rms",2); // energy test report - energySummaryMap = dbe->book2D("energySummaryMap","Energy deposits test summary",3,1,4,3,1,4); + energySummaryMap = ibooker.book2D("energySummaryMap","Energy deposits test summary",3,1,4,3,1,4); energySummaryMap->setAxisTitle("muons",1); energySummaryMap->setBinLabel(1,"GLB",1); energySummaryMap->setBinLabel(2,"TK",1); @@ -172,7 +157,7 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { energySummaryMap->setBinLabel(3,"H0",2); // multiplicity tests report - multiplicitySummaryMap = dbe->book1D("multiplicitySummaryMap","muon multiplicity test summary",3,1,4); + multiplicitySummaryMap = ibooker.book1D("multiplicitySummaryMap","muon multiplicity test summary",3,1,4); multiplicitySummaryMap->setAxisTitle("muon"); multiplicitySummaryMap->setBinLabel(1,"GLB"); multiplicitySummaryMap->setBinLabel(2,"TK"); @@ -180,10 +165,10 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { // summary test report - dbe->setCurrentFolder("Muons/EventInfo"); - summaryReport = dbe->bookFloat("reportSummary"); + ibooker.setCurrentFolder("Muons/EventInfo"); + summaryReport = ibooker.bookFloat("reportSummary"); - summaryReportMap = dbe->book2D("reportSummaryMap","Muon Report Summary Map",3,1,4,7,1,8); + summaryReportMap = ibooker.book2D("reportSummaryMap","Muon Report Summary Map",3,1,4,7,1,8); summaryReportMap->setAxisTitle("muons",1); summaryReportMap->setBinLabel(1,"GLB",1); summaryReportMap->setBinLabel(2,"TK",1); @@ -197,27 +182,27 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { summaryReportMap->setBinLabel(6,"energyDeposits",2); summaryReportMap->setBinLabel(7,"multiplicity",2); - dbe->setCurrentFolder("Muons/EventInfo/reportSummaryContents"); - theSummaryContents.push_back(dbe->bookFloat("kinematics_GLB")); - theSummaryContents.push_back(dbe->bookFloat("muonId_GLB")); - theSummaryContents.push_back(dbe->bookFloat("residuals_GLB")); - theSummaryContents.push_back(dbe->bookFloat("GLB")); - theSummaryContents.push_back(dbe->bookFloat("kinematics_TK")); - theSummaryContents.push_back(dbe->bookFloat("muonId_TK")); - theSummaryContents.push_back(dbe->bookFloat("residuals_TK")); - theSummaryContents.push_back(dbe->bookFloat("TK")); - theSummaryContents.push_back(dbe->bookFloat("kinematics_STA")); - theSummaryContents.push_back(dbe->bookFloat("residuals_STA")); - theSummaryContents.push_back(dbe->bookFloat("STA")); - theSummaryContents.push_back(dbe->bookFloat("energyDeposits")); - theSummaryContents.push_back(dbe->bookFloat("multiplicity")); + ibooker.setCurrentFolder("Muons/EventInfo/reportSummaryContents"); + theSummaryContents.push_back(ibooker.bookFloat("kinematics_GLB")); + theSummaryContents.push_back(ibooker.bookFloat("muonId_GLB")); + theSummaryContents.push_back(ibooker.bookFloat("residuals_GLB")); + theSummaryContents.push_back(ibooker.bookFloat("GLB")); + theSummaryContents.push_back(ibooker.bookFloat("kinematics_TK")); + theSummaryContents.push_back(ibooker.bookFloat("muonId_TK")); + theSummaryContents.push_back(ibooker.bookFloat("residuals_TK")); + theSummaryContents.push_back(ibooker.bookFloat("TK")); + theSummaryContents.push_back(ibooker.bookFloat("kinematics_STA")); + theSummaryContents.push_back(ibooker.bookFloat("residuals_STA")); + theSummaryContents.push_back(ibooker.bookFloat("STA")); + theSummaryContents.push_back(ibooker.bookFloat("energyDeposits")); + theSummaryContents.push_back(ibooker.bookFloat("multiplicity")); // certification report - dbe->setCurrentFolder("Muons/EventInfo"); - summaryCertification = dbe->bookFloat("CertificationSummary"); + ibooker.setCurrentFolder("Muons/EventInfo"); + summaryCertification = ibooker.bookFloat("CertificationSummary"); summaryCertification->Fill(-1); - summaryCertificationMap = dbe->book2D("CertificationSummaryMap","Muon Certification Summary Map",9,1,10,7,1,8); + summaryCertificationMap = ibooker.book2D("CertificationSummaryMap","Muon Certification Summary Map",9,1,10,7,1,8); summaryCertificationMap->setAxisTitle("muons",1); summaryCertificationMap->setBinLabel(1,"GLB_Tot",1); summaryCertificationMap->setBinLabel(2,"TK_Tot",1); @@ -237,16 +222,16 @@ void MuonTestSummary::beginRun(Run const& run, EventSetup const& eSetup) { summaryCertificationMap->setBinLabel(6,"energyDeposits",2); summaryCertificationMap->setBinLabel(7,"multiplicity",2); - dbe->setCurrentFolder("Muons/EventInfo/CertificationContents"); - theCertificationContents.push_back(dbe->bookFloat("GLB_Tot")); - theCertificationContents.push_back(dbe->bookFloat("STA_Tot")); - theCertificationContents.push_back(dbe->bookFloat("TK_Tot")); - theCertificationContents.push_back(dbe->bookFloat("GLB_B")); - theCertificationContents.push_back(dbe->bookFloat("STA_B")); - theCertificationContents.push_back(dbe->bookFloat("TK_B")); - theCertificationContents.push_back(dbe->bookFloat("GLB_EC")); - theCertificationContents.push_back(dbe->bookFloat("STA_EC")); - theCertificationContents.push_back(dbe->bookFloat("TK_EC")); + ibooker.setCurrentFolder("Muons/EventInfo/CertificationContents"); + theCertificationContents.push_back(ibooker.bookFloat("GLB_Tot")); + theCertificationContents.push_back(ibooker.bookFloat("STA_Tot")); + theCertificationContents.push_back(ibooker.bookFloat("TK_Tot")); + theCertificationContents.push_back(ibooker.bookFloat("GLB_B")); + theCertificationContents.push_back(ibooker.bookFloat("STA_B")); + theCertificationContents.push_back(ibooker.bookFloat("TK_B")); + theCertificationContents.push_back(ibooker.bookFloat("GLB_EC")); + theCertificationContents.push_back(ibooker.bookFloat("STA_EC")); + theCertificationContents.push_back(ibooker.bookFloat("TK_EC")); for (unsigned int icert=0;icert Fill(xBin,yBin,1); } } -} - -void MuonTestSummary::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) { - // LogTrace(metname)<<"[MuonTestSummary]: beginLuminosityBlock"; -} - -void MuonTestSummary::endLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) { - - // LogTrace(metname)<<"[MuonTestSummary]: endLuminosityBlock, performing the DQM LS client operation"; - -} - -void MuonTestSummary::endRun(Run const& run, EventSetup const& eSetup) { - - LogTrace(metname)<<"[MuonTestSummary]: endRun, performing the DQM end of run client operation"; + //////////////////////////////////////////////////////////// + /// DO OTHER OPERATIONS WITH HISTOGRAMS // fill the kinematics report summary - doKinematicsTests("GlbMuon_Glb_", 1); - doKinematicsTests("GlbMuon_Tk_", 2); - doKinematicsTests("GlbMuon_Sta_",3); - doKinematicsTests("TkMuon_", 4); - doKinematicsTests("StaMuon_", 5); + doKinematicsTests(igetter,"GlbMuon_Glb_", 1); + doKinematicsTests(igetter,"GlbMuon_Tk_", 2); + doKinematicsTests(igetter,"GlbMuon_Sta_",3); + doKinematicsTests(igetter,"TkMuon_", 4); + doKinematicsTests(igetter,"StaMuon_", 5); // fill the residuals report summary - doResidualsTests("TkGlb", "eta", 1); - doResidualsTests("GlbSta", "eta", 2); - doResidualsTests("TkSta", "eta", 3); - doResidualsTests("TkGlb", "phi", 1); - doResidualsTests("GlbSta", "phi", 2); - doResidualsTests("TkSta", "phi", 3); - doResidualsTests("TkGlb", "oneOverp", 1); - doResidualsTests("GlbSta", "oneOverp", 2); - doResidualsTests("TkSta", "oneOverp", 3); - doResidualsTests("GlbMuon", "qComparison", -1); + doResidualsTests(igetter,"TkGlb", "eta", 1); + doResidualsTests(igetter,"GlbSta", "eta", 2); + doResidualsTests(igetter,"TkSta", "eta", 3); + doResidualsTests(igetter,"TkGlb", "phi", 1); + doResidualsTests(igetter,"GlbSta", "phi", 2); + doResidualsTests(igetter,"TkSta", "phi", 3); + doResidualsTests(igetter,"TkGlb", "oneOverp", 1); + doResidualsTests(igetter,"GlbSta", "oneOverp", 2); + doResidualsTests(igetter,"TkSta", "oneOverp", 3); + doResidualsTests(igetter,"GlbMuon", "qComparison", -1); // fill the muonID report summary - doMuonIDTests(); + doMuonIDTests(igetter); // fill the energy report summary - doEnergyTests("ecalS9PointingMuDepositedEnergy_","Glb_muons", 1); - doEnergyTests("hadS9PointingMuDepositedEnergy_", "Glb_muons", 1); - doEnergyTests("hoS9PointingMuDepositedEnergy_", "Glb_muons", 1); - doEnergyTests("ecalS9PointingMuDepositedEnergy_", "Tk_muons", 2); - doEnergyTests("hadS9PointingMuDepositedEnergy_", "Tk_muons", 2); - doEnergyTests("hoS9PointingMuDepositedEnergy_", "Tk_muons", 2); - doEnergyTests("ecalS9PointingMuDepositedEnergy_", "Sta_muons", 3); - doEnergyTests("hadS9PointingMuDepositedEnergy_", "Sta_muons", 3); - doEnergyTests("hoS9PointingMuDepositedEnergy_", "Sta_muons", 3); + doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_","Glb_muons", 1); + doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Glb_muons", 1); + doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Glb_muons", 1); + doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_", "Tk_muons", 2); + doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Tk_muons", 2); + doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Tk_muons", 2); + doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_", "Sta_muons", 3); + doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Sta_muons", 3); + doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Sta_muons", 3); // fill the multiplicity test summary - doMultiplicityTests(); + doMultiplicityTests(igetter); // fill the final report summary - /* - summaryReportMap->setBinContent(1,1,double(kinematicsSummaryMap->getBinContent(1,1)+kinematicsSummaryMap->getBinContent(2,1)+kinematicsSummaryMap->getBinContent(3,1))/3.0); - summaryReportMap->setBinContent(2,1,kinematicsSummaryMap->getBinContent(4,1)); - summaryReportMap->setBinContent(3,1,kinematicsSummaryMap->getBinContent(5,1)); - summaryReportMap->setBinContent(1,2,double(kinematicsSummaryMap->getBinContent(1,2)+kinematicsSummaryMap->getBinContent(2,2)+kinematicsSummaryMap->getBinContent(3,2))/3.0); - summaryReportMap->setBinContent(2,2,kinematicsSummaryMap->getBinContent(4,2)); - summaryReportMap->setBinContent(3,2,kinematicsSummaryMap->getBinContent(5,2)); - summaryReportMap->setBinContent(1,3,double(kinematicsSummaryMap->getBinContent(1,3)+kinematicsSummaryMap->getBinContent(2,3)+kinematicsSummaryMap->getBinContent(3,3))/3.0); - summaryReportMap->setBinContent(2,3,kinematicsSummaryMap->getBinContent(4,3)); - summaryReportMap->setBinContent(3,3,kinematicsSummaryMap->getBinContent(5,3)); - */ //Changed to KolmogorovQuality test-------------------------- summaryReportMap->setBinContent(1,1,double(KolmogorovTestSummaryMap->getBinContent(1,1)+KolmogorovTestSummaryMap->getBinContent(2,1)+KolmogorovTestSummaryMap->getBinContent(3,1))/3.0); summaryReportMap->setBinContent(2,1,KolmogorovTestSummaryMap->getBinContent(4,1)); @@ -368,8 +329,6 @@ void MuonTestSummary::endRun(Run const& run, EventSetup const& eSetup) { summaryReportMap->setBinContent(2,3,KolmogorovTestSummaryMap->getBinContent(4,3)); summaryReportMap->setBinContent(3,3,KolmogorovTestSummaryMap->getBinContent(5,3)); - - //-- modified GH double residualsSummary = 0; //put the TRK-STA resid & pulls in the first bin ("GLB") @@ -420,11 +379,6 @@ void MuonTestSummary::endRun(Run const& run, EventSetup const& eSetup) { summaryReportMap->setBinContent(3,5,-1.0/6.0); //-- - - - //summaryReportMap->setBinContent(1,6,double(energySummaryMap->getBinContent(1,1)+energySummaryMap->getBinContent(1,2)+energySummaryMap->getBinContent(1,3))/3.0); - //summaryReportMap->setBinContent(2,6,double(energySummaryMap->getBinContent(2,1)+energySummaryMap->getBinContent(2,2)+energySummaryMap->getBinContent(2,3))/3.0); - //summaryReportMap->setBinContent(3,6,double(energySummaryMap->getBinContent(3,1)+energySummaryMap->getBinContent(3,2)+energySummaryMap->getBinContent(3,3))/3.0); summaryReportMap->setBinContent(1,6,double(energySummaryMap->getBinContent(1,1)+energySummaryMap->getBinContent(1,2))/2.0); summaryReportMap->setBinContent(2,6,double(energySummaryMap->getBinContent(2,1)+energySummaryMap->getBinContent(2,2))/2.0); summaryReportMap->setBinContent(3,6,double(energySummaryMap->getBinContent(3,1)+energySummaryMap->getBinContent(3,2))/2.0); @@ -512,22 +466,14 @@ void MuonTestSummary::endRun(Run const& run, EventSetup const& eSetup) { theCertificationContents[5]->Fill(muonId_TK_B); double muonId_TK_EC = double(summaryCertificationMap->getBinContent(8,5)); theCertificationContents[8]->Fill(muonId_TK_EC); - - - - - - - } -void MuonTestSummary::doKinematicsTests(string muonType, int bin){ +void MuonTestSummary::doKinematicsTests(DQMStore::IGetter & igetter, string muonType, int bin){ - // chi2 test string path = "Muons/MuonRecoAnalyzer/" + muonType + "chi2OverDf"; - MonitorElement * chi2Histo = dbe->get(path); + MonitorElement * chi2Histo = igetter.get(path); if(chi2Histo){ TH1F * chi2Histo_root = chi2Histo->getTH1F(); @@ -578,7 +524,7 @@ void MuonTestSummary::doKinematicsTests(string muonType, int bin){ // pseudorapidity test path = "Muons/MuonRecoAnalyzer/" + muonType + "eta"; - MonitorElement * etaHisto = dbe->get(path); + MonitorElement * etaHisto = igetter.get(path); if(etaHisto){ TH1F * etaHisto_root = etaHisto->getTH1F(); @@ -639,7 +585,7 @@ void MuonTestSummary::doKinematicsTests(string muonType, int bin){ // phi test path = "Muons/MuonRecoAnalyzer/" + muonType + "phi"; - MonitorElement * phiHisto = dbe->get(path); + MonitorElement * phiHisto = igetter.get(path); if(phiHisto ){ TH1F * phiHisto_root = phiHisto->getTH1F(); @@ -698,7 +644,7 @@ void MuonTestSummary::doKinematicsTests(string muonType, int bin){ // pt test path = "Muons/MuonRecoAnalyzer/" + muonType + "pt"; - MonitorElement * ptHisto = dbe->get(path); + MonitorElement * ptHisto = igetter.get(path); if(ptHisto ){ TH1F * ptHisto_root = ptHisto->getTH1F(); @@ -735,7 +681,7 @@ void MuonTestSummary::doKinematicsTests(string muonType, int bin){ // q test path = "Muons/MuonRecoAnalyzer/" + muonType + "q"; - MonitorElement * qHisto = dbe->get(path); + MonitorElement * qHisto = igetter.get(path); if(ptHisto ){ TH1F * qHisto_root = qHisto->getTH1F(); @@ -771,14 +717,7 @@ void MuonTestSummary::doKinematicsTests(string muonType, int bin){ } } - - - - - - - - //--GH new +//--GH new void MuonTestSummary::GaussFit(string type, string parameter, MonitorElement * Histo, float &mean, float &mean_err, float &sigma, float &sigma_err) { // Gaussian Fit @@ -815,18 +754,12 @@ void MuonTestSummary::GaussFit(string type, string parameter, MonitorElement * sigma_err=1; } } - - - - - - -void MuonTestSummary::doResidualsTests(string type, string parameter, int bin){ +void MuonTestSummary::doResidualsTests(DQMStore::IGetter &igetter, string type, string parameter, int bin){ // residuals test if(type!="GlbMuon"){ string path = "Muons/MuonRecoAnalyzer/Res_" + type + "_" + parameter; - MonitorElement * residualsHisto = dbe->get(path); + MonitorElement * residualsHisto = igetter.get(path); float mean = -1; float mean_err = -1; @@ -870,7 +803,7 @@ void MuonTestSummary::doResidualsTests(string type, string parameter, int bin){ if(type=="TkSta"){ //look at the pull: string path = "Muons/MuonRecoAnalyzer/Pull_" + type + "_" + parameter; - MonitorElement * pullHisto = dbe->get(path); + MonitorElement * pullHisto = igetter.get(path); if(pullHisto){ @@ -897,7 +830,7 @@ void MuonTestSummary::doResidualsTests(string type, string parameter, int bin){ //this part for Global Muons: else{ string path = "Muons/MuonRecoAnalyzer/" + type + "_" + parameter; - MonitorElement * residualsHisto = dbe->get(path); + MonitorElement * residualsHisto = igetter.get(path); if(residualsHisto){ LogTrace(metname) << "[MuonTestSummary]: Test of Charge Comparison "< muType; muType.push_back("GlobalMuons"); @@ -937,7 +870,7 @@ void MuonTestSummary::doMuonIDTests(){ // num matches test string path = "Muons/MuonIdDQM/" + muType[i] + "/hNumMatches"; - MonitorElement * matchesHisto = dbe->get(path); + MonitorElement * matchesHisto = igetter.get(path); if(matchesHisto){ TH1F * matchesHisto_root = matchesHisto->getTH1F(); @@ -952,19 +885,19 @@ void MuonTestSummary::doMuonIDTests(){ double numOneSegm_dt = 0; int numHistos_dt=0; int numHistos_csc=0; - MonitorElement * DT1Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT1NumSegments"); + MonitorElement * DT1Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT1NumSegments"); if(DT1Histo) {numHistos_dt++; if(DT1Histo->getEntries()!=0) numOneSegm_dt+=double(DT1Histo->getBinContent(2))/double(DT1Histo->getEntries());} - MonitorElement * DT2Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT2NumSegments"); + MonitorElement * DT2Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT2NumSegments"); if(DT2Histo) {numHistos_dt++; if(DT2Histo->getEntries()!=0) numOneSegm_dt+=double(DT2Histo->getBinContent(2))/double(DT2Histo->getEntries());} - MonitorElement * DT3Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT3NumSegments"); + MonitorElement * DT3Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT3NumSegments"); if(DT3Histo) {numHistos_dt++; if(DT3Histo->getEntries()!=0) numOneSegm_dt+=double(DT3Histo->getBinContent(2))/double(DT3Histo->getEntries());} - MonitorElement * DT4Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT4NumSegments"); + MonitorElement * DT4Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT4NumSegments"); if(DT4Histo) {numHistos_dt++; if(DT4Histo->getEntries()!=0) numOneSegm_dt+=double(DT4Histo->getBinContent(2))/double(DT4Histo->getEntries());} @@ -975,19 +908,19 @@ void MuonTestSummary::doMuonIDTests(){ } double numOneSegm_csc = 0; - MonitorElement * CSC1Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC1NumSegments"); + MonitorElement * CSC1Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC1NumSegments"); if(CSC1Histo) {numHistos_csc++; if(CSC1Histo->getEntries()!=0) numOneSegm_csc+=double(CSC1Histo->getBinContent(2))/double(CSC1Histo->getEntries());} - MonitorElement * CSC2Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC2NumSegments"); + MonitorElement * CSC2Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC2NumSegments"); if(CSC2Histo) {numHistos_csc++; if(CSC2Histo->getEntries()!=0) numOneSegm_csc+=double(CSC2Histo->getBinContent(2))/double(CSC2Histo->getEntries());} - MonitorElement * CSC3Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC3NumSegments"); + MonitorElement * CSC3Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC3NumSegments"); if(CSC3Histo) {numHistos_csc++; if(CSC3Histo->getEntries()!=0) numOneSegm_csc+=double(CSC3Histo->getBinContent(2))/double(CSC3Histo->getEntries());} - MonitorElement * CSC4Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC4NumSegments"); + MonitorElement * CSC4Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC4NumSegments"); if(CSC4Histo) {numHistos_csc++; if(CSC4Histo->getEntries()!=0) numOneSegm_csc+=double(CSC4Histo->getBinContent(2))/double(CSC4Histo->getEntries());} @@ -1041,10 +974,10 @@ void MuonTestSummary::doMuonIDTests(){ double dtSigmaX_err, dtSigmaY_err, cscSigmaX_err, cscSigmaY_err; double dtMeanX, dtMeanY, cscMeanX, cscMeanY; double dtMeanX_err, dtMeanY_err, cscMeanX_err, cscMeanY_err; - MuonTestSummary::ResidualCheck(muType[i], DTXresHistos, numPlot_dtX, dtMeanX, dtMeanX_err, dtSigmaX, dtSigmaX_err); - MuonTestSummary::ResidualCheck(muType[i], DTYresHistos, numPlot_dtY, dtMeanY, dtMeanY_err, dtSigmaY, dtSigmaY_err); - MuonTestSummary::ResidualCheck(muType[i], CSCXresHistos, numPlot_cscX, cscMeanX, cscMeanX_err, cscSigmaX, cscSigmaX_err); - MuonTestSummary::ResidualCheck(muType[i], CSCYresHistos, numPlot_cscY, cscMeanY, cscMeanY_err, cscSigmaY, cscSigmaY_err); + MuonTestSummary::ResidualCheck(igetter, muType[i], DTXresHistos, numPlot_dtX, dtMeanX, dtMeanX_err, dtSigmaX, dtSigmaX_err); + MuonTestSummary::ResidualCheck(igetter, muType[i], DTYresHistos, numPlot_dtY, dtMeanY, dtMeanY_err, dtSigmaY, dtSigmaY_err); + MuonTestSummary::ResidualCheck(igetter, muType[i], CSCXresHistos, numPlot_cscX, cscMeanX, cscMeanX_err, cscSigmaX, cscSigmaX_err); + MuonTestSummary::ResidualCheck(igetter, muType[i], CSCYresHistos, numPlot_cscY, cscMeanY, cscMeanY_err, cscSigmaY, cscSigmaY_err); LogTrace(metname)<<"DT mean must be between: "<& resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err){ +void MuonTestSummary::ResidualCheck(DQMStore::IGetter &igetter, std::string muType, const std::vector& resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err){ numPlot=0; Mean=0; @@ -1131,7 +1064,7 @@ void MuonTestSummary::ResidualCheck(std::string muType, const std::vectorget("Muons/MuonIdDQM/" + muType + "/"+resHistos[name]); + MonitorElement * resHisto = igetter.get("Muons/MuonIdDQM/" + muType + "/"+resHistos[name]); if(resHisto){ TH1F * resHisto_root = resHisto->getTH1F(); @@ -1191,16 +1124,11 @@ void MuonTestSummary::ResidualCheck(std::string muType, const std::vectorget(path); + MonitorElement * energyHisto = igetter.get(path); Double_t hPeak=-1, hFWHM=-1; if(energyHisto){ TH1F * energyHisto_root = energyHisto->getTH1F(); @@ -1263,11 +1191,9 @@ void MuonTestSummary::doEnergyTests(string histname, string muonType, int binNum //missing test on ho distributions } +void MuonTestSummary::doMultiplicityTests(DQMStore::IGetter &igetter){ - -void MuonTestSummary::doMultiplicityTests(){ - - MonitorElement* multiplicityHisto = dbe->get("Muons/MuonRecoAnalyzer/muReco"); + MonitorElement* multiplicityHisto = igetter.get("Muons/MuonRecoAnalyzer/muReco"); if(multiplicityHisto){ if(multiplicityHisto->getEntries()>20){ diff --git a/DQMOffline/Muon/src/MuonTrackResidualsTest.cc b/DQMOffline/Muon/src/MuonTrackResidualsTest.cc index 72fa764c58629..7939a231a9b24 100644 --- a/DQMOffline/Muon/src/MuonTrackResidualsTest.cc +++ b/DQMOffline/Muon/src/MuonTrackResidualsTest.cc @@ -35,28 +35,19 @@ using namespace std; MuonTrackResidualsTest::MuonTrackResidualsTest(const edm::ParameterSet& ps){ parameters = ps; - theDbe = edm::Service().operator->(); - prescaleFactor = parameters.getUntrackedParameter("diagnosticPrescale", 1); + GaussianCriterionName = parameters.getUntrackedParameter("resDistributionTestName","ResidualsDistributionGaussianTest"); + SigmaCriterionName = parameters.getUntrackedParameter("sigmaTestName","ResidualsSigmaInRange"); + MeanCriterionName = parameters.getUntrackedParameter("meanTestName","ResidualsMeanInRange"); } +void MuonTrackResidualsTest::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter & igetter){ - -MuonTrackResidualsTest::~MuonTrackResidualsTest(){ - - LogTrace(metname) << "DTResolutionTest: analyzed " << nevents << " events"; - -} - - -void MuonTrackResidualsTest::beginJob(void){ - - metname = "trackResidualsTest"; - theDbe->setCurrentFolder("Muons/Tests/trackResidualsTest"); - - LogTrace(metname) << "[MuonTrackResidualsTest] beginJob: Parameters initialization"< type; type.push_back("eta"); @@ -80,67 +71,22 @@ void MuonTrackResidualsTest::beginJob(void){ histoNames[type[c]].push_back(histName); - MeanHistos[type[c]] = theDbe->book1D(MeanHistoName.c_str(),MeanHistoTitle.c_str(),3,0.5,3.5); + MeanHistos[type[c]] = ibooker.book1D(MeanHistoName.c_str(),MeanHistoTitle.c_str(),3,0.5,3.5); (MeanHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1); (MeanHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1); (MeanHistos[type[c]])->setBinLabel(3,"Res_TkSta",1); - SigmaHistos[type[c]] = theDbe->book1D(SigmaHistoName.c_str(),SigmaHistoTitle.c_str(),3,0.5,3.5); + SigmaHistos[type[c]] = ibooker.book1D(SigmaHistoName.c_str(),SigmaHistoTitle.c_str(),3,0.5,3.5); (SigmaHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1); (SigmaHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1); (SigmaHistos[type[c]])->setBinLabel(3,"Res_TkSta",1); } - - nevents = 0; - -} - - -void MuonTrackResidualsTest::beginRun(Run const& run, EventSetup const& eSetup) { - - LogTrace(metname)<<"[MuonTrackResidualsTest]: beginRun"; - -} - -void MuonTrackResidualsTest::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) { - - // LogTrace(metname)<<"[MuonTrackResidualsTest]: beginLuminosityBlock"; - - // Get the run number - // run = lumiSeg.run(); - -} - - -void MuonTrackResidualsTest::analyze(const edm::Event& e, const edm::EventSetup& context){ - - nevents++; - LogTrace(metname)<< "[MuonTrackResidualsTest]: "< > ::const_iterator histo = histoNames.begin(); histo != histoNames.end(); histo++) { @@ -148,17 +94,11 @@ void MuonTrackResidualsTest::endRun(Run const& run, EventSetup const& eSetup) { for (unsigned int type=0; type< (*histo).second.size(); type++){ string path = "Muons/MuonRecoAnalyzer/" + (*histo).second[type]; - MonitorElement * res_histo = theDbe->get(path); + MonitorElement * res_histo = igetter.get(path); if (res_histo) { // gaussian test - string GaussianCriterionName = - parameters.getUntrackedParameter("resDistributionTestName", - "ResidualsDistributionGaussianTest"); - const QReport * GaussianReport = res_histo->getQReport(GaussianCriterionName); - if(GaussianReport){ - LogTrace(metname) << "-------- histo : "<<(*histo).second[type]<<" "<getMessage()<<" ------- "<getStatus(); - } + // const QReport *GaussianReport = res_histo->getQReport(GaussianCriterionName); int BinNumber = type+1; float mean = (*res_histo).getMean(1); float sigma = (*res_histo).getRMS(1); @@ -170,7 +110,6 @@ void MuonTrackResidualsTest::endRun(Run const& run, EventSetup const& eSetup) { // Mean test - string MeanCriterionName = parameters.getUntrackedParameter("meanTestName","ResidualsMeanInRange"); for(map::const_iterator hMean = MeanHistos.begin(); hMean != MeanHistos.end(); hMean++) { @@ -179,14 +118,11 @@ void MuonTrackResidualsTest::endRun(Run const& run, EventSetup const& eSetup) { vector badChannels = theMeanQReport->getBadChannels(); for (vector::iterator channel = badChannels.begin(); channel != badChannels.end(); channel++) { - LogTrace(metname)<< "type:"<<(*hMean).first<<" Bad mean channels: "<<(*channel).getBin()<<" Contents : "<<(*channel).getContents()<getMessage()<<" ------- "<getStatus()<("sigmaTestName","ResidualsSigmaInRange"); for(map::const_iterator hSigma = SigmaHistos.begin(); hSigma != SigmaHistos.end(); hSigma++) { @@ -195,19 +131,10 @@ void MuonTrackResidualsTest::endRun(Run const& run, EventSetup const& eSetup) { vector badChannels = theSigmaQReport->getBadChannels(); for (vector::iterator channel = badChannels.begin(); channel != badChannels.end(); channel++) { - LogTrace(metname)<< "type:"<<(*hSigma).first<<" Bad sigma channels: "<<(*channel).getBin()<<" Contents : "<<(*channel).getContents()<getMessage()<<" ------- "<getStatus()<rmdir("Muons/Tests/trackResidualsTest"); - -} - diff --git a/DQMOffline/Muon/src/SegmentTrackAnalyzer.cc b/DQMOffline/Muon/src/SegmentTrackAnalyzer.cc index 3dc90d109f14e..fbb7a3fb869f8 100644 --- a/DQMOffline/Muon/src/SegmentTrackAnalyzer.cc +++ b/DQMOffline/Muon/src/SegmentTrackAnalyzer.cc @@ -29,7 +29,6 @@ SegmentTrackAnalyzer::SegmentTrackAnalyzer(const edm::ParameterSet& pSet) { // MuonService theService = new MuonServiceProxy(parameters.getParameter("ServiceParameters")); - theDbe = edm::Service().operator->(); // Read Data: theMuTrackCollectionLabel_ = consumes(parameters.getParameter("MuTrackCollection")); @@ -39,32 +38,36 @@ SegmentTrackAnalyzer::SegmentTrackAnalyzer(const edm::ParameterSet& pSet) { edm::ConsumesCollector iC = consumesCollector(); theSegmentsAssociator = new SegmentsTrackAssociator(SegmentsTrackAssociatorParameters,iC); - - -} -void SegmentTrackAnalyzer::beginJob() { - metname = "segmTrackAnalyzer"; - LogTrace(metname)<<"[SegmentTrackAnalyzer] Parameters initialization"; - + + trackCollection = parameters.getParameter("MuTrackCollection").label() + parameters.getParameter("MuTrackCollection").instance(); + + etaBin = parameters.getParameter("etaBin"); + etaMin = parameters.getParameter("etaMin"); + etaMax = parameters.getParameter("etaMax"); + phiBin = parameters.getParameter("phiBin"); + phiMin = parameters.getParameter("phiMin"); + phiMax = parameters.getParameter("phiMax"); + ptBin = parameters.getParameter("ptBin"); + ptMin = parameters.getParameter("ptMin"); + ptMax = parameters.getParameter("ptMax"); } -void SegmentTrackAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){ - metname = "segmTrackAnalyzer"; +void SegmentTrackAnalyzer::bookHistograms(DQMStore::IBooker &ibooker, + const edm::Run& /*iRun*/, + const edm::EventSetup& /*iSetup*/){ + ibooker.cd(); + ibooker.setCurrentFolder("Muons/SegmentTrackAnalyzer"); - theDbe->cd(); - theDbe->setCurrentFolder("Muons/SegmentTrackAnalyzer"); - string trackCollection = parameters.getParameter("MuTrackCollection").label() + parameters.getParameter("MuTrackCollection").instance(); - // histograms initalization - hitsNotUsed = theDbe->book1D("HitsNotUsedForGlobalTracking_"+trackCollection, "recHits not used for GLB ["+trackCollection+"]", 50, -0.5, 49.5); - hitsNotUsedPercentual = theDbe->book1D("HitsNotUsedForGlobalTrackingDvHitUsed_"+trackCollection, "(recHits_{notUsedForGLB}) / (recHits_{GLB}) ["+trackCollection+"]", 100, 0, 1.); + hitsNotUsed = ibooker.book1D("HitsNotUsedForGlobalTracking_"+trackCollection, "recHits not used for GLB ["+trackCollection+"]", 50, -0.5, 49.5); + hitsNotUsedPercentual = ibooker.book1D("HitsNotUsedForGlobalTrackingDvHitUsed_"+trackCollection, "(recHits_{notUsedForGLB}) / (recHits_{GLB}) ["+trackCollection+"]", 100, 0, 1.); - TrackSegm = theDbe->book2D("trackSegments_"+trackCollection, "Number of segments associated to the track ["+trackCollection+"]", 3, 0.5, 3.5, 8, 0, 8); + TrackSegm = ibooker.book2D("trackSegments_"+trackCollection, "Number of segments associated to the track ["+trackCollection+"]", 3, 0.5, 3.5, 8, 0, 8); TrackSegm->setBinLabel(1,"DT+CSC",1); TrackSegm->setBinLabel(2,"DT",1); TrackSegm->setBinLabel(3,"CSC",1); - hitStaProvenance = theDbe->book1D("trackHitStaProvenance_"+trackCollection, "Number of recHits_{STAinTrack} ["+trackCollection+"]", 7, 0.5, 7.5); + hitStaProvenance = ibooker.book1D("trackHitStaProvenance_"+trackCollection, "Number of recHits_{STAinTrack} ["+trackCollection+"]", 7, 0.5, 7.5); hitStaProvenance->setBinLabel(1,"DT"); hitStaProvenance->setBinLabel(2,"CSC"); hitStaProvenance->setBinLabel(3,"RPC"); @@ -75,7 +78,7 @@ void SegmentTrackAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& if(trackCollection!="standAloneMuons"){ - hitTkrProvenance = theDbe->book1D("trackHitTkrProvenance_"+trackCollection, "Number of recHits_{TKinTrack} ["+trackCollection+"]", 6, 0.5, 6.5); + hitTkrProvenance = ibooker.book1D("trackHitTkrProvenance_"+trackCollection, "Number of recHits_{TKinTrack} ["+trackCollection+"]", 6, 0.5, 6.5); hitTkrProvenance->setBinLabel(1,"PixBarrel"); hitTkrProvenance->setBinLabel(2,"PixEndCap"); hitTkrProvenance->setBinLabel(3,"TIB"); @@ -84,38 +87,27 @@ void SegmentTrackAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& hitTkrProvenance->setBinLabel(6,"TEC"); } - int etaBin = parameters.getParameter("etaBin"); - double etaMin = parameters.getParameter("etaMin"); - double etaMax = parameters.getParameter("etaMax"); - trackHitPercentualVsEta = theDbe->book2D("trackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); - dtTrackHitPercentualVsEta = theDbe->book2D("dtTrackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); - cscTrackHitPercentualVsEta = theDbe->book2D("cscTrackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); - - int phiBin = parameters.getParameter("phiBin"); - double phiMin = parameters.getParameter("phiMin"); - double phiMax = parameters.getParameter("phiMax"); - trackHitPercentualVsPhi = theDbe->book2D("trackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); + trackHitPercentualVsEta = ibooker.book2D("trackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); + dtTrackHitPercentualVsEta = ibooker.book2D("dtTrackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); + cscTrackHitPercentualVsEta = ibooker.book2D("cscTrackHitDivtrackSegmHitVsEta_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+"]", etaBin, etaMin, etaMax, 20, 0, 1); + + trackHitPercentualVsPhi = ibooker.book2D("trackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); trackHitPercentualVsPhi->setAxisTitle("rad",2); - dtTrackHitPercentualVsPhi = theDbe->book2D("dtTrackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); + dtTrackHitPercentualVsPhi = ibooker.book2D("dtTrackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); dtTrackHitPercentualVsPhi->setAxisTitle("rad",2); - cscTrackHitPercentualVsPhi = theDbe->book2D("cscTrackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); + cscTrackHitPercentualVsPhi = ibooker.book2D("cscTrackHitDivtrackSegmHitVsPhi_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+"]", phiBin, phiMin, phiMax, 20, 0, 1); cscTrackHitPercentualVsPhi->setAxisTitle("rad",2); - int ptBin = parameters.getParameter("ptBin"); - double ptMin = parameters.getParameter("ptMin"); - double ptMax = parameters.getParameter("ptMax"); - trackHitPercentualVsPt = theDbe->book2D("trackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); + trackHitPercentualVsPt = ibooker.book2D("trackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{Track} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); trackHitPercentualVsPt->setAxisTitle("GeV",2); - dtTrackHitPercentualVsPt = theDbe->book2D("dtTrackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); + dtTrackHitPercentualVsPt = ibooker.book2D("dtTrackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{DTinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); dtTrackHitPercentualVsPt->setAxisTitle("GeV",2); - cscTrackHitPercentualVsPt = theDbe->book2D("cscTrackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); + cscTrackHitPercentualVsPt = ibooker.book2D("cscTrackHitDivtrackSegmHitVsPt_"+trackCollection, "(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+"]", ptBin, ptMin, ptMax, 20, 0, 1); cscTrackHitPercentualVsPt->setAxisTitle("GeV",2); - } void SegmentTrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ - LogTrace(metname)<<"[SegmentTrackAnalyzer] Filling the histos"; theService->update(iSetup); Handle glbTracks; @@ -127,7 +119,6 @@ void SegmentTrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet #ifdef DEBUG cout << "[SegmentTrackAnalyzer] # of segments associated to the track: "<<(segments).size() <