ATLAS Offline Software
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 
17 namespace 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  // cppcheck-suppress constStatement; false positive
63  offdiag, elem11;
64 
66 }
67 
68 //-------------------------------------------------------------
69 
70 MsgStream& SCT_SpacePoint::dump(MsgStream& out) const {
71  std::ostringstream os;
72  dump(os);
73  out << os.str();
74  return out;
75 }
76 
77 //-------------------------------------------------------------
78 
79 std::ostream& SCT_SpacePoint::dump(std::ostream& out) const {
80  const std::string lf{"\n"}; // linefeed
81  out << "SCT_SpacePoint contains: " << lf;
82  out << "Identifier Hashes ( " << int(this->elementIdList().first) << " , ";
83  out << int(this->elementIdList().second) << " ) " << lf;
84  out << "Global Position: " << Amg::toString(this->globalPosition(), 3) << lf;
85  out << "Global Covariance Matrix " << Amg::toString(this->globCovariance(), 3)
86  << lf;
87  out << "Local Parameters " << this->localParameters() << lf;
88  out << "Local Covariance " << Amg::toString(this->localCovariance()) << lf;
89  out << "Cluster 1 :" << lf << (*this->clusterList().first) << lf;
90  out << "Cluster 2 :" << lf << (*this->clusterList().second) << std::endl;
91 
92  return out;
93 }
94 
95 } // end of namespace InDet
96 
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
Trk::LocalParameters
Definition: LocalParameters.h:98
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Surface.h
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
makeComparison.deltaY
int deltaY
Definition: makeComparison.py:44
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::SpacePoint::m_clusList
std::pair< const PrepRawData *, const PrepRawData * > m_clusList
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:97
python.TriggerAPI.TriggerAPISession.lf
lf
Definition: TriggerAPISession.py:390
PrepRawData.h
Trk::SpacePoint::setupGlobalFromLocalCovariance
void setupGlobalFromLocalCovariance()
set up the global covariance matrix by rotating the local one
Definition: Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx:57
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
EventPrimitivesToStringConverter.h
SCT_SpacePoint.h
InDet::SCT_SpacePoint::setup
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.
Definition: SCT_SpacePoint.cxx:32
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SpacePoint::m_position
Amg::Vector3D m_position
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:99
Trk::SpacePoint::elementIdList
const std::pair< IdentifierHash, IdentifierHash > & elementIdList() const
return the pair of Ids of the element by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:122
InDet::SCT_SpacePoint::dump
virtual MsgStream & dump(MsgStream &out) const override final
Interface method for output, to be overloaded by child classes*.
Definition: SCT_SpacePoint.cxx:70
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
LocalParameters.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
InDet::SCT_SpacePoint::SCT_SpacePoint
SCT_SpacePoint()=default
Default constructor.
DeMoScan.first
bool first
Definition: DeMoScan.py:536
GeoPrimitivesToStringConverter.h
InDet::SCT_SpacePoint::setupLocalCovarianceSCT
void setupLocalCovarianceSCT()
method to set up the local Covariance Matrix.
Definition: SCT_SpacePoint.cxx:51
Trk::SpacePoint::m_elemIdList
std::pair< IdentifierHash, IdentifierHash > m_elemIdList
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:98