ATLAS Offline Software
SCT_ClusterOnTrack.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 // SCT_ClusterOnTrack.cxx, (c) ATLAS Detector Software
8 
10 
11 #include <limits>
12 #include <ostream>
13 
14 #include "GaudiKernel/MsgStream.h"
17 
18 // Constructor with parameters - no global position assigned
20  Trk::LocalParameters&& locpars,
21  Amg::MatrixX&& locerr,
22  const IdentifierHash& idDE,
23  bool isbroad)
24  : SiClusterOnTrack(std::move(locpars), std::move(locerr), idDE,
25  RIO->identify(), isbroad) {
26  m_detEl = RIO->detectorElement();
27  m_positionAlongStrip = std::numeric_limits<double>::quiet_NaN();
28  m_rio.setElement(RIO);
29  // Set global position
32 }
33 
34 // Constructor with parameters
36  const InDet::SCT_Cluster* RIO, Trk::LocalParameters&& locpars,
37  Amg::MatrixX&& locerr, const IdentifierHash& idDE,
38  const Amg::Vector3D& globalPosition, bool isbroad)
39  : SiClusterOnTrack(std::move(locpars), std::move(locerr), idDE,
40  RIO->identify(), globalPosition, isbroad),
41  m_detEl(RIO->detectorElement()) {
42  m_rio.setElement(RIO);
43 
44  // constructing local position provided a global one
45  std::optional<Amg::Vector2D> lpos{
47 
48  // storing the position along the strip if available
49  m_positionAlongStrip = (lpos) ? (*lpos)[Trk::locY] : 0.;
50 }
51 
54  const Trk::LocalParameters& locpars,
55  const Amg::MatrixX& locerr,
56  IdentifierHash idDE,
57  const Identifier& id,
58  bool isbroad,
59  double positionAlongStrip)
60  : SiClusterOnTrack(Trk::LocalParameters(locpars), Amg::MatrixX(locerr), idDE, id, isbroad),
61  m_rio(RIO),
62  m_detEl(nullptr),
63  m_positionAlongStrip(positionAlongStrip) {}
64 
65 // Default constructor:
68  m_rio(),
69  m_detEl(nullptr),
70  m_positionAlongStrip(std::numeric_limits<double>::quiet_NaN())
71 {}
72 
73 
75 {
76  return (detectorElement()->surface());
77 }
78 
80 {
81  m_detEl = dynamic_cast<const InDetDD::SiDetectorElement*>(detEl);
82  if (m_detEl) {
83  // Set global position after setting the detector element
87  }
88 }
89 
90 MsgStream& InDet::SCT_ClusterOnTrack::dump( MsgStream& sl ) const
91 {
92  SiClusterOnTrack::dump(sl); // use dump(...) from SiClusterOnTrack
93  return sl;
94 }
95 
96 std::ostream& InDet::SCT_ClusterOnTrack::dump( std::ostream& sl ) const
97 {
98  SiClusterOnTrack::dump(sl); // use dump(...) from SiClusterOnTrack
99  return sl;
100 }
Trk::LocalParameters
Definition: LocalParameters.h:98
SCT_ClusterOnTrack.h
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::SCT_ClusterOnTrack::m_detEl
const InDetDD::SiDetectorElement * m_detEl
corresponding detector element
Definition: SCT_ClusterOnTrack.h:135
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::SolidStateDetectorElementBase::surface
Trk::Surface & surface()
Element Surface.
xAOD::identify
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
InDet::SCT_ClusterOnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override final
returns some information about this RIO_OnTrack.
Definition: SCT_ClusterOnTrack.cxx:90
SCT_Cluster.h
InDet::SiClusterOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override
returns global position (gathered through Surface constraint)
Definition: SiClusterOnTrack.h:115
InDet::SCT_ClusterOnTrack::m_rio
ElementLinkToIDCSCT_ClusterContainer m_rio
SCT_Cluster - the RIO (PRD, PrepRawData)
Definition: SCT_ClusterOnTrack.h:133
InDet::SCT_ClusterOnTrack::m_positionAlongStrip
double m_positionAlongStrip
Definition: SCT_ClusterOnTrack.h:137
InDet::SCT_ClusterOnTrack::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: SCT_ClusterOnTrack.h:158
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
InDet::SiClusterOnTrack::m_globalPosition
Amg::Vector3D m_globalPosition
The global position.
Definition: SiClusterOnTrack.h:111
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SiDetectorElement.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::Surface::positionOnSurface
std::optional< Amg::Vector2D > positionOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
positionOnSurface() returns the LocalPosition on the Surface, If BoundaryCheck==false it just return...
Definition: Surface.cxx:106
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
InDet::SCT_ClusterOnTrack::associatedSurface
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: SCT_ClusterOnTrack.cxx:74
InDet::SCT_ClusterOnTrack::SCT_ClusterOnTrack
SCT_ClusterOnTrack()
For POOL only.
Definition: SCT_ClusterOnTrack.cxx:66
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::SCT_ClusterOnTrack::setValues
virtual void setValues(const Trk::TrkDetElementBase *detEl, const Trk::PrepRawData *prd) override final
ONLY for use in custom convertor Allows the custom convertor to reset values when persistying/reading...
Definition: SCT_ClusterOnTrack.cxx:79
Trk::Surface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
InDet::SiClusterOnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override
returns some information about this RIO_OnTrack.
Definition: SiClusterOnTrack.cxx:57
InDet::SiClusterOnTrack
Definition: SiClusterOnTrack.h:39
Identifier
Definition: IdentifierFieldParser.cxx:14