CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DreamSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1 // system include files
2 
3 // user include files
7 
12 
19 
21 public:
23  fromDD4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");
24  if (fromDD4hep_)
26  else
28  edm::LogVerbatim("EcalSim") << "DreamSensitiveDetectorBuilder called with dd4hep flag " << fromDD4hep_;
29  }
30 
31  void beginRun(const edm::EventSetup& es) final {
32  if (fromDD4hep_) {
33  cpvDD4hep_ = &es.getData(cpvTokenDD4hep_);
34  } else {
35  cpvDDD_ = &es.getData(cpvTokenDDD_);
36  }
37  }
38 
39  std::unique_ptr<SensitiveDetector> make(const std::string& iname,
40  const SensitiveDetectorCatalog& clg,
41  const edm::ParameterSet& p,
42  const SimTrackManager* man,
43  SimActivityRegistry& reg) const final {
44  auto sd = std::make_unique<DreamSD>(iname, cpvDDD_, cpvDD4hep_, clg, p, man);
46  return sd;
47  }
48 
49 private:
55 };
56 
Log< level::Info, true > LogVerbatim
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
static void enroll(SimActivityRegistry &iReg, T *iObj)
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
DreamSensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
double sd
DreamSD DreamSensitiveDetector
void beginRun(const edm::EventSetup &es) final
T getParameter(std::string const &) const
Definition: ParameterSet.h:303