ATLAS Offline Software
InnerDetector
InDetMonitoring
SCT_Monitoring
src
SCT_NameFormatter.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
3
/*
4
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5
*/
6
12
#ifndef SCT_NameFormatter_H
13
#define SCT_NameFormatter_H
14
15
#include <string>
16
17
namespace
SCT_Monitoring
{
20
class
LayerSideFormatter
{
21
private
:
22
const
unsigned
int
m_element
;
23
const
std::string
m_layerStr
;
24
const
std::string
m_sideStr
;
25
unsigned
int
m_region
;
26
public
:
27
LayerSideFormatter
(
const
unsigned
int
i
) :
m_element
(
i
),
m_layerStr
(std::
to_string
(
i
/ 2)),
m_sideStr
(std::
to_string
(
28
i
% 2)),
29
m_region
(1) {
30
// nop
31
}
32
33
LayerSideFormatter
(
const
unsigned
int
i
,
const
unsigned
int
m
) :
m_element
(
i
),
m_layerStr
(std::
to_string
(
i
/ 2)),
34
m_sideStr
(std::
to_string
(
i
% 2)),
m_region
(
m
) {
35
// nop
36
}
37
38
const
std::string&
39
layer
()
const
{
40
return
m_layerStr
;
41
}
42
43
const
std::string&
44
side
()
const
{
45
return
m_sideStr
;
46
}
47
48
std::string
49
layerPlus1
()
const
{
50
return
std::to_string
((
m_element
/ 2) + 1);
51
}
52
53
std::string
54
title
()
const
{
55
if
(
m_region
== 1) {
56
return
std::string(
"Layer "
) +
m_layerStr
+ std::string(
" Side "
) +
m_sideStr
;
57
}
else
{
58
return
std::string(
"Disk "
) +
m_layerStr
+ std::string(
" Side "
) +
m_sideStr
;
59
}
60
}
61
62
std::string
63
dedicated_title
()
const
{
64
if
(
m_region
== 1) {
65
return
std::string(
"Layer "
) +
m_layerStr
+ std::string(
" Side "
) +
std::to_string
((
m_element
% 2 + 1) % 2);
66
}
else
{
67
return
std::string(
"Disk "
) +
m_layerStr
+ std::string(
" Side "
) +
std::to_string
((
m_element
% 2 + 1) % 2);
68
}
69
}
70
71
std::string
72
name
(
const
std::string &
delimiter
=
"_"
)
const
{
73
return
m_layerStr
+
delimiter
+
m_sideStr
;
74
}
75
};
76
}
// end of SCT_Monitoring namespace
77
78
#endif
SCT_Monitoring::LayerSideFormatter::LayerSideFormatter
LayerSideFormatter(const unsigned int i, const unsigned int m)
Definition:
SCT_NameFormatter.h:33
python.SystemOfUnits.m
int m
Definition:
SystemOfUnits.py:91
SCT_Monitoring::LayerSideFormatter::layer
const std::string & layer() const
Definition:
SCT_NameFormatter.h:39
SCT_Monitoring::LayerSideFormatter::side
const std::string & side() const
Definition:
SCT_NameFormatter.h:44
SCT_Monitoring::LayerSideFormatter::name
std::string name(const std::string &delimiter="_") const
Definition:
SCT_NameFormatter.h:72
SCT_Monitoring::LayerSideFormatter::title
std::string title() const
Definition:
SCT_NameFormatter.h:54
SCT_Monitoring::LayerSideFormatter::LayerSideFormatter
LayerSideFormatter(const unsigned int i)
Definition:
SCT_NameFormatter.h:27
SCT_Monitoring
Definition:
SCT_MonitoringNumbers.h:17
python.AthDsoLogger.delimiter
delimiter
Definition:
AthDsoLogger.py:71
SCT_Monitoring::LayerSideFormatter::m_layerStr
const std::string m_layerStr
Definition:
SCT_NameFormatter.h:23
lumiFormat.i
int i
Definition:
lumiFormat.py:85
SCT_Monitoring::LayerSideFormatter
format an element index (e.g.
Definition:
SCT_NameFormatter.h:20
SCT_Monitoring::LayerSideFormatter::layerPlus1
std::string layerPlus1() const
Definition:
SCT_NameFormatter.h:49
SCT_Monitoring::LayerSideFormatter::m_element
const unsigned int m_element
Definition:
SCT_NameFormatter.h:22
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition:
GeometryDefs.h:34
SCT_Monitoring::LayerSideFormatter::m_sideStr
const std::string m_sideStr
Definition:
SCT_NameFormatter.h:24
SCT_Monitoring::LayerSideFormatter::m_region
unsigned int m_region
Definition:
SCT_NameFormatter.h:25
SCT_Monitoring::LayerSideFormatter::dedicated_title
std::string dedicated_title() const
Definition:
SCT_NameFormatter.h:63
Generated on Thu Nov 7 2024 21:25:32 for ATLAS Offline Software by
1.8.18