ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_SpacePoint.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <memory>
8#include <ostream>
9#include <sstream>
10
15#include "TrkSurfaces/Surface.h"
16
17namespace InDet {
18//-------------------------------------------------------------
19
21 const std::pair<IdentifierHash, IdentifierHash>& elementIdList,
22 const Amg::Vector3D& position,
23 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusList)
24 : Trk::SpacePoint() {
25 setup(elementIdList, position, clusList);
28}
29
30//-------------------------------------------------------------
31
33 const std::pair<IdentifierHash, IdentifierHash>& elementIdList,
34 const Amg::Vector3D& position,
35 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>&
36 clusList) {
37 m_clusList = clusList;
38 m_position = position;
39 m_elemIdList.first = elementIdList.first;
40 m_elemIdList.second = elementIdList.second;
41 assert((clusList.first != 0) && (clusList.second != 0));
42 assert(clusList.first->detectorElement());
43 std::optional<Amg::Vector2D> locpos{
44 clusList.first->detectorElement()->surface().globalToLocal(position)};
45 assert(locpos);
47}
48
49//-------------------------------------------------------------
50
52
53 /* For performance reason only, the error is assumed constant.
54 numbers are taken from
55 Trigger/TrigTools/TrigOfflineSpacePointTool/OfflineSpacePointProviderTool
56 */
57 constexpr double deltaY = 0.0004; // roughly pitch of SCT (80 mu) / sqrt(12)
58 constexpr double offdiag = 25. * deltaY;
59 constexpr double elem11 = 1600. * deltaY;
60 Amg::MatrixX cov(2, 2);
61 cov << deltaY, offdiag,
62 offdiag, elem11;
63
65}
66
67//-------------------------------------------------------------
68
69MsgStream& SCT_SpacePoint::dump(MsgStream& out) const {
70 std::ostringstream os;
71 dump(os);
72 out << os.str();
73 return out;
74}
75
76//-------------------------------------------------------------
77
78std::ostream& SCT_SpacePoint::dump(std::ostream& out) const {
79 const std::string lf{"\n"}; // linefeed
80 out << "SCT_SpacePoint contains: " << lf;
81 out << "Identifier Hashes ( " << int(this->elementIdList().first) << " , ";
82 out << int(this->elementIdList().second) << " ) " << lf;
83 out << "Global Position: " << Amg::toString(this->globalPosition(), 3) << lf;
84 out << "Global Covariance Matrix " << Amg::toString(this->globCovariance(), 3)
85 << lf;
86 out << "Local Parameters " << this->localParameters() << lf;
87 out << "Local Covariance " << Amg::toString(this->localCovariance()) << lf;
88 out << "Cluster 1 :" << lf << (*this->clusterList().first) << lf;
89 out << "Cluster 2 :" << lf << (*this->clusterList().second) << std::endl;
90
91 return out;
92}
93
94} // end of namespace InDet
95
virtual MsgStream & dump(MsgStream &out) const override final
Interface method for output, to be overloaded by child classes*.
SCT_SpacePoint()=default
Default constructor.
void setup(const std::pair< IdentifierHash, IdentifierHash > &elementIdList, const Amg::Vector3D &position, const std::pair< const Trk::PrepRawData *, const Trk::PrepRawData * > &clusList)
common method used in constructors.
void setupLocalCovarianceSCT()
method to set up the local Covariance Matrix.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
void setupGlobalFromLocalCovariance()
set up the global covariance matrix by rotating the local one
const std::pair< IdentifierHash, IdentifierHash > & elementIdList() const
return the pair of Ids of the element by reference
std::pair< IdentifierHash, IdentifierHash > m_elemIdList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
std::pair< const PrepRawData *, const PrepRawData * > m_clusList
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 3, 1 > Vector3D
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file