Belle II Software  release-05-02-19
DAQMonitor.cc
1 //+
2 // File : DAQMonitor.cc
3 // Description : Module to monitor raw data
4 //
5 // Author : Ryosuke Itoh, IPNS, KEK
6 // Date : 2 - Aug - 2013
7 //-
8 
9 /* Own header. */
10 #include <dqm/modules/DAQMonitor.h>
11 
12 /* ROOT headers. */
13 #include <TDirectory.h>
14 
15 using namespace Belle2;
16 
17 REG_MODULE(DAQMonitor)
18 
20 {
21  setDescription("This module produces general DAQ DQM histograms.");
22  setPropertyFlags(c_ParallelProcessingCertified);
23 }
24 
26 {
27  TDirectory* oldDir = gDirectory;
28  oldDir->mkdir("DAQ");
29  oldDir->cd("DAQ");
30  h_nEvt = new TH1F("Nevent", "Total Number of Events", 3, 0.0, 2.0);
31  h_pxdSize = new TH1F("PXDDataSize", "PXD Data Size;Size [kB];", 100, 0.0, 100.0);
32  h_svdSize = new TH1F("SVDDataSize", "SVD Data Size;Size [kB];", 100, 0.0, 100.0);
33  h_cdcSize = new TH1F("CDCDataSize", "CDC Data Size;Size [kB];", 100, 0.0, 100.0);
34  h_topSize = new TH1F("TOPDataSize", "TOP Data Size;Size [kB];", 100, 0.0, 100.0);
35  h_arichSize = new TH1F("ARICHDataSize", "ARICH Data Size;Size [kB];", 100, 0.0, 40.0);
36  h_eclSize = new TH1F("ECLDataSize", "ECL Data Size;Size [kB];", 100, 0.0, 100.0);
37  h_klmSize = new TH1F("KLMDataSize", "KLM Data Size;Size [kB];", 100, 0.0, 40.0);
38  h_trgSize = new TH1F("TRGDataSize", "TRG Data Size;Size [kB];", 100, 0.0, 40.0);
39  h_hltSize = new TH1F("HLTDataSize", "HLT (Total - PXD) Data Size;Size [kB];", 100, 0.0, 300.0);
40  h_totalSize = new TH1F("TotalDataSize", "Total (HLT + PXD) Data Size;Size [kB];", 100, 0.0, 300.0);
41  oldDir->cd();
42 }
43 
45 {
46  REG_HISTOGRAM;
47  m_pxdRaw.isOptional();
48  m_svdRaw.isOptional();
49  m_cdcRaw.isOptional();
50  m_topRaw.isOptional();
51  m_arichRaw.isOptional();
52  m_eclRaw.isOptional();
53  m_klmRaw.isOptional();
54  m_trgRaw.isOptional();
55 }
56 
58 {
59  h_nEvt->Reset();
60  h_pxdSize->Reset();
61  h_svdSize->Reset();
62  h_cdcSize->Reset();
63  h_topSize->Reset();
64  h_arichSize->Reset();
65  h_eclSize->Reset();
66  h_klmSize->Reset();
67  h_trgSize->Reset();
68  h_hltSize->Reset();
69  h_totalSize->Reset();
70 }
71 
73 {
74  // Total number of events: just fill the histogram with 1
75  h_nEvt->Fill(1.0);
76 
77  // Since sizeof returns the size in bytes (B),
78  // if we divide it by 1000 we obtain kilobytes (kB).
79 
80  // PXD
81  int pxdSize{0};
82  for (RawPXD& pxdRaw : m_pxdRaw)
83  pxdSize += (pxdRaw.size()) * sizeof(unsigned int);
84  h_pxdSize->Fill(static_cast<float>(pxdSize) / 1000.);
85 
86  // SVD
87  int svdSize{0};
88  for (RawSVD& svdRaw : m_svdRaw) // Loop over COPPERs
89  svdSize += svdRaw.GetBlockNwords(0) * sizeof(unsigned int);
90  h_svdSize->Fill(static_cast<float>(svdSize) / 1000.);
91 
92  // CDC
93  int cdcSize{0};
94  for (RawCDC& cdcRaw : m_cdcRaw) // Loop over COPPERs
95  cdcSize += cdcRaw.GetBlockNwords(0) * sizeof(unsigned int);
96  h_cdcSize->Fill(static_cast<float>(cdcSize) / 1000.);
97 
98  // TOP
99  int topSize{0};
100  for (RawTOP& topRaw : m_topRaw) // Loop over COPPERs
101  topSize += topRaw.GetBlockNwords(0) * sizeof(unsigned int);
102  h_topSize->Fill(static_cast<float>(topSize) / 1000.);
103 
104  // ARICH
105  int arichSize{0};
106  for (RawARICH& arichRaw : m_arichRaw) // Loop over COPPERs
107  arichSize += arichRaw.GetBlockNwords(0) * sizeof(unsigned int);
108  h_arichSize->Fill(static_cast<float>(arichSize) / 1000.);
109 
110  // ECL
111  int eclSize{0};
112  for (RawECL& eclRaw : m_eclRaw) // Loop over COPPERs
113  eclSize += eclRaw.GetBlockNwords(0) * sizeof(unsigned int);
114  h_eclSize->Fill(static_cast<float>(eclSize) / 1000.);
115 
116  // KLM
117  int klmSize{0};
118  for (RawKLM& klmRaw : m_klmRaw) // Loop over COPPERs
119  klmSize += klmRaw.GetBlockNwords(0) * sizeof(unsigned int);
120  h_klmSize->Fill(static_cast<float>(klmSize) / 1000.);
121 
122  // TRG
123  int trgSize{0};
124  for (RawTRG& trgRaw : m_trgRaw) // Loop over COPPERs
125  trgSize += trgRaw.GetBlockNwords(0) * sizeof(unsigned int);
126  h_trgSize->Fill(static_cast<float>(trgSize) / 1000.);
127 
128  // HLT size and total (HLT + PXD) size
129  int hltSize = svdSize + cdcSize + topSize + arichSize + eclSize + klmSize + trgSize;
130  h_hltSize->Fill(static_cast<float>(hltSize) / 1000.);
131  int totalSize = pxdSize + hltSize;
132  h_totalSize->Fill(static_cast<float>(totalSize) / 1000.);
133 }
Belle2::DAQMonitorModule::defineHisto
void defineHisto() override final
Histograms definition.
Definition: DAQMonitor.cc:25
Belle2::DAQMonitorModule::m_eclRaw
StoreArray< RawECL > m_eclRaw
ECL raw data.
Definition: DAQMonitor.h:106
Belle2::RawTRG
The Raw TOP class Class for RawCOPPER class data taken by TOP Currently, this class is almost same as...
Definition: RawTRG.h:27
Belle2::DAQMonitorModule::h_svdSize
TH1F * h_svdSize
Histogram for SVD data size.
Definition: DAQMonitor.h:64
Belle2::DAQMonitorModule::h_klmSize
TH1F * h_klmSize
Histogram for KLM data size.
Definition: DAQMonitor.h:79
Belle2::DAQMonitorModule::h_trgSize
TH1F * h_trgSize
Histogram for TRG data size.
Definition: DAQMonitor.h:82
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::RawSVD
The Raw SVD class Class for RawCOPPER class data taken by SVD Currently, this class is almost same as...
Definition: RawSVD.h:26
Belle2::DAQMonitorModule::m_cdcRaw
StoreArray< RawCDC > m_cdcRaw
CDC raw data.
Definition: DAQMonitor.h:97
Belle2::DAQMonitorModule::initialize
void initialize() override final
Initialize.
Definition: DAQMonitor.cc:44
Belle2::RawTOP
The Raw TOP class Class for RawCOPPER class data taken by TOP Currently, this class is almost same as...
Definition: RawTOP.h:27
Belle2::RawECL
The Raw ECL class Class for RawCOPPER class data taken by ECL Currently, this class is almost same as...
Definition: RawECL.h:26
Belle2::DAQMonitorModule::m_klmRaw
StoreArray< RawKLM > m_klmRaw
KLM raw data.
Definition: DAQMonitor.h:109
Belle2::DAQMonitorModule::h_cdcSize
TH1F * h_cdcSize
Histogram for CDC data size.
Definition: DAQMonitor.h:67
Belle2::RawARICH
The Raw ARICH class Class for RawCOPPER class data taken by ARICH Currently, this class is almost sam...
Definition: RawARICH.h:27
Belle2::DAQMonitorModule::h_hltSize
TH1F * h_hltSize
Histogram for HLT data size.
Definition: DAQMonitor.h:85
Belle2::RawPXD
The Raw PXD class.
Definition: RawPXD.h:28
Belle2::DAQMonitorModule::h_topSize
TH1F * h_topSize
Histogram for TOP data size.
Definition: DAQMonitor.h:70
Belle2::DAQMonitorModule::h_arichSize
TH1F * h_arichSize
Histogram for ARICH data size.
Definition: DAQMonitor.h:73
Belle2::DAQMonitorModule::m_svdRaw
StoreArray< RawSVD > m_svdRaw
SVD raw data.
Definition: DAQMonitor.h:94
Belle2::RawCDC
The Raw CDC class Class for RawCOPPER class data taken by CDC Currently, this class is almost same as...
Definition: RawCDC.h:27
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RawKLM
The Raw KLM class Class for RawCOPPER class data taken by KLM.
Definition: RawKLM.h:27
Belle2::DAQMonitorModule::m_trgRaw
StoreArray< RawTRG > m_trgRaw
TRG raw data.
Definition: DAQMonitor.h:112
Belle2::DAQMonitorModule::h_totalSize
TH1F * h_totalSize
Histogram for total data size.
Definition: DAQMonitor.h:88
Belle2::DAQMonitorModule::m_arichRaw
StoreArray< RawARICH > m_arichRaw
ARICH raw data.
Definition: DAQMonitor.h:103
Belle2::DAQMonitorModule::h_eclSize
TH1F * h_eclSize
Histogram for ECL data size.
Definition: DAQMonitor.h:76
Belle2::DAQMonitorModule::m_topRaw
StoreArray< RawTOP > m_topRaw
TOP raw data.
Definition: DAQMonitor.h:100
Belle2::DAQMonitorModule::h_pxdSize
TH1F * h_pxdSize
Histogram for PXD data size.
Definition: DAQMonitor.h:61
Belle2::DAQMonitorModule::h_nEvt
TH1F * h_nEvt
Histogram for total number of events.
Definition: DAQMonitor.h:58
Belle2::DAQMonitorModule::event
void event() override final
Event.
Definition: DAQMonitor.cc:72
Belle2::DAQMonitorModule::beginRun
void beginRun() override final
Begin run.
Definition: DAQMonitor.cc:57
Belle2::DAQMonitorModule::m_pxdRaw
StoreArray< RawPXD > m_pxdRaw
PXD raw data.
Definition: DAQMonitor.h:91
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::DAQMonitorModule
A module for producing general DAQ DQM histograms.
Definition: DAQMonitor.h:33