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

#include <SimHitHandle_ForwardHit.h>

Inheritance diagram for SimHitHandle_ForwardHit:
Collaboration diagram for SimHitHandle_ForwardHit:

Classes

class  Imp
 

Public Member Functions

 SimHitHandle_ForwardHit (const SimulationHit *)
 
virtual ~SimHitHandle_ForwardHit ()
 
QString type () const
 
Amg::Vector3D momentumDirection () const
 
double actualMomentum () const
 
Amg::Vector3D posStart () const
 
Amg::Vector3D posEnd () const
 
double hitTime () const
 
int actualPDGCodeFromSimHit () const
 
const HepMcParticleLinkparticleLink () const
 
Trk::TrackParameterscreateTrackParameters () const
 
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

Impm_d
 
HepMcParticleLink m_link
 
Trk::TrackParametersm_trackPars
 
int m_pdgId
 
double m_fakemom
 
double m_charge
 

Detailed Description

Definition at line 23 of file SimHitHandle_ForwardHit.h.

Constructor & Destructor Documentation

◆ SimHitHandle_ForwardHit()

SimHitHandle_ForwardHit::SimHitHandle_ForwardHit ( const SimulationHit h)

Definition at line 42 of file SimHitHandle_ForwardHit.cxx.

43  : SimHitHandleBase(), m_d(new Imp(h))
44 {
45  if (!h)
46  VP1Msg::message("SimHitHandle_ForwardHit constructor ERROR: Received null hit pointer");
47 
49 }

◆ ~SimHitHandle_ForwardHit()

SimHitHandle_ForwardHit::~SimHitHandle_ForwardHit ( )
virtual

Definition at line 52 of file SimHitHandle_ForwardHit.cxx.

53 {
54  delete m_d;
55 }

Member Function Documentation

◆ actualMomentum()

double SimHitHandle_ForwardHit::actualMomentum ( ) const
virtual

Reimplemented from SimHitHandleBase.

Definition at line 63 of file SimHitHandle_ForwardHit.cxx.

64 {
65  return m_d->thehit->pre().momentum.mag();
66 }

◆ actualPDGCodeFromSimHit()

int SimHitHandle_ForwardHit::actualPDGCodeFromSimHit ( ) const
virtual

Reimplemented from SimHitHandleBase.

Definition at line 92 of file SimHitHandle_ForwardHit.cxx.

93 {
94  return m_d->thehit->particleEncoding();
95 }

◆ 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_ForwardHit::createTrackParameters ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 98 of file SimHitHandle_ForwardHit.cxx.

99 {
100 
101  // const Trk::StraightLineSurface * surf = new Trk::StraightLineSurface(new HepGeom::Translate3D(0,0,0));
102  Amg::Transform3D transf = Amg::CLHEPTranslate3DToEigen( HepGeom::Translate3D(0,0,0) );
103  const Trk::StraightLineSurface * surf = new Trk::StraightLineSurface( transf );
104 
105 
106  if (!surf) {
107  VP1Msg::message("SimHitHandle_ForwardHit::createTrackParameters ERROR: could not get Trk::StraightLineSurface");
108  return nullptr;
109  }
110 
111  double c;
112  if ( !hasCharge() ) {
113  bool ok;
115  if (!ok) {
116  VP1Msg::message("SimHitHandle_ForwardHit::createTrackParameters ERROR: Could not find particle charge (pdg="
117  +QString::number(m_d->thehit->particleEncoding())+"). Assuming charge=+1.");
118  c = +1.0;
119  } else {
120  if (VP1Msg::verbose())
121  VP1Msg::messageVerbose("Looked up particle charge for trt simhit with pdg code "+VP1Msg::str(m_d->thehit->particleEncoding())+": "+VP1Msg::str(c));
122  }
123  const_cast<SimHitHandle_ForwardHit*>(this)->setCharge(c);
124  } else {
125  c = charge();
126  }
127  return new Trk::AtaStraightLine(posStart(),momentumDirection(),c,*surf);
128  //Fixme: Use constructor with local coords instead?:
129 }

◆ hasCharge()

bool SimHitHandleBase::hasCharge ( ) const
inlineinherited

Definition at line 50 of file SimHitHandleBase.h.

50 { return m_charge!=-99999.0; }

◆ hitTime()

double SimHitHandle_ForwardHit::hitTime ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 80 of file SimHitHandle_ForwardHit.cxx.

81 {
82  return m_d->thehit->pre().time;
83 }

◆ 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_ForwardHit::momentumDirection ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 58 of file SimHitHandle_ForwardHit.cxx.

59 {
61 }

◆ particleLink()

const HepMcParticleLink & SimHitHandle_ForwardHit::particleLink ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 86 of file SimHitHandle_ForwardHit.cxx.

87 {
88  return m_link;
89 }

◆ pdg()

int SimHitHandleBase::pdg ( ) const
inlineinherited

Definition at line 82 of file SimHitHandleBase.h.

83 {
84  return m_pdgId;
85 }

◆ posEnd()

Amg::Vector3D SimHitHandle_ForwardHit::posEnd ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 74 of file SimHitHandle_ForwardHit.cxx.

75 {
77 }

◆ posStart()

Amg::Vector3D SimHitHandle_ForwardHit::posStart ( ) const
virtual

Implements SimHitHandleBase.

Definition at line 68 of file SimHitHandle_ForwardHit.cxx.

69 {
71 }

◆ 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()

QString SimHitHandle_ForwardHit::type ( ) const
inlinevirtual

Implements SimHitHandleBase.

Definition at line 29 of file SimHitHandle_ForwardHit.h.

29 { return "SimulationHit"; };

Member Data Documentation

◆ m_charge

double SimHitHandleBase::m_charge
privateinherited

Definition at line 71 of file SimHitHandleBase.h.

◆ m_d

Imp* SimHitHandle_ForwardHit::m_d
private

Definition at line 44 of file SimHitHandle_ForwardHit.h.

◆ m_fakemom

double SimHitHandleBase::m_fakemom
privateinherited

Definition at line 70 of file SimHitHandleBase.h.

◆ m_link

HepMcParticleLink SimHitHandle_ForwardHit::m_link
private

Definition at line 45 of file SimHitHandle_ForwardHit.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.


The documentation for this class was generated from the following files:
SimHitHandleBase::particleLink
virtual const HepMcParticleLink & particleLink() const =0
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
SimHitHandle_ForwardHit::m_link
HepMcParticleLink m_link
Definition: SimHitHandle_ForwardHit.h:45
SimHitHandle_ForwardHit::posStart
Amg::Vector3D posStart() const
Definition: SimHitHandle_ForwardHit.cxx:68
SimulationHit::StepPoint::time
double time
Definition: SimulationHit.h:23
VP1String::str
static QString str(const QString &s)
Definition: VP1String.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
SimulationHit::pre
const StepPoint & pre() const
Definition: SimulationHit.h:30
Trk::AtaStraightLine
ParametersT< TrackParametersDim, Charged, StraightLineSurface > AtaStraightLine
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:35
SimHitHandleBase::setCharge
void setCharge(const double &c)
Definition: SimHitHandleBase.h:57
SimHitHandleBase::SimHitHandleBase
SimHitHandleBase()
Definition: SimHitHandleBase.h:34
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
SimHitHandle_ForwardHit::Imp::thehit
const SimulationHit * thehit
Definition: SimHitHandle_ForwardHit.cxx:37
VP1ParticleData::particleCharge
static double particleCharge(const int &pdgcode, bool &ok)
Definition: VP1ParticleData.cxx:103
SimulationHit::StepPoint::position
CLHEP::Hep3Vector position
Definition: SimulationHit.h:24
SimHitHandle_ForwardHit::momentumDirection
Amg::Vector3D momentumDirection() const
Definition: SimHitHandle_ForwardHit.cxx:58
SimulationHit::trackID
int trackID() const
Definition: SimulationHit.h:34
SimHitHandle_ForwardHit
Definition: SimHitHandle_ForwardHit.h:23
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
SimulationHit::particleEncoding
int particleEncoding() const
Definition: SimulationHit.h:33
SimHitHandleBase::m_charge
double m_charge
Definition: SimHitHandleBase.h:71
SimulationHit::post
const StepPoint & post() const
Definition: SimulationHit.h:31
SimHitHandle_ForwardHit::m_d
Imp * m_d
Definition: SimHitHandle_ForwardHit.h:43
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
h
SimHitHandleBase::m_pdgId
int m_pdgId
Definition: SimHitHandleBase.h:68
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
SimHitHandleBase::hasCharge
bool hasCharge() const
Definition: SimHitHandleBase.h:50
SimHitHandleBase::actualMomentum
virtual double actualMomentum() const
Definition: SimHitHandleBase.h:40
SimHitHandleBase::charge
double charge() const
Definition: SimHitHandleBase.h:51
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
python.compressB64.c
def c
Definition: compressB64.py:93
SimulationHit::StepPoint::direction
CLHEP::Hep3Vector direction
Definition: SimulationHit.h:26
SimulationHit::StepPoint::momentum
CLHEP::Hep3Vector momentum
Definition: SimulationHit.h:27
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51