CMS 3D CMS Logo

HcalTB02SensitiveDetectorBuilder.cc
Go to the documentation of this file.
1 // system include files
2 
3 // user include files
7 
11 
16 
18 public:
21  edm::ESInputTag{"", "EcalHitsEB"})},
23  edm::ESInputTag{"", "HcalHits"})},
24  ebPar_{nullptr},
25  hcPar_{nullptr} {}
26 
27  void beginRun(const edm::EventSetup& es) final {
28  ebPar_ = &es.getData(ebParToken_);
29  hcPar_ = &es.getData(hcParToken_);
30  }
31 
32  std::unique_ptr<SensitiveDetector> make(const std::string& iname,
33  const SensitiveDetectorCatalog& clg,
34  const edm::ParameterSet& p,
35  const SimTrackManager* man,
36  SimActivityRegistry& reg) const final {
37  auto par = ((iname == "EcalHitsEB") ? ebPar_ : ((iname == "HcalHits") ? hcPar_ : nullptr));
38  auto sd = std::make_unique<HcalTB02SD>(iname, par, clg, p, man);
40  return sd;
41  }
42 
43 private:
48 };
49 
HcalTB02SensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
const edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > hcParToken_
static void enroll(SimActivityRegistry &iReg, T *iObj)
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
const edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > ebParToken_
void beginRun(const edm::EventSetup &es) final
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
HcalTB02SD HcalTB02SensitiveDetector