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

Run3-gex124A Try to remove compilation warnings in RecoParticleFlow/PFClusterProducer #37331

Merged
merged 2 commits into from Mar 25, 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
13 changes: 4 additions & 9 deletions RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.cc
Expand Up @@ -11,18 +11,13 @@ using namespace std;
using namespace edm;
using namespace reco;

PFClusterAnalyzer::PFClusterAnalyzer(const edm::ParameterSet& iConfig) {
inputTagPFClusters_ = iConfig.getParameter<InputTag>("PFClusters");

verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);

printBlocks_ = iConfig.getUntrackedParameter<bool>("printBlocks", false);

PFClusterAnalyzer::PFClusterAnalyzer(const edm::ParameterSet& iConfig)
: inputTagPFClusters_(iConfig.getParameter<InputTag>("PFClusters")),
verbose_(iConfig.getUntrackedParameter<bool>("verbose", false)),
printBlocks_(iConfig.getUntrackedParameter<bool>("printBlocks", false)) {
LogDebug("PFClusterAnalyzer") << " input collection : " << inputTagPFClusters_;
}

PFClusterAnalyzer::~PFClusterAnalyzer() = default;

void PFClusterAnalyzer::beginRun(const edm::Run& run, const edm::EventSetup& es) {}

void PFClusterAnalyzer::analyze(const Event& iEvent, const EventSetup& iSetup) {
Expand Down
13 changes: 7 additions & 6 deletions RecoParticleFlow/PFClusterProducer/test/PFClusterAnalyzer.h
Expand Up @@ -8,7 +8,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/ParameterSet/interface/ParameterSet.h"

#include "FWCore/Framework/interface/Event.h"
Expand All @@ -20,15 +20,16 @@
\brief test analyzer for PFClusters
*/

class PFClusterAnalyzer : public edm::EDAnalyzer {
class PFClusterAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit PFClusterAnalyzer(const edm::ParameterSet&);

~PFClusterAnalyzer() override;
~PFClusterAnalyzer() override = default;

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

void beginRun(const edm::Run& r, const edm::EventSetup& c) override;
void endRun(const edm::Run& r, const edm::EventSetup& c) override {}

private:
void fetchCandidateCollection(edm::Handle<reco::PFClusterCollection>& c,
Expand All @@ -39,13 +40,13 @@ class PFClusterAnalyzer : public edm::EDAnalyzer {
/* std::ostream& out=std::cout) const; */

/// PFClusters in which we'll look for pile up particles
edm::InputTag inputTagPFClusters_;
const edm::InputTag inputTagPFClusters_;

/// verbose ?
bool verbose_;
const bool verbose_;

/// print the blocks associated to a given candidate ?
bool printBlocks_;
const bool printBlocks_;
};

#endif
51 changes: 23 additions & 28 deletions RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.cc
Expand Up @@ -13,38 +13,33 @@ using namespace std;
using namespace edm;
using namespace reco;

PFClusterComparator::PFClusterComparator(const edm::ParameterSet& iConfig) {
inputTagPFClusters_ = iConfig.getParameter<InputTag>("PFClusters");

inputTagPFClustersCompare_ = iConfig.getParameter<InputTag>("PFClustersCompare");

verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);

printBlocks_ = iConfig.getUntrackedParameter<bool>("printBlocks", false);

log10E_old = fs_->make<TH1F>("log10E_old", "log10(E cluster)", 500, -5, 5);
log10E_new = fs_->make<TH1F>("log10E_new", "log10(E cluster)", 500, -5, 5);
deltaEnergy = fs_->make<TH1F>("delta_energy", "E_{old} - E_{new}", 5000, -5, 5);

posX_old = fs_->make<TH1F>("posX_old", "log10(E cluster)", 50000, 0, 500);
posX_new = fs_->make<TH1F>("posX_new", "log10(E cluster)", 50000, 0, 500);
deltaX = fs_->make<TH1F>("delta_X", "X_{old} - X_{new}", 5000, -5, 5);

posY_old = fs_->make<TH1F>("posY_old", "log10(E cluster)", 50000, 0, 500);
posY_new = fs_->make<TH1F>("posY_new", "log10(E cluster)", 50000, 0, 500);
deltaY = fs_->make<TH1F>("delta_Y", "Y_{old} - Y_{new}", 5000, -5, 5);

posZ_old = fs_->make<TH1F>("posZ_old", "log10(E cluster)", 50000, 0, 500);
posZ_new = fs_->make<TH1F>("posZ_new", "log10(E cluster)", 50000, 0, 500);
deltaZ = fs_->make<TH1F>("delta_Z", "Z_{old} - Z_{new}", 5000, -5, 5);
PFClusterComparator::PFClusterComparator(const edm::ParameterSet& iConfig)
: inputTagPFClusters_(iConfig.getParameter<InputTag>("PFClusters")),
inputTagPFClustersCompare_(iConfig.getParameter<InputTag>("PFClustersCompare")),
verbose_(iConfig.getUntrackedParameter<bool>("verbose", false)),
printBlocks_(iConfig.getUntrackedParameter<bool>("printBlocks", false)) {
usesResource("TFileService");

edm::Service<TFileService> fs;
log10E_old = fs->make<TH1F>("log10E_old", "log10(E cluster)", 500, -5, 5);
log10E_new = fs->make<TH1F>("log10E_new", "log10(E cluster)", 500, -5, 5);
deltaEnergy = fs->make<TH1F>("delta_energy", "E_{old} - E_{new}", 5000, -5, 5);

posX_old = fs->make<TH1F>("posX_old", "log10(E cluster)", 50000, 0, 500);
posX_new = fs->make<TH1F>("posX_new", "log10(E cluster)", 50000, 0, 500);
deltaX = fs->make<TH1F>("delta_X", "X_{old} - X_{new}", 5000, -5, 5);

posY_old = fs->make<TH1F>("posY_old", "log10(E cluster)", 50000, 0, 500);
posY_new = fs->make<TH1F>("posY_new", "log10(E cluster)", 50000, 0, 500);
deltaY = fs->make<TH1F>("delta_Y", "Y_{old} - Y_{new}", 5000, -5, 5);

posZ_old = fs->make<TH1F>("posZ_old", "log10(E cluster)", 50000, 0, 500);
posZ_new = fs->make<TH1F>("posZ_new", "log10(E cluster)", 50000, 0, 500);
deltaZ = fs->make<TH1F>("delta_Z", "Z_{old} - Z_{new}", 5000, -5, 5);

LogDebug("PFClusterComparator") << " input collection : " << inputTagPFClusters_;
}

PFClusterComparator::~PFClusterComparator() = default;

void PFClusterComparator::beginRun(const edm::Run& run, const edm::EventSetup& es) {}

void PFClusterComparator::analyze(const Event& iEvent, const EventSetup& iSetup) {
std::map<unsigned, unsigned> detId_count;

Expand Down
26 changes: 13 additions & 13 deletions RecoParticleFlow/PFClusterProducer/test/PFClusterComparator.h
Expand Up @@ -8,7 +8,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/ParameterSet/interface/ParameterSet.h"

#include "FWCore/Framework/interface/Event.h"
Expand All @@ -23,15 +23,16 @@
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "TH1F.h"

class PFClusterComparator : public edm::EDAnalyzer {
class PFClusterComparator : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
public:
explicit PFClusterComparator(const edm::ParameterSet &);

~PFClusterComparator() override;
~PFClusterComparator() override = default;

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

void beginRun(const edm::Run &r, const edm::EventSetup &c) override;
void beginRun(const edm::Run &r, const edm::EventSetup &c) override {}
void endRun(const edm::Run &r, const edm::EventSetup &c) override {}

private:
void fetchCandidateCollection(edm::Handle<reco::PFClusterCollection> &c,
Expand All @@ -42,20 +43,19 @@ class PFClusterComparator : public edm::EDAnalyzer {
/* std::ostream& out=std::cout) const; */

/// PFClusters in which we'll look for pile up particles
edm::InputTag inputTagPFClusters_;
edm::InputTag inputTagPFClustersCompare_;
const edm::InputTag inputTagPFClusters_;
const edm::InputTag inputTagPFClustersCompare_;

/// verbose ?
const bool verbose_;

/// print the blocks associated to a given candidate ?
const bool printBlocks_;

edm::Service<TFileService> fs_;
TH1F *log10E_old, *log10E_new, *deltaEnergy;
TH1F *posX_old, *posX_new, *deltaX;
TH1F *posY_old, *posY_new, *deltaY;
TH1F *posZ_old, *posZ_new, *deltaZ;

/// verbose ?
bool verbose_;

/// print the blocks associated to a given candidate ?
bool printBlocks_;
};

#endif