Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMS deprecation warning in JetMETCorrections subsystem #39819

Merged
merged 4 commits into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions JetMETCorrections/IsolatedParticles/test/TestIsoSimTracks.cc
Expand Up @@ -20,7 +20,7 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -77,13 +77,12 @@
#include "TH1F.h"
#include <TFile.h>

class TestIsoSimTracks : public edm::EDAnalyzer {
class TestIsoSimTracks : public edm::one::EDAnalyzer<> {
public:
explicit TestIsoSimTracks(const edm::ParameterSet&);
virtual ~TestIsoSimTracks(){};

virtual void analyze(const edm::Event&, const edm::EventSetup&);
void endJob(void);
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;

private:
TFile* m_Hfile;
Expand Down
9 changes: 4 additions & 5 deletions JetMETCorrections/IsolatedParticles/test/TestIsoTracks.cc
Expand Up @@ -20,7 +20,7 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -91,15 +91,14 @@
using namespace std;
using namespace reco;

class TestIsoTracks : public edm::EDAnalyzer {
class TestIsoTracks : public edm::one::EDAnalyzer<> {
public:
explicit TestIsoTracks(const edm::ParameterSet&);
virtual ~TestIsoTracks(){};

void setPrimaryVertex(const reco::Vertex& a) { theRecVertex = a; }
void setTracksFromPrimaryVertex(vector<reco::Track>& a) { theTrack = a; }
virtual void analyze(const edm::Event&, const edm::EventSetup&);
void endJob(void);
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;

private:
TFile* m_Hfile;
Expand Down
4 changes: 2 additions & 2 deletions JetMETCorrections/MCJet/plugins/CaloMCTruthTreeProducer.h
Expand Up @@ -3,14 +3,14 @@

#include "TTree.h"
#include "TFile.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
#include "DataFormats/JetReco/interface/GenJetCollection.h"
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"

//namespace cms
//{
class CaloMCTruthTreeProducer : public edm::EDAnalyzer {
class CaloMCTruthTreeProducer : public edm::one::EDAnalyzer<> {
public:
explicit CaloMCTruthTreeProducer(edm::ParameterSet const& cfg);
void beginJob() override;
Expand Down
4 changes: 2 additions & 2 deletions JetMETCorrections/MCJet/plugins/PFMCTruthTreeProducer.h
Expand Up @@ -3,14 +3,14 @@

#include "TTree.h"
#include "TFile.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/JetReco/interface/GenJetCollection.h"
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"

//namespace cms
//{
class PFMCTruthTreeProducer : public edm::EDAnalyzer {
class PFMCTruthTreeProducer : public edm::one::EDAnalyzer<> {
public:
explicit PFMCTruthTreeProducer(edm::ParameterSet const& cfg);
void beginJob() override;
Expand Down
47 changes: 0 additions & 47 deletions JetMETCorrections/TauJet/interface/TauJetCorrector.h

This file was deleted.

29 changes: 3 additions & 26 deletions JetMETCorrections/TauJet/plugins/TauJetCorrectorExample.cc
Expand Up @@ -16,7 +16,7 @@ Description: <one line class summary>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -27,13 +27,7 @@ Description: <one line class summary>
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
#include "DataFormats/JetReco/interface/CaloJet.h"
////#include "DataFormats/EgammaCandidates/interface/Electron.h"
////#include "DataFormats/EgammaReco/interface/ElectronPixelSeed.h"
////#include "DataFormats/MuonReco/interface/Muon.h"
////#include "DataFormats/JetReco/interface/GenJet.h"

#include "JetMETCorrections/TauJet/interface/TauJetCorrector.h"
//#include "JetMETCorrections/TauJet/interface/JetCalibratorTauJet.h"
#include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h"
Expand All @@ -57,7 +51,7 @@ Description: <one line class summary>
//
// class decleration
//
class TauJetCorrectorExample : public edm::EDAnalyzer {
class TauJetCorrectorExample : public edm::one::EDAnalyzer<> {
public:
explicit TauJetCorrectorExample(const edm::ParameterSet&);
~TauJetCorrectorExample() override;
Expand All @@ -68,9 +62,6 @@ class TauJetCorrectorExample : public edm::EDAnalyzer {
void endJob() override;

// ----------member data ---------------------------
#ifdef THIS_IS_AN_EVENT_EXAMPLE
edm::EDGetTokenT<ExampleData> exampletoken;
#endif
std::string jetname;
edm::EDGetTokenT<reco::IsolatedTauTagInfoCollection> tautoken;
edm::EDGetTokenT<reco::JetCorrector> tauCorrectortoken;
Expand All @@ -94,11 +85,7 @@ class TauJetCorrectorExample : public edm::EDAnalyzer {
using namespace reco;

TauJetCorrectorExample::TauJetCorrectorExample(const edm::ParameterSet& iConfig)
:
#ifdef THIS_IS_AN_EVENT_EXAMPLE
exampletoken(consumes<ExampleData>(edm::InputTag("example"))),
#endif
jetname(iConfig.getUntrackedParameter<std::string>("JetHandle", "iterativeCone5CaloJets")),
: jetname(iConfig.getUntrackedParameter<std::string>("JetHandle", "iterativeCone5CaloJets")),
tautoken(consumes<reco::IsolatedTauTagInfoCollection>(
edm::InputTag(iConfig.getUntrackedParameter<std::string>("TauHandle", "coneIsolation")))),
tauCorrectortoken(consumes<reco::JetCorrector>(
Expand All @@ -124,16 +111,6 @@ void TauJetCorrectorExample::analyze(const edm::Event& iEvent, const edm::EventS
Handle<reco::JetCorrector> taucorrector;
iEvent.getByToken(tauCorrectortoken, taucorrector);

#ifdef THIS_IS_AN_EVENT_EXAMPLE
Handle<ExampleData> pIn;
iEvent.getByToken(exampletoken, pIn);
#endif

#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
ESHandle<SetupData> pSetup;
iSetup.get<SetupRecord>().get(pSetup);
#endif

// this analyzer produces a small root file with basic candidates and some MC information
// some additional print statements
++nEvt;
Expand Down