Skip to content

Commit

Permalink
Merge pull request #36815 from bsunanda/Run3-gex116
Browse files Browse the repository at this point in the history
Run3-gex116 Remove compilation warnings in several packages of RecoBTag
  • Loading branch information
cmsbuild authored Feb 6, 2022
2 parents d45e122 + d26844e commit 8e4da88
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 23 deletions.
4 changes: 2 additions & 2 deletions RecoBTag/ImpactParameter/test/IPAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down Expand Up @@ -49,7 +49,7 @@ using namespace reco;
// class decleration
//

class IPAnalyzer : public edm::EDAnalyzer {
class IPAnalyzer : public edm::one::EDAnalyzer<> {
public:
explicit IPAnalyzer(const edm::ParameterSet&);
~IPAnalyzer() {}
Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/Skimming/interface/BTagSkimLeptonJet.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
*/

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/one/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"

class BTagSkimLeptonJet : public edm::EDFilter {
class BTagSkimLeptonJet : public edm::one::EDFilter<> {
public:
explicit BTagSkimLeptonJet(const edm::ParameterSet&);
~BTagSkimLeptonJet() override;
Expand Down
21 changes: 17 additions & 4 deletions RecoBTag/Skimming/interface/BTagSkimMC.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/stream/EDFilter.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

class BTagSkimMC : public edm::EDFilter {
namespace BTagSkimMCCount {
struct Counters {
Counters() : nEvents_(0), nAccepted_(0) {}
mutable std::atomic<unsigned int> nEvents_, nAccepted_;
};
} // namespace BTagSkimMCCount

class BTagSkimMC : public edm::stream::EDFilter<edm::GlobalCache<BTagSkimMCCount::Counters> > {
public:
/// constructor
BTagSkimMC(const edm::ParameterSet&);
explicit BTagSkimMC(const edm::ParameterSet&, const BTagSkimMCCount::Counters* count);

static std::unique_ptr<BTagSkimMCCount::Counters> initializeGlobalCache(edm::ParameterSet const&) {
return std::make_unique<BTagSkimMCCount::Counters>();
}

bool filter(edm::Event& evt, const edm::EventSetup& es) override;
void endJob() override;
void endStream() override;
static void globalEndJob(const BTagSkimMCCount::Counters* counters);

private:
bool verbose;
Expand Down
16 changes: 11 additions & 5 deletions RecoBTag/Skimming/src/BTagSkimMC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace std;
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
using namespace reco;

BTagSkimMC::BTagSkimMC(const ParameterSet& p) : nEvents_(0), nAccepted_(0) {
BTagSkimMC::BTagSkimMC(const ParameterSet& p, const BTagSkimMCCount::Counters* count) : nEvents_(0), nAccepted_(0) {
verbose = p.getUntrackedParameter<bool>("verbose", false);
pthatMin = p.getParameter<double>("pthat_min");
pthatMax = p.getParameter<double>("pthat_max");
Expand Down Expand Up @@ -77,12 +77,18 @@ bool BTagSkimMC::filter(Event& evt, const EventSetup& es) {
return false;
}

void BTagSkimMC::endJob() {
void BTagSkimMC::endStream() {
globalCache()->nEvents_ += nEvents_;
globalCache()->nAccepted_ += nAccepted_;
}

void BTagSkimMC::globalEndJob(const BTagSkimMCCount::Counters* count) {
edm::LogVerbatim("BTagSkimMC") << "=============================================================================\n"
<< " Events read: " << nEvents_ << "\n Events accepted by BTagSkimMC: " << nAccepted_
<< "\n Efficiency: " << (double)(nAccepted_) / (double)(nEvents_)
<< " Events read: " << count->nEvents_
<< "\n Events accepted by BTagSkimMC: " << count->nAccepted_
<< "\n Efficiency: " << (double)(count->nAccepted_) / (double)(count->nEvents_)
<< "\n==========================================================================="
<< endl;
<< std::endl;
}

#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/SoftLepton/test/testLeptonAssociator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <tuple>

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -28,7 +28,7 @@ namespace std {
};
} // namespace std

class testLeptonAssociator : public edm::EDAnalyzer {
class testLeptonAssociator : public edm::one::EDAnalyzer<> {
public:
explicit testLeptonAssociator(const edm::ParameterSet& iConfig);
virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& setup) override;
Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/SoftLepton/test/testMuonAssociator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <set>

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -26,7 +26,7 @@ namespace std {
};
} // namespace std

class testMuonAssociator : public edm::EDAnalyzer {
class testMuonAssociator : public edm::one::EDAnalyzer<> {
public:
explicit testMuonAssociator(const edm::ParameterSet& iConfig);
virtual ~testMuonAssociator();
Expand Down
2 changes: 1 addition & 1 deletion RecoBTag/TrackProbability/test/CalibrationSkeleton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace std;

// 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"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/TrackProbability/test/TrackProbabilityAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace std;

// 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"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -53,7 +53,7 @@ using namespace reco;
// class decleration
//

class TrackProbabilityAnalyzer : public edm::EDAnalyzer {
class TrackProbabilityAnalyzer : public edm::one::EDAnalyzer<> {
public:
explicit TrackProbabilityAnalyzer(const edm::ParameterSet&);
~TrackProbabilityAnalyzer() {}
Expand Down
2 changes: 1 addition & 1 deletion RecoBTag/TrackProbability/test/TrackProbabilityXMLtoDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace std;

// 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"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down
4 changes: 2 additions & 2 deletions RecoBTag/XMLCalibration/test/XMLCalibrationTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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 All @@ -24,7 +24,7 @@ class TestCategory;
///This is an example of how to use the AlgorithmCalibration stuff
// to read the calibrated objects from a .xml file

class XMLCalibrationTest : public edm::EDAnalyzer {
class XMLCalibrationTest : public edm::one::EDAnalyzer<> {
public:
explicit XMLCalibrationTest(const edm::ParameterSet&);
~XMLCalibrationTest();
Expand Down

0 comments on commit 8e4da88

Please sign in to comment.