-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sunanda
committed
Jul 18, 2021
1 parent
a55eda1
commit 66cc52a
Showing
4 changed files
with
48 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
SimG4CMS/Tracker/plugins/TkAccumulatingSensitiveDetectorBuilder.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// system include files | ||
|
||
// user include files | ||
#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h" | ||
#include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h" | ||
#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" | ||
|
||
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" | ||
#include "Geometry/Records/interface/IdealGeometryRecord.h" | ||
|
||
#include "SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h" | ||
|
||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/ConsumesCollector.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
#include "FWCore/PluginManager/interface/ModuleDef.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
class TkAccumulatingSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { | ||
public: | ||
explicit TkAccumulatingSensitiveDetectorBuilder(edm::ParameterSet const& p, edm::ConsumesCollector cc) | ||
: geomdet_{nullptr}, | ||
geomdetToken_{cc.esConsumes<edm::Transition::BeginRun>()} {} | ||
|
||
void beginRun(const edm::EventSetup& es) final { geomdet_ = &es.getData(geomdetToken_); } | ||
|
||
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<TkAccumulatingSensitiveDetector>(iname, geomdet_, clg, p, man); | ||
SimActivityRegistryEnroller::enroll(reg, sd.get()); | ||
return sd; | ||
} | ||
|
||
private: | ||
const GeometricDet* geomdet_; | ||
const edm::ESGetToken<GeometricDet, IdealGeometryRecord> geomdetToken_; | ||
}; | ||
|
||
DEFINE_SENSITIVEDETECTORBUILDER(TkAccumulatingSensitiveDetectorBuilder, TkAccumulatingSensitiveDetector); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
#include "SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h" | ||
#include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" | ||
#include "FWCore/PluginManager/interface/ModuleDef.h" | ||
|
||
DEFINE_SENSITIVEDETECTOR(TkAccumulatingSensitiveDetector); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters