Public Member Functions | Private Attributes | List of all members
AdcCodeHelper Class Reference

#include <AdcCodeHelper.h>

Public Member Functions

 AdcCodeHelper (AdcCount aSuppressedSignalMax=0)
 
bool hasStickyBits (AdcCount sig)
 
bool isSmall (AdcCount sig, AdcSignal ped=0.0)
 
AdcCount intSignal (AdcSignal fsig) const
 
AdcSignal subtract (AdcCount sig, AdcSignal ped) const
 
AdcCount intSubtract (AdcCount sig, AdcSignal ped) const
 

Private Attributes

AdcSignal m_SuppressedSignalMax
 

Detailed Description

Definition at line 20 of file AdcCodeHelper.h.

Constructor & Destructor Documentation

AdcCodeHelper::AdcCodeHelper ( AdcCount  aSuppressedSignalMax = 0)

Definition at line 8 of file AdcCodeHelper.cxx.

9 : m_SuppressedSignalMax(aSuppressedSignalMax) { }
AdcSignal m_SuppressedSignalMax
Definition: AdcCodeHelper.h:47

Member Function Documentation

bool AdcCodeHelper::hasStickyBits ( AdcCount  sig)

Definition at line 13 of file AdcCodeHelper.cxx.

13  {
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 }
const unsigned int onemask
Definition: raw.h:139
AdcCount AdcCodeHelper::intSignal ( AdcSignal  fsig) const

Definition at line 31 of file AdcCodeHelper.cxx.

31  {
32  if ( fsig > 0.1 ) return AdcCount(fsig + 0.5);
33  if ( fsig < -0.1 ) return -AdcCount(-fsig + 0.5);
34  return 0;
35 }
short AdcCount
Definition: AdcTypes.h:18
AdcCount AdcCodeHelper::intSubtract ( AdcCount  sig,
AdcSignal  ped 
) const

Definition at line 45 of file AdcCodeHelper.cxx.

45  {
46  return intSignal(subtract(sig, ped));
47 }
AdcCount intSignal(AdcSignal fsig) const
AdcSignal subtract(AdcCount sig, AdcSignal ped) const
bool AdcCodeHelper::isSmall ( AdcCount  sig,
AdcSignal  ped = 0.0 
)

Definition at line 23 of file AdcCodeHelper.cxx.

23  {
24  if ( m_SuppressedSignalMax <= 0.0 ) return false;
25  AdcSignal pedsignal = sig - ped;
26  return std::abs(pedsignal) < m_SuppressedSignalMax;
27 }
float AdcSignal
Definition: AdcTypes.h:21
AdcSignal m_SuppressedSignalMax
Definition: AdcCodeHelper.h:47
T abs(T value)
AdcSignal AdcCodeHelper::subtract ( AdcCount  sig,
AdcSignal  ped 
) const

Definition at line 39 of file AdcCodeHelper.cxx.

39  {
40  return sig - ped;
41 }

Member Data Documentation

AdcSignal AdcCodeHelper::m_SuppressedSignalMax
private

Definition at line 47 of file AdcCodeHelper.h.


The documentation for this class was generated from the following files: