ATLAS Offline Software
CaloCluster_OnTrack.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // Trk
7 
8 // Gaudi & AthenaCommon
9 #include "GaudiKernel/MsgStream.h"
10 #include <limits>
11 #include <ostream>
12 #include <string>
13 
14 namespace {
15 const double NaN(std::numeric_limits<double>::quiet_NaN());
16 const Amg::Vector3D INVALID_VECTOR3D(NaN, NaN, NaN);
17 }
18 
20  Trk::LocalParameters&& locpars,
21  Amg::MatrixX&& locerr,
22  const Trk::Surface& surface,
23  const Trk::EnergyLoss* eloss)
24  : MeasurementBase(std::move(locpars), std::move(locerr))
25  , SurfacePtrHolder(surface)
26  , m_globalpos(surface.localToGlobal(m_localParams))
27  , m_eloss(eloss)
28 {}
29 
30 // default constructor:
32  : Trk::MeasurementBase()
34  , m_globalpos{ INVALID_VECTOR3D }
35  , m_eloss{ nullptr }
36 {}
37 
38 // copy constructor:
40  const Trk::CaloCluster_OnTrack& cot)
41  : Trk::MeasurementBase(cot)
42  , SurfacePtrHolder(cot)
43  , m_globalpos(cot.m_globalpos)
44 {
45  m_eloss.reset(cot.m_eloss ? new Trk::EnergyLoss(*cot.m_eloss) : nullptr);
46 }
47 
48 // assignment operator:
51 {
52  if (&cot != this) {
55  m_globalpos = cot.m_globalpos;
56  m_eloss.reset(cot.m_eloss ? new Trk::EnergyLoss(*cot.m_eloss) : nullptr);
57  }
58  return *this;
59 }
60 
63 {
64  return new Trk::CaloCluster_OnTrack(*this);
65 }
66 
67 const Amg::Vector3D&
69 {
70  return m_globalpos;
71 }
72 
73 MsgStream&
74 Trk::CaloCluster_OnTrack::dump(MsgStream& sl) const
75 {
76  sl << "Trk::CaloCluster_OnTrack { "
77  << "\n";
78  sl << "\t surface = " << associatedSurface() << "\n";
79  sl << "\t position = (" << localParameters() << endmsg;
80  sl << "\t has Error Matrix: "
81  << "\n";
82  sl << localCovariance() << "}"
83  << "\n";
84 
85  return sl;
86 }
87 
88 std::ostream&
89 Trk::CaloCluster_OnTrack::dump(std::ostream& sl) const
90 {
91  sl << "\t surface = " << associatedSurface() << "\n";
92  sl << "\t position = (" << localParameters() << "\n";
93  sl << "\t has Error Matrix: "
94  << "\n";
95  sl << localCovariance() << "}"
96  << "\n";
97  return sl;
98 }
99 
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::MeasurementBase::operator=
MeasurementBase & operator=(const MeasurementBase &)=default
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::MeasurementBaseType::CaloCluster_OnTrack
@ CaloCluster_OnTrack
Definition: MeasurementBase.h:53
Trk::CaloCluster_OnTrack::operator=
CaloCluster_OnTrack & operator=(const CaloCluster_OnTrack &cot)
Assignment operator.
Definition: CaloCluster_OnTrack.cxx:50
Trk::SurfacePtrHolderImpl
Definition: SurfaceHolderImpl.h:79
Trk::CaloCluster_OnTrack::m_globalpos
Amg::Vector3D m_globalpos
global position of the cluster hit
Definition: CaloCluster_OnTrack.h:88
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trk::CaloCluster_OnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override final
returns the some information about this CaloCluster_OnTrack.
Definition: CaloCluster_OnTrack.cxx:74
Trk::CaloCluster_OnTrack::clone
virtual CaloCluster_OnTrack * clone() const override final
Pseudo-constructor, needed to avoid excessive RTTI.
Definition: CaloCluster_OnTrack.cxx:62
Trk::CaloCluster_OnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: CaloCluster_OnTrack.cxx:68
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::CaloCluster_OnTrack
Definition: CaloCluster_OnTrack.h:32
Trk::EnergyLoss
This class describes energy loss material effects in the ATLAS tracking EDM.
Definition: EnergyLoss.h:34
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CaloCluster_OnTrack.h
Trk::CaloCluster_OnTrack::CaloCluster_OnTrack
CaloCluster_OnTrack()
Default Constructor for POOL.
Definition: CaloCluster_OnTrack.cxx:31
Trk::SurfacePtrHolderImpl::operator=
SurfacePtrHolderImpl & operator=(const SurfacePtrHolderImpl &other)
copy assingmemnt if surface is free we clone/copy.
Definition: SurfaceHolderImpl.h:105
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::CaloCluster_OnTrack::m_eloss
std::unique_ptr< const Trk::EnergyLoss > m_eloss
Energy Loss.
Definition: CaloCluster_OnTrack.h:91