ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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

Enumerator
UNPICKABLE 
ALL 
COMPONENTS 

Definition at line 57 of file AssociatedObjectHandleBase.h.

Constructor & Destructor Documentation

◆ AscObj_TruthPoint() [1/2]

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

Definition at line 50 of file AscObj_TruthPoint.cxx.

51  : AssociatedObjectHandleBase(th), m_d(new Imp(v,p))
52 {
53 }

◆ AscObj_TruthPoint() [2/2]

AscObj_TruthPoint::AscObj_TruthPoint ( TrackHandleBase th,
SimHitHandleBase s 
)

Definition at line 56 of file AscObj_TruthPoint.cxx.

57  : AssociatedObjectHandleBase(th), m_d(new Imp(s))
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();
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;
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 }

◆ 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 }

◆ 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 {
158 }

◆ hasError()

bool AssociatedObjectHandleBase::hasError ( ) const
inlineinherited

Definition at line 50 of file AssociatedObjectHandleBase.h.

◆ hasMaterialEffect()

bool AssociatedObjectHandleBase::hasMaterialEffect ( ) const
inlineinherited

Definition at line 51 of file AssociatedObjectHandleBase.h.

◆ hasMeasurement()

bool AssociatedObjectHandleBase::hasMeasurement ( ) const
inlineinherited

Definition at line 53 of file AssociatedObjectHandleBase.h.

◆ hasParameters()

bool AssociatedObjectHandleBase::hasParameters ( ) const
inlineinherited

Definition at line 48 of file AssociatedObjectHandleBase.h.

◆ hasParError()

bool AssociatedObjectHandleBase::hasParError ( ) const
inlineinherited

Definition at line 49 of file AssociatedObjectHandleBase.h.

◆ hasSurface()

bool AssociatedObjectHandleBase::hasSurface ( ) const
inlineinherited

Definition at line 52 of file AssociatedObjectHandleBase.h.

◆ initiatesOwnZooms()

virtual bool AssociatedObjectHandleBase::initiatesOwnZooms ( ) const
inlinevirtualinherited

Reimplemented in AscObj_TSOS, and AscObj_TrackState.

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.

131 {
132  return Imp::nascobjs;
133 }

◆ parts()

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

Reimplemented in AscObj_TSOS, and AscObj_TrackState.

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.

59 { return m_pickStyle; }

◆ 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 {
96 }

◆ setPickable()

void AssociatedObjectHandleBase::setPickable ( PICKSTYLE  ps)
inherited

Definition at line 136 of file AssociatedObjectHandleBase.cxx.

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

◆ setVisible()

void AssociatedObjectHandleBase::setVisible ( bool  b)
virtualinherited

Reimplemented in AscObj_TSOS, and AscObj_TrackState.

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.

62 { setVisible(!m_visible); }

◆ 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 {
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:
AssociatedObjectHandleBase::m_d
Imp * m_d
Definition: AssociatedObjectHandleBase.h:90
AssociatedObjectHandleBase::UNPICKABLE
@ UNPICKABLE
Definition: AssociatedObjectHandleBase.h:57
AscObjSelectionManager::registerAscObj
void registerAscObj(SoSeparator *simple, SoSeparator *detailed, AssociatedObjectHandleBase *)
Definition: AscObjSelectionManager.cxx:140
AssociatedObjectHandleBase::parts
virtual TrackCommonFlags::TSOSPartsFlags parts() const
Definition: AssociatedObjectHandleBase.h:46
AssociatedObjectHandleBase::lodCrossOverValue
virtual double lodCrossOverValue() const
Definition: AssociatedObjectHandleBase.h:82
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
checkFileSG.line
line
Definition: checkFileSG.py:75
AssociatedObjectHandleBase::Imp::attach
void attach(AssociatedObjectHandleBase *theclass)
Definition: AssociatedObjectHandleBase.cxx:162
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
AssociatedObjectHandleBase::regionIndex
virtual int regionIndex() const
Definition: AssociatedObjectHandleBase.h:81
AssociatedObjectHandleBase::m_trackHandle
TrackHandleBase * m_trackHandle
Definition: AssociatedObjectHandleBase.h:93
TrackCommonFlags::TSOS_AnyMeasurement
@ TSOS_AnyMeasurement
Definition: TrackCommonFlags.h:61
AssociatedObjectHandleBase::COMPONENTS
@ COMPONENTS
Definition: AssociatedObjectHandleBase.h:57
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
TrackHandleBase::collHandle
TrackCollHandleBase * collHandle() const
Definition: TrackHandleBase.h:68
TrackSysCommonData::ascObjSelectionManager
AscObjSelectionManager * ascObjSelectionManager() const
Definition: TrackSysCommonData.h:123
TrackCommonFlags::TSOS_AnySurface
@ TSOS_AnySurface
Definition: TrackCommonFlags.h:60
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AssociatedObjectHandleBase::Imp::detach
void detach() const
Definition: AssociatedObjectHandleBase.cxx:147
TrackCommonFlags::TSOS_AnyErrors
@ TSOS_AnyErrors
Definition: TrackCommonFlags.h:67
SimHitHandleBase::momentumDirection
virtual Amg::Vector3D momentumDirection() const =0
AssociatedObjectHandleBase::Imp::sep_detailed
SoSeparator * sep_detailed
Definition: AssociatedObjectHandleBase.cxx:36
SimHitHandleBase::posStart
virtual Amg::Vector3D posStart() const =0
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrackCommonFlags::TSOS_TrackPars
@ TSOS_TrackPars
bit 0
Definition: TrackCommonFlags.h:44
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
python.TriggerHandler.th
th
Definition: TriggerHandler.py:296
AssociatedObjectHandleBase::m_visible
bool m_visible
Definition: AssociatedObjectHandleBase.h:94
AssociatedObjectHandleBase::m_pickStyle
PICKSTYLE m_pickStyle
Definition: AssociatedObjectHandleBase.h:95
AssociatedObjectHandleBase::Imp::sep_simple
SoSeparator * sep_simple
Definition: AssociatedObjectHandleBase.cxx:35
SimHitHandleBase::type
virtual QString type() const =0
AssociatedObjectHandleBase::setVisible
virtual void setVisible(bool)
Definition: AssociatedObjectHandleBase.cxx:171
SimHitHandleBase::momentum
double momentum() const
Definition: SimHitHandleBase.h:41
TrackCommonFlags::TSOS_AnyMaterialEffects
@ TSOS_AnyMaterialEffects
Definition: TrackCommonFlags.h:59
AscObj_TruthPoint::Imp::simhit
SimHitHandleBase * simhit
Definition: AscObj_TruthPoint.cxx:45
TrackHandleBase::common
TrackSysCommonData * common() const
Definition: TrackHandleBase.cxx:255
AssociatedObjectHandleBase::ALL
@ ALL
Definition: AssociatedObjectHandleBase.h:57
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
AssociatedObjectHandleBase::Imp::ensureShapesBuild
void ensureShapesBuild(AssociatedObjectHandleBase *theclass)
Definition: AssociatedObjectHandleBase.cxx:49
AscObjSelectionManager::unregisterAscObj
void unregisterAscObj(SoSeparator *simple, SoSeparator *detailed)
Definition: AscObjSelectionManager.cxx:164
AscObj_TruthPoint::m_d
Imp * m_d
Definition: AscObj_TruthPoint.h:43
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.PyAthena.v
v
Definition: PyAthena.py:154
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
SimHitHandleBase::actualMomentum
virtual double actualMomentum() const
Definition: SimHitHandleBase.h:40
TrackCommonFlags::TSOS_AnyParsErrors
@ TSOS_AnyParsErrors
Definition: TrackCommonFlags.h:66
Amg::AsString
std::string AsString(const T &m)
write an Amg Eigen object to std::string
Definition: AmgStringHelpers.h:26
AscObj_TruthPoint::Imp::genVertex
HepMC::ConstGenVertexPtr genVertex
Definition: AscObj_TruthPoint.cxx:43
AssociatedObjectHandleBase::Imp::ensureShapesErased
void ensureShapesErased(AssociatedObjectHandleBase *theclass)
Definition: AssociatedObjectHandleBase.cxx:77
AscObj_TruthPoint::Imp::genParticle
HepMC::ConstGenParticlePtr genParticle
Definition: AscObj_TruthPoint.cxx:44
TrackHandleBase::getAttachmentHandle
AssocObjAttachmentHandle * getAttachmentHandle(int regionIndex, const double &crossoverval)
Definition: TrackHandleBase.cxx:1468
TrackCollHandleBase::common
TrackSysCommonData * common() const
Definition: TrackCollHandleBase.h:79
AssociatedObjectHandleBase::Imp::nascobjs
static int nascobjs
Definition: AssociatedObjectHandleBase.cxx:29
AssociatedObjectHandleBase::AssociatedObjectHandleBase
AssociatedObjectHandleBase(TrackHandleBase *)
Definition: AssociatedObjectHandleBase.cxx:111