11 #include <svd/modules/svdReconstruction/SVDDataFormatCheckModule.h>
27 setDescription(
"Checks the SVD data format: ");
28 setPropertyFlags(c_ParallelProcessingCertified);
30 addParam(
"SVDEventInfo", m_svdEventInfoName,
31 "SVDEventInfo name",
string(
""));
32 addParam(
"ShaperDigits", m_storeShaperDigitsName,
33 "ShaperDigits collection name",
string(
"SVDShaperDigits"));
34 addParam(
"DAQDiagnostics", m_storeDAQName,
35 "DAQDiagnostics collection name",
string(
"SVDDAQDiagnostics"));
36 addParam(
"maxProblematicEvents", m_maxProblematicEvts,
37 "maximum number of problematic events to display WARNING",
int(10));
41 SVDDataFormatCheckModule::~SVDDataFormatCheckModule()
49 m_evtMetaData.isRequired();
50 m_storeShaper.isRequired(m_storeShaperDigitsName);
51 m_storeSVDEvtInfo.isRequired(m_svdEventInfoName);
53 if (!m_storeSVDEvtInfo.isOptional(m_svdEventInfoName)) m_svdEventInfoName =
"SVDEventInfoSim";
54 m_storeSVDEvtInfo.isRequired(m_svdEventInfoName);
57 m_storeDAQ.isOptional(m_storeDAQName);
59 B2DEBUG(1,
" COLLECTIONS:");
60 B2DEBUG(1,
" --> Digits: " << m_storeShaperDigitsName);
61 B2DEBUG(1,
" --> Diagnostic: " << m_storeDAQName);
67 m_expNumber = m_evtMetaData->getExperiment();
68 m_runNumber = m_evtMetaData->getRun();
70 m_shutUpWarnings =
false;
71 m_problematicEvtsCounter = 0;
72 m_stripEvtsCounter = 0;
87 int evtNumber = m_evtMetaData->getEvent();
88 bool isProblematic =
false;
91 if (!m_storeShaper || !m_storeShaper.getEntries()) {
93 if (m_evtsCounter < m_maxProblematicEvts)
94 B2INFO(
"SVDDataFormatCheck: no " << m_storeShaperDigitsName <<
" in event " << evtNumber <<
" of exp " << m_expNumber <<
", run " <<
99 if (!m_storeSVDEvtInfo.isValid())
return;
101 SVDModeByte modeByte = m_storeSVDEvtInfo->getModeByte();
103 m_stripEvtsCounter++;
115 isProblematic =
true;
116 if (!m_shutUpWarnings)
117 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
118 " is apparently taken with 3-sample mode, this is not expected. [daqMode = " << daqMode <<
"]");
123 isProblematic =
true;
124 if (!m_shutUpWarnings)
125 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
126 " is apparently taken with 1-sample mode, this is not expected. [daqMode = " << daqMode <<
"]");
134 isProblematic =
true;
135 if (!m_shutUpWarnings)
136 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
137 " is apparently taken as Local Run, this is not expected. [evtType = " << evtType <<
"]");
147 isProblematic =
true;
148 if (!m_shutUpWarnings)
149 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
150 " is apparently not taken as ZeroSuppressed, this is not expected. [runType = " << runType <<
"]");
155 if (triggerBin < 0 || triggerBin > 3) {
157 isProblematic =
true;
158 if (!m_shutUpWarnings)
159 B2WARNING(
"SVDDataFormatCheck: the event " << evtNumber <<
" of exp " << m_expNumber <<
", run " << m_runNumber <<
160 " is apparently not with an unexpected trigger bin = " << triggerBin);
164 m_problematicEvtsCounter++;
166 if (m_problematicEvtsCounter > m_maxProblematicEvts)
167 m_shutUpWarnings =
true;
175 B2RESULT(
"SVDDataFormatCheck counters:");
176 B2RESULT(
"total number of events with at least one strip = " << m_stripEvtsCounter);
177 B2RESULT(
"total number of apparently problematic events = " << m_problematicEvtsCounter);
178 if (m_nLocalRunEvts > 0)
179 B2RESULT(
"total number local-run strips = " << m_nLocalRunEvts);
181 B2RESULT(
"total number of NOT zero-suppressed strips = " << m_nNoZSEvts);
182 if (m_nBadTBEvts > 0)
183 B2RESULT(
"total number of strips with wrong TB = " << m_nBadTBEvts);
184 if (m_n1samples > 0 || m_n3samples > 0) {
185 B2RESULT(
"total number of 1-sample strips = " << m_n1samples);
186 B2RESULT(
"total number of 3-sample strips = " << m_n3samples);
187 B2RESULT(
"total number of 6-sample strips = " << m_n6samples);