ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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
More...
 
 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 }

◆ 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.

47 {
49 }

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(); }

◆ 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 }

◆ setTimeShift()

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

Definition at line 65 of file ShapeInfo.h.

65 { m_timeShift = shift; }

◆ shift()

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

Definition at line 42 of file ShapeInfo.h.

42 { return m_shift + m_timeShift; }

◆ timeShift()

static 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

constexpr 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:
LArSamples::ShapeInfo::nIntervals
unsigned int nIntervals() const
Definition: ShapeInfo.h:41
LArSamples::ShapeInfo::nPhases
unsigned char nPhases() const
Definition: ShapeInfo.h:40
xAOD::short
short
Definition: Vertex_v1.cxx:165
LArSamples::ShapeInfo::nPoints
unsigned int nPoints() const
Definition: ShapeInfo.h:37
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
LArSamples::ShapeInfo::m_timeShift
static double m_timeShift
Definition: ShapeInfo.h:72
LArSamples::ShapeInfo::value
double value(unsigned int i) const
Definition: ShapeInfo.cxx:58
LArSamples::ShapeInfo::m_values
std::vector< short > m_values
Definition: ShapeInfo.h:69
LArSamples::ShapeInfo::nSamples
unsigned char nSamples() const
Definition: ShapeInfo.h:39
LArSamples::ShapeInfo::m_nPhases
unsigned char m_nPhases
Definition: ShapeInfo.h:70
LArSamples::ShapeInfo::nBuckets
static constexpr unsigned int nBuckets
Definition: ShapeInfo.h:62
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::ShapeInfo::m_shift
float m_shift
Definition: ShapeInfo.h:71
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::ShapeInfo::m_nSamples
unsigned char m_nSamples
Definition: ShapeInfo.h:70
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LArSamples::ShapeInfo::binSize
unsigned char binSize() const
Definition: ShapeInfo.h:38
LArSamples::ShapeInfo::shift
float shift() const
Definition: ShapeInfo.h:42
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
DeMoScan.index
string index
Definition: DeMoScan.py:364
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::ShapeInfo::m_binSize
unsigned char m_binSize
Definition: ShapeInfo.h:70