Skip to content

Commit

Permalink
Merge pull request #68 from DUNE-DAQ/prep-release/fddaq-v4.4.0
Browse files Browse the repository at this point in the history
Prep release/fddaq v4.4.0
  • Loading branch information
jcfreeman2 committed Apr 23, 2024
2 parents 42f8d1c + 4c47332 commit 0e9af55
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 102 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(triggeralgs VERSION 1.3.0)
project(triggeralgs VERSION 1.3.1)

include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
Expand Down
5 changes: 2 additions & 3 deletions include/triggeralgs/AbstractFactory.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ void AbstractFactory<T>::register_creator(const std::string alg_name, maker_crea
makers[alg_name] = creator;
return;
}
ers::warning(FactoryOverwrite(ERS_HERE, alg_name));
throw; // creators should not be overwritten.
throw FactoryOverwrite(ERS_HERE, alg_name);
return;
}

Expand All @@ -47,7 +46,7 @@ std::unique_ptr<T> AbstractFactory<T>::build_maker(const std::string& alg_name)
return it->second();
}

ers::error(FactoryNotFound(ERS_HERE, alg_name));
throw FactoryNotFound(ERS_HERE, alg_name);
return nullptr;
}

Expand Down
5 changes: 5 additions & 0 deletions include/triggeralgs/Issues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ ERS_DECLARE_ISSUE(triggeralgs,
"Factory couldn't find: " << alg_name,
((std::string)alg_name))

ERS_DECLARE_ISSUE(triggeralgs,
BadConfiguration,
"Bad configuration in " << alg_name,
((std::string)alg_name))

#endif // TRIGGERALGS_INCLUDE_TRIGGERALGS_ISSUES_HPP_
6 changes: 1 addition & 5 deletions include/triggeralgs/Logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
#ifndef TRIGGERALGS_INCLUDE_LOGGING_HPP_
#define TRIGGERALGS_INCLUDE_LOGGING_HPP_

namespace dunedaq {
namespace triggeralgs {
namespace logging {

/**
* @brief Common name used by TRACE TLOG calls from this package
*/
enum
enum Logging
{
TLVL_VERY_IMPORTANT = 1,
TLVL_IMPORTANT = 2,
Expand All @@ -27,8 +25,6 @@ enum
TLVL_DEBUG_ALL = 20
};

} // namespace logging
} // namespace triggeralgs
} // namespace dunedaq

#endif // TRIGGERALGS_INCLUDE_LOGGING_HPP_
2 changes: 2 additions & 0 deletions include/triggeralgs/TriggerActivityMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERACTIVITYMAKER_HPP_
#define TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERACTIVITYMAKER_HPP_

#include "triggeralgs/Issues.hpp"
#include "triggeralgs/Logging.hpp"
#include "triggeralgs/TriggerActivity.hpp"
#include "triggeralgs/TriggerPrimitive.hpp"
#include "triggeralgs/Types.hpp"
Expand Down
2 changes: 2 additions & 0 deletions include/triggeralgs/TriggerCandidateMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERCANDIDATEMAKER_HPP_
#define TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERCANDIDATEMAKER_HPP_

#include "triggeralgs/Issues.hpp"
#include "triggeralgs/Logging.hpp"
#include "triggeralgs/TriggerActivity.hpp"
#include "triggeralgs/TriggerCandidate.hpp"
#include "triggeralgs/Types.hpp"
Expand Down
2 changes: 2 additions & 0 deletions include/triggeralgs/TriggerDecisionMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERDECISIONMAKER_HPP_
#define TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERDECISIONMAKER_HPP_

#include "triggeralgs/Issues.hpp"
#include "triggeralgs/Logging.hpp"
#include "triggeralgs/TriggerCandidate.hpp"
#include "triggeralgs/TriggerDecision.hpp"

Expand Down
2 changes: 2 additions & 0 deletions include/triggeralgs/TriggerPrimitiveMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERPRIMITIVEMAKER_HPP_
#define TRIGGERALGS_INCLUDE_TRIGGERALGS_TRIGGERPRIMITIVEMAKER_HPP_

#include "triggeralgs/Issues.hpp"
#include "triggeralgs/Logging.hpp"
#include "trgdataformats/TriggerPrimitive.hpp"

#include <nlohmann/json.hpp>
Expand Down
9 changes: 4 additions & 5 deletions src/TriggerActivityMakerADCSimpleWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
*/

#include "triggeralgs/ADCSimpleWindow/TriggerActivityMakerADCSimpleWindow.hpp"
#include "triggeralgs/Logging.hpp"

#include "TRACE/trace.h"
#define TRACE_NAME "TriggerActivityMakerADCSimpleWindowPlugin"

#include <vector>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_ALL;
using dunedaq::triggeralgs::logging::TLVL_DEBUG_HIGH;
using dunedaq::triggeralgs::logging::TLVL_DEBUG_LOW;
using dunedaq::triggeralgs::logging::TLVL_IMPORTANT;

using namespace triggeralgs;
using Logging::TLVL_DEBUG_ALL;
using Logging::TLVL_DEBUG_HIGH;
using Logging::TLVL_DEBUG_LOW;
using Logging::TLVL_IMPORTANT;

void
TriggerActivityMakerADCSimpleWindow::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
Expand Down
6 changes: 5 additions & 1 deletion src/TriggerActivityMakerBundleN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace triggeralgs {

using Logging::TLVL_IMPORTANT;
using Logging::TLVL_DEBUG_HIGH;

void TriggerActivityMakerBundleN::set_ta_attributes() {
// Using the first TA as reference.
TriggerPrimitive first_tp = m_current_ta.inputs.front();
Expand Down Expand Up @@ -52,6 +55,7 @@ TriggerActivityMakerBundleN::operator()(const TriggerPrimitive& input_tp, std::v
m_current_ta.inputs.push_back(input_tp);

if (bundle_condition()) {
TLOG_DEBUG(TLVL_DEBUG_HIGH) << "[TA:BN] Emitting BundleN TA with " << m_current_ta.inputs.size() << " TPs.";
set_ta_attributes();
output_tas.push_back(m_current_ta);

Expand All @@ -61,7 +65,7 @@ TriggerActivityMakerBundleN::operator()(const TriggerPrimitive& input_tp, std::v

// Should never reach this step. In this case, send it out.
if (m_current_ta.inputs.size() > m_bundle_size) {
TLOG(TLVL_DEBUG_1) << "Emitting large BundleN TriggerActivity with " << m_current_ta.inputs.size() << " TPs.";
TLOG_DEBUG(TLVL_IMPORTANT) << "[TA:BN] Emitting large BundleN TriggerActivity with " << m_current_ta.inputs.size() << " TPs.";
set_ta_attributes();
output_tas.push_back(m_current_ta);

Expand Down
4 changes: 2 additions & 2 deletions src/TriggerActivityMakerChannelAdjacency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include <vector>
#include <math.h>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_LOW;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_LOW;

void
TriggerActivityMakerChannelAdjacency::operator()(const TriggerPrimitive& input_tp,
std::vector<TriggerActivity>& output_ta)
Expand Down
5 changes: 2 additions & 3 deletions src/TriggerActivityMakerDBSCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

#include "triggeralgs/dbscan/TriggerActivityMakerDBSCAN.hpp"
#include "triggeralgs/Logging.hpp"
#include "dbscan/Point.hpp"

#include "TRACE/trace.h"
Expand All @@ -18,10 +17,10 @@

#include <vector>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_LOW;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_LOW;

void
TriggerActivityMakerDBSCAN::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
{
Expand Down
7 changes: 3 additions & 4 deletions src/TriggerActivityMakerHorizontalMuon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
*/

#include "triggeralgs/HorizontalMuon/TriggerActivityMakerHorizontalMuon.hpp"
#include "triggeralgs/Logging.hpp"
#include "TRACE/trace.h"
#define TRACE_NAME "TriggerActivityMakerHorizontalMuonPlugin"
#include <vector>
#include <math.h>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_ALL;
using dunedaq::triggeralgs::logging::TLVL_DEBUG_MEDIUM;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_ALL;
using Logging::TLVL_DEBUG_MEDIUM;

void
TriggerActivityMakerHorizontalMuon::operator()(const TriggerPrimitive& input_tp,
std::vector<TriggerActivity>& output_ta)
Expand Down
5 changes: 2 additions & 3 deletions src/TriggerActivityMakerMichelElectron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
*/

#include "triggeralgs/MichelElectron/TriggerActivityMakerMichelElectron.hpp"
#include "triggeralgs/Logging.hpp"
#include "TRACE/trace.h"
#define TRACE_NAME "TriggerActivityMakerMichelElectronPlugin"
#include <vector>
#include <algorithm>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_MEDIUM;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_MEDIUM;

void
TriggerActivityMakerMichelElectron::operator()(const TriggerPrimitive& input_tp,
std::vector<TriggerActivity>& output_ta)
Expand Down
5 changes: 2 additions & 3 deletions src/TriggerActivityMakerPlaneCoincidence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
*/

#include "triggeralgs/PlaneCoincidence/TriggerActivityMakerPlaneCoincidence.hpp"
#include "triggeralgs/Logging.hpp"
#include "TRACE/trace.h"
#define TRACE_NAME "TriggerActivityMakerPlaneCoincidencePlugin"
#include <vector>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_MEDIUM;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_MEDIUM;

void
TriggerActivityMakerPlaneCoincidence::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
{
Expand Down
7 changes: 3 additions & 4 deletions src/TriggerActivityMakerPrescale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
*/

#include "triggeralgs/Prescale/TriggerActivityMakerPrescale.hpp"
#include "triggeralgs/Logging.hpp"

#include "TRACE/trace.h"
#define TRACE_NAME "TriggerActivityMakerPrescalePlugin"

#include <vector>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_MEDIUM;
using dunedaq::triggeralgs::logging::TLVL_IMPORTANT;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_MEDIUM;
using Logging::TLVL_IMPORTANT;

void
TriggerActivityMakerPrescale::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
{
Expand Down
5 changes: 2 additions & 3 deletions src/TriggerCandidateMakerADCSimpleWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
*/

#include "triggeralgs/ADCSimpleWindow/TriggerCandidateMakerADCSimpleWindow.hpp"
#include "triggeralgs/Logging.hpp"

#include "TRACE/trace.h"
#define TRACE_NAME "TriggerCandidateMakerADCSimpleWindowPlugin"

#include <vector>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_LOW;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_LOW;

void
TriggerCandidateMakerADCSimpleWindow::operator()(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
{
Expand Down
6 changes: 5 additions & 1 deletion src/TriggerCandidateMakerBundleN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace triggeralgs {

using Logging::TLVL_IMPORTANT;
using Logging::TLVL_DEBUG_HIGH;

void TriggerCandidateMakerBundleN::set_tc_attributes() {
// Using the first TA as reference.
dunedaq::trgdataformats::TriggerActivityData front_ta = m_current_tc.inputs.front();
Expand All @@ -37,6 +40,7 @@ TriggerCandidateMakerBundleN::operator()(const TriggerActivity& input_ta, std::v
m_current_tc.inputs.push_back(input_ta);

if (bundle_condition()) {
TLOG_DEBUG(TLVL_DEBUG_HIGH) << "[TC:BN] Emitting BundleN TriggerCandidate with " << m_current_tc.inputs.size() << " TAs.";
set_tc_attributes();
output_tcs.push_back(m_current_tc);

Expand All @@ -46,7 +50,7 @@ TriggerCandidateMakerBundleN::operator()(const TriggerActivity& input_ta, std::v

// Should never reach this step. In this case, send it out.
if (m_current_tc.inputs.size() > m_bundle_size) {
TLOG(TLVL_DEBUG_1) << "Emitting large BundleN TriggerCandidate with " << m_current_tc.inputs.size() << " TAs.";
TLOG_DEBUG(TLVL_IMPORTANT) << "[TC:BN] Emitting large BundleN TriggerCandidate with " << m_current_tc.inputs.size() << " TAs.";
set_tc_attributes();
output_tcs.push_back(m_current_tc);

Expand Down
20 changes: 11 additions & 9 deletions src/TriggerCandidateMakerChannelAdjacency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#include <vector>
#include <math.h>

using dunedaq::triggeralgs::logging::TLVL_DEBUG_ALL;
using dunedaq::triggeralgs::logging::TLVL_DEBUG_HIGH;
using dunedaq::triggeralgs::logging::TLVL_DEBUG_MEDIUM;
using dunedaq::triggeralgs::logging::TLVL_VERY_IMPORTANT;

using namespace triggeralgs;

using Logging::TLVL_DEBUG_ALL;
using Logging::TLVL_DEBUG_HIGH;
using Logging::TLVL_DEBUG_MEDIUM;
using Logging::TLVL_VERY_IMPORTANT;

void
TriggerCandidateMakerChannelAdjacency::operator()(const TriggerActivity& activity,
std::vector<TriggerCandidate>& output_tc)
Expand Down Expand Up @@ -78,10 +78,6 @@ TriggerCandidateMakerChannelAdjacency::operator()(const TriggerActivity& activit
output_tc.push_back(construct_tc());
m_current_window.clear();
}

else if (!m_trigger_on_adc && !m_trigger_on_n_channels) {
TLOG_DEBUG(TLVL_VERY_IMPORTANT) << "[TCM:CA] either trigger_on_adc or trigger_on_n_channels should be true!";
}

m_activity_count++;
return;
Expand All @@ -108,6 +104,12 @@ TriggerCandidateMakerChannelAdjacency::configure(const nlohmann::json& config)
m_readout_window_ticks_after = config["readout_window_ticks_after"];
}

// Both trigger flags were false. This will never trigger.
if (!m_trigger_on_adc && !m_trigger_on_n_channels) {
TLOG_DEBUG(TLVL_VERY_IMPORTANT) << "[TCM:CA] Not triggering! All trigger flags are false!";
throw BadConfiguration(ERS_HERE, TRACE_NAME);
}

return;
}

Expand Down

0 comments on commit 0e9af55

Please sign in to comment.