45 if ( isig > nsig ) jsig1 = isig - nsig;
47 if ( jsig2 > sigs.size() ) jsig2 = sigs.size();
48 for (
Index jsig=jsig1; jsig<jsig2; ++jsig ) {
52 Index lsb = rawsig & 0x3f;
53 if ( lsb == 0 )
continue;
54 if ( lsb == 0x3f )
continue;
57 if (
abs(sig) > thresh ) {
65 if ( state ==
OUT )
return "OUT";
66 if ( state ==
LIVE )
return "LIVE";
67 if ( state ==
DEAD )
return "DEAD";
68 if ( state ==
END )
return "END";
79 : m_ts(ts), m_tl(tl), m_td(td), m_ns(ns), m_nl(nl), m_nd(nd), m_nt(nt),
87 const string myname =
"Dune35tZeroSuppressService::ctor: ";
103 const string myname =
"ZeroSuppress35t::filter: ";
104 if (
m_LogLevel >= 2 ) cout << myname <<
"Filtering channel " << chan <<
" with tick count " << sigs.size() <<
endl;
105 bool m_skipStuck =
false;
107 unsigned int nsig = sigs.size();
109 keep.resize(nsig,
false);
112 unsigned int nlow = 0;
113 for (
unsigned int isig=0; isig<nsig; ++isig ) {
116 RunningSum
rs(sigs, ped, isig,
m_ns, m_ts, m_skipStuck);
120 if ( state ==
OUT || state ==
END ) {
124 bool keepit = asigsum > sumthresh;
125 if (
m_LogLevel >= 3 ) cout << myname <<
" RS sum/thresh=" <<
setw(3) << rs.sigsum <<
"/" <<
setw(3) << sumthresh <<
endl;
127 if (
m_LogLevel == 2 ) cout << myname <<
setw(6) << isig <<
": RS sum/thresh=" <<
setw(3) << rs.sigsum
128 <<
"/" <<
setw(3) << sumthresh <<
endl;
130 unsigned int jsig1 = 0;
131 if ( isig >
m_nl ) jsig1 = isig -
m_nl;
132 unsigned int jsig2 = isig;
133 for (
unsigned int jsig=jsig1; jsig<jsig2; ++jsig) {
142 if (
m_LogLevel >= 3 ) cout << myname <<
" RS sum/thresh=" <<
setw(3) << rs.sigsum <<
"/" <<
setw(3) << sumthresh <<
endl;
143 if ( state ==
LIVE ) {
145 if ( asigsum <= sumthresh ) {
150 }
else if ( state ==
DEAD ) {
152 if ( asigsum > sumthresh ) {
158 }
else if ( ++nlow >=
m_nd ) {
162 unsigned int jsig1 = isig + 1;
163 unsigned int jsig2 = jsig1 +
m_nt;
164 if ( jsig2 > nsig ) jsig2 = nsig;
165 for (
unsigned int jsig=jsig1; jsig<jsig2; ++jsig) {
173 if ( state !=
OUT ) keep[isig] =
true;
181 out << prefix <<
" TS = " <<
m_ts <<
endl;
182 out << prefix <<
" TL = " <<
m_tl <<
endl;
183 out << prefix <<
" TD = " <<
m_td <<
endl;
184 out << prefix <<
" NS = " <<
m_ns <<
endl;
185 out << prefix <<
" NL = " <<
m_nl <<
endl;
186 out << prefix <<
" ND = " <<
m_nd <<
endl;
187 out << prefix <<
" NT = " <<
m_nt <<
endl;
std::vector< AdcCount > AdcCountVector
Dune35tZeroSuppressService(AdcCount ts, AdcCount tl, AdcCount td, Index ns, Index nl, Index nd, Index nt)
int filter(const AdcCountVector &sigs, Channel chan, AdcPedestal ped, AdcFilterVector &keep) const
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
Dune35tZeroSuppressService::Index Index
T get(std::string const &key) const
Q_EXPORT QTSManip setw(int w)
std::vector< bool > AdcFilterVector
std::optional< T > get_if_present(std::string const &key) const
std::string nl(std::size_t i=1)
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)