9#include <rawdata/modules/PrintData.h>
10#include <rawdata/dataobjects/RawPXD.h>
11#include <framework/core/InputController.h>
41 B2INFO(
"PrintData: Constructor done.");
46 for (
int i = 0; i < 10; i++)
hist[ i ] = NULL;
47 for (
int i = 0; i < 1000; i++)
prev_tv_eve[ i ] = 0;
49 for (
int i = 0; i < 1000; i++)
tv_flag[ i ] = 0;
55PrintDataModule::~PrintDataModule()
62 B2INFO(
"PrintData: initialize() started.");
70 B2INFO(
"PrintData: initialize() done.");
82 sprintf(title,
"Event Number");
83 sprintf(hname,
"h_00");
87 hist[ 0 ] =
new TH1F(hname, title, size, min, max);
88 sprintf(title,
"Size per COPPER");
89 sprintf(hname,
"h_01");
93 hist[ 1 ] =
new TH1F(hname, title, size, min, max);
94 sprintf(title,
"nodeid");
95 sprintf(hname,
"h_02");
99 hist[ 2 ] =
new TH1F(hname, title, size, min, max);
100 sprintf(hname,
"h_03");
101 sprintf(title,
"event rate");
105 hist[ 3 ] =
new TH1F(hname, title, size, min, max);
106 sprintf(hname,
"h_04");
107 sprintf(title,
"time difference");
111 hist[ 4 ] =
new TH1F(hname, title, size, min, max);
112 sprintf(title,
"time difference");
116 sprintf(hname,
"h_05");
117 hist[ 5 ] =
new TH1F(hname, title, size, min, max);
118 sprintf(hname,
"h_06");
119 hist[ 6 ] =
new TH1F(hname, title, size, min, max);
120 sprintf(hname,
"h_07");
121 hist[ 7 ] =
new TH1F(hname, title, size, min, max);
122 sprintf(hname,
"h_08");
123 hist[ 8 ] =
new TH1F(hname, title, size, min, max);
124 sprintf(hname,
"h_09");
125 hist[ 9 ] =
new TH1F(hname, title, size, min, max);
132 TFile f(
"temp.root",
"RECREATE");
135 for (
int i = 0; i < 10 ; i++) {
154 for (
int j = 0; j < nwords; j++) {
155 printf(
" %.8x", buf[ j ]);
156 if ((j + 1) % 10 == 0) {
172 printf(
"*******FTSW data**********: nwords %d\n", nwords);
180 rawftsw.
SetBuffer(buf, nwords, delete_flag, num_event, num_nodes);
186 printf(
"eve %u TLU %d: %d %d %.8x: tv %d %d\n",
192 (
int)(tv.tv_sec), (
int)(tv.tv_usec)
207 unsigned int eve = raw_copper->
GetEveNo(n);
209 if (array_index == 0 && n == 0) {
213 if (
hist[3]->GetEntries() == 0) {
226 float diff = (float)(tv.tv_sec -
prev_tv[ i ].tv_sec) + (float)(tv.tv_usec -
prev_tv[ i ].tv_usec) * 1.e-6 ;
227 hist[ 4 ]->Fill(diff);
228 hist[ 5 ]->Fill(diff);
233 float diff = (float)(tv.tv_sec -
prev_tv[ i ].tv_sec) + (float)(tv.tv_usec -
prev_tv[ i ].tv_usec) * 1.e-6 ;
234 hist[ 4 ]->Fill(-diff);
235 hist[ 5 ]->Fill(-diff);
252 if (eve % 10000 == 0) printf(
"1 %d %d\n", (
int)(tv.tv_sec) - 1422134556, (
int)eve);
266 hist[ 0 ]->Fill((
float)(eve));
271 for (
int i = 0; i < 4; i++) {
316 printf(
": block size %d bytes : bebafeca = %04x :\n",
317 (
int)raw_pxd->
size(), raw_pxd->
data()[0]);
318 printf(
"******* Raw PXD data block (including Detector Buffer) **********\n");
325 B2INFO(
"aPrintData: event() started.");
328 for (
int i = 0; i < raw_eclarray.
getEntries(); i++) {
329 for (
int j = 0; j < raw_eclarray[ i ]->GetNumEntries(); j++) {
void setDescription(const std::string &description)
Sets the description of the module.
unsigned int m_start_utime
Unix time of the run start.
int tv_flag[1000]
flag of timevalue
virtual void initialize() override
initialization
virtual void printFTSWEvent(RawDataBlock *raw_array, int i)
print the contents of a RawFTSW event
virtual void printBuffer(int *buf, int nwords)
print the hex dump of an input
virtual void event() override
Module functions to be called from event process.
virtual void endRun() override
Called if the current run ends.
PrintDataModule()
Constructor / Destructor.
int n_basf2evt
No. of sent events.
unsigned int prev_tv_eve[1000]
Integer time of the previous event.
timeval prev_tv[1000]
Time of the previous event.
int m_compressionLevel
Compression parameter.
int prev_tv_pos
previous timevalue
virtual void printPXDEvent(RawPXD *raw_pxd)
print a PXD event
TH1F * hist[10]
histogram array
virtual void printCOPPEREvent(RawCOPPER *raw_array, int i, int array_index)
print the contents of a RawCOPPER event
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
The RawDataBlock class Base class for rawdata handling.
virtual int * GetBuffer(int n)
get nth buffer pointer
virtual int GetBlockNwords(int n)
get size of a data block
unsigned int GetFTSWNodeID(int n)
Get Node # ( should be "TTD " )
unsigned int GetEveNo(int n)
Get event #.
int Get15bitTLUTag(int n)
DESY test only.
int GetNwordsHeader(int n)
Get # of words of header.
void GetTTTimeVal(int n, struct timeval *tv)
Get timeval from ctime and utime.
void SetBuffer(int *bufin, int nwords, int delete_flag, int num_events, int num_nodes) OVERRIDE_CPP17
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
virtual int * data(void)
get pointer to data
virtual int size() const
get size of buffer in 32 Bit words
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
unsigned int GetEveNo(int n)
get subrun #(8bit)
unsigned int GetTTUtime(int n)
Check if COPPER Magic words are correct.
int Get1stFINESSENwords(int n)
get data size of FINESSE slot A buffer
void GetTTTimeVal(int n, struct timeval *tv)
Get timeval.
unsigned int GetNodeID(int n)
get node-ID from data
Abstract base class for different kinds of events.