13 std::pair<std::vector<SensitiveTkDetector*>, std::vector<SensitiveCaloDetector*>>
sim::attachSD(
14 const std::unordered_map<
std::string, std::unique_ptr<SensitiveDetectorMakerBase>>& makers,
20 std::pair<std::vector<SensitiveTkDetector*>, std::vector<SensitiveCaloDetector*>> detList;
21 const std::vector<std::string_view>& rouNames = clg.
readoutNames();
23 edm::LogVerbatim(
"SimG4CoreSensitiveDetector") <<
" AttachSD: Initialising " << rouNames.size() <<
" SDs";
24 for (
auto&
rname : rouNames) {
26 auto makerItr = makers.find(
std::string(className.data(), className.size()));
27 if (makerItr == makers.end()) {
29 <<
"Asked to use " << className <<
" sensitive detector but it was not in the list of preloaded ones.";
32 std::unique_ptr<SensitiveDetector>
sd{makerItr->second->make({
rname.data(),
rname.size()}, es, clg,
p, man, reg)};
35 ss <<
" AttachSD: created a " << className <<
" with name " <<
rname;
38 detList.second.push_back(static_cast<SensitiveCaloDetector*>(
sd.release()));
41 detList.first.push_back(static_cast<SensitiveTkDetector*>(
sd.release()));
42 ss <<
" + tracking SD";
Log< level::Info, true > LogVerbatim
std::string_view className(const std::string &readoutName) const
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > attachSD(const std::unordered_map< std::string, std::unique_ptr< SensitiveDetectorMakerBase >> &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry ®)
const G4String rname[NREG]
const std::vector< std::string_view > readoutNames(const std::string &className) const
std::string className(const T &t)