DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV2BoardConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneV2BoardConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneV2BoardConf_0_dunedaq__appmodel_0_appmodel_H_
5
6#include <stdint.h> // to define 64 bits types
7#include <iostream>
8#include <sstream>
9#include <string>
10#include <map>
11#include <vector>
12
14#include "conffwk/DalObject.hpp"
15
16
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace appmodel {
21 class DaphneV2AFE;
22 class DaphneV2Channel;
23 }
24}
25
26
27namespace dunedaq {
28 namespace appmodel {
29
34 class DaphneV2BoardConf : public virtual dunedaq::conffwk::DalObject {
35
37 friend class conffwk::DalObject;
38 friend class conffwk::DalFactory;
40
41 protected:
42
44 virtual ~DaphneV2BoardConf() noexcept;
45 virtual void init(bool init_children);
46
47 public:
48
51 static const std::string& s_class_name;
52
53
63 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
64
65
75 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
76
77
78 protected:
79
80 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
81
82
83 private:
84
85 uint16_t m_bias_ctrl;
87 std::vector<uint8_t> m_full_stream_channels;
89 uint32_t m_tp_conf;
90 uint64_t m_compensator;
91 uint64_t m_inverter;
92 uint16_t m_slot_id;
93 uint16_t m_crate_id;
94 uint16_t m_detector_id;
99
100
101 public:
102
103 // attribute names
104
105 inline static const std::string s_bias_ctrl = "bias_ctrl";
106 inline static const std::string s_self_trigger_threshold = "self_trigger_threshold";
107 inline static const std::string s_full_stream_channels = "full_stream_channels";
108 inline static const std::string s_self_trigger_xcorr = "self_trigger_xcorr";
109 inline static const std::string s_tp_conf = "tp_conf";
110 inline static const std::string s_compensator = "compensator";
111 inline static const std::string s_inverter = "inverter";
112 inline static const std::string s_slot_id = "slot_id";
113 inline static const std::string s_crate_id = "crate_id";
114 inline static const std::string s_detector_id = "detector_id";
115
116 static const std::string& __get_bias_ctrl_str() noexcept { return s_bias_ctrl; }
117 static const std::string& __get_self_trigger_threshold_str() noexcept { return s_self_trigger_threshold; }
118 static const std::string& __get_full_stream_channels_str() noexcept { return s_full_stream_channels; }
119 static const std::string& __get_self_trigger_xcorr_str() noexcept { return s_self_trigger_xcorr; }
120 static const std::string& __get_tp_conf_str() noexcept { return s_tp_conf; }
121 static const std::string& __get_compensator_str() noexcept { return s_compensator; }
122 static const std::string& __get_inverter_str() noexcept { return s_inverter; }
123 static const std::string& __get_slot_id_str() noexcept { return s_slot_id; }
124 static const std::string& __get_crate_id_str() noexcept { return s_crate_id; }
125 static const std::string& __get_detector_id_str() noexcept { return s_detector_id; }
126
127
135 uint16_t
137 {
138 std::lock_guard scoped_lock(m_mutex);
139 check();
140 check_init();
141 return m_bias_ctrl;
142 }
143
151 void
152 set_bias_ctrl(uint16_t value)
153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 clear();
158 }
159
160
168 uint64_t
170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 check_init();
175 }
176
184 void
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 clear();
191 }
192
193
201 const std::vector<uint8_t>&
203 {
204 std::lock_guard scoped_lock(m_mutex);
205 check();
206 check_init();
208 }
209
217 void
218 set_full_stream_channels(const std::vector<uint8_t>& value)
219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 clear();
224 }
225
226
233 uint64_t
235 {
236 std::lock_guard scoped_lock(m_mutex);
237 check();
238 check_init();
240 }
241
248 void
250 {
251 std::lock_guard scoped_lock(m_mutex);
252 check();
253 clear();
255 }
256
257
264 uint32_t
266 {
267 std::lock_guard scoped_lock(m_mutex);
268 check();
269 check_init();
270 return m_tp_conf;
271 }
272
279 void
280 set_tp_conf(uint32_t value)
281 {
282 std::lock_guard scoped_lock(m_mutex);
283 check();
284 clear();
285 p_obj.set_by_val(s_tp_conf, value);
286 }
287
288
295 uint64_t
297 {
298 std::lock_guard scoped_lock(m_mutex);
299 check();
300 check_init();
301 return m_compensator;
302 }
303
310 void
311 set_compensator(uint64_t value)
312 {
313 std::lock_guard scoped_lock(m_mutex);
314 check();
315 clear();
317 }
318
319
326 uint64_t
328 {
329 std::lock_guard scoped_lock(m_mutex);
330 check();
331 check_init();
332 return m_inverter;
333 }
334
341 void
342 set_inverter(uint64_t value)
343 {
344 std::lock_guard scoped_lock(m_mutex);
345 check();
346 clear();
348 }
349
350
357 uint16_t
359 {
360 std::lock_guard scoped_lock(m_mutex);
361 check();
362 check_init();
363 return m_slot_id;
364 }
365
372 void
373 set_slot_id(uint16_t value)
374 {
375 std::lock_guard scoped_lock(m_mutex);
376 check();
377 clear();
378 p_obj.set_by_val(s_slot_id, value);
379 }
380
381
388 uint16_t
390 {
391 std::lock_guard scoped_lock(m_mutex);
392 check();
393 check_init();
394 return m_crate_id;
395 }
396
403 void
404 set_crate_id(uint16_t value)
405 {
406 std::lock_guard scoped_lock(m_mutex);
407 check();
408 clear();
410 }
411
412
419 uint16_t
421 {
422 std::lock_guard scoped_lock(m_mutex);
423 check();
424 check_init();
425 return m_detector_id;
426 }
427
434 void
435 set_detector_id(uint16_t value)
436 {
437 std::lock_guard scoped_lock(m_mutex);
438 check();
439 clear();
441 }
442
443
444 // relationship names
445
446 inline static const std::string s_active_channels = "active_channels";
447 inline static const std::string s_active_afes = "active_afes";
448 inline static const std::string s_default_channel = "default_channel";
449 inline static const std::string s_default_afe = "default_afe";
450
451 static const std::string& __get_active_channels_str() noexcept { return s_active_channels; }
452 static const std::string& __get_active_afes_str() noexcept { return s_active_afes; }
453 static const std::string& __get_default_channel_str() noexcept { return s_default_channel; }
454 static const std::string& __get_default_afe_str() noexcept { return s_default_afe; }
455
456
463 const std::vector<const dunedaq::appmodel::DaphneV2Channel*>&
465 {
466 std::lock_guard scoped_lock(m_mutex);
467 check();
468 check_init();
469 return m_active_channels;
470 }
471
472
479 void
480 set_active_channels(const std::vector<const dunedaq::appmodel::DaphneV2Channel*>& value);
481
488 const std::vector<const dunedaq::appmodel::DaphneV2AFE*>&
490 {
491 std::lock_guard scoped_lock(m_mutex);
492 check();
493 check_init();
494 return m_active_afes;
495 }
496
497
504 void
505 set_active_afes(const std::vector<const dunedaq::appmodel::DaphneV2AFE*>& value);
506
515 {
516 std::lock_guard scoped_lock(m_mutex);
517 check();
518 check_init();
520 {
521 std::ostringstream text;
522 text << "relationship \"" << s_default_channel << "\" of object " << this << " is not set";
523 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
524 }
525 return m_default_channel;
526 }
527
528
535 void
537
546 {
547 std::lock_guard scoped_lock(m_mutex);
548 check();
549 check_init();
550 if (!m_default_afe)
551 {
552 std::ostringstream text;
553 text << "relationship \"" << s_default_afe << "\" of object " << this << " is not set";
554 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
555 }
556 return m_default_afe;
557 }
558
559
566 void
568
569
570 public:
571
572 // user-defined algorithms
573
578 const DaphneV2Channel & get_channel(size_t ch) const ;
579
580
585 const DaphneV2AFE & get_afe( size_t id) const ;
586
587
592 bool is_channel_used(size_t ch) const;
593
594
599 bool is_afe_used(size_t ch) const;
600 };
601
602 // out stream operator
603
604 inline std::ostream& operator<<(std::ostream& s, const DaphneV2BoardConf& obj)
605 {
606 return obj.print_object(s);
607 }
608
609 typedef std::vector<const DaphneV2BoardConf*>::const_iterator DaphneV2BoardConfIterator;
610
611 }
612}
613
614#endif
#define ERS_HERE
static const std::string & __get_active_channels_str() noexcept
const std::vector< const dunedaq::appmodel::DaphneV2AFE * > & get_active_afes() const
Get "active_afes" relationship value.
static const std::string & __get_compensator_str() noexcept
void set_default_channel(const dunedaq::appmodel::DaphneV2Channel *value)
Set "default_channel" relationship value.
static const std::string & __get_default_afe_str() noexcept
const DaphneV2AFE & get_afe(size_t id) const
uint16_t get_slot_id() const
Get "slot_id" attribute value.
const DaphneV2Channel & get_channel(size_t ch) const
std::vector< uint8_t > m_full_stream_channels
const dunedaq::appmodel::DaphneV2Channel * m_default_channel
static const std::string & __get_default_channel_str() noexcept
void set_default_afe(const dunedaq::appmodel::DaphneV2AFE *value)
Set "default_afe" relationship value.
static const std::string & __get_detector_id_str() noexcept
static const std::string & __get_slot_id_str() noexcept
uint64_t get_self_trigger_threshold() const
Get "self_trigger_threshold" attribute value. Configuration for full stream case. If it is 0,...
uint16_t get_crate_id() const
Get "crate_id" attribute value.
static const std::string & __get_tp_conf_str() noexcept
static const std::string s_self_trigger_threshold
std::vector< const dunedaq::appmodel::DaphneV2AFE * > m_active_afes
const dunedaq::appmodel::DaphneV2AFE * m_default_afe
const dunedaq::appmodel::DaphneV2Channel * get_default_channel() const
Get "default_channel" relationship value.
static const std::string s_self_trigger_xcorr
static const std::string s_full_stream_channels
static const std::string & s_class_name
static const std::string & __get_bias_ctrl_str() noexcept
void set_inverter(uint64_t value)
Set "inverter" attribute value.
void set_detector_id(uint16_t value)
Set "detector_id" attribute value.
static const std::string & __get_crate_id_str() noexcept
uint16_t get_bias_ctrl() const
Get "bias_ctrl" attribute value. V bias control.
void set_self_trigger_threshold(uint64_t value)
Set "self_trigger_threshold" attribute value. Configuration for full stream case. If it is 0,...
static const std::string & __get_active_afes_str() noexcept
uint64_t get_self_trigger_xcorr() const
Get "self_trigger_xcorr" attribute value.
DaphneV2BoardConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_self_trigger_threshold_str() noexcept
void set_tp_conf(uint32_t value)
Set "tp_conf" attribute value.
std::vector< const dunedaq::appmodel::DaphneV2Channel * > m_active_channels
static const std::string & __get_full_stream_channels_str() noexcept
void set_full_stream_channels(const std::vector< uint8_t > &value)
Set "full_stream_channels" attribute value. list of channels to be used in full stream.
uint64_t get_inverter() const
Get "inverter" attribute value.
static const std::string & __get_inverter_str() noexcept
virtual void init(bool init_children)
const std::vector< const dunedaq::appmodel::DaphneV2Channel * > & get_active_channels() const
Get "active_channels" relationship value.
void set_active_channels(const std::vector< const dunedaq::appmodel::DaphneV2Channel * > &value)
Set "active_channels" relationship value.
uint16_t get_detector_id() const
Get "detector_id" attribute value.
const std::vector< uint8_t > & get_full_stream_channels() const
Get "full_stream_channels" attribute value. list of channels to be used in full stream.
uint32_t get_tp_conf() const
Get "tp_conf" attribute value.
static const std::string & __get_self_trigger_xcorr_str() noexcept
void set_self_trigger_xcorr(uint64_t value)
Set "self_trigger_xcorr" attribute value.
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
void set_bias_ctrl(uint16_t value)
Set "bias_ctrl" attribute value. V bias control.
void set_crate_id(uint16_t value)
Set "crate_id" attribute value.
void set_slot_id(uint16_t value)
Set "slot_id" attribute value.
uint64_t get_compensator() const
Get "compensator" attribute value.
void set_compensator(uint64_t value)
Set "compensator" attribute value.
void set_active_afes(const std::vector< const dunedaq::appmodel::DaphneV2AFE * > &value)
Set "active_afes" relationship value.
const dunedaq::appmodel::DaphneV2AFE * get_default_afe() const
Get "default_afe" relationship value.
void set_by_val(const std::string &name, T value)
Set attribute value.
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
ConfigObject p_obj
Config object used by given template object.
void check_init() const
Check and initialize object if necessary.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
Generic configuration exception.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDaphneV2BoardConf * >::const_iterator DaphneV2BoardConfIterator
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ch