ATLAS Offline Software
Loading...
Searching...
No Matches
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,
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),
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
90MsgStream& InDet::SCT_ClusterOnTrack::dump( MsgStream& sl ) const
91{
92 SiClusterOnTrack::dump(sl); // use dump(...) from SiClusterOnTrack
93 return sl;
94}
95
96std::ostream& InDet::SCT_ClusterOnTrack::dump( std::ostream& sl ) const
97{
98 SiClusterOnTrack::dump(sl); // use dump(...) from SiClusterOnTrack
99 return sl;
100}
ElementLink< InDet::SCT_ClusterContainer > ElementLinkToIDCSCT_ClusterContainer
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
Trk::Surface & surface()
Element Surface.
ElementLinkToIDCSCT_ClusterContainer m_rio
SCT_Cluster - the RIO (PRD, PrepRawData)
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
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...
const InDetDD::SiDetectorElement * m_detEl
corresponding detector element
virtual MsgStream & dump(MsgStream &out) const override final
returns some information about this RIO_OnTrack.
virtual const Amg::Vector3D & globalPosition() const override
returns global position (gathered through Surface constraint)
SiClusterOnTrack()
Default Constructor - needed for POOL.
virtual IdentifierHash idDE() const override
returns the DE hashID*
Amg::Vector3D m_globalPosition
The global position.
virtual MsgStream & dump(MsgStream &out) const override
returns some information about this RIO_OnTrack.
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...
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Identifier identify() const
return the identifier -extends MeasurementBase
Abstract Base Class for tracking surfaces.
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.
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
This is the base class for all tracking detector elements with read-out relevant information.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
STL namespace.