ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
8
9namespace ActsTrk {
10
12 {
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
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
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
57 {
58 ++m_stat[(code > 0 and code < kOtherError) ? code : kOtherError];
59 }
60
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
@ cosmic
TableUtils::StatTable< T > makeTable(const std::array< T, N > &counter, const std::array< std::string, N > &label)
Definition TableUtils.h:544
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...
void countError(int code) const
Book a rejected pair against the slot of its Acts::SpacePointFormationError.
static Acts::StripSpacePointBuilder::StripEnds stripEnds(const StripInformationHelper &info)
Recover the two ends of the strip from the centre and direction cached in the helper.
const Acts::StripSpacePointBuilder::ConstrainedStripCache & constrainedCache() const
The same quantities in the layout Acts::StripSpacePointBuilder consumes.
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.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Eigen::Matrix< double, 3, 1 > Vector3D