|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "ui_example5controllerform.h"
24 #include "GaudiKernel/SystemOfUnits.h"
27 #include <Inventor/nodes/SoSeparator.h>
28 #include <Inventor/nodes/SoLineSet.h>
29 #include <Inventor/nodes/SoVertexProperty.h>
30 #include <Inventor/nodes/SoSwitch.h>
38 "This is an illustration of a very basic 3D system.\n"
39 "It transforms track information found in storegate"
40 " into 3D objects, displays track information and zooms to them upon selection, "
41 "and has a controller which allows the user to set a pt cut on tracks."
42 " It also has a multiple selection mode which can be used to display the combined invariant mass of tracks",
43 "Thomas.Kittelmann@cern.ch"), m_ptcut(0*
Gaudi::
Units::
GeV), m_multiselection(0)
58 message(
"Error: Got null storegate pointer");
63 std::string trackname=
"Tracks";
65 if (
status != StatusCode::SUCCESS || !trackColl) {
66 message(
"Error: Could not retrieve track collection (used key="+QString(trackname.c_str())+
")");
92 for ( trackItr = trackColl->
begin() ; trackItr != trackItrEnd; ++trackItr) {
104 SoVertexProperty *vertices =
new SoVertexProperty();
109 vertices->vertex.set1Value(iver++,(*it)->position().x(),(*it)->position().y(),(*it)->position().z());
113 SoLineSet *
line =
new SoLineSet();
114 line->numVertices = iver;
115 line->vertexProperty = vertices;
118 SoSwitch * sw =
new SoSwitch();
122 sw->whichChild =
pt >
m_ptcut ? SO_SWITCH_ALL : SO_SWITCH_NONE;
147 message(
"Error: Does not have track information for picked node");
154 message(
"Error: Track has no trackparameters");
167 for (
CamListItr itCam = cameras.begin(); itCam!=cameras.end(); ++itCam) {
181 double totalenergy(0);
183 for (SoNode *
node : nodes) {
186 message(
"Error: Does not have track information for all nodes");
192 message(
"Error: Track has no trackparameters");
195 total3mom +=
params->front()->momentum();
196 totalenergy +=
params->front()->momentum().mag();
199 double invmasssq = totalenergy*totalenergy - total3mom.mag2();
201 message(
"Invariant mass of "+
QString::number(nodes.count())+
" selected tracks (massless particles): "+invmass_str+
" GeV");
207 QWidget * controller =
new QWidget(0);
208 Ui::Example5ControllerForm ui;
209 ui.setupUi(controller);
212 connect(ui.doubleSpinBox_ptcut,SIGNAL(valueChanged(
double)),
this,SLOT(
ptCutChanged(
double)));
227 it->first->whichChild = (
it->second>
m_ptcut ? SO_SWITCH_ALL : SO_SWITCH_NONE );
void userChangedSelection(SoCooperativeSelection *, QSet< SoNode * >, QSet< SoPath * >)
JetConstituentVector::iterator iterator
Const iterator class for DataVector/DataList.
void ptCutChanged(double)
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
void registerSelectionNode(SoCooperativeSelection *)
The Athena Transient Store API.
std::set< SoCamera * > CamList
::StatusCode StatusCode
StatusCode definition for legacy code.
CamList::iterator CamListItr
std::map< SoSwitch *, double > m_switchToPt
void updateSelectionMode(bool single)
Eigen::Matrix< double, 3, 1 > Vector3D
std::map< SoNode *, const Trk::Track * > m_nodeToTrack
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
QWidget * buildController()
=============================================================================
SoCooperativeSelection * m_multiselection
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
void message(const QString &) const
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.