Belle II Software development
TOPCalEventT0Offset Class Reference

Class to store the calibrated EventT0 offsets of other detector components The offsets are measured relative to TOP EventT0 (e.g CDC - TOP etc) More...

#include <TOPCalEventT0Offset.h>

Inheritance diagram for TOPCalEventT0Offset:

Classes

struct  OffsetData
 Calibration constants of a detector component. More...
 

Public Member Functions

 TOPCalEventT0Offset ()
 Default class constructor.
 
void set (Const::EDetector detector, double offset, double sigma)
 Setter.
 
const OffsetDataget (Const::EDetector detector) const
 Getter.
 
bool isAvailable (Const::EDetector detector) const
 Is calibration available for a given detector component?
 
bool isEmpty () const
 Is object empty?
 

Private Member Functions

void set () const
 Set the cache.
 
 ClassDef (TOPCalEventT0Offset, 1)
 do not write out
 

Private Attributes

std::vector< OffsetDatam_data
 calibration data
 
std::map< Const::EDetector, OffsetDatam_calibrations
 cache
 

Detailed Description

Class to store the calibrated EventT0 offsets of other detector components The offsets are measured relative to TOP EventT0 (e.g CDC - TOP etc)

Definition at line 27 of file TOPCalEventT0Offset.h.

Constructor & Destructor Documentation

◆ TOPCalEventT0Offset()

TOPCalEventT0Offset ( )
inline

Default class constructor.

Definition at line 58 of file TOPCalEventT0Offset.h.

59 {}

Member Function Documentation

◆ ClassDef()

ClassDef ( TOPCalEventT0Offset  ,
 
)
private

do not write out

ClassDef

◆ get()

const OffsetData & get ( Const::EDetector  detector) const
inline

Getter.

Parameters
detectordetector component
Returns
calibration constants

Definition at line 82 of file TOPCalEventT0Offset.h.

83 {
84 if (m_calibrations.empty()) set();
85 return m_calibrations[detector];
86 }
std::map< Const::EDetector, OffsetData > m_calibrations
cache
void set() const
Set the cache.

◆ isAvailable()

bool isAvailable ( Const::EDetector  detector) const
inline

Is calibration available for a given detector component?

Parameters
detectordetector component
Returns
true if available

Definition at line 93 of file TOPCalEventT0Offset.h.

94 {
95 if (m_calibrations.empty()) set();
96 return (m_calibrations[detector].sigma > 0);
97 }

◆ isEmpty()

bool isEmpty ( ) const
inline

Is object empty?

Returns
true if empty

Definition at line 103 of file TOPCalEventT0Offset.h.

103{return m_data.empty();}
std::vector< OffsetData > m_data
calibration data

◆ set() [1/2]

void set ( ) const
inlineprivate

Set the cache.

Definition at line 110 of file TOPCalEventT0Offset.h.

111 {
112 for (const auto& data : m_data) m_calibrations[data.component] = data;
113 }

◆ set() [2/2]

void set ( Const::EDetector  detector,
double  offset,
double  sigma 
)
inline

Setter.

Parameters
detectordetector component
offsetoffset relative to TOP
sigmatime resolution of the detector component (must be a positive value)

Definition at line 67 of file TOPCalEventT0Offset.h.

68 {
69 if (sigma > 0) {
70 m_data.push_back(OffsetData(offset, sigma, detector));
71 } else {
72 B2ERROR("TOPCalEventT0Offset::set: time resolution must be a positive number. Entry ignored"
73 << LogVar("detector component", detector));
74 }
75 }
Class to store variables with their name which were sent to the logging service.

Member Data Documentation

◆ m_calibrations

std::map<Const::EDetector, OffsetData> m_calibrations
mutableprivate

cache

Definition at line 117 of file TOPCalEventT0Offset.h.

◆ m_data

std::vector<OffsetData> m_data
private

calibration data

Definition at line 115 of file TOPCalEventT0Offset.h.


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