LCOV - code coverage report
Current view: top level - sspmodules/src/anlBoard - EventPacket.cxx (source / functions) Coverage Total Hit
Test: code.result Lines: 0.0 % 41 0
Test Date: 2025-12-21 13:07:08 Functions: 0.0 % 4 0

            Line data    Source code
       1              : /**
       2              :  * @file EventPacket.cxx
       3              :  *
       4              :  * This is part of the DUNE DAQ , copyright 2020.
       5              :  * Licensing/copyright details are in the COPYING file that you should have
       6              :  * received with this code.
       7              :  */
       8              : #ifndef SSPMODULES_SRC_ANLBOARD_EVENTPACKET_CXX_
       9              : #define SSPMODULES_SRC_ANLBOARD_EVENTPACKET_CXX_
      10              : 
      11              : #include "logging/Logging.hpp"
      12              : 
      13              : #include "EventPacket.hpp"
      14              : 
      15            0 : void dunedaq::sspmodules::EventPacket::SetEmpty(){
      16            0 :   data.clear();
      17            0 :   header.header=0xDEADBEEF;
      18            0 : }
      19              : 
      20            0 : void dunedaq::sspmodules::EventPacket::DumpHeader(){
      21              : 
      22            0 :   u_int32_t peaksum = ((header.group3 & 0x00FF) >> 16) + header.peakSumLow;
      23            0 :   if(peaksum & 0x00800000) {
      24              :     peaksum |= 0xFF000000;
      25              :   }
      26              :   // clang-format off
      27              :   //dune::DAQLogger::LogInfo("SSP_EventPacket")
      28            0 :   TLOG_DEBUG(10) 
      29            0 :     << "=====HEADER=======================================" << std::endl
      30            0 :     << "Header:                             " << header.header   << std::endl
      31            0 :     << "Length:                             " << header.length   << std::endl
      32            0 :     << "Trigger type:                       " << ((header.group1 & 0xFF00) >> 8) << std::endl
      33            0 :     << "Status flags:                       " << ((header.group1 & 0x00F0) >> 4) << std::endl
      34            0 :     << "Header type:                        " << ((header.group1 & 0x000F) >> 0) << std::endl
      35            0 :     << "Trigger ID:                         " << header.triggerID << std::endl
      36            0 :     << "Module ID:                          " << ((header.group2 & 0xFFF0) >> 4) << std::endl
      37            0 :     << "Channel ID:                         " << ((header.group2 & 0x000F) >> 0) << std::endl
      38            0 :     << "External timestamp (FP mode):       " << std::endl
      39            0 :     << "  Sync delay:                       " << ((unsigned int)(header.timestamp[1]) << 16) + (unsigned int)(header.timestamp[0]) << std::endl
      40            0 :     << "  Sync count:                       " << ((unsigned int)(header.timestamp[3]) << 16) + (unsigned int)(header.timestamp[2]) << std::endl
      41            0 :     << "External timestamp (NOvA mode):     " << ((unsigned long)header.timestamp[3]  << 48) +((unsigned long)header.timestamp[2] << 32)    // NOLINT(runtime/int)
      42            0 :     + ((unsigned long)header.timestamp[1] << 16) + (unsigned long)header.timestamp[0] <<std::endl                                           // NOLINT(runtime/int)
      43            0 :     << "Peak sum:                           " << peaksum << std::endl
      44            0 :     << "Peak time:                          " << ((header.group3 & 0xFF00) >> 8) << std::endl
      45            0 :     << "Prerise:                            " << ((header.group4 & 0x00FF) << 16) + header.preriseLow << std::endl
      46            0 :     << "Integrated sum:                     " << ((unsigned int)(header.intSumHigh) << 8) + (((unsigned int)(header.group4) & 0xFF00) >> 8) << std::endl
      47            0 :     << "Baseline:                           " << header.baseline << std::endl
      48            0 :     << "CFD Timestamp interpolation points: " << header.cfdPoint[0] << " " << header.cfdPoint[1] << " " << header.cfdPoint[2] << " " << header.cfdPoint[3] << std::endl
      49            0 :     << "Internal interpolation point:       " << header.intTimestamp[0] << std::endl
      50            0 :     << "Internal timestamp:                 " << ((uint64_t)((uint64_t)header.intTimestamp[3] << 32)) + ((uint64_t)((uint64_t)header.intTimestamp[2]) << 16) + ((uint64_t)((uint64_t)header.intTimestamp[1])) <<" ("<<header.intTimestamp[3]<<" "<<header.intTimestamp[2]<<" "<<header.intTimestamp[1]<<")"<<std::endl  // NOLINT(build/unsigned)
      51            0 :     << "=================================================="<< std::endl
      52            0 :     << std::endl;
      53              :   // clang-format on
      54            0 : }
      55              : 
      56            0 : void dunedaq::sspmodules::EventPacket::DumpEvent(){
      57              : 
      58              :   //dune::DAQLogger::LogInfo("SSP_EventPacket")<<"*****EVENT DUMP***********************************" <<std::endl<<std::endl;
      59              : 
      60            0 :   this->DumpHeader();
      61              : 
      62              :   //dune::DAQLogger::LogInfo("SSP_EventPacket")<<"=====ADC VALUES===================================" <<std::endl;
      63              : 
      64            0 :   unsigned int nADC=data.size()*2;
      65            0 :   unsigned short* adcs=reinterpret_cast<unsigned short*>(&(data[0])); // NOLINT
      66              : 
      67            0 :   std::stringstream adcstream;
      68              : 
      69            0 :   for(unsigned int i=0;i<nADC;++i){
      70              : 
      71            0 :     adcstream << adcs[i] << ", ";
      72              :   }
      73              : 
      74              :   //dune::DAQLogger::LogInfo("SSP_EventPacket")<< adcstream.str() ;
      75              : 
      76              :   //dune::DAQLogger::LogInfo("SSP_EventPacket")<<std::endl<<"**************************************************" 
      77              :   //<<std::endl<<std::endl;
      78            0 : }
      79              : 
      80              : #endif // SSPMODULES_SRC_ANLBOARD_EVENTPACKET_CXX_
        

Generated by: LCOV version 2.0-1