ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsDataPreparation
src
CoreStripSpacePointFormationTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CoreStripSpacePointFormationTool.h
"
6
7
#include "
ActsInterop/TableUtils.h
"
8
9
namespace
ActsTrk
{
10
11
StatusCode
CoreStripSpacePointFormationTool::initialize
()
12
{
13
ATH_CHECK
(
StripSpacePointFormationToolBase::initialize
() );
14
15
if
(
m_mode
.value() ==
"Cosmic"
) {
16
m_cosmicMode
=
true
;
17
}
else
if
(
m_mode
.value() ==
"Constrained"
) {
18
m_cosmicMode
=
false
;
19
}
else
{
20
ATH_MSG_FATAL
(
"Unknown Mode '"
<<
m_mode
.value() <<
"', expected 'Constrained' or 'Cosmic'"
);
21
return
StatusCode::FAILURE;
22
}
23
24
ATH_MSG_INFO
(
"Using Acts::StripSpacePointBuilder in "
<<
m_mode
.value() <<
" mode"
);
25
26
return
StatusCode::SUCCESS;
27
}
28
29
StatusCode
CoreStripSpacePointFormationTool::finalize
()
30
{
31
ATH_MSG_INFO
(
"Strip space point formation statistics"
<< std::endl <<
makeTable
(m_stat,
32
std::array<std::string, kNStat>{
33
"Accepted"
,
34
"ClusterPairDistanceExceeded"
,
35
"ClusterPairThetaDistanceExceeded"
,
36
"ClusterPairPhiDistanceExceeded"
,
37
"CosmicToleranceNotMet"
,
38
"OutsideLimits"
,
39
"OutsideRelaxedLimits"
,
40
"NoSolutionFound"
,
41
"OtherError"
42
}).columnWidth(12));
43
44
return
StatusCode::SUCCESS;
45
}
46
47
Acts::StripSpacePointBuilder::StripEnds
48
CoreStripSpacePointFormationTool::stripEnds
(
const
StripInformationHelper
& info)
49
{
50
// stripCenter = 0.5*(start+end), stripDirection = start-end
51
const
Amg::Vector3D
half = 0.5 * info.stripDirection();
52
return
Acts::StripSpacePointBuilder::StripEnds{info.stripCenter() + half,
53
info.stripCenter() - half};
54
}
55
56
void
CoreStripSpacePointFormationTool::countError
(
int
code)
const
57
{
58
++m_stat[(code > 0 and code <
kOtherError
) ? code :
kOtherError
];
59
}
60
61
StatusCode
CoreStripSpacePointFormationTool::makeStripSpacePoint
(
62
std::vector<StripSP>& collection,
63
const
StripInformationHelper
& firstInfo,
64
const
StripInformationHelper
& secondInfo,
65
const
Amg::Vector3D
& beamSpotVertex,
66
bool
isEndcap,
67
double
limit,
68
double
slimit)
const
69
{
70
namespace
SPB = Acts::StripSpacePointBuilder;
71
72
if
(
m_cosmicMode
) {
73
SPB::CosmicOptions options;
74
options.tolerance =
m_cosmicTolerance
;
75
options.stripLengthTolerance = limit - 1.;
76
77
const
Acts::Result<Acts::Vector3>
cosmic
=
78
SPB::computeCosmicSpacePoint(
stripEnds
(firstInfo),
stripEnds
(secondInfo), options);
79
if
(not
cosmic
.ok()) {
80
countError
(
cosmic
.error().value());
81
return
StatusCode::SUCCESS;
82
}
83
++m_stat[
kNAccepted
];
84
collection.push_back(
makeStripSP
(*
cosmic
, firstInfo, secondInfo, isEndcap));
85
return
StatusCode::SUCCESS;
86
}
87
88
// The vertex is already folded into the cached trajectory direction, so
89
// options.vertex is not read by this overload.
90
SPB::ConstrainedOptions options;
91
options.vertex = beamSpotVertex;
92
options.stripLengthTolerance = limit - 1.;
93
options.stripLengthGapTolerance = slimit;
94
95
Acts::Vector3 position;
96
const
std::optional<Acts::SpacePointFormationError>
error
=
97
SPB::computeConstrainedSpacePoint(firstInfo.
constrainedCache
(),
98
secondInfo.
constrainedCache
(), options, position);
99
if
(
error
.has_value()) {
100
countError
(
static_cast<
int
>
(*
error
));
101
return
StatusCode::SUCCESS;
102
}
103
104
++m_stat[
kNAccepted
];
105
collection.push_back(
makeStripSP
(position, firstInfo, secondInfo, isEndcap));
106
107
return
StatusCode::SUCCESS;
108
}
109
110
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
CoreStripSpacePointFormationTool.h
cosmic
@ cosmic
Definition
SUSYToolsTester.cxx:96
TableUtils.h
makeTable
TableUtils::StatTable< T > makeTable(const std::array< T, N > &counter, const std::array< std::string, N > &label)
Definition
TableUtils.h:544
ActsTrk::CoreStripSpacePointFormationTool::m_mode
Gaudi::Property< std::string > m_mode
Definition
CoreStripSpacePointFormationTool.h:58
ActsTrk::CoreStripSpacePointFormationTool::m_cosmicTolerance
Gaudi::Property< double > m_cosmicTolerance
Definition
CoreStripSpacePointFormationTool.h:60
ActsTrk::CoreStripSpacePointFormationTool::makeStripSpacePoint
virtual StatusCode makeStripSpacePoint(std::vector< StripSP > &collection, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, const Amg::Vector3D &beamSpotVertex, bool isEndcap, double limit, double slimit) const override
Compute the space point position for a compatible pair of strips and, if it satisfies the geometrical...
Definition
CoreStripSpacePointFormationTool.cxx:61
ActsTrk::CoreStripSpacePointFormationTool::finalize
virtual StatusCode finalize() override
Definition
CoreStripSpacePointFormationTool.cxx:29
ActsTrk::CoreStripSpacePointFormationTool::countError
void countError(int code) const
Book a rejected pair against the slot of its Acts::SpacePointFormationError.
Definition
CoreStripSpacePointFormationTool.cxx:56
ActsTrk::CoreStripSpacePointFormationTool::initialize
virtual StatusCode initialize() override
Definition
CoreStripSpacePointFormationTool.cxx:11
ActsTrk::CoreStripSpacePointFormationTool::stripEnds
static Acts::StripSpacePointBuilder::StripEnds stripEnds(const StripInformationHelper &info)
Recover the two ends of the strip from the centre and direction cached in the helper.
Definition
CoreStripSpacePointFormationTool.cxx:48
ActsTrk::CoreStripSpacePointFormationTool::kNAccepted
@ kNAccepted
Definition
CoreStripSpacePointFormationTool.h:68
ActsTrk::CoreStripSpacePointFormationTool::kOtherError
@ kOtherError
Definition
CoreStripSpacePointFormationTool.h:76
ActsTrk::CoreStripSpacePointFormationTool::m_cosmicMode
bool m_cosmicMode
Definition
CoreStripSpacePointFormationTool.h:63
ActsTrk::StripInformationHelper
Definition
StripInformationHelper.h:17
ActsTrk::StripInformationHelper::constrainedCache
const Acts::StripSpacePointBuilder::ConstrainedStripCache & constrainedCache() const
The same quantities in the layout Acts::StripSpacePointBuilder consumes.
Definition
StripInformationHelper.h:66
ActsTrk::StripSpacePointFormationToolBase::initialize
virtual StatusCode initialize() override
Definition
StripSpacePointFormationToolBase.cxx:16
ActsTrk::StripSpacePointFormationToolBase::makeStripSP
static StripSP makeStripSP(const Eigen::Matrix< double, 3, 1 > &globalPosition, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, bool isEndcap)
Fill the StripSP payload that is common to all implementations, i.e.
Definition
StripSpacePointFormationToolBase.cxx:378
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0