DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
EventPacket.cxx
Go to the documentation of this file.
1
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
16 data.clear();
17 header.header=0xDEADBEEF;
18}
19
21
22 u_int32_t peaksum = ((header.group3 & 0x00FF) >> 16) + header.peakSumLow;
23 if(peaksum & 0x00800000) {
24 peaksum |= 0xFF000000;
25 }
26 // clang-format off
27 //dune::DAQLogger::LogInfo("SSP_EventPacket")
28 TLOG_DEBUG(10)
29 << "=====HEADER=======================================" << std::endl
30 << "Header: " << header.header << std::endl
31 << "Length: " << header.length << std::endl
32 << "Trigger type: " << ((header.group1 & 0xFF00) >> 8) << std::endl
33 << "Status flags: " << ((header.group1 & 0x00F0) >> 4) << std::endl
34 << "Header type: " << ((header.group1 & 0x000F) >> 0) << std::endl
35 << "Trigger ID: " << header.triggerID << std::endl
36 << "Module ID: " << ((header.group2 & 0xFFF0) >> 4) << std::endl
37 << "Channel ID: " << ((header.group2 & 0x000F) >> 0) << std::endl
38 << "External timestamp (FP mode): " << std::endl
39 << " Sync delay: " << ((unsigned int)(header.timestamp[1]) << 16) + (unsigned int)(header.timestamp[0]) << std::endl
40 << " Sync count: " << ((unsigned int)(header.timestamp[3]) << 16) + (unsigned int)(header.timestamp[2]) << std::endl
41 << "External timestamp (NOvA mode): " << ((unsigned long)header.timestamp[3] << 48) +((unsigned long)header.timestamp[2] << 32) // NOLINT(runtime/int)
42 + ((unsigned long)header.timestamp[1] << 16) + (unsigned long)header.timestamp[0] <<std::endl // NOLINT(runtime/int)
43 << "Peak sum: " << peaksum << std::endl
44 << "Peak time: " << ((header.group3 & 0xFF00) >> 8) << std::endl
45 << "Prerise: " << ((header.group4 & 0x00FF) << 16) + header.preriseLow << std::endl
46 << "Integrated sum: " << ((unsigned int)(header.intSumHigh) << 8) + (((unsigned int)(header.group4) & 0xFF00) >> 8) << std::endl
47 << "Baseline: " << header.baseline << std::endl
48 << "CFD Timestamp interpolation points: " << header.cfdPoint[0] << " " << header.cfdPoint[1] << " " << header.cfdPoint[2] << " " << header.cfdPoint[3] << std::endl
49 << "Internal interpolation point: " << header.intTimestamp[0] << std::endl
50 << "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 << "=================================================="<< std::endl
52 << std::endl;
53 // clang-format on
54}
55
57
58 //dune::DAQLogger::LogInfo("SSP_EventPacket")<<"*****EVENT DUMP***********************************" <<std::endl<<std::endl;
59
60 this->DumpHeader();
61
62 //dune::DAQLogger::LogInfo("SSP_EventPacket")<<"=====ADC VALUES===================================" <<std::endl;
63
64 unsigned int nADC=data.size()*2;
65 unsigned short* adcs=reinterpret_cast<unsigned short*>(&(data[0])); // NOLINT
66
67 std::stringstream adcstream;
68
69 for(unsigned int i=0;i<nADC;++i){
70
71 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}
79
80#endif // SSPMODULES_SRC_ANLBOARD_EVENTPACKET_CXX_
dunedaq::sspmodules::EventHeader header
std::vector< unsigned int > data
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112