Belle II Software development
EKLMSegmentAlignment Class Reference

Class to store EKLM alignment data in the database. More...

#include <EKLMSegmentAlignment.h>

Inheritance diagram for EKLMSegmentAlignment:

Public Member Functions

 EKLMSegmentAlignment ()
 Constructor.
 
 ~EKLMSegmentAlignment ()
 Destructor.
 
void setSegmentAlignment (EKLMSegmentNumber segment, KLMAlignmentData *dat)
 Set segment alignment data.
 
const KLMAlignmentDatagetSegmentAlignment (EKLMSegmentNumber segment) const
 Get segment alignment data.
 
double getGlobalParam (unsigned short element, unsigned short param) const
 Get global parameter.
 
void setGlobalParam (double value, unsigned short element, unsigned short param)
 Set global parameter.
 
std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams ()
 Get a list of stored global parameters.
 

Static Public Member Functions

static unsigned short getGlobalUniqueID ()
 Get global unique identifier.
 

Private Member Functions

 ClassDef (Belle2::EKLMSegmentAlignment, 1)
 Class version.
 

Private Attributes

std::map< EKLMSegmentNumber, KLMAlignmentDatam_SegmentAlignment
 Segment alignment.
 

Detailed Description

Class to store EKLM alignment data in the database.

Definition at line 30 of file EKLMSegmentAlignment.h.

Constructor & Destructor Documentation

◆ EKLMSegmentAlignment()

Constructor.

Definition at line 14 of file EKLMSegmentAlignment.cc.

15{
16}

◆ ~EKLMSegmentAlignment()

Destructor.

Definition at line 18 of file EKLMSegmentAlignment.cc.

19{
20}

Member Function Documentation

◆ getGlobalParam()

double getGlobalParam ( unsigned short  element,
unsigned short  param 
) const

Get global parameter.

Parameters
[in]elementElement number (EKLM segment number).
[in]paramParameter number.
Returns
Global parameter value.

Definition at line 44 of file EKLMSegmentAlignment.cc.

46{
47 const KLMAlignmentData* alignmentData = getSegmentAlignment(element);
48 if (alignmentData == nullptr)
49 return 0;
50 return alignmentData->getParameter(
51 static_cast<enum KLMAlignmentData::ParameterNumbers>(param));
52}
const KLMAlignmentData * getSegmentAlignment(EKLMSegmentNumber segment) const
Get segment alignment data.
KLM Alignment data.
ParameterNumbers
Alignment parameter numbers.

◆ getGlobalUniqueID()

static unsigned short getGlobalUniqueID ( )
inlinestatic

Get global unique identifier.

Returns
Global unique identifier.

Definition at line 63 of file EKLMSegmentAlignment.h.

64 {
65 return 41;
66 }

◆ getSegmentAlignment()

const KLMAlignmentData * getSegmentAlignment ( EKLMSegmentNumber  segment) const

Get segment alignment data.

Parameters
[in]segmentSegment number.

Definition at line 34 of file EKLMSegmentAlignment.cc.

36{
37 std::map<EKLMSegmentNumber, KLMAlignmentData>::const_iterator it;
38 it = m_SegmentAlignment.find(segment);
39 if (it == m_SegmentAlignment.end())
40 return nullptr;
41 return &(it->second);
42}
std::map< EKLMSegmentNumber, KLMAlignmentData > m_SegmentAlignment
Segment alignment.

◆ listGlobalParams()

std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams ( )

Get a list of stored global parameters.

Definition at line 77 of file EKLMSegmentAlignment.cc.

78{
79 return {};
80}

◆ setGlobalParam()

void setGlobalParam ( double  value,
unsigned short  element,
unsigned short  param 
)

Set global parameter.

Parameters
[in]valueParameter value.
[in]elementElement number (EKLM segment number).
[in]paramParameter number.

Definition at line 54 of file EKLMSegmentAlignment.cc.

56{
57 KLMAlignmentData* alignmentData =
58 const_cast<KLMAlignmentData*>(getSegmentAlignment(element));
59 /*
60 * Create alignment data if it does not exist.
61 * This is necessary for errors and corrections.
62 */
63 if (alignmentData == nullptr) {
64 KLMAlignmentData newAlignmentData(0, 0, 0, 0, 0, 0);
65 newAlignmentData.setParameter(
66 static_cast<enum KLMAlignmentData::ParameterNumbers>(param), value);
67 m_SegmentAlignment.insert(
68 std::pair<EKLMSegmentNumber, KLMAlignmentData>(element, newAlignmentData));
69 } else {
70 alignmentData->setParameter(
71 static_cast<enum KLMAlignmentData::ParameterNumbers>(param), value);
72 }
73}

◆ setSegmentAlignment()

void setSegmentAlignment ( EKLMSegmentNumber  segment,
KLMAlignmentData dat 
)

Set segment alignment data.

Parameters
[in]segmentSegment number.
[in]datAlignment data.

Definition at line 22 of file EKLMSegmentAlignment.cc.

24{
25 std::map<EKLMSegmentNumber, KLMAlignmentData>::iterator it;
26 it = m_SegmentAlignment.find(segment);
27 if (it == m_SegmentAlignment.end()) {
28 m_SegmentAlignment.insert(
29 std::pair<EKLMSegmentNumber, KLMAlignmentData>(segment, *dat));
30 } else
31 it->second = *dat;
32}

Member Data Documentation

◆ m_SegmentAlignment

std::map<EKLMSegmentNumber, KLMAlignmentData> m_SegmentAlignment
private

Segment alignment.

Definition at line 93 of file EKLMSegmentAlignment.h.


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