File indexing completed on 2025-01-18 09:14:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DDDigi/DigiSegmentation.h>
0016 #include <DD4hep/Segmentations.h>
0017 #include <DD4hep/Printout.h>
0018 #include <DD4hep/Plugins.h>
0019 #include <DD4hep/Shapes.h>
0020
0021 std::shared_ptr<dd4hep::digi::DigiCellScanner>
0022 dd4hep::digi::create_cell_scanner(Solid solid, Segmentation segment) {
0023 std::string typ = "DigiCellScanner" +
0024 std::string("_") + segment.type() +
0025 std::string("_") + solid.title();
0026 return create_cell_scanner(typ, segment);
0027 }
0028
0029 std::shared_ptr<dd4hep::digi::DigiCellScanner>
0030 dd4hep::digi::create_cell_scanner(const std::string& typ, Segmentation segment) {
0031 SegmentationObject* seg = segment.ptr();
0032 DigiCellScanner* scan = PluginService::Create<DigiCellScanner*>(typ, seg);
0033 if ( !scan ) {
0034 PluginDebug dbg;
0035 PluginService::Create<DigiCellScanner*>(typ, seg);
0036 except("create_cell_scanner",
0037 "Failed to create cell scanner of type %s [%s]",
0038 typ.c_str(),dbg.missingFactory(typ).c_str());
0039 }
0040 return std::shared_ptr<DigiCellScanner>(scan);
0041 }