3 #include <mevt/ChannelRecData.h>
9 namespace MdMuonCounterAG {
12 fWindowSize(windowSize) ,
23 unsigned int nPatternMatchs = 0;
30 typedef std::deque<std::pair<unsigned int, unsigned int> > Window;
31 typedef Window::const_iterator WinItor;
34 unsigned int nZeros = 0;
39 if (samples[ sNumber ]) {
41 win.push_back(std::make_pair(sNumber, 0));
42 }
else if (! win.empty()){
63 WinItor wIt = win.begin();
64 for(; wIt!=win.end(); ++wIt){
68 sumZeros+=(*wIt).second;
81 if (
fOpt==
"strict" ) {
88 for (
bool first=
true; wIt!=win.end(); ++wIt, first=
false) {
89 if( !first) sumOnes+=1;
91 double DeltaOnes = (win.back().first-win.front().first);
96 else if ( (1<DeltaOnes)&&(DeltaOnes<(
fNumGaps+1)) )
119 nZeros -= win.front().second;
126 return nPatternMatchs;
std::vector< T >::size_type SizeType
unsigned int operator()(const utl::TraceB &samples, mevt::ChannelRecData &recData) const
Performs the counting.
void AddPatternMatchBin(unsigned int bin)
Adds the time of a pattern match detection.
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
GapStrategy(unsigned int windowSize, unsigned int nOnes, unsigned int nGaps, const std::string opt="strict")
Creates a functor.
Channel level reconstruction data.