DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
triggeralgs
include
triggeralgs
Supernova
TDMakerSupernovaAlgorithm.hpp
Go to the documentation of this file.
1
8
9
#ifndef TRIGGERALGS_SRC_TRIGGERALGS_SUPERNOVA_TRIGGERDECISIONMAKERSUPERNOVA_HPP_
10
#define TRIGGERALGS_SRC_TRIGGERALGS_SUPERNOVA_TRIGGERDECISIONMAKERSUPERNOVA_HPP_
11
12
#include "
triggeralgs/TriggerDecisionMaker.hpp
"
13
#include "
trgdataformats/Types.hpp
"
14
15
#include <algorithm>
16
#include <atomic>
17
#include <limits>
18
#include <vector>
19
20
namespace
triggeralgs
{
21
class
TDMakerSupernovaAlgorithm
:
public
TriggerDecisionMaker
22
{
24
25
public
:
27
void
operator()
(
const
TriggerCandidate
&, std::vector<TriggerDecision>&);
28
29
protected
:
30
std::vector<TriggerCandidate>
m_candidate
;
32
std::atomic<dunedaq::trgdataformats::timestamp_t>
m_time_window
= { 500'000'000 };
34
std::atomic<uint16_t>
m_threshold
= { 1 };
// NOLINT(build/unsigned)
36
std::atomic<uint16_t>
m_hit_threshold
= { 1 };
// NOLINT(build/unsigned)
37
39
void
FlushOldCandidate
(
dunedaq::trgdataformats::timestamp_t
time_now)
40
{
41
dunedaq::trgdataformats::timestamp_diff_t
how_far = time_now -
m_time_window
;
42
auto
end = std::remove_if(
43
m_candidate
.begin(),
m_candidate
.end(), [how_far,
this
](
auto
& c) ->
bool
{ return (static_cast<dunedaq::trgdataformats::timestamp_diff_t>(c.time_start) < how_far); });
44
m_candidate
.erase(end,
m_candidate
.end());
45
}
46
};
47
48
}
// namespace triggeralgs
49
50
#endif
// TRIGGERALGS_SRC_TRIGGERALGS_SUPERNOVA_TRIGGERDECISIONMAKERSUPERNOVA_HPP_
TriggerDecisionMaker.hpp
triggeralgs::TDMakerSupernovaAlgorithm
Definition
TDMakerSupernovaAlgorithm.hpp:22
triggeralgs::TDMakerSupernovaAlgorithm::m_time_window
std::atomic< dunedaq::trgdataformats::timestamp_t > m_time_window
Sliding time window to count activities.
Definition
TDMakerSupernovaAlgorithm.hpp:32
triggeralgs::TDMakerSupernovaAlgorithm::m_hit_threshold
std::atomic< uint16_t > m_hit_threshold
Minimum number of primities in an activity.
Definition
TDMakerSupernovaAlgorithm.hpp:36
triggeralgs::TDMakerSupernovaAlgorithm::operator()
void operator()(const TriggerCandidate &, std::vector< TriggerDecision > &)
This decision maker just spits out the trigger candidates.
Definition
TDMakerSupernovaAlgorithm.cpp:20
triggeralgs::TDMakerSupernovaAlgorithm::m_threshold
std::atomic< uint16_t > m_threshold
Minimum number of activities in the time window to issue a trigger.
Definition
TDMakerSupernovaAlgorithm.hpp:34
triggeralgs::TDMakerSupernovaAlgorithm::FlushOldCandidate
void FlushOldCandidate(dunedaq::trgdataformats::timestamp_t time_now)
this function gets rid of the old activities
Definition
TDMakerSupernovaAlgorithm.hpp:39
triggeralgs::TDMakerSupernovaAlgorithm::m_candidate
std::vector< TriggerCandidate > m_candidate
Definition
TDMakerSupernovaAlgorithm.hpp:30
triggeralgs::TriggerDecisionMaker
Definition
TriggerDecisionMaker.hpp:25
dunedaq::trgdataformats::timestamp_diff_t
int64_t timestamp_diff_t
Definition
Types.hpp:24
dunedaq::trgdataformats::timestamp_t
uint64_t timestamp_t
Definition
Types.hpp:20
triggeralgs
Definition
AbstractFactory.hpp:18
triggeralgs::TriggerCandidate
Definition
TriggerCandidate.hpp:20
Types.hpp
Generated on
for DUNE-DAQ by
1.17.0