Skip to content

Commit

Permalink
Merge pull request #36586 from Dr15Jones/deprecated_RecoRomanPotRecoF…
Browse files Browse the repository at this point in the history
…P420

Remove CMS deprecated warnings from RecoRomanPot/RecoFP420
  • Loading branch information
cmsbuild committed Dec 30, 2021
2 parents 01e3b3e + ef611c4 commit ef7ab7a
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 156 deletions.
10 changes: 5 additions & 5 deletions RecoRomanPot/RecoFP420/interface/ClusterProducerFP420.h
Expand Up @@ -23,16 +23,16 @@ class ClusterProducerFP420 {
std::vector<ClusterFP420> clusterizeDetUnit(HDigiFP420Iter begin,
HDigiFP420Iter end,
unsigned int detid,
const ElectrodNoiseVector& vnoise);
const ElectrodNoiseVector& vnoise) const;
std::vector<ClusterFP420> clusterizeDetUnitPixels(HDigiFP420Iter begin,
HDigiFP420Iter end,
unsigned int detid,
const ElectrodNoiseVector& vnoise,
unsigned int xytype,
int verb);
int verb) const;

int difNarr(unsigned int xytype, HDigiFP420Iter ichannel, HDigiFP420Iter jchannel);
int difWide(unsigned int xytype, HDigiFP420Iter ichannel, HDigiFP420Iter jchannel);
int difNarr(unsigned int xytype, HDigiFP420Iter ichannel, HDigiFP420Iter jchannel) const;
int difWide(unsigned int xytype, HDigiFP420Iter ichannel, HDigiFP420Iter jchannel) const;

float channelThresholdInNoiseSigma() const { return theChannelThreshold; }
float seedThresholdInNoiseSigma() const { return theSeedThreshold; }
Expand All @@ -51,7 +51,7 @@ class AboveSeed {
public:
AboveSeed(float aseed, const ElectrodNoiseVector& vnoise) : verb(0), seed(aseed), vnoise_(vnoise){};

bool operator()(const HDigiFP420& digi) {
bool operator()(const HDigiFP420& digi) const {
return (!vnoise_[digi.channel()].getDisable() && digi.adc() >= seed * vnoise_[digi.channel()].getNoise());
}

Expand Down
18 changes: 4 additions & 14 deletions RecoRomanPot/RecoFP420/interface/ClusterizerFP420.h
@@ -1,7 +1,7 @@
#ifndef ClusterizerFP420_h
#define ClusterizerFP420_h

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -19,37 +19,27 @@
#include "DataFormats/FP420Cluster/interface/ClusterFP420.h"
#include "DataFormats/FP420Cluster/interface/ClusterCollectionFP420.h"

#include <CLHEP/Vector/ThreeVector.h>
#include <string>
#include <vector>
#include <map>
#include <iostream>

namespace cms {
class ClusterizerFP420 : public edm::EDProducer {
class ClusterizerFP420 : public edm::global::EDProducer<> {
public:
explicit ClusterizerFP420(const edm::ParameterSet& conf);

~ClusterizerFP420() override;

void beginJob() override;

// virtual void produce(DigiCollectionFP420*, ClusterCollectionFP420 &);
// virtual void produce(DigiCollectionFP420 &, ClusterCollectionFP420 &);

void produce(edm::Event& e, const edm::EventSetup& c) override;
void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& c) const override;

private:
typedef std::vector<std::string> vstring;

edm::ParameterSet conf_;
vstring trackerContainers;

FP420ClusterMain* sClusterizerFP420_;

ClusterCollectionFP420* soutput;
std::unique_ptr<const FP420ClusterMain> sClusterizerFP420_;

std::vector<ClusterNoiseFP420> noise;
bool UseNoiseBadElectrodeFlagFromDB_;
int sn0, pn0, dn0, rn0;
int verbosity;
Expand Down
22 changes: 4 additions & 18 deletions RecoRomanPot/RecoFP420/interface/FP420ClusterMain.h
Expand Up @@ -3,48 +3,38 @@

#include <string>
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "SimG4CMS/FP420/interface/FP420NumberingScheme.h"
#include "DataFormats/FP420Digi/interface/DigiCollectionFP420.h"
#include "DataFormats/FP420Cluster/interface/ClusterCollectionFP420.h"
#include "RecoRomanPot/RecoFP420/interface/ClusterNoiseFP420.h"
#include "DataFormats/FP420Cluster/interface/ClusterFP420.h"
#include "RecoRomanPot/RecoFP420/interface/ClusterProducerFP420.h"
#include <iostream>
#include <vector>
#include <memory>

class ClusterNoiseFP420;
class ClusterProducerFP420;

class FP420ClusterMain {
public:
FP420ClusterMain(const edm::ParameterSet &conf, int dn, int sn, int pn, int rn);
// FP420ClusterMain();

~FP420ClusterMain();

/// Runs the algorithm

// void run(const DigiCollectionFP420 &input,
// ClusterCollectionFP420 &soutput,
// const std::vector<ClusterNoiseFP420>& noise
// );
void run(edm::Handle<DigiCollectionFP420> &input,
ClusterCollectionFP420 *soutput,
std::vector<ClusterNoiseFP420> &noise);
void run(edm::Handle<DigiCollectionFP420> &input, ClusterCollectionFP420 *soutput) const;

private:
ClusterProducerFP420 *threeThreshold_;
std::unique_ptr<const ClusterProducerFP420> threeThreshold_;
std::string clusterMode_;

//std::vector<HDigiFP420> collector;
edm::ParameterSet conf_;

bool validClusterizer_;
double ElectronPerADC_;
Expand All @@ -59,16 +49,12 @@ class FP420ClusterMain {

double ldriftX;
double ldriftY;
double ldrift;
double pitchX; // pitchX
double pitchY; // pitchY
double pitch; // pitch automatic
float moduleThicknessX; // plate thicknessX
float moduleThicknessY; // plate thicknessY
float moduleThickness; // plate thickness
int numStripsX, numStripsXW; // number of strips in the moduleX
int numStripsY, numStripsYW; // number of strips in the moduleY
int numStrips; // number of strips in the module

float Thick300;

Expand Down
7 changes: 0 additions & 7 deletions RecoRomanPot/RecoFP420/interface/FP420RecoMain.h
Expand Up @@ -3,14 +3,7 @@

#include <string>
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DataFormats/FP420Cluster/interface/TrackFP420.h"
#include "DataFormats/FP420Cluster/interface/TrackCollectionFP420.h"
Expand Down
12 changes: 2 additions & 10 deletions RecoRomanPot/RecoFP420/interface/FP420TrackMain.h
Expand Up @@ -3,14 +3,7 @@

#include <string>
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DataFormats/FP420Cluster/interface/ClusterCollectionFP420.h"
#include "DataFormats/FP420Cluster/interface/TrackCollectionFP420.h"
Expand All @@ -24,11 +17,10 @@ class FP420TrackMain {
~FP420TrackMain();

/// Runs the algorithm
void run(edm::Handle<ClusterCollectionFP420> &input, TrackCollectionFP420 *toutput);
void run(edm::Handle<ClusterCollectionFP420> &input, TrackCollectionFP420 *toutput) const;

private:
edm::ParameterSet conf_;
TrackProducerFP420 *finderParameters_;
TrackProducerFP420 const *finderParameters_;
std::string trackMode_;

bool validTrackerizer_;
Expand Down
6 changes: 2 additions & 4 deletions RecoRomanPot/RecoFP420/interface/ReconstructerFP420.h
@@ -1,7 +1,7 @@
#ifndef ReconstructerFP420_h
#define ReconstructerFP420_h

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
//#include "FWCore/Framework/interface/Handle.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -20,15 +20,13 @@
#include <iostream>

namespace cms {
class ReconstructerFP420 : public edm::EDProducer {
class ReconstructerFP420 : public edm::stream::EDProducer<> {
public:
explicit ReconstructerFP420(const edm::ParameterSet& conf);
//ReconstructerFP420();

~ReconstructerFP420() override;

void beginJob() override;

// virtual void produce(ClusterCollectionFP420 &, RecoCollectionFP420 &);
void produce(edm::Event& e, const edm::EventSetup& c) override;

Expand Down
9 changes: 1 addition & 8 deletions RecoRomanPot/RecoFP420/interface/TrackProducerFP420.h
Expand Up @@ -3,14 +3,7 @@

#include <string>
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DataFormats/FP420Cluster/interface/TrackFP420.h"
#include "DataFormats/FP420Cluster/interface/ClusterFP420.h"
Expand Down Expand Up @@ -62,7 +55,7 @@ class TrackProducerFP420 {
// //std::vector<TrackFP420> trackFinderVar2(ClusterCollectionFP420 input);

// std::vector<TrackFP420> trackFinderSophisticated(ClusterCollectionFP420 input);
std::vector<TrackFP420> trackFinderSophisticated(edm::Handle<ClusterCollectionFP420> input, int det);
std::vector<TrackFP420> trackFinderSophisticated(edm::Handle<ClusterCollectionFP420> input, int det) const;

// std::vector<TrackFP420> trackFinder3D(ClusterCollectionFP420 input);

Expand Down
13 changes: 4 additions & 9 deletions RecoRomanPot/RecoFP420/interface/TrackerizerFP420.h
@@ -1,7 +1,7 @@
#ifndef TrackerizerFP420_h
#define TrackerizerFP420_h

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
//#include "FWCore/Framework/interface/Handle.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -23,24 +23,19 @@
#include <iostream>

namespace cms {
class TrackerizerFP420 : public edm::EDProducer {
class TrackerizerFP420 : public edm::global::EDProducer<> {
public:
explicit TrackerizerFP420(const edm::ParameterSet& conf);
//TrackerizerFP420();

~TrackerizerFP420() override;

void beginJob() override;

// virtual void produce(ClusterCollectionFP420 &, TrackCollectionFP420 &);
void produce(edm::Event& e, const edm::EventSetup& c) override;
void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& c) const override;

private:
typedef std::vector<std::string> vstring;
edm::ParameterSet conf_;
vstring trackerContainers;

FP420TrackMain* sFP420TrackMain_;
const FP420TrackMain sFP420TrackMain_;
// FP420TrackMain startFP420TrackMain_;
//bool UseNoiseBadElectrodeFlagFromDB_;
int verbosity;
Expand Down
20 changes: 8 additions & 12 deletions RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc
Expand Up @@ -8,7 +8,6 @@
#include <string>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -38,30 +37,27 @@
using namespace std;

namespace cms {
ClusterizerFP420::ClusterizerFP420(const edm::ParameterSet& conf) : conf_(conf) {
ClusterizerFP420::ClusterizerFP420(const edm::ParameterSet& conf) {
std::string alias(conf.getParameter<std::string>("@module_label"));

produces<ClusterCollectionFP420>().setBranchAlias(alias);

trackerContainers.clear();
trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");

verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
dn0 = conf_.getParameter<int>("NumberFP420Detectors");
sn0 = conf_.getParameter<int>("NumberFP420Stations");
pn0 = conf_.getParameter<int>("NumberFP420SPlanes");
verbosity = conf.getUntrackedParameter<int>("VerbosityLevel");
dn0 = conf.getParameter<int>("NumberFP420Detectors");
sn0 = conf.getParameter<int>("NumberFP420Stations");
pn0 = conf.getParameter<int>("NumberFP420SPlanes");
rn0 = 7;
if (verbosity > 0) {
std::cout << "Creating a ClusterizerFP420" << std::endl;
std::cout << "ClusterizerFP420: dn0=" << dn0 << " sn0=" << sn0 << " pn0=" << pn0 << " rn0=" << rn0 << std::endl;
}

sClusterizerFP420_ = new FP420ClusterMain(conf_, dn0, sn0, pn0, rn0);
sClusterizerFP420_ = std::make_unique<FP420ClusterMain>(conf, dn0, sn0, pn0, rn0);
}

// Virtual destructor needed.
ClusterizerFP420::~ClusterizerFP420() { delete sClusterizerFP420_; }

//Get at the beginning
void ClusterizerFP420::beginJob() {
if (verbosity > 0) {
Expand Down Expand Up @@ -96,7 +92,7 @@ namespace cms {
// }
}

void ClusterizerFP420::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
void ClusterizerFP420::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
// beginJob;
// be lazy and include the appropriate namespaces
using namespace edm;
Expand Down Expand Up @@ -200,7 +196,7 @@ namespace cms {
if (verbosity > 0) {
std::cout << "ClusterizerFP420: OK2" << std::endl;
}
sClusterizerFP420_->run(input, soutput.get(), noise);
sClusterizerFP420_->run(input, soutput.get());

if (verbosity > 0) {
std::cout << "ClusterizerFP420: OK3" << std::endl;
Expand Down
8 changes: 0 additions & 8 deletions RecoRomanPot/RecoFP420/plugins/ReconstructerFP420.cc
Expand Up @@ -7,7 +7,6 @@
#include <memory>
#include <string>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -55,13 +54,6 @@ namespace cms {
delete sFP420RecoMain_;
}

//Get at the beginning
void ReconstructerFP420::beginJob() {
if (verbosity > 0) {
std::cout << "ReconstructerFP420:BeginJob method " << std::endl;
}
}

void ReconstructerFP420::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
// beginJob;
// be lazy and include the appropriate namespaces
Expand Down

0 comments on commit ef7ab7a

Please sign in to comment.