LCOV - code coverage report
Current view: top level - triggeralgs/src - TAMakerPrescaleAlgorithm.cpp (source / functions) Coverage Total Hit
Test: code.result Lines: 4.3 % 23 1
Test Date: 2025-12-21 13:07:08 Functions: 25.0 % 4 1

            Line data    Source code
       1              : /**
       2              :  * @file TAMakerPrescaleAlgorithm.cpp
       3              :  *
       4              :  * This is part of the DUNE DAQ Application Framework, copyright 2020.
       5              :  * Licensing/copyright details are in the COPYING file that you should have
       6              :  * received with this code.
       7              :  */
       8              : 
       9              : #include "triggeralgs/Prescale/TAMakerPrescaleAlgorithm.hpp"
      10              : 
      11              : #include "TRACE/trace.h"
      12              : #define TRACE_NAME "TAMakerPrescaleAlgorithm"
      13              : 
      14              : #include <vector>
      15              : 
      16              : using namespace triggeralgs;
      17              : 
      18              : using Logging::TLVL_DEBUG_MEDIUM;
      19              : using Logging::TLVL_IMPORTANT;
      20              : 
      21              : void
      22            0 : TAMakerPrescaleAlgorithm::process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta)
      23              : {
      24            0 :   std::vector<TriggerPrimitive> tp_list;
      25            0 :   tp_list.push_back(input_tp);
      26              : 
      27            0 :   TriggerActivity ta;
      28            0 :   ta.time_start = input_tp.time_start;
      29            0 :   ta.time_end = input_tp.time_start + input_tp.samples_over_threshold * 32;  // FIXME: Replace the hard-coded SOT to TOT scaling.
      30            0 :   ta.time_peak = input_tp.samples_to_peak * 32 + input_tp.time_start;  // FIXME: Replace STP to `time_peak` conversion.
      31            0 :   ta.time_activity = 0;
      32            0 :   ta.channel_start = input_tp.channel;
      33            0 :   ta.channel_end = input_tp.channel;
      34            0 :   ta.channel_peak = input_tp.channel;
      35            0 :   ta.adc_integral = input_tp.adc_integral;
      36            0 :   ta.adc_peak = input_tp.adc_peak;
      37            0 :   ta.detid = input_tp.detid;
      38            0 :   ta.type = TriggerActivity::Type::kTPC;
      39            0 :   ta.algorithm = TriggerActivity::Algorithm::kPrescale;
      40              : 
      41            0 :   ta.inputs = tp_list;
      42              : 
      43            0 :   output_ta.push_back(ta);
      44            0 : }
      45              : 
      46              : void
      47            0 : TAMakerPrescaleAlgorithm::configure(const nlohmann::json& config)
      48              : {
      49            0 :   TriggerActivityMaker::configure(config);
      50            0 : }
      51              : 
      52              : // Register algo in TA Factory
      53           12 : REGISTER_TRIGGER_ACTIVITY_MAKER(TRACE_NAME, TAMakerPrescaleAlgorithm)
        

Generated by: LCOV version 2.0-1