From 73ba7926abb6e2d7cf3d7e9136d82dbb6b0e5e31 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 17 Aug 2021 09:17:31 -0500 Subject: [PATCH] Consolidated GLBMuonAnalyzer into one file The module was never actually registered with the plugin manager as SealModule.cc was not compiled. This was changed to remove an unneeded dependency on FWCore/Services/src/SiteLocalConfigService.h. --- .../test/GLBMuonAnalyzer.cc | 49 ++++++++++++++- .../GlobalMuonProducer/test/GLBMuonAnalyzer.h | 59 ------------------- .../GlobalMuonProducer/test/SealModule.cc | 13 ---- 3 files changed, 46 insertions(+), 75 deletions(-) delete mode 100644 RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h delete mode 100644 RecoMuon/GlobalMuonProducer/test/SealModule.cc diff --git a/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.cc b/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.cc index 7963d983ecaf4..d95ddc13b4d0f 100644 --- a/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.cc +++ b/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.cc @@ -5,9 +5,11 @@ * \author A. Everett - Purdue University */ -#include "RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h" +// Base Class Headers +#include "FWCore/Framework/interface/EDAnalyzer.h" // Collaborating Class Header +#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -32,11 +34,50 @@ #include "TH1F.h" #include "TH2F.h" +class GLBMuonAnalyzer : public edm::EDAnalyzer { +public: + /// Constructor + GLBMuonAnalyzer(const edm::ParameterSet &pset); + + /// Destructor + virtual ~GLBMuonAnalyzer(); + + // Operations + + void analyze(const edm::Event &event, const edm::EventSetup &eventSetup); + + virtual void beginJob(); + virtual void endJob(); + +protected: +private: + edm::InputTag theGLBMuonLabel; + + std::string theRootFileName; + TFile *theFile; + + // Histograms + TH1F *hPtRec; + TH1F *hPtSim; + TH1F *hPres; + TH1F *h1_Pres; + TH1F *hPTDiff; + TH1F *hPTDiff2; + TH2F *hPTDiffvsEta; + TH2F *hPTDiffvsPhi; + + // Counters + int numberOfSimTracks; + int numberOfRecTracks; + + std::string theDataType; +}; + using namespace std; using namespace edm; /// Constructor -GLBMuonAnalyzer::GLBMuonAnalyzer(const ParameterSet& pset) { +GLBMuonAnalyzer::GLBMuonAnalyzer(const ParameterSet &pset) { theGLBMuonLabel = pset.getUntrackedParameter("GlobalTrackCollectionLabel"); theRootFileName = pset.getUntrackedParameter("rootFileName"); @@ -91,7 +132,7 @@ void GLBMuonAnalyzer::endJob() { theFile->Close(); } -void GLBMuonAnalyzer::analyze(const Event& event, const EventSetup& eventSetup) { +void GLBMuonAnalyzer::analyze(const Event &event, const EventSetup &eventSetup) { //LogTrace("Analyzer") << "Run: " << event.id().run() << " Event: " << event.id().event() << endl; MuonPatternRecoDumper debug; @@ -186,3 +227,5 @@ void GLBMuonAnalyzer::analyze(const Event& event, const EventSetup& eventSetup) } LogTrace("Analyzer") << "---" << endl; } + +DEFINE_FWK_MODULE(GLBMuonAnalyzer); diff --git a/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h b/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h deleted file mode 100644 index c7ad966bbd8b3..0000000000000 --- a/RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef RecoMuon_GlobalMuonProducer_GLBMuonAnalyzer_H -#define RecoMuon_GlobalMuonProducer_GLBMuonAnalyzer_H - -/** \class GLBMuonAnalyzer - * Analyzer of the Global muon tracks - * - * \author R. Bellan - INFN Torino - * \author A. Everett - Purdue University - */ - -// Base Class Headers -#include "FWCore/Framework/interface/EDAnalyzer.h" - -//#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Utilities/interface/InputTag.h" - -class TFile; -class TH1F; -class TH2F; - -class GLBMuonAnalyzer : public edm::EDAnalyzer { -public: - /// Constructor - GLBMuonAnalyzer(const edm::ParameterSet &pset); - - /// Destructor - virtual ~GLBMuonAnalyzer(); - - // Operations - - void analyze(const edm::Event &event, const edm::EventSetup &eventSetup); - - virtual void beginJob(); - virtual void endJob(); - -protected: -private: - edm::InputTag theGLBMuonLabel; - - std::string theRootFileName; - TFile *theFile; - - // Histograms - TH1F *hPtRec; - TH1F *hPtSim; - TH1F *hPres; - TH1F *h1_Pres; - TH1F *hPTDiff; - TH1F *hPTDiff2; - TH2F *hPTDiffvsEta; - TH2F *hPTDiffvsPhi; - - // Counters - int numberOfSimTracks; - int numberOfRecTracks; - - std::string theDataType; -}; -#endif diff --git a/RecoMuon/GlobalMuonProducer/test/SealModule.cc b/RecoMuon/GlobalMuonProducer/test/SealModule.cc deleted file mode 100644 index 282c1b0442d09..0000000000000 --- a/RecoMuon/GlobalMuonProducer/test/SealModule.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" - -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/Services/src/SiteLocalConfigService.h" -#include "FWCore/ServiceRegistry/interface/ServiceMaker.h" -#include "RecoMuon/GlobalMuonProducer/test/GLBMuonAnalyzer.h" - -using namespace edm::serviceregistry; - - - -DEFINE_FWK_MODULE(GLBMuonAnalyzer);