ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_Monitoring::LayerSideFormatter Class Reference

format an element index (e.g. More...

#include <SCT_NameFormatter.h>

Collaboration diagram for SCT_Monitoring::LayerSideFormatter:

Public Member Functions

 LayerSideFormatter (const unsigned int i)
 LayerSideFormatter (const unsigned int i, const unsigned int m)
const std::string & layer () const
const std::string & side () const
std::string layerPlus1 () const
std::string title () const
std::string dedicated_title () const
std::string name (std::string_view delimiter="_") const

Private Attributes

const unsigned int m_element {}
const std::string m_layerStr
const std::string m_sideStr
unsigned int m_region {}

Detailed Description

format an element index (e.g.

in looping through barrels, this goes from 0->(2*(nbarrels)) - 1 into layer and side for use in both the histogram title and its name

Definition at line 21 of file SCT_NameFormatter.h.

Constructor & Destructor Documentation

◆ LayerSideFormatter() [1/2]

SCT_Monitoring::LayerSideFormatter::LayerSideFormatter ( const unsigned int i)
inline

Definition at line 29 of file SCT_NameFormatter.h.

29 : m_element(i), m_layerStr(std::to_string(i / 2)), m_sideStr(std::to_string(
30 i % 2)),
31 m_region(1) {
32 // nop
33 }

◆ LayerSideFormatter() [2/2]

SCT_Monitoring::LayerSideFormatter::LayerSideFormatter ( const unsigned int i,
const unsigned int m )
inline

Definition at line 35 of file SCT_NameFormatter.h.

35 : m_element(i), m_layerStr(std::to_string(i / 2)),
36 m_sideStr(std::to_string(i % 2)), m_region(m) {
37 // nop
38 }

Member Function Documentation

◆ dedicated_title()

std::string SCT_Monitoring::LayerSideFormatter::dedicated_title ( ) const
inline

Definition at line 65 of file SCT_NameFormatter.h.

65 {
66 if (m_region == 1) {
67 return std::string("Layer ") + m_layerStr + std::string(" Side ") + std::to_string((m_element % 2 + 1) % 2);
68 } else {
69 return std::string("Disk ") + m_layerStr + std::string(" Side ") + std::to_string((m_element % 2 + 1) % 2);
70 }
71 }

◆ layer()

const std::string & SCT_Monitoring::LayerSideFormatter::layer ( ) const
inline

Definition at line 41 of file SCT_NameFormatter.h.

41 {
42 return m_layerStr;
43 }

◆ layerPlus1()

std::string SCT_Monitoring::LayerSideFormatter::layerPlus1 ( ) const
inline

Definition at line 51 of file SCT_NameFormatter.h.

51 {
52 return std::to_string((m_element / 2) + 1);
53 }

◆ name()

std::string SCT_Monitoring::LayerSideFormatter::name ( std::string_view delimiter = "_") const
inline

Definition at line 74 of file SCT_NameFormatter.h.

74 {
75 std::string result{m_layerStr};
76 return result.append(delimiter).append(m_sideStr);
77 }
static const std::string delimiter("/")

◆ side()

const std::string & SCT_Monitoring::LayerSideFormatter::side ( ) const
inline

Definition at line 46 of file SCT_NameFormatter.h.

46 {
47 return m_sideStr;
48 }

◆ title()

std::string SCT_Monitoring::LayerSideFormatter::title ( ) const
inline

Definition at line 56 of file SCT_NameFormatter.h.

56 {
57 if (m_region == 1) {
58 return std::string("Layer ") + m_layerStr + std::string(" Side ") + m_sideStr;
59 } else {
60 return std::string("Disk ") + m_layerStr + std::string(" Side ") + m_sideStr;
61 }
62 }

Member Data Documentation

◆ m_element

const unsigned int SCT_Monitoring::LayerSideFormatter::m_element {}
private

Definition at line 23 of file SCT_NameFormatter.h.

23{};

◆ m_layerStr

const std::string SCT_Monitoring::LayerSideFormatter::m_layerStr
private

Definition at line 24 of file SCT_NameFormatter.h.

◆ m_region

unsigned int SCT_Monitoring::LayerSideFormatter::m_region {}
private

Definition at line 26 of file SCT_NameFormatter.h.

26{};

◆ m_sideStr

const std::string SCT_Monitoring::LayerSideFormatter::m_sideStr
private

Definition at line 25 of file SCT_NameFormatter.h.


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