diff --git a/SimG4CMS/PPS/interface/PPSDiamondSD.h b/SimG4CMS/PPS/interface/PPSDiamondSD.h index 27073180b796d..7bef48db01fcc 100644 --- a/SimG4CMS/PPS/interface/PPSDiamondSD.h +++ b/SimG4CMS/PPS/interface/PPSDiamondSD.h @@ -32,11 +32,7 @@ class PPSDiamondSD : public SensitiveTkDetector, public Observer, public Observer { public: - PPSDiamondSD(const std::string&, - const edm::EventSetup&, - const SensitiveDetectorCatalog&, - edm::ParameterSet const&, - const SimTrackManager*); + PPSDiamondSD(const std::string&, const SensitiveDetectorCatalog&, edm::ParameterSet const&, const SimTrackManager*); ~PPSDiamondSD() override; void printHitInfo(); diff --git a/SimG4CMS/PPS/interface/PPSPixelSD.h b/SimG4CMS/PPS/interface/PPSPixelSD.h index 8af0c94d9505a..41a08a2adcea5 100644 --- a/SimG4CMS/PPS/interface/PPSPixelSD.h +++ b/SimG4CMS/PPS/interface/PPSPixelSD.h @@ -47,11 +47,7 @@ class PPSPixelSD : public SensitiveTkDetector, public Observer, public Observer { public: - PPSPixelSD(const std::string&, - const edm::EventSetup&, - const SensitiveDetectorCatalog&, - edm::ParameterSet const&, - SimTrackManager const*); + PPSPixelSD(const std::string&, const SensitiveDetectorCatalog&, edm::ParameterSet const&, SimTrackManager const*); ~PPSPixelSD() override; bool ProcessHits(G4Step*, G4TouchableHistory*) override; diff --git a/SimG4CMS/PPS/interface/TotemRPSD.h b/SimG4CMS/PPS/interface/TotemRPSD.h index 2eff09d2a94d5..431b139e9efd3 100644 --- a/SimG4CMS/PPS/interface/TotemRPSD.h +++ b/SimG4CMS/PPS/interface/TotemRPSD.h @@ -29,11 +29,7 @@ class TotemTestHitHBNtuple; class TotemRPSD : public SensitiveTkDetector, public Observer, public Observer { public: - TotemRPSD(const std::string&, - const edm::EventSetup&, - const SensitiveDetectorCatalog&, - edm::ParameterSet const&, - const SimTrackManager*); + TotemRPSD(const std::string&, const SensitiveDetectorCatalog&, edm::ParameterSet const&, const SimTrackManager*); ~TotemRPSD() override; void printHitInfo(); diff --git a/SimG4CMS/PPS/plugins/CTPPSDiamondSensitiveDetectorBuilder.cc b/SimG4CMS/PPS/plugins/CTPPSDiamondSensitiveDetectorBuilder.cc new file mode 100644 index 0000000000000..1a06cb76214fe --- /dev/null +++ b/SimG4CMS/PPS/plugins/CTPPSDiamondSensitiveDetectorBuilder.cc @@ -0,0 +1,33 @@ +// system include files +#include +#include + +// user include files +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h" +#include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h" +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" + +#include "SimG4CMS/PPS/interface/PPSDiamondSD.h" + +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +class CTPPSDiamondSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { +public: + explicit CTPPSDiamondSensitiveDetectorBuilder(edm::ParameterSet const& p, edm::ConsumesCollector cc) {} + std::unique_ptr make(const std::string& iname, + const SensitiveDetectorCatalog& clg, + const edm::ParameterSet& p, + const SimTrackManager* man, + SimActivityRegistry& reg) const final { + auto sd = std::make_unique(iname, clg, p, man); + SimActivityRegistryEnroller::enroll(reg, sd.get()); + return sd; + } +}; + +typedef PPSDiamondSD CTPPSDiamondSensitiveDetector; +DEFINE_SENSITIVEDETECTORBUILDER(CTPPSDiamondSensitiveDetectorBuilder, CTPPSDiamondSensitiveDetector); diff --git a/SimG4CMS/PPS/plugins/CTPPSSensitiveDetectorBuilder.cc b/SimG4CMS/PPS/plugins/CTPPSSensitiveDetectorBuilder.cc new file mode 100644 index 0000000000000..2802ec9b6f21d --- /dev/null +++ b/SimG4CMS/PPS/plugins/CTPPSSensitiveDetectorBuilder.cc @@ -0,0 +1,33 @@ +// system include files +#include +#include + +// user include files +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h" +#include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h" +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" + +#include "SimG4CMS/PPS/interface/PPSPixelSD.h" + +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +class CTPPSSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { +public: + explicit CTPPSSensitiveDetectorBuilder(edm::ParameterSet const& p, edm::ConsumesCollector cc) {} + std::unique_ptr make(const std::string& iname, + const SensitiveDetectorCatalog& clg, + const edm::ParameterSet& p, + const SimTrackManager* man, + SimActivityRegistry& reg) const final { + auto sd = std::make_unique(iname, clg, p, man); + SimActivityRegistryEnroller::enroll(reg, sd.get()); + return sd; + } +}; + +typedef PPSPixelSD CTPPSSensitiveDetector; +DEFINE_SENSITIVEDETECTORBUILDER(CTPPSSensitiveDetectorBuilder, CTPPSSensitiveDetector); diff --git a/SimG4CMS/PPS/plugins/RomanPotSensitiveDetectorBuilder.cc b/SimG4CMS/PPS/plugins/RomanPotSensitiveDetectorBuilder.cc new file mode 100644 index 0000000000000..503ff6a61ccf3 --- /dev/null +++ b/SimG4CMS/PPS/plugins/RomanPotSensitiveDetectorBuilder.cc @@ -0,0 +1,33 @@ +// system include files +#include +#include + +// user include files +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h" +#include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h" +#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" + +#include "SimG4CMS/PPS/interface/TotemRPSD.h" + +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +class RomanPotSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { +public: + explicit RomanPotSensitiveDetectorBuilder(edm::ParameterSet const& p, edm::ConsumesCollector cc) {} + std::unique_ptr make(const std::string& iname, + const SensitiveDetectorCatalog& clg, + const edm::ParameterSet& p, + const SimTrackManager* man, + SimActivityRegistry& reg) const final { + auto sd = std::make_unique(iname, clg, p, man); + SimActivityRegistryEnroller::enroll(reg, sd.get()); + return sd; + } +}; + +typedef TotemRPSD RomanPotSensitiveDetector; +DEFINE_SENSITIVEDETECTORBUILDER(RomanPotSensitiveDetectorBuilder, RomanPotSensitiveDetector); diff --git a/SimG4CMS/PPS/plugins/module.cc b/SimG4CMS/PPS/plugins/module.cc index 1a4709109382d..e69de29bb2d1d 100644 --- a/SimG4CMS/PPS/plugins/module.cc +++ b/SimG4CMS/PPS/plugins/module.cc @@ -1,16 +0,0 @@ -#include "SimG4CMS/PPS/interface/TotemRPSD.h" -#include "SimG4CMS/PPS/interface/PPSPixelSD.h" -#include "SimG4CMS/PPS/interface/PPSDiamondSD.h" - -#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" -#include "SimG4Core/Watcher/interface/SimWatcherFactory.h" -#include "FWCore/PluginManager/interface/ModuleDef.h" - -typedef PPSPixelSD CTPPSSensitiveDetector; -DEFINE_SENSITIVEDETECTOR(CTPPSSensitiveDetector); - -typedef TotemRPSD RomanPotSensitiveDetector; -DEFINE_SENSITIVEDETECTOR(RomanPotSensitiveDetector); - -typedef PPSDiamondSD CTPPSDiamondSensitiveDetector; -DEFINE_SENSITIVEDETECTOR(CTPPSDiamondSensitiveDetector); diff --git a/SimG4CMS/PPS/src/PPSDiamondSD.cc b/SimG4CMS/PPS/src/PPSDiamondSD.cc index 026177f5ca5c7..415a885c8f656 100644 --- a/SimG4CMS/PPS/src/PPSDiamondSD.cc +++ b/SimG4CMS/PPS/src/PPSDiamondSD.cc @@ -4,7 +4,6 @@ // 2016 Nov /////////////////////////////////////////////////////////////////////////////// #include "SimG4CMS/PPS/interface/PPSDiamondSD.h" -#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "SimG4Core/Notification/interface/TrackInformation.h" @@ -27,7 +26,6 @@ #include PPSDiamondSD::PPSDiamondSD(const std::string& name_, - const edm::EventSetup& es, const SensitiveDetectorCatalog& clg, edm::ParameterSet const& p, const SimTrackManager* manager) diff --git a/SimG4CMS/PPS/src/PPSPixelSD.cc b/SimG4CMS/PPS/src/PPSPixelSD.cc index 77559dab05d35..e58fdf54b67da 100644 --- a/SimG4CMS/PPS/src/PPSPixelSD.cc +++ b/SimG4CMS/PPS/src/PPSPixelSD.cc @@ -13,7 +13,6 @@ // system include files // user include files -#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -36,7 +35,6 @@ #include "G4SystemOfUnits.hh" PPSPixelSD::PPSPixelSD(const std::string& name_, - const edm::EventSetup& es, const SensitiveDetectorCatalog& clg, edm::ParameterSet const& p, SimTrackManager const* manager) diff --git a/SimG4CMS/PPS/src/TotemRPSD.cc b/SimG4CMS/PPS/src/TotemRPSD.cc index 7defb584e54c0..019a490b84438 100644 --- a/SimG4CMS/PPS/src/TotemRPSD.cc +++ b/SimG4CMS/PPS/src/TotemRPSD.cc @@ -5,7 +5,6 @@ #include "SimG4CMS/PPS/interface/TotemRPSD.h" #include "SimG4CMS/PPS/interface/PPSStripNumberingScheme.h" -#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -32,7 +31,6 @@ #include TotemRPSD::TotemRPSD(const std::string& name_, - const edm::EventSetup& es, const SensitiveDetectorCatalog& clg, edm::ParameterSet const& p, const SimTrackManager* manager)