9 #include <svd/modules/svdReconstruction/SVDDataFormatCheckModule.h>
25 setDescription(
"Checks the SVD data format: ");
26 setPropertyFlags(c_ParallelProcessingCertified);
28 addParam(
"SVDEventInfo", m_svdEventInfoName,
29 "SVDEventInfo name",
string(
""));
30 addParam(
"ShaperDigits", m_storeShaperDigitsName,
31 "ShaperDigits collection name",
string(
"SVDShaperDigits"));
32 addParam(
"DAQDiagnostics", m_storeDAQName,
33 "DAQDiagnostics collection name",
string(
"SVDDAQDiagnostics"));
34 addParam(
"maxProblematicEvents", m_maxProblematicEvts,
35 "maximum number of problematic events to display WARNING",
int(10));
39 SVDDataFormatCheckModule::~SVDDataFormatCheckModule()
47 m_evtMetaData.isRequired();
48 m_storeShaper.isRequired(m_storeShaperDigitsName);
49 m_storeSVDEvtInfo.isRequired(m_svdEventInfoName);
51 if (!m_storeSVDEvtInfo.isOptional(m_svdEventInfoName)) m_svdEventInfoName =
"SVDEventInfoSim";
52 m_storeSVDEvtInfo.isRequired(m_svdEventInfoName);
55 m_storeDAQ.isOptional(m_storeDAQName);
57 B2DEBUG(29,
" COLLECTIONS:");
58 B2DEBUG(29,
" --> Digits: " << m_storeShaperDigitsName);
59 B2DEBUG(29,
" --> Diagnostic: " << m_storeDAQName);
65 m_expNumber = m_evtMetaData->getExperiment();
66 m_runNumber = m_evtMetaData->getRun();
68 m_shutUpWarnings =
false;
69 m_problematicEvtsCounter = 0;
70 m_stripEvtsCounter = 0;
85 int evtNumber = m_evtMetaData->getEvent();
86 bool isProblematic =
false;
89 if (!m_storeShaper || !m_storeShaper.getEntries()) {
91 if (m_evtsCounter < m_maxProblematicEvts)
92 B2INFO(
"SVDDataFormatCheck: no " << m_storeShaperDigitsName <<
" in event " << evtNumber <<
" of exp " << m_expNumber <<
", run " <<
97 if (!m_storeSVDEvtInfo.isValid())
return;
99 SVDModeByte modeByte = m_storeSVDEvtInfo->getModeByte();
101 m_stripEvtsCounter++;
113 isProblematic =
true;
114 if (!m_shutUpWarnings)
115 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
116 " is apparently taken with 3-sample mode, this is not expected. [daqMode = " << daqMode <<
"]");
121 isProblematic =
true;
122 if (!m_shutUpWarnings)
123 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
124 " is apparently taken with 1-sample mode, this is not expected. [daqMode = " << daqMode <<
"]");
132 isProblematic =
true;
133 if (!m_shutUpWarnings)
134 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
135 " is apparently taken as Local Run, this is not expected. [evtType = " << evtType <<
"]");
145 isProblematic =
true;
146 if (!m_shutUpWarnings)
147 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
148 " is apparently not taken as ZeroSuppressed, this is not expected. [runType = " << runType <<
"]");
153 if (triggerBin < 0 || triggerBin > 3) {
155 isProblematic =
true;
156 if (!m_shutUpWarnings)
157 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
158 " is apparently not with an unexpected trigger bin = " << triggerBin);
162 m_problematicEvtsCounter++;
164 if (m_problematicEvtsCounter > m_maxProblematicEvts)
165 m_shutUpWarnings =
true;
173 B2RESULT(
"SVDDataFormatCheck counters:");
174 B2RESULT(
"total number of events with at least one strip = " << m_stripEvtsCounter);
175 B2RESULT(
"total number of apparently problematic events = " << m_problematicEvtsCounter);
176 if (m_nLocalRunEvts > 0)
177 B2RESULT(
"total number local-run strips = " << m_nLocalRunEvts);
179 B2RESULT(
"total number of NOT zero-suppressed strips = " << m_nNoZSEvts);
180 if (m_nBadTBEvts > 0)
181 B2RESULT(
"total number of strips with wrong TB = " << m_nBadTBEvts);
182 if (m_n1samples > 0 || m_n3samples > 0) {
183 B2RESULT(
"total number of 1-sample strips = " << m_n1samples);
184 B2RESULT(
"total number of 3-sample strips = " << m_n3samples);
185 B2RESULT(
"total number of 6-sample strips = " << m_n6samples);
Class to store SVD mode information.
baseType getRunType() const
Get the runMode id.
baseType getEventType() const
Get the eventMode id.
baseType getTriggerBin() const
Get the triggerBin id.
baseType getDAQMode() const
Get the daqMode id.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.