CMS 3D CMS Logo

FiberSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SimG4CMS/ShowerLibraryProducer
4 // Class : FiberSensitiveDetectorBuilder
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Sunanda Banerjee
10 // Created: Tue, 13 Jun 2021 15:18:17 GMT
11 //
12 
13 // system include files
14 #include <string>
15 
16 // user include files
20 
25 
31 
33 public:
36  cdcToken_{cc.esConsumes<edm::Transition::BeginRun>()},
37  hcalSimCons_{nullptr},
38  hcalDDCons_{nullptr} {}
39 
40  void beginRun(const edm::EventSetup& es) final {
41  hcalSimCons_ = &es.getData(cspsToken_);
42  hcalDDCons_ = &es.getData(cdcToken_);
43  }
44 
45  std::unique_ptr<SensitiveDetector> make(const std::string& iname,
46  const SensitiveDetectorCatalog& clg,
47  const edm::ParameterSet& p,
48  const SimTrackManager* man,
49  SimActivityRegistry& reg) const final {
50  auto sd = std::make_unique<FiberSD>(iname, hcalSimCons_, hcalDDCons_, clg, p, man);
52  return sd;
53  }
54 
55 private:
60 };
61 
static void enroll(SimActivityRegistry &iReg, T *iObj)
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > cdcToken_
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
const HcalSimulationConstants * hcalSimCons_
void beginRun(const edm::EventSetup &es) final
const edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord > cspsToken_
FiberSD FiberSensitiveDetector
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
FiberSensitiveDetectorBuilder(const edm::ParameterSet &p, edm::ConsumesCollector cc)