AdcCodeHelper.cxx
Go to the documentation of this file.
1 // AdcCodeHelper.cxx
2 
4 #include <cmath>
5 
6 //**********************************************************************
7 
9 : m_SuppressedSignalMax(aSuppressedSignalMax) { }
10 
11 //**********************************************************************
12 
14  const unsigned int onemask = 0x003f;
15  unsigned int lsb= sig & onemask;
16  bool allzero = lsb == 0;
17  bool allone = lsb == onemask;
18  return allzero || allone;
19 }
20 
21 //**********************************************************************
22 
24  if ( m_SuppressedSignalMax <= 0.0 ) return false;
25  AdcSignal pedsignal = sig - ped;
26  return std::abs(pedsignal) < m_SuppressedSignalMax;
27 }
28 
29 //**********************************************************************
30 
32  if ( fsig > 0.1 ) return AdcCount(fsig + 0.5);
33  if ( fsig < -0.1 ) return -AdcCount(-fsig + 0.5);
34  return 0;
35 }
36 
37 //**********************************************************************
38 
40  return sig - ped;
41 }
42 
43 //**********************************************************************
44 
46  return intSignal(subtract(sig, ped));
47 }
48 
49 //**********************************************************************
AdcCount intSignal(AdcSignal fsig) const
AdcCodeHelper(AdcCount aSuppressedSignalMax=0)
float AdcSignal
Definition: AdcTypes.h:21
const unsigned int onemask
Definition: raw.h:139
AdcSignal m_SuppressedSignalMax
Definition: AdcCodeHelper.h:47
T abs(T value)
AdcSignal subtract(AdcCount sig, AdcSignal ped) const
AdcCount intSubtract(AdcCount sig, AdcSignal ped) const
bool isSmall(AdcCount sig, AdcSignal ped=0.0)
bool hasStickyBits(AdcCount sig)
short AdcCount
Definition: AdcTypes.h:18