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_DIGISEGMENTATION_H
0014 #define DDDIGI_DIGISEGMENTATION_H
0015 
0016 /// Framework include files
0017 #include <DD4hep/Segmentations.h>
0018 #include <DD4hep/Volumes.h>
0019 #include <DD4hep/Shapes.h>
0020 
0021 /// C/C++ include files
0022 #include <functional>
0023 
0024 /// Namespace for the AIDA detector description toolkit
0025 namespace dd4hep {
0026 
0027   /// Namespace for the Digitization part of the AIDA detector description toolkit
0028   namespace digi {
0029 
0030     /// Forward declarations
0031     class DigiContext;
0032     class DigiSegmentation;
0033     template <typename SEGMENTATION> class cell_data;
0034     template <typename SEGMENTATION> class segmentation_data;
0035     
0036     /// 
0037     /*
0038      *
0039      *  \author  M.Frank
0040      *  \version 1.0
0041      *  \ingroup DD4HEP_DIGITIZATION
0042      */
0043     class DigiCellData   {
0044     public:
0045 #if 0
0046       PlacedVolume  placement  { };
0047       Volume        volume     { };
0048       Solid         solid      { };
0049       CellID        cell_id    { 0 };
0050 #endif
0051       double        signal     { 0.0 };
0052       mutable bool  kill       { false };
0053 
0054       /// Default constructor
0055       DigiCellData() = default;
0056       /// Default move constructor
0057       DigiCellData(DigiCellData&& copy) = default;
0058       /// Default copy constructor
0059       DigiCellData(const DigiCellData& copy) = default;
0060       /// Default destructor
0061       virtual ~DigiCellData() = default;
0062       /// Default move assignment
0063       DigiCellData& operator=(DigiCellData&& copy) = delete;
0064       /// Default copy assignment
0065       DigiCellData& operator=(const DigiCellData& copy) = delete;
0066     };
0067 
0068     template <typename SEGMENTATION> 
0069     void init_segmentation_data(segmentation_data<SEGMENTATION>& data, const Segmentation& seg);
0070 
0071     /// 
0072     /**
0073      *
0074      *  \author  M.Frank
0075      *  \version 1.0
0076      *  \ingroup DD4HEP_DIGITIZATION
0077      */
0078     class DigiCellScanner  {
0079     public:
0080       typedef std::function<void(DigiContext& context, const DigiCellScanner& env, const DigiCellData&)> cell_handler_t;
0081     public:
0082       DigiCellScanner() = default;
0083       virtual ~DigiCellScanner() = default;
0084       virtual void operator()(DigiContext& context, PlacedVolume pv, VolumeID vid, const cell_handler_t& cell_handler) = 0;
0085     };
0086     std::shared_ptr<DigiCellScanner> create_cell_scanner(Solid solid, Segmentation segment);
0087     std::shared_ptr<DigiCellScanner> create_cell_scanner(const std::string& typ, Segmentation segment);
0088 
0089   }    // End namespace digi
0090 }      // End namespace dd4hep
0091 #endif // DDDIGI_DIGISEGMENTATION_H