27
27
#include < calin_global_definitions.hpp>
28
28
#include < calin_global_config.hpp>
29
29
#include < io/chained_data_source.hpp>
30
+
30
31
#include < iact_data/actl_event_decoder.hpp>
31
32
#include < iact_data/zfits_actl_data_source.hpp>
33
+
34
+ #include < iact_data/acada_data_source.hpp>
35
+ #include < iact_data/acada_event_decoder.hpp>
36
+ #include < iact_data/zfits_acada_data_source.hpp>
37
+
32
38
#include < iact_data/zfits_data_source.pb.h>
33
39
#include < iact_data/telescope_data_source.hpp>
34
40
@@ -40,6 +46,102 @@ namespace calin { namespace iact_data { namespace zfits_data_source {
40
46
41
47
#ifdef CALIN_HAVE_CTA_CAMERASTOACTL
42
48
49
+ template <typename EventMessage, typename HeaderMessage>
50
+ class ZFITSSingleFileDataSource :
51
+ public calin::iact_data::telescope_data_source::
52
+ TelescopeRandomAccessDataSourceWithRunConfig
53
+ {
54
+ public:
55
+ CALIN_TYPEALIAS (config_type,
56
+ calin::ix::iact_data::zfits_data_source::ZFITSDataSourceConfig);
57
+
58
+ ZFITSSingleFileDataSource (
59
+ calin::iact_data::zfits_acada_data_source::
60
+ ZFITSSingleFileACADACameraEventDataSource<EventMessage,HeaderMessage>* actl_zfits,
61
+ bool dont_decode_run_configuration,
62
+ calin::iact_data::acada_event_decoder::
63
+ ACADACameraEventDecoder<EventMessage,HeaderMessage>* decoder,
64
+ bool adopt_decoder = false ,
65
+ bool adopt_actl_zfits = false );
66
+
67
+ ZFITSSingleFileDataSource (const std::string& filename,
68
+ calin::iact_data::acada_event_decoder::
69
+ ACADACameraEventDecoder<EventMessage,HeaderMessage>* decoder,
70
+ bool adopt_decoder = false ,
71
+ const config_type& config = default_config());
72
+
73
+ virtual ~ZFITSSingleFileDataSource ();
74
+
75
+ calin::ix::iact_data::telescope_event::TelescopeEvent* get_next (
76
+ uint64_t & seq_index_out, google::protobuf::Arena** arena = nullptr ) override ;
77
+ uint64_t size () override ;
78
+ void set_next_index (uint64_t next_index) override ;
79
+
80
+ calin::ix::iact_data::telescope_run_configuration::
81
+ TelescopeRunConfiguration* get_run_configuration () override ;
82
+
83
+ static config_type default_config ();
84
+
85
+ private:
86
+ calin::iact_data::acada_event_decoder::
87
+ ACADACameraEventDecoder<EventMessage,HeaderMessage>* decoder_;
88
+ bool adopt_decoder_ = false ;
89
+ calin::iact_data::zfits_acada_data_source::
90
+ ZFITSSingleFileACADACameraEventDataSource<EventMessage,HeaderMessage>* acada_zfits_ = nullptr ;
91
+ bool adopt_acada_zfits_ = false ;
92
+ calin::ix::iact_data::telescope_run_configuration::
93
+ TelescopeRunConfiguration* run_config_ = nullptr ;
94
+ };
95
+
96
+ template <typename EventMessage, typename HeaderMessage>
97
+ class ZFITSDataSource :
98
+ public calin::iact_data::telescope_data_source::
99
+ TelescopeRandomAccessDataSourceWithRunConfig,
100
+ public calin::io::data_source::FragmentList
101
+ {
102
+ public:
103
+ CALIN_TYPEALIAS (config_type,
104
+ calin::ix::iact_data::zfits_data_source::ZFITSDataSourceConfig);
105
+
106
+ ZFITSDataSource (const std::string& filename,
107
+ calin::iact_data::acada_event_decoder::
108
+ ACADACameraEventDecoder<EventMessage,HeaderMessage>* decoder,
109
+ bool adopt_decoder = false ,
110
+ const config_type& config = default_config());
111
+
112
+ ZFITSDataSource (const std::string& filename,
113
+ ZFITSDataSource<EventMessage,HeaderMessage>* base_datasource,
114
+ const config_type& config = default_config());
115
+
116
+ virtual ~ZFITSDataSource ();
117
+
118
+ calin::ix::iact_data::telescope_event::TelescopeEvent* get_next (
119
+ uint64_t & seq_index_out, google::protobuf::Arena** arena = nullptr ) override ;
120
+
121
+ uint64_t size () override ;
122
+ void set_next_index (uint64_t next_index) override ;
123
+
124
+ calin::ix::iact_data::telescope_run_configuration::
125
+ TelescopeRunConfiguration* get_run_configuration () override ;
126
+
127
+ unsigned current_fragment_index () const override ;
128
+ unsigned num_fragments () const override ;
129
+ std::string fragment_name (unsigned index) const override ;
130
+
131
+ static config_type default_config ();
132
+
133
+ protected:
134
+
135
+ calin::iact_data::acada_event_decoder::
136
+ ACADACameraEventDecoder<EventMessage,HeaderMessage>* decoder_;
137
+ bool adopt_decoder_ = false ;
138
+ calin::iact_data::zfits_acada_data_source::
139
+ ZFITSACADACameraEventDataSource<EventMessage,HeaderMessage>* acada_zfits_ = nullptr ;
140
+ bool adopt_acada_zfits_ = false ;
141
+ calin::ix::iact_data::telescope_run_configuration::
142
+ TelescopeRunConfiguration* run_config_ = nullptr ;
143
+ };
144
+
43
145
/*
44
146
45
147
LLLLLLLLLLL 000000000
0 commit comments