ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetCalibAlgs
SCT_CalibAlgs
src
SCT_CalibUtilities.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
11
12
#include "
SCT_CalibUtilities.h
"
13
14
//gaudi
15
#include "
InDetIdentifier/SCT_ID.h
"
16
#include "Identifier/Identifier.h"
17
#include <algorithm>
//std::unique
18
19
namespace
SCT_CalibAlgs
{
20
std::string
21
normalizeList
(std::string s) {
22
auto
binaryPredicate=[](
char
s0
,
char
s1){
23
return
(
s0
==
' '
and
s0
==s1);
24
};
25
auto
normalised=
std::unique
(s.begin(), s.end(), binaryPredicate);
26
s.erase(normalised,s.end());
27
size_t
first=0;
28
size_t
last=s.size()-1;
29
if
(s[first] ==
' '
) first =1;
30
if
(s[last] ==
' '
) last-=1;
31
return
s.substr(first,last);
32
}
33
34
35
std::string
36
formatPosition
(
const
Identifier
& waferId,
const
SCT_ID
* helper,
37
std::string_view
delimiter
,
const
bool
includeSide) {
38
std::string result{std::to_string(helper->barrel_ec(waferId))};
39
result.append(
delimiter
);
40
result += std::to_string(helper->layer_disk(waferId));
41
//
42
result.append(
delimiter
);
43
result += std::to_string(helper->phi_module(waferId));
44
//
45
result.append(
delimiter
);
46
result += std::to_string(helper->eta_module(waferId));
47
//
48
if
(includeSide) {
49
result.append(
delimiter
);
50
result += std::to_string(helper->side(waferId));
51
}
52
53
return
result;
54
}
55
56
std::string
57
chipList2LinkList
(
const
std::string& chipList) {
58
if
(chipList ==
"0-5 6-11"
) {
59
return
"0 1"
;
60
}
else
if
(chipList ==
"0-5"
) {
61
return
"0"
;
62
}
else
if
(chipList ==
"6-11"
) {
63
return
"1"
;
64
}
else
{
65
return
""
;
66
}
67
}
68
69
unsigned
int
70
bec2Index
(
const
int
bec) {
71
return
static_cast<
unsigned
int
>
((bec/2) + 1);
72
}
73
74
std::string
75
xmlCloseChannel
() {
76
return
"</channel>"
;
77
}
78
}
//end of namespace
s0
static Double_t s0
Definition
LArPhysWaveHECTool.cxx:37
SCT_CalibUtilities.h
header file for the SCTCalibUtilities
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SCT_ID
This is an Identifier helper class for the SCT subdetector.
Definition
SCT_ID.h:68
delimiter
static const std::string delimiter("/")
Identifier
Definition
IdentifierFieldParser.cxx:14
SCT_CalibAlgs
Definition
IElementStreamer.cxx:13
SCT_CalibAlgs::formatPosition
std::string formatPosition(const Identifier &waferId, const SCT_ID *helper, std::string_view delimiter, const bool includeSide)
Definition
SCT_CalibUtilities.cxx:36
SCT_CalibAlgs::chipList2LinkList
std::string chipList2LinkList(const std::string &chipList)
Definition
SCT_CalibUtilities.cxx:57
SCT_CalibAlgs::xmlCloseChannel
std::string xmlCloseChannel()
Definition
SCT_CalibUtilities.cxx:75
SCT_CalibAlgs::normalizeList
std::string normalizeList(std::string s)
Definition
SCT_CalibUtilities.cxx:21
SCT_CalibAlgs::bec2Index
unsigned int bec2Index(const int bec)
Definition
SCT_CalibUtilities.cxx:70
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition
DVL_algorithms.h:135
Generated on
for ATLAS Offline Software by
1.17.0