Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:21

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 #ifndef DDDIGI_DIGIFACTORIES_H
0014 #define DDDIGI_DIGIFACTORIES_H
0015 
0016 // Framework include files
0017 #include <DD4hep/Plugins.h>
0018 #include <DD4hep/Detector.h>
0019 #include <DD4hep/Primitives.h>
0020 
0021 // C/C++ include files
0022 #include <string>
0023 #include <map>
0024 
0025 class TGeoShape;
0026 
0027 /// Namespace for the AIDA detector description toolkit
0028 namespace dd4hep {
0029   class SegmentationObject;
0030   class DetElement;
0031   class Detector;
0032 
0033   /// Namespace for the Digitization part of the AIDA detector description toolkit
0034   namespace digi {
0035     class DigiKernel;
0036     class DigiAction;
0037     class DigiInputAction;
0038     class DigiEventAction;
0039     class DigiCellScanner;
0040     class DigiSignalProcessor;
0041     class DigiSegmentProcessor;
0042     class DigiContainerProcessor;
0043   }
0044 }
0045 
0046 namespace {
0047   namespace DS = dd4hep::digi;
0048 
0049   /// Factory to create Digi action objects
0050   DD4HEP_PLUGIN_FACTORY_ARGS_2(DS::DigiAction*,const DS::DigiKernel*, std::string)
0051   {    return new P(*a0,a1);  }
0052 #if 0
0053   /// Factory to create Digi action objects
0054   DD4HEP_PLUGIN_FACTORY_ARGS_2(DS::DigiEventAction*,const DS::DigiKernel*, std::string)
0055   {    return new P(*a0,a1);  }
0056   /// Factory to create Digi action objects
0057   DD4HEP_PLUGIN_FACTORY_ARGS_2(DS::DigiSegmentProcessor*,const DS::DigiKernel*, std::string)
0058   {    return new P(*a0,a1);  }
0059 #endif
0060 
0061   /// Factory to create Digi signal processor objects
0062   DD4HEP_PLUGIN_FACTORY_ARGS_2(DS::DigiSignalProcessor*,const DS::DigiKernel*, std::string)
0063   {    return new P(*a0,a1);  }
0064   /// Factory to create Digi cell scanner objects
0065   DD4HEP_PLUGIN_FACTORY_ARGS_1(DS::DigiCellScanner*, dd4hep::SegmentationObject*)
0066   {    return new P(dd4hep::Segmentation(a0));  }
0067 }
0068 
0069 /// Plugin defintion to create DigiAction objects
0070 #define DECLARE_DIGIACTION_NS(name_space,name)  namespace {\
0071   using name_space::name;                                               \
0072   DD4HEP_PLUGINSVC_FACTORY(name,name,dd4hep::digi::DigiAction*(const DS::DigiKernel*,std::string),__LINE__) }
0073 /// Plugin defintion to create DigiAction objects
0074 #define DECLARE_DIGIACTION(name)   DECLARE_DIGIACTION_NS(dd4hep::digi,name)
0075 
0076 
0077 #if 0
0078 /// Plugin defintion to create DigiAction objects
0079 #define DECLARE_DIGIEVENTACTION_NS(name_space,name)  namespace {\
0080   using name_space::name;                                               \
0081   DD4HEP_PLUGINSVC_FACTORY(name,name,dd4hep::digi::DigiEventAction*(const DS::DigiKernel*,std::string),__LINE__) }
0082 /// Plugin defintion to create DigiAction objects
0083 #define DECLARE_DIGIEVENTACTION(name)     DECLARE_DIGIEVENTACTION_NS(dd4hep::digi,name)
0084 
0085 /// Plugin defintion to create DigiAction objects
0086 #define DECLARE_DIGISEGMENTPROCESSOR_NS(name_space,name)  namespace {\
0087   using name_space::name;                                               \
0088   DD4HEP_PLUGINSVC_FACTORY(name,name,dd4hep::digi::DigiSegmentProcessor*(const DS::DigiKernel*,std::string),__LINE__) }
0089 /// Plugin defintion to create DigiAction objects
0090 #define DECLARE_DIGISEGMENTPROCESSOR(name)   DECLARE_DIGISEGMENTPROCESSOR_NS(dd4hep::digi,name)
0091 #endif
0092 
0093 
0094 
0095 #define DECLARE_DIGISIGNALPROCESSOR_NS(name_space,name)  namespace {     \
0096   using name_space::name;                                               \
0097   DD4HEP_PLUGINSVC_FACTORY(name,name,dd4hep::digi::DigiSignalProcessor*(const DS::DigiKernel*,std::string),__LINE__) }
0098 
0099 /// Plugin defintion to create DigiSignalProcessor objects
0100 #define DECLARE_DIGISIGNALPROCESSOR(name) DECLARE_DIGISIGNALPROCESSOR_NS(dd4hep::digi,name)
0101 
0102 #define DECLARE_DIGICELLSCANNER_NS(name_space,typ,seg,sol)  namespace { \
0103 typedef name_space :: CellScanner<dd4hep:: seg , dd4hep:: sol > Scanner_##typ##_##seg##_##sol##_t; \
0104  DD4HEP_PLUGINSVC_FACTORY( Scanner_##typ##_##seg##_##sol##_t, typ##_##seg##_##sol ,                   \
0105                            dd4hep::digi::DigiCellScanner*(dd4hep::SegmentationObject*),__LINE__) }
0106 
0107 /// Plugin defintion to create DigiCellscanner objects
0108 #define DECLARE_DIGICELLSCANNER(typ,seg,sol) DECLARE_DIGICELLSCANNER_NS(dd4hep::digi,typ,seg,sol)
0109 
0110 #endif // DDDIGI_DIGIFACTORIES_H