Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:09

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
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 }