Belle II Software development
MonitorData.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <daq/dqm/modules/MonitorData.h>
9
10#include <framework/datastore/StoreArray.h>
11#include <rawdata/dataobjects/RawCOPPER.h>
12
13using namespace std;
14using namespace Belle2;
15
16
17//#define DEBUG
18
19//-----------------------------------------------------------------
20// Register the Module
21//-----------------------------------------------------------------
22REG_MODULE(MonitorData);
23
24//-----------------------------------------------------------------
25// Implementation
26//-----------------------------------------------------------------
27
29{
30 //Set module properties
31
32 setDescription("Monitor Raw Data");
34 m_nevt = -1;
35
36}
37
38
39
40MonitorDataModule::~MonitorDataModule()
41{
42}
43
45{
46 h_ncpr = new TH1F("NumCOPPER", "Number of COPPERs", 10, 0.0, 10.0);
47 h_nevt = new TH1F("Nevent COPPER", "Number of Events", 10, 0.0, 10.0);
48 h_size = new TH1F("Data Size COPPER", "Data Size", 100, 0.0, 2000.0);
49 h_size2d = new TH2F("Data Size vs. Cpr", "Data Size vs. Copper", 100, 0.0, 2000.0, 5, 0.0, 5.0);
50}
51
52
54{
55 REG_HISTOGRAM
56}
57
58
60{
61 B2INFO("beginRun called.");
62}
63
64
65
66
68{
69 //fill Run data
70
71 B2INFO("endRun done.");
72}
73
74
76{
77 B2INFO("terminate called");
78}
79
80
81
82//
83// User defined functions
84//
85
86
88{
89 h_nevt->Fill((float)m_nevt);
90 StoreArray<RawCOPPER> rawcprarray;
91
92 int ncpr = rawcprarray.getEntries();
93 h_ncpr->Fill((float)ncpr);
94
95 for (int j = 0; j < ncpr; j++) {
96 for (int i = 0; i < rawcprarray[ j ]->GetNumEntries(); i++) {
97
98 //int* buf;
99 //buf = rawcprarray[ j ]->GetBuffer(i);
100
101 int size_byte = rawcprarray[ j ]->GetBlockNwords(i) * sizeof(int);
102 h_size->Fill((float)size_byte);
103 h_size2d->Fill((float)size_byte, (float)j);
104
105
106// printf("=== event====\n exp %d run %d eve %d copperNode %d type %d size %d byte\n",
107// rawcprarray[ j ]->GetExpNo( i ),
108// rawcprarray[ j ]->GetRunNo( i ),
109// rawcprarray[ j ]->GetEveNo( i ),
110// rawcprarray[ j ]->GetSubsysId( i ),
111// rawcprarray[ j ]->GetDataType( i ),
112// size_byte);
113
114
115 //int* finesse_buf_1st = rawcprarray[ j ]->Get1stFINESSEBuffer(i);
116 //int* finesse_buf_2nd = rawcprarray[ j ]->Get2ndFINESSEBuffer(i);
117 //int* finesse_buf_3rd = rawcprarray[ j ]->Get3rdFINESSEBuffer(i);
118 //int* finesse_buf_4th = rawcprarray[ j ]->Get4thFINESSEBuffer(i);
119 // printf("FEEbuf %p %p %p %p\n", fee_buf_1st, fee_buf_2nd, fee_buf_3rd, fee_buf_4th);
120 }
121 }
122 m_nevt++;
123
124}
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
int m_nevt
No. of sent events.
Definition: MonitorData.h:50
void initialize() override
Module functions to be called from main process.
Definition: MonitorData.cc:53
void event() override
Function to process event record.
Definition: MonitorData.cc:87
void endRun() override
Function to process end_run record.
Definition: MonitorData.cc:67
void terminate() override
Function to terminate module.
Definition: MonitorData.cc:75
void beginRun() override
Module functions to be called from event process.
Definition: MonitorData.cc:59
TH1F * h_ncpr
Histograms.
Definition: MonitorData.h:53
MonitorDataModule()
Constructor / Destructor.
Definition: MonitorData.cc:28
void defineHisto() override
Histogram definition.
Definition: MonitorData.cc:44
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
STL namespace.