ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SimHitHandle_TrackRecord Class Reference

#include <SimHitHandle_TrackRecord.h>

Inheritance diagram for SimHitHandle_TrackRecord:
Collaboration diagram for SimHitHandle_TrackRecord:

Public Member Functions

 SimHitHandle_TrackRecord (const TrackRecord *)
 
virtual ~SimHitHandle_TrackRecord ()
 
virtual QString type () const override
 
virtual Amg::Vector3D momentumDirection () const override
 
virtual double actualMomentum () const override
 
virtual Amg::Vector3D posStart () const override
 
virtual Amg::Vector3D posEnd () const override
 
virtual double hitTime () const override
 
virtual int actualPDGCodeFromSimHit () const override
 
virtual const HepMcParticleLinkparticleLink () const override
 
virtual Trk::TrackParameterscreateTrackParameters () const override
 
double momentum () const
 
int pdg () const
 
SimBarCode simBarCode () const
 
bool hasCharge () const
 
double charge () const
 
void setFakeMomentum (const double &m)
 
void setCharge (const double &c)
 
void cacheMomentum ()
 

Private Member Functions

void setPDG (int)
 

Private Attributes

TrackRecordm_trkrecord
 
double m_mom
 
Amg::Vector3D m_momdir
 
const HepMcParticleLinkm_link
 
Trk::TrackParametersm_trackPars
 
int m_pdgId
 
double m_fakemom
 
double m_charge
 

Detailed Description

Definition at line 28 of file SimHitHandle_TrackRecord.h.

Constructor & Destructor Documentation

◆ SimHitHandle_TrackRecord()

SimHitHandle_TrackRecord::SimHitHandle_TrackRecord ( const TrackRecord tr)

Definition at line 25 of file SimHitHandle_TrackRecord.cxx.

◆ ~SimHitHandle_TrackRecord()

SimHitHandle_TrackRecord::~SimHitHandle_TrackRecord ( )
virtual

Definition at line 35 of file SimHitHandle_TrackRecord.cxx.

36 {
37  delete m_link;
38 }

Member Function Documentation

◆ actualMomentum()

double SimHitHandle_TrackRecord::actualMomentum ( ) const
inlineoverridevirtual

Reimplemented from SimHitHandleBase.

Definition at line 62 of file SimHitHandle_TrackRecord.h.

63 {
64  return m_mom;
65 }

◆ actualPDGCodeFromSimHit()

int SimHitHandle_TrackRecord::actualPDGCodeFromSimHit ( ) const
inlineoverridevirtual

Reimplemented from SimHitHandleBase.

Definition at line 82 of file SimHitHandle_TrackRecord.h.

83 {
84  return m_trkrecord->GetPDGCode();
85 }

◆ cacheMomentum()

void SimHitHandleBase::cacheMomentum ( )
inlineinherited

Definition at line 58 of file SimHitHandleBase.h.

58 { if (m_fakemom==-2) m_fakemom = actualMomentum(); }

◆ charge()

double SimHitHandleBase::charge ( ) const
inlineinherited

Definition at line 51 of file SimHitHandleBase.h.

51 { return m_charge; }

◆ createTrackParameters()

Trk::TrackParameters * SimHitHandle_TrackRecord::createTrackParameters ( ) const
overridevirtual

Implements SimHitHandleBase.

Definition at line 41 of file SimHitHandle_TrackRecord.cxx.

42 {
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;
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  }
62 }

◆ hasCharge()

bool SimHitHandleBase::hasCharge ( ) const
inlineinherited

Definition at line 50 of file SimHitHandleBase.h.

50 { return m_charge!=-99999.0; }

◆ hitTime()

double SimHitHandle_TrackRecord::hitTime ( ) const
inlineoverridevirtual

Implements SimHitHandleBase.

Definition at line 77 of file SimHitHandle_TrackRecord.h.

78 {
79  return m_trkrecord->GetTime();
80 }

◆ momentum()

double SimHitHandleBase::momentum ( ) const
inlineinherited

Definition at line 41 of file SimHitHandleBase.h.

41 { return m_fakemom == -2 ? actualMomentum() : m_fakemom; }

◆ momentumDirection()

Amg::Vector3D SimHitHandle_TrackRecord::momentumDirection ( ) const
inlineoverridevirtual

Implements SimHitHandleBase.

Definition at line 57 of file SimHitHandle_TrackRecord.h.

58 {
59  return m_momdir;
60 }

◆ particleLink()

const HepMcParticleLink & SimHitHandle_TrackRecord::particleLink ( ) const
overridevirtual

Implements SimHitHandleBase.

Definition at line 64 of file SimHitHandle_TrackRecord.cxx.

65 {
66  return *m_link;
67 }

◆ pdg()

int SimHitHandleBase::pdg ( ) const
inlineinherited

Definition at line 82 of file SimHitHandleBase.h.

83 {
84  return m_pdgId;
85 }

◆ posEnd()

Amg::Vector3D SimHitHandle_TrackRecord::posEnd ( ) const
inlineoverridevirtual

Implements SimHitHandleBase.

Definition at line 72 of file SimHitHandle_TrackRecord.h.

73 {
74  return posStart() + 0.1*CLHEP::mm*(momentumDirection());//faking it... but shouldn't matter.
75 }

◆ posStart()

Amg::Vector3D SimHitHandle_TrackRecord::posStart ( ) const
inlineoverridevirtual

Implements SimHitHandleBase.

Definition at line 67 of file SimHitHandle_TrackRecord.h.

68 {
70 }

◆ setCharge()

void SimHitHandleBase::setCharge ( const double &  c)
inlineinherited

Definition at line 57 of file SimHitHandleBase.h.

57 { m_charge = c; }

◆ setFakeMomentum()

void SimHitHandleBase::setFakeMomentum ( const double &  m)
inlineinherited

Definition at line 56 of file SimHitHandleBase.h.

56 { m_fakemom = m; }

◆ setPDG()

void SimHitHandleBase::setPDG ( int  pdg)
inlineprivateinherited

Definition at line 87 of file SimHitHandleBase.h.

88 {
89  m_pdgId = pdg;
90 }

◆ simBarCode()

SimBarCode SimHitHandleBase::simBarCode ( ) const
inlineinherited

Definition at line 48 of file SimHitHandleBase.h.

48 { return SimBarCode(particleLink(),pdg()); }

◆ type()

virtual QString SimHitHandle_TrackRecord::type ( ) const
inlineoverridevirtual

Implements SimHitHandleBase.

Definition at line 34 of file SimHitHandle_TrackRecord.h.

34 { return "TrackRecord"; };

Member Data Documentation

◆ m_charge

double SimHitHandleBase::m_charge
privateinherited

Definition at line 71 of file SimHitHandleBase.h.

◆ m_fakemom

double SimHitHandleBase::m_fakemom
privateinherited

Definition at line 70 of file SimHitHandleBase.h.

◆ m_link

const HepMcParticleLink* SimHitHandle_TrackRecord::m_link
private

Definition at line 50 of file SimHitHandle_TrackRecord.h.

◆ m_mom

double SimHitHandle_TrackRecord::m_mom
private

Definition at line 48 of file SimHitHandle_TrackRecord.h.

◆ m_momdir

Amg::Vector3D SimHitHandle_TrackRecord::m_momdir
private

Definition at line 49 of file SimHitHandle_TrackRecord.h.

◆ m_pdgId

int SimHitHandleBase::m_pdgId
privateinherited

Definition at line 68 of file SimHitHandleBase.h.

◆ m_trackPars

Trk::TrackParameters* SimHitHandleBase::m_trackPars
mutableprivateinherited

Definition at line 67 of file SimHitHandleBase.h.

◆ m_trkrecord

TrackRecord* SimHitHandle_TrackRecord::m_trkrecord
private

Definition at line 47 of file SimHitHandle_TrackRecord.h.


The documentation for this class was generated from the following files:
SimHitHandleBase::particleLink
virtual const HepMcParticleLink & particleLink() const =0
SimHitHandle_TrackRecord::posStart
virtual Amg::Vector3D posStart() const override
Definition: SimHitHandle_TrackRecord.h:67
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
SimHitHandle_TrackRecord::m_momdir
Amg::Vector3D m_momdir
Definition: SimHitHandle_TrackRecord.h:49
SimBarCode
Definition: SimBarCode.h:22
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
TrackRecord::GetTime
double GetTime() const
Time.
Definition: TrackRecord.h:106
SimHitHandle_TrackRecord::m_link
const HepMcParticleLink * m_link
Definition: SimHitHandle_TrackRecord.h:50
TrackRecord::GetPosition
CLHEP::Hep3Vector GetPosition() const
Position.
Definition: TrackRecord.h:88
SimHitHandleBase::SimHitHandleBase
SimHitHandleBase()
Definition: SimHitHandleBase.h:34
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
VP1ParticleData::particleCharge
static double particleCharge(const int &pdgcode, bool &ok)
Definition: VP1ParticleData.cxx:103
SimHitHandle_TrackRecord::m_mom
double m_mom
Definition: SimHitHandle_TrackRecord.h:48
python.selection.number
number
Definition: selection.py:20
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
SimHitHandleBase::m_fakemom
double m_fakemom
Definition: SimHitHandleBase.h:70
SimHitHandleBase::m_charge
double m_charge
Definition: SimHitHandleBase.h:71
TrackRecord::GetMomentum
CLHEP::Hep3Vector GetMomentum() const
Momentum.
Definition: TrackRecord.h:94
TrackRecord
Definition: TrackRecord.h:12
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
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
SimHitHandleBase::m_pdgId
int m_pdgId
Definition: SimHitHandleBase.h:68
TrackRecord::barcode
int barcode() const
bar code.
Definition: TrackRecord.h:135
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
SimHitHandleBase::actualMomentum
virtual double actualMomentum() const
Definition: SimHitHandleBase.h:40
SimHitHandle_TrackRecord::momentumDirection
virtual Amg::Vector3D momentumDirection() const override
Definition: SimHitHandle_TrackRecord.h:57
Trk::AtaPlane
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:34
SimHitHandleBase::charge
double charge() const
Definition: SimHitHandleBase.h:51
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
TrackRecord::GetPDGCode
int GetPDGCode() const
PDG Code.
Definition: TrackRecord.h:100
python.compressB64.c
def c
Definition: compressB64.py:93
SimHitHandle_TrackRecord::m_trkrecord
TrackRecord * m_trkrecord
Definition: SimHitHandle_TrackRecord.h:47