ATLAS Offline Software
PixelClusterOnTrack.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 // PixelClusterOnTrack.cxx, (c) ATLAS Detector Software
8 
12 #include "GaudiKernel/MsgStream.h"
13 #include <ostream>
14 
15 
17  const InDet::PixelCluster* RIO,
18  Trk::LocalParameters&& locpars,
19  Amg::MatrixX&& locerr,
20  const IdentifierHash& idDE,
21  bool,
22  bool isbroad)
23  : // call base class constructor
24  InDet::SiClusterOnTrack(std::move(locpars),
25  std::move(locerr),
26  idDE, RIO->identify(), isbroad)
27  , m_hasClusterAmbiguity(RIO->isAmbiguous())
28  , m_isFake(RIO->isFake())
29  , m_energyLoss(RIO->energyLoss())
30  , m_detEl(RIO->detectorElement())
31 {
32  m_rio.setElement(RIO);
33  // Set global position
35 }
36 
37 // Constructor with parameters
39  const InDet::PixelCluster* RIO,
40  Trk::LocalParameters&& locpars,
41  Amg::MatrixX&& locerr,
42  const IdentifierHash& idDE,
43  const Amg::Vector3D& globalPosition,
44  bool,
45  bool isbroad)
46  : // call base class constructor
47  InDet::SiClusterOnTrack(std::move(locpars),
48  std::move(locerr),
49  idDE,
50  RIO->identify(),
51  globalPosition,
52  isbroad)
53  , m_hasClusterAmbiguity(RIO->isAmbiguous())
54  , m_isFake(RIO->isFake())
55  , m_energyLoss(RIO->energyLoss())
56  , m_detEl(RIO->detectorElement())
57 {
58  m_rio.setElement(RIO);
59 }
60 
61 
62 
63 //P->T constructor
66  const Trk::LocalParameters& locpars,
67  const Amg::MatrixX& locerr,
68  const IdentifierHash& idDE,
69  const Identifier& id,
70  float energyLoss,
71  bool isFake,
72  bool hasClusterAmbiguity,
73  bool isbroad)
74  : InDet::SiClusterOnTrack(Trk::LocalParameters(locpars), Amg::MatrixX(locerr), idDE, id, isbroad),
75  m_rio (RIO),
76  m_hasClusterAmbiguity (hasClusterAmbiguity),
77  m_isFake (isFake),
78  m_energyLoss (energyLoss),
79  m_detEl (nullptr)
80 {
81  // The setting of the global position
82  // happens via the setValues method
83 }
84 
85 
86 
87 // Default constructor:
89  :
91  m_rio(),
92  m_hasClusterAmbiguity(false),
93  m_isFake(false),
94  m_energyLoss(0.),
95  m_detEl(nullptr)
96 {}
97 
98 
99 
100 
102 { return ( detectorElement()->surface()); }
103 
104 
106 {
107  //set detector element
108  m_detEl = dynamic_cast< const InDetDD::SiDetectorElement* >(detEl);
109  if(m_detEl){
110  //Then set global potition based on it
112  }
113 }
114 
115 
116 
117 MsgStream& InDet::PixelClusterOnTrack::dump( MsgStream& sl ) const
118 {
119  sl<<"PixelClusterOnTrack {"<<endmsg;
120  InDet::SiClusterOnTrack::dump(sl); // use common dump(...) from SiClusterOnTrack
121  sl<<"Ganged cluster ambiguity: "<<hasClusterAmbiguity()
122  <<", fake: " << isFake()
123  <<", dedX: " << energyLoss()
124  <<endmsg;
125  sl<<"}"<<endmsg;
126  return sl;
127 }
128 
129 std::ostream& InDet::PixelClusterOnTrack::dump( std::ostream& sl ) const
130 {
131  sl<<"PixelClusterOnTrack {"<<std::endl;
132  InDet::SiClusterOnTrack::dump(sl);// use common dump(...) from SiClusterOnTrack
133  sl<<"Ganged cluster ambiguity: "<<hasClusterAmbiguity()
134  <<", fake: " << isFake()
135  <<", dedX: " << energyLoss()
136  <<std::endl;
137  sl<<"}"<<std::endl;
138  return sl;
139 }
140 
141 
142 
143 
144 
145 
146 
InDet::PixelClusterOnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override final
returns some information about this RIO_OnTrack.
Definition: PixelClusterOnTrack.cxx:117
Trk::LocalParameters
Definition: LocalParameters.h:98
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::PixelClusterOnTrack::m_rio
ElementLinkToIDCPixelClusterContainer m_rio
PixelCluster - the RIO (PRD, PrepRawData)
Definition: PixelClusterOnTrack.h:162
InDetSecVtxTruthMatchUtils::isFake
bool isFake(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:60
PixelCluster.h
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
InDet::PixelClusterOnTrack::PixelClusterOnTrack
PixelClusterOnTrack()
Default constructor - needed for POOL.
Definition: PixelClusterOnTrack.cxx:88
InDet::PixelClusterOnTrack::energyLoss
float energyLoss() const
returns the energy loss in MeV associated to this cluster.
Definition: PixelClusterOnTrack.h:206
InDet::PixelClusterOnTrack::hasClusterAmbiguity
bool hasClusterAmbiguity() const
returns whether there was an ambiguity associated with this pixel cluster.
Definition: PixelClusterOnTrack.h:198
InDet::PixelClusterOnTrack::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: PixelClusterOnTrack.h:193
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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:227
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
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
InDet::PixelClusterOnTrack::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: PixelClusterOnTrack.cxx:105
InDet::PixelClusterOnTrack::isFake
bool isFake() const
returns whether this cluster is likely to be the fake mirror image of a ganged pixel.
Definition: PixelClusterOnTrack.h:202
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
PixelClusterOnTrack.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::PixelClusterOnTrack::associatedSurface
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: PixelClusterOnTrack.cxx:101
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
InDet::PixelClusterOnTrack::m_detEl
const InDetDD::SiDetectorElement * m_detEl
corresponding detector element
Definition: PixelClusterOnTrack.h:172
Identifier
Definition: IdentifierFieldParser.cxx:14