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) {
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)};
38 detList.second.push_back(static_cast<SensitiveCaloDetector*>(sd.release()));
41 detList.first.push_back(static_cast<SensitiveTkDetector*>(sd.release()));
42 ss <<
" + tracking SD";
const std::vector< std::string_view > readoutNames(const std::string &className) const
Log< level::Info, true > LogVerbatim
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 ®)
std::string_view className(const std::string &readoutName) const
const G4String rname[NREG]
std::string className(const T &t)