9 #include <pxd/modules/pxdHelper/PXDBadSensorTagModule.h>
10 #include <framework/core/ModuleParam.templateDetails.h>
16 using namespace Belle2::PXD::PXDError;
26 setDescription(
"Mark bad-data PXD modules");
27 setPropertyFlags(c_ParallelProcessingCertified);
28 addParam(
"zeroSuppressionCut", m_0cut,
"Minimum charge for a raw hit to carry", 0);
29 addParam(
"nrHitsCut", m_nrHitsCut,
"Cut on nr hits per module [[id1,cut1],[id1,cut2],...]");
32 void PXDBadSensorTagModule::initialize()
35 m_storeRawHits.isRequired(m_PXDRawHitsName);
36 m_storeDAQEvtStats.isRequired(m_PXDDAQEvtStatsName);
38 for (
auto& m : m_nrHitsCut) {
39 if (m.size() != 2) { B2ERROR(
"Wrong nr of Parameter " << m.size());
continue;}
40 m_cut[
VxdID(m[0])] = m[1];
44 void PXDBadSensorTagModule::event()
46 std::map <VxdID, int> freq;
47 for (
auto& p : m_storeRawHits) {
48 if (p.getCharge() < m_0cut)
continue;
49 freq[p.getSensorID()]++;
52 for (
auto& p : *m_storeDAQEvtStats) {
55 if (freq[e.getSensorID()] > m_cut[e.getSensorID()]) {
The PXD bad sensor tagger module.
Class to uniquely identify a any structure of the PXD and SVD.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.