ATLAS Offline Software
Loading...
Searching...
No Matches
AscObj_TruthPoint Class Reference

#include <AscObj_TruthPoint.h>

Inheritance diagram for AscObj_TruthPoint:
Collaboration diagram for AscObj_TruthPoint:

Classes

class  Imp

Public Types

enum  PICKSTYLE { UNPICKABLE , ALL , COMPONENTS }

Public Member Functions

 AscObj_TruthPoint (TrackHandleBase *, HepMC::ConstGenVertexPtr v, HepMC::ConstGenParticlePtr p)
 AscObj_TruthPoint (TrackHandleBase *, SimHitHandleBase *)
virtual ~AscObj_TruthPoint ()
void buildShapes (SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
QStringList clicked ()
virtual TrackCommonFlags::TSOSPartsFlags parts () const
virtual unsigned nParts () const
bool hasParameters () const
bool hasParError () const
bool hasError () const
bool hasMaterialEffect () const
bool hasSurface () const
bool hasMeasurement () const
TrackSysCommonDatacommon () const
void setPickable (PICKSTYLE)
PICKSTYLE pickStyle () const
virtual void setVisible (bool)
bool visible () const
void toggleVisible ()
TrackHandleBasetrackHandle () const
void update3DObjects ()
SoSeparator * shapeSimple () const
SoSeparator * shapeDetailed () const
virtual bool initiatesOwnZooms () const

Static Public Member Functions

static int numberOfInstances ()

Protected Member Functions

int regionIndex () const
double lodCrossOverValue () const

Private Member Functions

void registerShapes (SoSeparator *simple, SoSeparator *detailed)
void unregisterShapes (SoSeparator *simple, SoSeparator *detailed)
AssocObjAttachmentHandlegetAttachmentHandle ()

Private Attributes

Impm_d
TrackHandleBasem_trackHandle
bool m_visible
PICKSTYLE m_pickStyle

Detailed Description

Definition at line 27 of file AscObj_TruthPoint.h.

Member Enumeration Documentation

◆ PICKSTYLE

Constructor & Destructor Documentation

◆ AscObj_TruthPoint() [1/2]

AscObj_TruthPoint::AscObj_TruthPoint ( TrackHandleBase * th,
HepMC::ConstGenVertexPtr v,
HepMC::ConstGenParticlePtr p )

◆ AscObj_TruthPoint() [2/2]

AscObj_TruthPoint::AscObj_TruthPoint ( TrackHandleBase * th,
SimHitHandleBase * s )

Definition at line 56 of file AscObj_TruthPoint.cxx.

58{
59}

◆ ~AscObj_TruthPoint()

AscObj_TruthPoint::~AscObj_TruthPoint ( )
virtual

Definition at line 62 of file AscObj_TruthPoint.cxx.

63{
64 delete m_d;
65}

Member Function Documentation

◆ buildShapes()

void AscObj_TruthPoint::buildShapes ( SoSeparator *& shape_simple,
SoSeparator *& shape_detailed )
virtual

Implements AssociatedObjectHandleBase.

Definition at line 68 of file AscObj_TruthPoint.cxx.

69{
70 VP1Msg::message("AscObj_TruthPoint::buildShapes.");
71
72 // Eigen migration
73// Trk::GlobalPosition p1;//point
74// Trk::GlobalMomentum u;//mom direction
75 Amg::Vector3D p1;//point
76 Amg::Vector3D u;//mom direction
77
78
79 if (m_d->simhit) {
80 p1 = m_d->simhit->posStart();
81 u = m_d->simhit->momentumDirection();
82 }
83 else
84 {
85 // Eigen migration
86 p1 = Amg::Vector3D(m_d->genVertex->position().x(),m_d->genVertex->position().y(),m_d->genVertex->position().z());
87 u = Amg::Vector3D(m_d->genParticle->momentum().px(),m_d->genParticle->momentum().py(),m_d->genParticle->momentum().pz()).unit();
88 }
89
90 // Eigen migration
91// Trk::GlobalPosition p2 = p1+5*CLHEP::cm*u;
92 Amg::Vector3D p2 = p1+5*CLHEP::cm*u;
93
94 SoLineSet * line = new SoLineSet();
95 SoVertexProperty * vertices = new SoVertexProperty();
96 vertices->vertex.set1Value(0,p1.x(),p1.y(),p1.z());
97 vertices->vertex.set1Value(1,p2.x(),p2.y(),p2.z());
98 line->numVertices.set1Value(0,2);
99 line->vertexProperty = vertices;
100
101 shape_simple = new SoSeparator;
102 shape_simple->addChild(line);
103 shape_detailed = shape_simple;
104
105// //Fixme: Uncomment these two lines:
106// shape_detailed = new SoSeparator;
107// shape_detailed->addChild(line);
108}
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30
Eigen::Matrix< double, 3, 1 > Vector3D
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ clicked()

QStringList AscObj_TruthPoint::clicked ( )
virtual

Implements AssociatedObjectHandleBase.

Definition at line 111 of file AscObj_TruthPoint.cxx.

112{
113 VP1Msg::messageVerbose("AscObj_TruthPoint::clicked()");
114
115 QStringList l;
116
117 l << " ==> Truth point";
118 if (m_d->simhit) {
119 l << "Sim Hit ("+m_d->simhit->type()+")";
121// l << " Direction: "+VP1Msg::str( m_d->simhit->momentumDirection() );
122// l << " Momentum: "+VP1Msg::str(m_d->simhit->momentum()/CLHEP::GeV)+" GeV"+(m_d->simhit->actualMomentum()==m_d->simhit->momentum()?"":" (fudged)");
123 l << " Position: " + QString::fromStdString(Amg::AsString(m_d->simhit->posStart()));
124 l << " Direction: " + QString::fromStdString(Amg::AsString(m_d->simhit->momentumDirection()));
125 l << " Momentum: " + VP1Msg::str(m_d->simhit->momentum()/CLHEP::GeV)+" GeV"+(m_d->simhit->actualMomentum()==m_d->simhit->momentum()?"":" (fudged)");
126 } else {
127 if (!m_d->genVertex||!m_d->genParticle) {
128 l << "ERROR";
129 return l;
130 }
131
132 Amg::Vector3D p(m_d->genVertex->position().x(),m_d->genVertex->position().y(),m_d->genVertex->position().z());
133 Amg::Vector3D mom(m_d->genParticle->momentum().px(),m_d->genParticle->momentum().py(),m_d->genParticle->momentum().pz());
134
135 l << "Gen Particle vertex";
136// l << " Position: "+VP1Msg::str(p);
137// l << " Direction: "+ VP1Msg::str(mom.unit());
138 l << " Position: "+ QString::fromStdString(Amg::AsString(p));
139 l << " Direction: "+ QString::fromStdString( Amg::AsString(mom.unit()) );
140 l << " Momentum: "+ VP1Msg::str(mom.mag()/CLHEP::GeV)+" GeV";
141 }
142
143 return l;
144}
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84
static QString str(const QString &s)
Definition VP1String.h:49
std::string AsString(const T &m)
write an Amg Eigen object to std::string
l
Printing final latex table to .tex output file.

◆ common()

TrackSysCommonData * AssociatedObjectHandleBase::common ( ) const
inherited

Definition at line 105 of file AssociatedObjectHandleBase.cxx.

106{
107 return m_trackHandle->common();
108}

◆ getAttachmentHandle()

AssocObjAttachmentHandle * AssociatedObjectHandleBase::getAttachmentHandle ( )
privateinherited

Definition at line 155 of file AssociatedObjectHandleBase.cxx.

156{
157 return m_trackHandle->getAttachmentHandle(regionIndex(), lodCrossOverValue());
158}
virtual double lodCrossOverValue() const

◆ hasError()

bool AssociatedObjectHandleBase::hasError ( ) const
inlineinherited

Definition at line 50 of file AssociatedObjectHandleBase.h.

virtual TrackCommonFlags::TSOSPartsFlags parts() const

◆ hasMaterialEffect()

bool AssociatedObjectHandleBase::hasMaterialEffect ( ) const
inlineinherited

◆ hasMeasurement()

bool AssociatedObjectHandleBase::hasMeasurement ( ) const
inlineinherited

◆ hasParameters()

bool AssociatedObjectHandleBase::hasParameters ( ) const
inlineinherited

Definition at line 48 of file AssociatedObjectHandleBase.h.

◆ hasParError()

bool AssociatedObjectHandleBase::hasParError ( ) const
inlineinherited

◆ hasSurface()

bool AssociatedObjectHandleBase::hasSurface ( ) const
inlineinherited

◆ initiatesOwnZooms()

virtual bool AssociatedObjectHandleBase::initiatesOwnZooms ( ) const
inlinevirtualinherited

Reimplemented in AscObj_TrackState, and AscObj_TSOS.

Definition at line 71 of file AssociatedObjectHandleBase.h.

71{ return false; }

◆ lodCrossOverValue()

double AscObj_TruthPoint::lodCrossOverValue ( ) const
protectedvirtual

Reimplemented from AssociatedObjectHandleBase.

Definition at line 153 of file AscObj_TruthPoint.cxx.

154{
155 return 100;
156}

◆ nParts()

virtual unsigned AssociatedObjectHandleBase::nParts ( ) const
inlinevirtualinherited

Definition at line 47 of file AssociatedObjectHandleBase.h.

47{ return 1; }

◆ numberOfInstances()

int AssociatedObjectHandleBase::numberOfInstances ( )
staticinherited

Definition at line 130 of file AssociatedObjectHandleBase.cxx.

◆ parts()

virtual TrackCommonFlags::TSOSPartsFlags AssociatedObjectHandleBase::parts ( ) const
inlinevirtualinherited

Reimplemented in AscObj_TrackState, and AscObj_TSOS.

Definition at line 46 of file AssociatedObjectHandleBase.h.

46{ return TrackCommonFlags::TSOSPartsFlags(); }

◆ pickStyle()

PICKSTYLE AssociatedObjectHandleBase::pickStyle ( ) const
inlineinherited

Definition at line 59 of file AssociatedObjectHandleBase.h.

◆ regionIndex()

int AscObj_TruthPoint::regionIndex ( ) const
protectedvirtual

Reimplemented from AssociatedObjectHandleBase.

Definition at line 147 of file AscObj_TruthPoint.cxx.

148{
149 return 0;
150}

◆ registerShapes()

void AssociatedObjectHandleBase::registerShapes ( SoSeparator * simple,
SoSeparator * detailed )
privateinherited

Definition at line 93 of file AssociatedObjectHandleBase.cxx.

94{
95 m_trackHandle->collHandle()->common()->ascObjSelectionManager()->registerAscObj(simple,detailed,this);
96}

◆ setPickable()

void AssociatedObjectHandleBase::setPickable ( PICKSTYLE ps)
inherited

Definition at line 136 of file AssociatedObjectHandleBase.cxx.

137{
138 if (m_pickStyle==ps)
139 return;
141
142 //Fixme...
143
144}

◆ setVisible()

void AssociatedObjectHandleBase::setVisible ( bool b)
virtualinherited

Reimplemented in AscObj_TrackState, and AscObj_TSOS.

Definition at line 171 of file AssociatedObjectHandleBase.cxx.

172{
173 if (m_visible==b)
174 return;
175 m_visible=b;
176 if (b) {
177 m_d->ensureShapesBuild(this);
178 m_d->attach(this);
179 } else {
180 m_d->detach();
181 }
182}

◆ shapeDetailed()

SoSeparator * AssociatedObjectHandleBase::shapeDetailed ( ) const
inherited

Definition at line 206 of file AssociatedObjectHandleBase.cxx.

207{
208 return m_d->sep_detailed;
209}

◆ shapeSimple()

SoSeparator * AssociatedObjectHandleBase::shapeSimple ( ) const
inherited

Definition at line 200 of file AssociatedObjectHandleBase.cxx.

201{
202 return m_d->sep_simple;
203}

◆ toggleVisible()

void AssociatedObjectHandleBase::toggleVisible ( )
inlineinherited

Definition at line 62 of file AssociatedObjectHandleBase.h.

◆ trackHandle()

TrackHandleBase * AssociatedObjectHandleBase::trackHandle ( ) const
inlineinherited

Definition at line 64 of file AssociatedObjectHandleBase.h.

64{ return m_trackHandle; }

◆ unregisterShapes()

void AssociatedObjectHandleBase::unregisterShapes ( SoSeparator * simple,
SoSeparator * detailed )
privateinherited

Definition at line 99 of file AssociatedObjectHandleBase.cxx.

100{
101 m_trackHandle->collHandle()->common()->ascObjSelectionManager()->unregisterAscObj(simple,detailed);
102}

◆ update3DObjects()

void AssociatedObjectHandleBase::update3DObjects ( )
inherited

Definition at line 185 of file AssociatedObjectHandleBase.cxx.

186{
187 VP1Msg::messageVerbose("AssociatedObjectHandleBase update3DObjects.");
188
189 if (m_visible) {
190 m_d->detach();
191 m_d->ensureShapesErased(this);
192 m_d->ensureShapesBuild(this);
193 m_d->attach(this);
194 } else {
195 m_d->ensureShapesErased(this);
196 }
197}

◆ visible()

bool AssociatedObjectHandleBase::visible ( ) const
inlineinherited

Definition at line 61 of file AssociatedObjectHandleBase.h.

61{ return m_visible; }

Member Data Documentation

◆ m_d

Imp* AscObj_TruthPoint::m_d
private

Definition at line 44 of file AscObj_TruthPoint.h.

◆ m_pickStyle

PICKSTYLE AssociatedObjectHandleBase::m_pickStyle
privateinherited

Definition at line 95 of file AssociatedObjectHandleBase.h.

◆ m_trackHandle

TrackHandleBase* AssociatedObjectHandleBase::m_trackHandle
privateinherited

Definition at line 93 of file AssociatedObjectHandleBase.h.

◆ m_visible

bool AssociatedObjectHandleBase::m_visible
privateinherited

Definition at line 94 of file AssociatedObjectHandleBase.h.


The documentation for this class was generated from the following files: