AmountGlobalStrategy.cc
Go to the documentation of this file.
1 #include "AmountGlobalStrategy.h"
2 //
3 #include <utl/Trace.h>
4 
5 namespace MdMuonCounterAG {
6 
7  AmountGlobalStrategy::AmountGlobalStrategy(double nOnesPerPatternMatch, unsigned int nMinOnes) :
8  fNOnesPerPatternMatch(nOnesPerPatternMatch),
9  fNMinOnes(nMinOnes)
10  {
11  }
12 
13  double
15  const
16  {
17  unsigned int nOnes = 0;
18  for (utl::TraceB::SizeType i = 0; i < samples.GetSize(); ++i) {
19  if (samples[i])
20  nOnes++;
21  }
22  if (fNMinOnes > nOnes)
23  nOnes = 0;
24 
25  double nPatternMatchs = nOnes/fNOnesPerPatternMatch;
26  return nPatternMatchs;
27  }
28 }
29 
AmountGlobalStrategy(double nOnesPerPatternMatch, unsigned int nMinOnes)
Creates a functor.
std::vector< T >::size_type SizeType
Definition: Trace.h:58
SizeType GetSize() const
Definition: Trace.h:156
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
double operator()(const utl::TraceB &samples) const
Performs the counting.

, generated on Tue Sep 26 2023.