9 #include <svd/modules/svdSimulation/SVDZeroSuppressionEmulatorModule.h>
25 setDescription(
"Filters out SVDShaperDigit with less than 1 (default) sample is below a certain threshold, by default set at SN = 3.");
26 setPropertyFlags(c_ParallelProcessingCertified);
28 addParam(
"FADCmode", m_FADCmode,
29 "FADC mode: if true the approximation to integer is done",
bool(
true));
30 addParam(
"ShaperDigits", m_storeShaperDigitsName,
31 "ShaperDigits collection name",
string(
""));
32 addParam(
"ShaperDigitsIN", m_SVDShaperDigitsIN,
33 "Kept ShaperDigits collection name",
string(
""));
34 addParam(
"ShaperDigitsOUT", m_SVDShaperDigitsOUT,
35 "ShaperDigits collection name",
string(
""));
36 addParam(
"SNthreshold", m_cutSN,
37 "minimum SN to be kept",
float(3));
38 addParam(
"numberOfSamples", m_nSample,
39 "number of samples above threshold to be kept ",
int(1));
40 addParam(
"createOUTStripsList", m_createOutside,
41 "create the StoreArray of outside strips",
bool(
false));
47 SVDZeroSuppressionEmulatorModule::~SVDZeroSuppressionEmulatorModule()
54 m_storeShaper.isRequired(m_storeShaperDigitsName);
56 if (m_storeShaperDigitsName == m_SVDShaperDigitsIN) {
57 m_selectorIN.registerSubset(m_storeShaper);
60 m_selectorIN.inheritAllRelations();
63 if (m_createOutside) {
64 if (m_storeShaperDigitsName == m_SVDShaperDigitsOUT) {
65 m_selectorOUT.registerSubset(m_storeShaper);
67 m_selectorOUT.registerSubset(m_storeShaper, m_SVDShaperDigitsOUT);
68 m_selectorOUT.inheritAllRelations();
79 if (!m_storeShaper || !m_storeShaper.getEntries())
return;
81 m_selectorIN.select([&](
const SVDShaperDigit * shaper) {
return this->passesZS(shaper) ;});
84 m_selectorOUT.select([&](
const SVDShaperDigit * shaper) {
return ! this->passesZS(shaper) ;});
86 B2DEBUG(10,
" shaper digits = " << m_storeShaper.getEntries() <<
90 B2DEBUG(10,
" shaper digits = " << m_storeShaper.getEntries() <<
104 float noise = m_NoiseCal.getNoise(thisSensorID, thisSide, thisCellID);
105 float cutMinSignal = m_cutSN * noise;
109 cutMinSignal = cutMinSignal + 0.5;
110 cutMinSignal = (int)cutMinSignal;
113 if (shaper->
passesZS(m_nSample, cutMinSignal))
@ c_WriteOut
Object/array should be saved by output modules.
The SVD ShaperDigit class.
bool passesZS(int nSamples, float cutMinSignal) const
does the strip pass the ZS cut?
VxdID getSensorID() const
Get the sensor ID.
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
This module filters out strips that do not pass a ZS cut from the SVDShaperDigit StoreArray.
virtual void initialize() override
Initialize the SVDZeroSuppressionEmulator.
virtual void event() override
This method is the core of the SVDZeroSuppressionEmulator.
bool passesZS(const SVDShaperDigit *)
returns true if the strip passes the ZS cut
Accessor to arrays stored in the data store.
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.
Abstract base class for different kinds of events.