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_DIGIINPUTACTION_H
0014 #define DDDIGI_DIGIINPUTACTION_H
0015
0016
0017 #include <DDDigi/DigiEventAction.h>
0018
0019
0020 #include <limits>
0021
0022
0023 namespace dd4hep {
0024
0025
0026 namespace digi {
0027
0028
0029 class DigiInputAction;
0030
0031
0032
0033
0034
0035
0036
0037
0038 class DigiInputAction : public DigiEventAction {
0039 public:
0040 enum { INPUT_START = -1 };
0041 enum { NO_MASK = 0x0 };
0042
0043 static constexpr double epsilon = std::numeric_limits<double>::epsilon();
0044
0045
0046 class input_source {
0047 public:
0048
0049 int event_count { 0 };
0050 };
0051
0052
0053 class event_frame {
0054 public:
0055 };
0056
0057 protected:
0058
0059 std::vector<std::string> m_input_sources { };
0060
0061 std::vector<std::string> m_objects_enabled { };
0062
0063 std::vector<std::string> m_objects_disabled { };
0064
0065 std::string m_input_section { "EVENT" };
0066
0067 std::string m_input_segment { "inputs" };
0068
0069 int m_input_mask { NO_MASK };
0070
0071 int m_events_per_file { -1 };
0072
0073 bool m_input_rescan { true };
0074
0075 bool m_keep_raw { true };
0076
0077 protected:
0078
0079 DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiInputAction);
0080
0081 public:
0082
0083 DigiInputAction(const kernel_t& kernel, const std::string& nam);
0084
0085 virtual ~DigiInputAction();
0086
0087
0088 const std::vector<std::string>& inputs() const {
0089 return m_input_sources;
0090 }
0091
0092 const std::string& input_segment() const {
0093 return m_input_segment;
0094 }
0095
0096 int input_mask() const {
0097 return m_input_mask;
0098 }
0099
0100 const std::string& input_section() const {
0101 return m_input_section;
0102 }
0103
0104 const std::vector<std::string>& objects_enabled() const {
0105 return m_objects_enabled;
0106 }
0107
0108 const std::vector<std::string>& objects_disabled() const {
0109 return m_objects_disabled;
0110 }
0111
0112 bool fileLimitReached(input_source& source) const;
0113
0114 virtual void onOpenFile(input_source& source);
0115
0116 virtual void onProcessEvent(input_source& source, event_frame& frame);
0117
0118
0119 bool object_loading_is_enabled(const std::string& nam) const;
0120
0121
0122 virtual void execute(context_t& context) const override;
0123 };
0124 }
0125 }
0126 #endif