Skip to content

Commit

Permalink
JCF: update names as described in DUNE-DAQ/daq-release#376 and detail…
Browse files Browse the repository at this point in the history
  • Loading branch information
John Freeman committed Jun 14, 2024
1 parent b6cd93f commit eea4bd3
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ find_package(detchannelmaps REQUIRED)
add_library(triggeralgs SHARED
src/TriggerActivityMakerADCSimpleWindow.cpp
src/TriggerCandidateMakerADCSimpleWindow.cpp
src/TriggerActivityMakerHorizontalMuon.cpp
src/TriggerCandidateMakerHorizontalMuon.cpp
src/TAMakerHorizontalMuonAlgorithm.cpp
src/TCMakerHorizontalMuonAlgorithm.cpp
src/TriggerCandidateMakerPlaneCoincidence.cpp
src/TriggerActivityMakerPlaneCoincidence.cpp
src/TriggerActivityMakerMichelElectron.cpp
src/TriggerCandidateMakerMichelElectron.cpp
src/TriggerActivityMakerPrescale.cpp
src/TriggerCandidateMakerPrescale.cpp
src/TAMakerPrescaleAlgorithm.cpp
src/TCMakerPrescaleAlgorithm.cpp
src/TriggerActivityMakerSupernova.cpp
src/TriggerCandidateMakerSupernova.cpp
src/TriggerDecisionMakerSupernova.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file TriggerActivityMakerHorizontalMuon.hpp
* @file TAMakerHorizontalMuonAlgorithm.hpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2021.
* Licensing/copyright details are in the COPYING file that you should have
Expand All @@ -15,7 +15,7 @@
#include <vector>

namespace triggeralgs {
class TriggerActivityMakerHorizontalMuon : public TriggerActivityMaker
class TAMakerHorizontalMuonAlgorithm : public TriggerActivityMaker
{
public:
void operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file TriggerCandidateMakerHorizontalMuon.hpp
* @file TCMakerHorizontalMuonAlgorithm.hpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2021.
* Licensing/copyright details are in the COPYING file that you should have
Expand All @@ -16,7 +16,7 @@
#include <vector>

namespace triggeralgs {
class TriggerCandidateMakerHorizontalMuon : public TriggerCandidateMaker
class TCMakerHorizontalMuonAlgorithm : public TriggerCandidateMaker
{

public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file TriggerActivityMakerPrescale.hpp
* @file TAMakerPrescaleAlgorithm.hpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
Expand All @@ -14,7 +14,7 @@
#include <vector>

namespace triggeralgs {
class TriggerActivityMakerPrescale : public TriggerActivityMaker
class TAMakerPrescaleAlgorithm : public TriggerActivityMaker
{

public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file TriggerCandidateMakerPrescale.hpp
* @file TCMakerPrescaleAlgorithm.hpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
Expand All @@ -14,7 +14,7 @@
#include <vector>

namespace triggeralgs {
class TriggerCandidateMakerPrescale : public TriggerCandidateMaker
class TCMakerPrescaleAlgorithm : public TriggerCandidateMaker
{

public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* @file TriggerActivityMakerHorizontalMuon.cpp
* @file TAMakerHorizontalMuonAlgorithm.cpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2021.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

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

using namespace triggeralgs;

void
TriggerActivityMakerHorizontalMuon::operator()(const TriggerPrimitive& input_tp,
TAMakerHorizontalMuonAlgorithm::operator()(const TriggerPrimitive& input_tp,
std::vector<TriggerActivity>& output_ta)
{

Expand Down Expand Up @@ -138,7 +138,7 @@ TriggerActivityMakerHorizontalMuon::operator()(const TriggerPrimitive& input_tp,
}

void
TriggerActivityMakerHorizontalMuon::configure(const nlohmann::json& config)
TAMakerHorizontalMuonAlgorithm::configure(const nlohmann::json& config)
{
if (config.is_object()) {
if (config.contains("trigger_on_adc"))
Expand Down Expand Up @@ -171,7 +171,7 @@ TriggerActivityMakerHorizontalMuon::configure(const nlohmann::json& config)
}

TriggerActivity
TriggerActivityMakerHorizontalMuon::construct_ta() const
TAMakerHorizontalMuonAlgorithm::construct_ta() const
{

TriggerActivity ta;
Expand Down Expand Up @@ -209,7 +209,7 @@ TriggerActivityMakerHorizontalMuon::construct_ta() const
}

uint16_t
TriggerActivityMakerHorizontalMuon::check_adjacency() const
TAMakerHorizontalMuonAlgorithm::check_adjacency() const
{
// This function returns the adjacency value for the current window, where adjacency
// is defined as the maximum number of consecutive wires containing hits. It accepts
Expand Down Expand Up @@ -277,15 +277,15 @@ TriggerActivityMakerHorizontalMuon::check_adjacency() const
// Functions below this line are for debugging purposes.
// =====================================================================================
void
TriggerActivityMakerHorizontalMuon::add_window_to_record(TPWindow window)
TAMakerHorizontalMuonAlgorithm::add_window_to_record(TPWindow window)
{
m_window_record.push_back(window);
return;
}

// Function to dump the details of the TA window currently on record
void
TriggerActivityMakerHorizontalMuon::dump_window_record()
TAMakerHorizontalMuonAlgorithm::dump_window_record()
{
std::ofstream outfile;
outfile.open("window_record_tam.csv", std::ios_base::app);
Expand All @@ -311,7 +311,7 @@ TriggerActivityMakerHorizontalMuon::dump_window_record()

// Function to add current TP details to a text file for testing and debugging.
void
TriggerActivityMakerHorizontalMuon::dump_tp(TriggerPrimitive const& input_tp)
TAMakerHorizontalMuonAlgorithm::dump_tp(TriggerPrimitive const& input_tp)
{
std::ofstream outfile;
outfile.open("coldbox_tps.txt", std::ios_base::app);
Expand All @@ -331,7 +331,7 @@ TriggerActivityMakerHorizontalMuon::dump_tp(TriggerPrimitive const& input_tp)
}

int
TriggerActivityMakerHorizontalMuon::check_tot() const
TAMakerHorizontalMuonAlgorithm::check_tot() const
{
// Here, we just want to sum up all the tot values for each TP within window,
// and return this tot of the window.
Expand All @@ -344,4 +344,4 @@ TriggerActivityMakerHorizontalMuon::check_tot() const
}

// Register algo in TA Factory
REGISTER_TRIGGER_ACTIVITY_MAKER(TRACE_NAME, TriggerActivityMakerHorizontalMuon)
REGISTER_TRIGGER_ACTIVITY_MAKER(TRACE_NAME, TAMakerHorizontalMuonAlgorithm)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**
* @file TriggerActivityMakerPrescale.cpp
* @file TAMakerPrescaleAlgorithm.cpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

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

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

#include <vector>

using namespace triggeralgs;

void
TriggerActivityMakerPrescale::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
TAMakerPrescaleAlgorithm::operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
{
if ((m_primitive_count++) % m_prescale == 0)
{
Expand Down Expand Up @@ -53,7 +53,7 @@ TriggerActivityMakerPrescale::operator()(const TriggerPrimitive& input_tp, std::
}

void
TriggerActivityMakerPrescale::configure(const nlohmann::json &config)
TAMakerPrescaleAlgorithm::configure(const nlohmann::json &config)
{
//FIXME use some schema here
if (config.is_object() && config.contains("prescale"))
Expand All @@ -64,4 +64,4 @@ TriggerActivityMakerPrescale::configure(const nlohmann::json &config)
}

// Register algo in TA Factory
REGISTER_TRIGGER_ACTIVITY_MAKER(TRACE_NAME, TriggerActivityMakerPrescale)
REGISTER_TRIGGER_ACTIVITY_MAKER(TRACE_NAME, TAMakerPrescaleAlgorithm)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**
* @file TriggerCandidateMakerHorizontalMuon.cpp
* @file TCMakerHorizontalMuonAlgorithm.cpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2021.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

#include "triggeralgs/HorizontalMuon/TriggerCandidateMakerHorizontalMuon.hpp"
#include "triggeralgs/HorizontalMuon/TCMakerHorizontalMuonAlgorithm.hpp"

#include "TRACE/trace.h"
#define TRACE_NAME "TriggerCandidateMakerHorizontalMuonPlugin"
#define TRACE_NAME "TCMakerHorizontalMuonAlgorithm"

#include <vector>
#include <math.h>
using namespace triggeralgs;

void
TriggerCandidateMakerHorizontalMuon::operator()(const TriggerActivity& activity,
TCMakerHorizontalMuonAlgorithm::operator()(const TriggerActivity& activity,
std::vector<TriggerCandidate>& output_tc)
{

Expand Down Expand Up @@ -103,7 +103,7 @@ TriggerCandidateMakerHorizontalMuon::operator()(const TriggerActivity& activity,


void
TriggerCandidateMakerHorizontalMuon::configure(const nlohmann::json& config)
TCMakerHorizontalMuonAlgorithm::configure(const nlohmann::json& config)
{
if (config.is_object()) {
if (config.contains("trigger_on_adc"))
Expand Down Expand Up @@ -144,7 +144,7 @@ TriggerCandidateMakerHorizontalMuon::configure(const nlohmann::json& config)
}

TriggerCandidate
TriggerCandidateMakerHorizontalMuon::construct_tc() const
TCMakerHorizontalMuonAlgorithm::construct_tc() const
{
TriggerActivity latest_ta_in_window = m_current_window.inputs.back();

Expand All @@ -168,22 +168,22 @@ TriggerCandidateMakerHorizontalMuon::construct_tc() const
}

bool
TriggerCandidateMakerHorizontalMuon::check_adjacency() const
TCMakerHorizontalMuonAlgorithm::check_adjacency() const
{
// FIX ME: An adjacency check on the channels which have hits.
return true;
}

// Functions below this line are for debugging purposes.
void
TriggerCandidateMakerHorizontalMuon::add_window_to_record(TAWindow window)
TCMakerHorizontalMuonAlgorithm::add_window_to_record(TAWindow window)
{
m_window_record.push_back(window);
return;
}

void
TriggerCandidateMakerHorizontalMuon::dump_window_record()
TCMakerHorizontalMuonAlgorithm::dump_window_record()
{
// FIX ME: Need to index this outfile in the name by detid or something similar.
std::ofstream outfile;
Expand All @@ -207,7 +207,7 @@ TriggerCandidateMakerHorizontalMuon::dump_window_record()

/*
void
TriggerCandidateMakerHorizontalMuon::flush(timestamp_t, std::vector<TriggerCandidate>& output_tc)
TCMakerHorizontalMuonAlgorithm::flush(timestamp_t, std::vector<TriggerCandidate>& output_tc)
{
// Check the status of the current window, construct TC if conditions are met. Regardless
// of whether the conditions are met, reset the window.
Expand All @@ -228,4 +228,4 @@ reset."; m_current_window.clear();
return;
}*/

REGISTER_TRIGGER_CANDIDATE_MAKER(TRACE_NAME, TriggerCandidateMakerHorizontalMuon)
REGISTER_TRIGGER_CANDIDATE_MAKER(TRACE_NAME, TCMakerHorizontalMuonAlgorithm)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**
* @file TriggerCandidateMakerPrescale.cpp
* @file TCMakerPrescaleAlgorithm.cpp
*
* This is part of the DUNE DAQ Application Framework, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

#include "triggeralgs/Prescale/TriggerCandidateMakerPrescale.hpp"
#include "triggeralgs/Prescale/TCMakerPrescaleAlgorithm.hpp"

#include "TRACE/trace.h"
#define TRACE_NAME "TriggerCandidateMakerPrescalePlugin"
#define TRACE_NAME "TCMakerPrescaleAlgorithm"

#include <vector>

using namespace triggeralgs;

void
TriggerCandidateMakerPrescale::operator()(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
TCMakerPrescaleAlgorithm::operator()(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
{
if ((m_activity_count++) % m_prescale == 0)
{
Expand Down Expand Up @@ -47,7 +47,7 @@ TriggerCandidateMakerPrescale::operator()(const TriggerActivity& activity, std::
}

void
TriggerCandidateMakerPrescale::configure(const nlohmann::json &config)
TCMakerPrescaleAlgorithm::configure(const nlohmann::json &config)
{
if (config.is_object() && config.contains("prescale"))
{
Expand All @@ -61,4 +61,4 @@ TriggerCandidateMakerPrescale::configure(const nlohmann::json &config)
TLOG_DEBUG(TRACE_NAME) << "Using candidate prescale " << m_prescale;
}

REGISTER_TRIGGER_CANDIDATE_MAKER(TRACE_NAME, TriggerCandidateMakerPrescale)
REGISTER_TRIGGER_CANDIDATE_MAKER(TRACE_NAME, TCMakerPrescaleAlgorithm)
2 changes: 1 addition & 1 deletion test/test_factory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace triggeralgs {

BOOST_AUTO_TEST_CASE(test_macro_overview)
{
std::unique_ptr<TriggerActivityMaker> prescale_maker = TriggerActivityFactory::makeTAMaker("TriggerActivityMakerPrescalePlugin");
std::unique_ptr<TriggerActivityMaker> prescale_maker = TriggerActivityFactory::makeTAMaker("TAMakerPrescaleAlgorithm");

std::vector<TriggerActivity> prescale_ta;
TriggerPrimitive some_tp;
Expand Down

0 comments on commit eea4bd3

Please sign in to comment.