17#include <Inventor/nodes/SoSeparator.h>
18#include <Inventor/nodes/SoLineSet.h>
19#include <Inventor/nodes/SoVertexProperty.h>
26#include "GaudiKernel/SystemOfUnits.h"
32 "This is an illustration of a very basic 3D system.\n"
33 "It transforms track information found in storegate"
34 " into relevant 3D objects (SoLineSet's), and displays track information when tracks are selected by the cursor.",
35 "Thomas.Kittelmann@cern.ch")
49 message(
"Error: Got null storegate pointer");
54 std::string trackname=
"Tracks";
55 StatusCode status = sg->
retrieve(trackColl, trackname);
56 if (status != StatusCode::SUCCESS || !trackColl) {
57 message(
"Error: Could not retrieve track collection (used key="+QString(trackname.c_str())+
")");
65 for ( trackItr = trackColl->
begin() ; trackItr != trackItrEnd; ++trackItr) {
70 if ( !params || params->size()<2 )
77 SoVertexProperty *vertices =
new SoVertexProperty();
81 for (it = params->begin();it!=itE;++it) {
82 vertices->vertex.set1Value(iver++,(*it)->position().x(),(*it)->position().y(),(*it)->position().z());
86 SoLineSet * line =
new SoLineSet();
87 line->numVertices = iver;
88 line->vertexProperty = vertices;
108 message(
"Error: Does not have track information for picked node");
114 if ( !params || params->empty() ) {
115 message(
"Error: Track has no trackparameters");
121 message(
" |p| = "+QString::number(params->front()->momentum().mag()/Gaudi::Units::GeV)+
" GeV");
122 message(
" pT = "+QString::number(params->front()->pT()/Gaudi::Units::GeV)+
" GeV");
123 message(
" Q = "+QString::number(params->front()->charge()));
124 message(
" eta = "+QString::number(params->front()->eta()));
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::map< SoNode *, const Trk::Track * > m_nodeToTrack
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
void message(const QString &) const
The Athena Transient Store API.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.