Belle II Software development
BKLMAlignment Class Reference

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

#include <BKLMAlignment.h>

Inheritance diagram for BKLMAlignment:

Public Member Functions

 BKLMAlignment ()
 Constructor.
 
 ~BKLMAlignment ()
 Destructor.
 
void setModuleAlignment (KLMModuleNumber module, KLMAlignmentData *dat)
 Set module alignment data.
 
const KLMAlignmentDatagetModuleAlignment (KLMModuleNumber module) const
 Get module 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::BKLMAlignment, 3)
 Class version.
 

Private Attributes

std::map< KLMModuleNumber, KLMAlignmentDatam_ModuleAlignment
 Module alignment.
 

Detailed Description

Class to store BKLM alignment data in the database.

Definition at line 30 of file BKLMAlignment.h.

Constructor & Destructor Documentation

◆ BKLMAlignment()

Constructor.

Definition at line 14 of file BKLMAlignment.cc.

15{
16}

◆ ~BKLMAlignment()

Destructor.

Definition at line 18 of file BKLMAlignment.cc.

19{
20}

Member Function Documentation

◆ getGlobalParam()

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

Get global parameter.

Parameters
[in]elementElement number (KLM module number).
[in]paramParameter number.
Returns
Global parameter value.

Definition at line 45 of file BKLMAlignment.cc.

47{
48 const KLMAlignmentData* alignmentData = getModuleAlignment(element);
49 if (alignmentData == nullptr)
50 return 0;
51 return alignmentData->getParameter(
52 static_cast<enum KLMAlignmentData::ParameterNumbers>(param));
53}
const KLMAlignmentData * getModuleAlignment(KLMModuleNumber module) const
Get module 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 BKLMAlignment.h.

64 {
65 return 30;
66 }

◆ getModuleAlignment()

const KLMAlignmentData * getModuleAlignment ( KLMModuleNumber  module) const

Get module alignment data.

Parameters
[in]moduleModule number.

Definition at line 35 of file BKLMAlignment.cc.

37{
38 std::map<KLMModuleNumber, KLMAlignmentData>::const_iterator it;
39 it = m_ModuleAlignment.find(module);
40 if (it == m_ModuleAlignment.end())
41 return nullptr;
42 return &(it->second);
43}
std::map< KLMModuleNumber, KLMAlignmentData > m_ModuleAlignment
Module alignment.
Definition: BKLMAlignment.h:92

◆ listGlobalParams()

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

Get a list of stored global parameters.

Definition at line 78 of file BKLMAlignment.cc.

79{
80 return {};
81}

◆ setGlobalParam()

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

Set global parameter.

Parameters
[in]valueParameter value.
[in]elementElement number (KLM module number).
[in]paramParameter number.

Definition at line 55 of file BKLMAlignment.cc.

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

◆ setModuleAlignment()

void setModuleAlignment ( KLMModuleNumber  module,
KLMAlignmentData dat 
)

Set module alignment data.

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

Definition at line 22 of file BKLMAlignment.cc.

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

Member Data Documentation

◆ m_ModuleAlignment

std::map<KLMModuleNumber, KLMAlignmentData> m_ModuleAlignment
private

Module alignment.

Definition at line 92 of file BKLMAlignment.h.


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