Skip to content

Commit

Permalink
Merge pull request #34568 from bsunanda/Run3-gex83K
Browse files Browse the repository at this point in the history
Run3-gex83K New way of SD declaration for PPS detectors
  • Loading branch information
cmsbuild authored Jul 21, 2021
2 parents 38cabfa + 647e2a0 commit 2739d11
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 37 deletions.
6 changes: 1 addition & 5 deletions SimG4CMS/PPS/interface/PPSDiamondSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ class PPSDiamondSD : public SensitiveTkDetector,
public Observer<const BeginOfEvent*>,
public Observer<const EndOfEvent*> {
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();

Expand Down
6 changes: 1 addition & 5 deletions SimG4CMS/PPS/interface/PPSPixelSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ class PPSPixelSD : public SensitiveTkDetector,
public Observer<const BeginOfEvent*>,
public Observer<const EndOfEvent*> {
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;
Expand Down
6 changes: 1 addition & 5 deletions SimG4CMS/PPS/interface/TotemRPSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ class TotemTestHitHBNtuple;

class TotemRPSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*>, public Observer<const EndOfEvent*> {
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();
Expand Down
33 changes: 33 additions & 0 deletions SimG4CMS/PPS/plugins/CTPPSDiamondSensitiveDetectorBuilder.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// system include files
#include <string>
#include <vector>

// 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<SensitiveDetector> make(const std::string& iname,
const SensitiveDetectorCatalog& clg,
const edm::ParameterSet& p,
const SimTrackManager* man,
SimActivityRegistry& reg) const final {
auto sd = std::make_unique<PPSDiamondSD>(iname, clg, p, man);
SimActivityRegistryEnroller::enroll(reg, sd.get());
return sd;
}
};

typedef PPSDiamondSD CTPPSDiamondSensitiveDetector;
DEFINE_SENSITIVEDETECTORBUILDER(CTPPSDiamondSensitiveDetectorBuilder, CTPPSDiamondSensitiveDetector);
33 changes: 33 additions & 0 deletions SimG4CMS/PPS/plugins/CTPPSSensitiveDetectorBuilder.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// system include files
#include <string>
#include <vector>

// 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<SensitiveDetector> make(const std::string& iname,
const SensitiveDetectorCatalog& clg,
const edm::ParameterSet& p,
const SimTrackManager* man,
SimActivityRegistry& reg) const final {
auto sd = std::make_unique<PPSPixelSD>(iname, clg, p, man);
SimActivityRegistryEnroller::enroll(reg, sd.get());
return sd;
}
};

typedef PPSPixelSD CTPPSSensitiveDetector;
DEFINE_SENSITIVEDETECTORBUILDER(CTPPSSensitiveDetectorBuilder, CTPPSSensitiveDetector);
33 changes: 33 additions & 0 deletions SimG4CMS/PPS/plugins/RomanPotSensitiveDetectorBuilder.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// system include files
#include <string>
#include <vector>

// 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<SensitiveDetector> make(const std::string& iname,
const SensitiveDetectorCatalog& clg,
const edm::ParameterSet& p,
const SimTrackManager* man,
SimActivityRegistry& reg) const final {
auto sd = std::make_unique<TotemRPSD>(iname, clg, p, man);
SimActivityRegistryEnroller::enroll(reg, sd.get());
return sd;
}
};

typedef TotemRPSD RomanPotSensitiveDetector;
DEFINE_SENSITIVEDETECTORBUILDER(RomanPotSensitiveDetectorBuilder, RomanPotSensitiveDetector);
16 changes: 0 additions & 16 deletions SimG4CMS/PPS/plugins/module.cc
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 0 additions & 2 deletions SimG4CMS/PPS/src/PPSDiamondSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -27,7 +26,6 @@
#include <string>

PPSDiamondSD::PPSDiamondSD(const std::string& name_,
const edm::EventSetup& es,
const SensitiveDetectorCatalog& clg,
edm::ParameterSet const& p,
const SimTrackManager* manager)
Expand Down
2 changes: 0 additions & 2 deletions SimG4CMS/PPS/src/PPSPixelSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions SimG4CMS/PPS/src/TotemRPSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -32,7 +31,6 @@
#include <string>

TotemRPSD::TotemRPSD(const std::string& name_,
const edm::EventSetup& es,
const SensitiveDetectorCatalog& clg,
edm::ParameterSet const& p,
const SimTrackManager* manager)
Expand Down

0 comments on commit 2739d11

Please sign in to comment.