ATLAS Offline Software
graphics
VP1
VP1Systems
VP1TrackSystems
src
SimHitHandle_TrackRecord.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
7
// //
8
// Implementation of class SimHitHandle_TrackRecord //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: May 2008 //
12
// //
14
15
#include "
VP1TrackSystems/SimHitHandle_TrackRecord.h
"
16
#include "
VP1Utils/VP1ParticleData.h
"
17
#include "
VP1Base/VP1Msg.h
"
18
19
#include "
GeneratorObjects/HepMcParticleLink.h
"
20
#include "
TrkSurfaces/PlaneSurface.h
"
21
22
#include "
TrkParameters/TrackParameters.h
"
23
24
//____________________________________________________________________
25
SimHitHandle_TrackRecord::SimHitHandle_TrackRecord
(
const
TrackRecord
* tr)
26
:
SimHitHandleBase
(),
27
m_trkrecord(const_cast<
TrackRecord
*>(tr)),
28
m_mom(m_trkrecord->GetMomentum().
mag
()),
29
m_momdir(
Amg
::
Hep3VectorToEigen
( m_trkrecord->GetMomentum().
unit
() ) ),
30
m_link(
new
HepMcParticleLink
(m_trkrecord->
barcode
(), 0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE))
// FIXME barcode-based
31
{
32
}
33
34
//____________________________________________________________________
35
SimHitHandle_TrackRecord::~SimHitHandle_TrackRecord
()
36
{
37
delete
m_link
;
38
}
39
40
//____________________________________________________________________
41
Trk::TrackParameters
*
SimHitHandle_TrackRecord::createTrackParameters
()
const
42
{
43
Amg::Transform3D
transf =
Amg::CLHEPTranslate3DToEigen
(HepGeom::Translate3D(
m_trkrecord
->
GetPosition
().x(),
m_trkrecord
->
GetPosition
().y(),
m_trkrecord
->
GetPosition
().z()));
44
//Surface:
45
const
Trk::PlaneSurface
* surf
46
=
new
Trk::PlaneSurface
( transf );
47
//Fixme: surface and transform ever DELETED??
48
49
//Fixme: Don't do this in every simhit!!:
50
bool
hasCharge
;
51
double
charge
;
52
charge
=
VP1ParticleData::particleCharge
(
pdg
(),
hasCharge
);
53
if
(!
hasCharge
) {
54
VP1Msg::message
(
"SimHitHandle_TrackRecord::createTrackParameters ERROR: Could not find particle charge (pdg="
55
+
QString::number
(
pdg
())+
"). Assuming charge=+1."
);
56
charge
= +1.0;
57
}
else
{
58
if
(
VP1Msg::verbose
())
59
VP1Msg::messageVerbose
(
"Looked up particle charge for track record with pdg code "
+
VP1Msg::str
(
pdg
())+
": "
+
VP1Msg::str
(
charge
));
60
}
61
return
new
Trk::AtaPlane
(
posStart
(),
Amg::Hep3VectorToEigen
(
m_trkrecord
->
GetMomentum
()),
charge
,*surf);
62
}
63
64
const
HepMcParticleLink
&
SimHitHandle_TrackRecord::particleLink
()
const
65
{
66
return
*
m_link
;
67
}
68
SimHitHandle_TrackRecord::SimHitHandle_TrackRecord
SimHitHandle_TrackRecord(const TrackRecord *)
Definition:
SimHitHandle_TrackRecord.cxx:25
SimHitHandle_TrackRecord::posStart
virtual Amg::Vector3D posStart() const override
Definition:
SimHitHandle_TrackRecord.h:67
HepMcParticleLink.h
TrackParameters.h
VP1Msg.h
CSV_InDetExporter.new
new
Definition:
CSV_InDetExporter.py:145
VP1ParticleData.h
SimHitHandle_TrackRecord::createTrackParameters
virtual Trk::TrackParameters * createTrackParameters() const override
Definition:
SimHitHandle_TrackRecord.cxx:41
SimHitHandle_TrackRecord::~SimHitHandle_TrackRecord
virtual ~SimHitHandle_TrackRecord()
Definition:
SimHitHandle_TrackRecord.cxx:35
SimHitHandle_TrackRecord::particleLink
virtual const HepMcParticleLink & particleLink() const override
Definition:
SimHitHandle_TrackRecord.cxx:64
VP1String::str
static QString str(const QString &s)
Definition:
VP1String.h:49
Amg::Hep3VectorToEigen
Amg::Vector3D Hep3VectorToEigen(const CLHEP::Hep3Vector &CLHEPvector)
Converts a CLHEP-based CLHEP::Hep3Vector into an Eigen-based Amg::Vector3D.
Definition:
CLHEPtoEigenConverter.h:137
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition:
HepMcParticleLink.h:72
SimHitHandle_TrackRecord::m_link
const HepMcParticleLink * m_link
Definition:
SimHitHandle_TrackRecord.h:50
TrackRecord::GetPosition
CLHEP::Hep3Vector GetPosition() const
Position.
Definition:
TrackRecord.h:88
HepMC::barcode
int barcode(const T *p)
Definition:
Barcode.h:16
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition:
GeoPrimitives.h:46
VP1ParticleData::particleCharge
static double particleCharge(const int &pdgcode, bool &ok)
Definition:
VP1ParticleData.cxx:103
Trk::ParametersBase
Definition:
ParametersBase.h:55
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition:
AmgStringHelpers.h:19
python.selection.number
number
Definition:
selection.py:20
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition:
VP1Msg.cxx:84
TrackRecord::GetMomentum
CLHEP::Hep3Vector GetMomentum() const
Momentum.
Definition:
TrackRecord.h:94
TrackRecord
Definition:
TrackRecord.h:12
Amg::CLHEPTranslate3DToEigen
Amg::Transform3D CLHEPTranslate3DToEigen(const HepGeom::Translate3D &CLHEPtranslate3D)
Converts a CLHEP-based HepGeom::Translate3 into an Eigen-based Amg::Transform3D.
Definition:
CLHEPtoEigenConverter.h:99
SimHitHandleBase::pdg
int pdg() const
Definition:
SimHitHandleBase.h:82
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition:
VP1Msg.cxx:30
Trk::PlaneSurface
Definition:
PlaneSurface.h:64
SimHitHandleBase::hasCharge
bool hasCharge() const
Definition:
SimHitHandleBase.h:50
PlaneSurface.h
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition:
AmgMatrixBasePlugin.h:21
Trk::AtaPlane
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane
Definition:
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:34
SimHitHandleBase
Definition:
SimHitHandleBase.h:32
SimHitHandleBase::charge
double charge() const
Definition:
SimHitHandleBase.h:51
VP1Msg::verbose
static bool verbose()
Definition:
VP1Msg.h:31
SimHitHandle_TrackRecord.h
mag
Scalar mag() const
mag method
Definition:
AmgMatrixBasePlugin.h:26
SimHitHandle_TrackRecord::m_trkrecord
TrackRecord * m_trkrecord
Definition:
SimHitHandle_TrackRecord.h:47
Generated on Fri Nov 8 2024 21:26:22 for ATLAS Offline Software by
1.8.18