ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
#include <string_view>
17
18
namespace
SCT_Monitoring
{
21
class
LayerSideFormatter
{
22
private
:
23
const
unsigned
int
m_element
{};
24
const
std::string
m_layerStr
;
25
const
std::string
m_sideStr
;
26
unsigned
int
m_region
{};
27
28
public
:
29
LayerSideFormatter
(
const
unsigned
int
i) :
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
}
34
35
LayerSideFormatter
(
const
unsigned
int
i,
const
unsigned
int
m) :
m_element
(i),
m_layerStr
(
std
::
to_string
(i / 2)),
36
m_sideStr
(
std
::
to_string
(i % 2)),
m_region
(m) {
37
// nop
38
}
39
40
const
std::string&
41
layer
()
const
{
42
return
m_layerStr
;
43
}
44
45
const
std::string&
46
side
()
const
{
47
return
m_sideStr
;
48
}
49
50
std::string
51
layerPlus1
()
const
{
52
return
std::to_string((
m_element
/ 2) + 1);
53
}
54
55
std::string
56
title
()
const
{
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
}
63
64
std::string
65
dedicated_title
()
const
{
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
}
72
73
std::string
74
name
(std::string_view
delimiter
=
"_"
)
const
{
75
std::string result{
m_layerStr
};
76
return
result.append(
delimiter
).append(
m_sideStr
);
77
}
78
};
79
}
// end of SCT_Monitoring namespace
80
81
#endif
to_string
static std::string to_string(const std::vector< T > &v)
Definition
FPGATrackSimGenScanTool.cxx:44
SCT_Monitoring::LayerSideFormatter::title
std::string title() const
Definition
SCT_NameFormatter.h:56
SCT_Monitoring::LayerSideFormatter::layer
const std::string & layer() const
Definition
SCT_NameFormatter.h:41
SCT_Monitoring::LayerSideFormatter::m_region
unsigned int m_region
Definition
SCT_NameFormatter.h:26
SCT_Monitoring::LayerSideFormatter::m_layerStr
const std::string m_layerStr
Definition
SCT_NameFormatter.h:24
SCT_Monitoring::LayerSideFormatter::m_element
const unsigned int m_element
Definition
SCT_NameFormatter.h:23
SCT_Monitoring::LayerSideFormatter::side
const std::string & side() const
Definition
SCT_NameFormatter.h:46
SCT_Monitoring::LayerSideFormatter::m_sideStr
const std::string m_sideStr
Definition
SCT_NameFormatter.h:25
SCT_Monitoring::LayerSideFormatter::dedicated_title
std::string dedicated_title() const
Definition
SCT_NameFormatter.h:65
SCT_Monitoring::LayerSideFormatter::LayerSideFormatter
LayerSideFormatter(const unsigned int i, const unsigned int m)
Definition
SCT_NameFormatter.h:35
SCT_Monitoring::LayerSideFormatter::layerPlus1
std::string layerPlus1() const
Definition
SCT_NameFormatter.h:51
SCT_Monitoring::LayerSideFormatter::name
std::string name(std::string_view delimiter="_") const
Definition
SCT_NameFormatter.h:74
SCT_Monitoring::LayerSideFormatter::LayerSideFormatter
LayerSideFormatter(const unsigned int i)
Definition
SCT_NameFormatter.h:29
delimiter
static const std::string delimiter("/")
SCT_Monitoring
Definition
SCT_MonitoringNumbers.h:17
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0