CMS 3D CMS Logo

HFNoseSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1 
2 // system include files
3 #include <string>
4 #include <vector>
5 
6 // user include files
10 
14 
21 
23 public:
25  : hgcToken_{cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag{"", "HGCalHFNoseSensitive"})},
26  hgcons_{nullptr} {}
27 
28  void beginRun(const edm::EventSetup& es) final { hgcons_ = es.getHandle(hgcToken_); }
29 
30  std::unique_ptr<SensitiveDetector> make(const std::string& iname,
31  const SensitiveDetectorCatalog& clg,
32  const edm::ParameterSet& p,
33  const SimTrackManager* man,
34  SimActivityRegistry& reg) const final {
35  auto hgc = ((iname.find("HFNoseHits") != std::string::npos) && hgcons_.isValid()) ? hgcons_.product() : nullptr;
36  auto sd = std::make_unique<HFNoseSD>(iname, hgc, clg, p, man);
38  return sd;
39  }
40 
41 private:
44 };
45 
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcToken_
static void enroll(SimActivityRegistry &iReg, T *iObj)
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< HGCalDDDConstants > hgcons_
bool isValid() const
Definition: ESHandle.h:44
HFNoseSensitiveDetectorBuilder(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
void beginRun(const edm::EventSetup &es) final
HFNoseSD HFNoseSensitiveDetector