File indexing completed on 2025-01-18 09:55:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDDIGI_DIGISEGMENTATION_H
0014 #define DDDIGI_DIGISEGMENTATION_H
0015
0016
0017 #include <DD4hep/Segmentations.h>
0018 #include <DD4hep/Volumes.h>
0019 #include <DD4hep/Shapes.h>
0020
0021
0022 #include <functional>
0023
0024
0025 namespace dd4hep {
0026
0027
0028 namespace digi {
0029
0030
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
0040
0041
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
0055 DigiCellData() = default;
0056
0057 DigiCellData(DigiCellData&& copy) = default;
0058
0059 DigiCellData(const DigiCellData& copy) = default;
0060
0061 virtual ~DigiCellData() = default;
0062
0063 DigiCellData& operator=(DigiCellData&& copy) = delete;
0064
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
0075
0076
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 }
0090 }
0091 #endif