ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::ShapeInfo Class Referencefinal

#include <ShapeInfo.h>

Collaboration diagram for LArSamples::ShapeInfo:

Public Member Functions

 ShapeInfo (unsigned char nSamples=5, unsigned char binSize=3, unsigned char nPhases=8, float shift=0)
 Constructor.
 ShapeInfo (const ShapeInfo &other)
 ~ShapeInfo ()
unsigned int nPoints () const
unsigned char binSize () const
unsigned char nSamples () const
unsigned char nPhases () const
unsigned int nIntervals () const
float shift () const
double value (unsigned int i) const
unsigned char phase (unsigned int i) const
void set (unsigned char iSample, unsigned char iPhase, float value)
bool isValid () const
double footprint () const

Static Public Member Functions

static double timeShift ()
static void setTimeShift (double shift=0)

Static Public Attributes

static constexpr unsigned int nBuckets = 24

Private Member Functions

ShapeInfooperator= (const ShapeInfo &)

Private Attributes

std::vector< short > m_values
unsigned char m_nSamples
unsigned char m_binSize
unsigned char m_nPhases
float m_shift

Static Private Attributes

static double m_timeShift = 0

Detailed Description

Definition at line 24 of file ShapeInfo.h.

Constructor & Destructor Documentation

◆ ShapeInfo() [1/2]

ShapeInfo::ShapeInfo ( unsigned char nSamples = 5,
unsigned char binSize = 3,
unsigned char nPhases = 8,
float shift = 0 )

Constructor.

Definition at line 28 of file ShapeInfo.cxx.

30{
32 unsigned int nPoints = nIntervals()*(nSamples - 1) + nPhases;
33 m_values.resize(nPoints, 0);
34}
unsigned char m_binSize
Definition ShapeInfo.h:70
unsigned char m_nSamples
Definition ShapeInfo.h:70
unsigned char nPhases() const
Definition ShapeInfo.h:40
float shift() const
Definition ShapeInfo.h:42
unsigned char binSize() const
Definition ShapeInfo.h:38
unsigned int nPoints() const
Definition ShapeInfo.h:37
std::vector< short > m_values
Definition ShapeInfo.h:69
unsigned int nIntervals() const
Definition ShapeInfo.h:41
unsigned char m_nPhases
Definition ShapeInfo.h:70
unsigned char nSamples() const
Definition ShapeInfo.h:39

◆ ShapeInfo() [2/2]

ShapeInfo::ShapeInfo ( const ShapeInfo & other)

Definition at line 37 of file ShapeInfo.cxx.

38 : m_values(other.m_values),
39 m_nSamples(other.m_nSamples), m_binSize(other.m_binSize),
40 m_nPhases(other.m_nPhases), m_shift(other.m_shift)
41{
43}

◆ ~ShapeInfo()

ShapeInfo::~ShapeInfo ( )

Definition at line 46 of file ShapeInfo.cxx.

Member Function Documentation

◆ binSize()

unsigned char LArSamples::ShapeInfo::binSize ( ) const
inline

Definition at line 38 of file ShapeInfo.h.

38{ return m_binSize; } // in ns. 3 ns for now, may move to 1 ns

◆ footprint()

double LArSamples::ShapeInfo::footprint ( ) const
inline

Definition at line 55 of file ShapeInfo.h.

55{ return sizeof(*this) + m_values.size()*sizeof(short); }

◆ isValid()

bool ShapeInfo::isValid ( ) const

Definition at line 52 of file ShapeInfo.cxx.

53{
54 return (!m_values.empty());
55}

◆ nIntervals()

unsigned int LArSamples::ShapeInfo::nIntervals ( ) const
inline

Definition at line 41 of file ShapeInfo.h.

41{ return nBuckets/binSize(); }
static constexpr unsigned int nBuckets
Definition ShapeInfo.h:62

◆ nPhases()

unsigned char LArSamples::ShapeInfo::nPhases ( ) const
inline

Definition at line 40 of file ShapeInfo.h.

40{ return m_nPhases; }

◆ nPoints()

unsigned int LArSamples::ShapeInfo::nPoints ( ) const
inline
Returns
size

Definition at line 37 of file ShapeInfo.h.

37{ return m_values.size() + 1; } // add one more point by extrapolation

◆ nSamples()

unsigned char LArSamples::ShapeInfo::nSamples ( ) const
inline

Definition at line 39 of file ShapeInfo.h.

39{ return m_nSamples; }

◆ operator=()

ShapeInfo & LArSamples::ShapeInfo::operator= ( const ShapeInfo & )
private

◆ phase()

unsigned char ShapeInfo::phase ( unsigned int i) const

Definition at line 66 of file ShapeInfo.cxx.

67{
68 return (i % nIntervals());
69}

◆ set()

void ShapeInfo::set ( unsigned char iSample,
unsigned char iPhase,
float value )

Definition at line 72 of file ShapeInfo.cxx.

73{
74 unsigned int index = iPhase + iSample*nIntervals();
75 m_values[index] = int(value*32767 + 0.5) + (value > 0 ? 0 : -1);
76}
double value(unsigned int i) const
Definition ShapeInfo.cxx:58
str index
Definition DeMoScan.py:362

◆ setTimeShift()

void LArSamples::ShapeInfo::setTimeShift ( double shift = 0)
inlinestatic

Definition at line 65 of file ShapeInfo.h.

65{ m_timeShift = shift; }
static double m_timeShift
Definition ShapeInfo.h:72

◆ shift()

float LArSamples::ShapeInfo::shift ( ) const
inline

Definition at line 42 of file ShapeInfo.h.

42{ return m_shift + m_timeShift; }

◆ timeShift()

double LArSamples::ShapeInfo::timeShift ( )
inlinestatic

Definition at line 64 of file ShapeInfo.h.

64{ return m_timeShift; }

◆ value()

double ShapeInfo::value ( unsigned int i) const
Returns
data points

Definition at line 58 of file ShapeInfo.cxx.

59{
60 if (i < m_values.size()) return double(m_values[i])/32767;
61 if (i == m_values.size() && m_values.size() >= 2)
62 return 2*value(i - 1) - value(i - 2);
63 return -1E99;
64}

Member Data Documentation

◆ m_binSize

unsigned char LArSamples::ShapeInfo::m_binSize
private

Definition at line 70 of file ShapeInfo.h.

◆ m_nPhases

unsigned char LArSamples::ShapeInfo::m_nPhases
private

Definition at line 70 of file ShapeInfo.h.

◆ m_nSamples

unsigned char LArSamples::ShapeInfo::m_nSamples
private

Definition at line 70 of file ShapeInfo.h.

◆ m_shift

float LArSamples::ShapeInfo::m_shift
private

Definition at line 71 of file ShapeInfo.h.

◆ m_timeShift

double ShapeInfo::m_timeShift = 0
staticprivate

Definition at line 72 of file ShapeInfo.h.

◆ m_values

std::vector<short> LArSamples::ShapeInfo::m_values
private

Definition at line 69 of file ShapeInfo.h.

◆ nBuckets

unsigned int LArSamples::ShapeInfo::nBuckets = 24
staticconstexpr

Definition at line 62 of file ShapeInfo.h.


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