13#include <Inventor/nodes/SoCamera.h>
14#include <Inventor/nodes/SoCylinder.h>
15#include <Inventor/nodes/SoLineSet.h>
16#include <Inventor/nodes/SoMaterial.h>
17#include <Inventor/nodes/SoPointSet.h>
18#include <Inventor/nodes/SoRotationXYZ.h>
19#include <Inventor/nodes/SoSeparator.h>
20#include <Inventor/nodes/SoSphere.h>
21#include <Inventor/nodes/SoTransform.h>
22#include <Inventor/nodes/SoTranslation.h>
23#include <Inventor/nodes/SoVertexProperty.h>
28#include "Acts/Surfaces/Surface.hpp"
29#include "Acts/EventData/ParticleHypothesis.hpp"
51#include "Acts/Surfaces/ConeSurface.hpp"
52#include "Acts/Surfaces/CylinderSurface.hpp"
53#include "Acts/Surfaces/DiscSurface.hpp"
54#include "Acts/Surfaces/PerigeeSurface.hpp"
55#include "Acts/Surfaces/PlaneSurface.hpp"
56#include "Acts/Surfaces/RectangleBounds.hpp"
57#include "Acts/Surfaces/StrawSurface.hpp"
58#include "Acts/Surfaces/SurfaceBounds.hpp"
67 const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy& trackstate)
111 return surface().center(
common()->geometryContext().context() );
113 "AscObj_TrackState::approxCenter() WARNING: Failed to determine"
114 " position from either params or surface");
121 static const double l = 30.0 * CLHEP::cm;
122 return static_cast<int>(c.z() / l) + 1000 *
static_cast<int>(c.y() / l) +
123 1000000 *
static_cast<int>(c.x() / l);
130 SoSeparator*& shape_detailed,
136 SoSeparator* param_simple =
new SoSeparator;
137 SoSeparator* param_detailed =
new SoSeparator;
143 "AscObj_TrackState::addTrackParamInfoToShapes() - no reference "
148 const Acts::BoundTrackParameters trackparams(
150 m_trackstate.covariance(), Acts::ParticleHypothesis::pion());
151 auto p1 = trackparams.position(
common()->geometryContext().context());
153 auto u = trackparams.direction().unit();
154 double length = 15 * CLHEP::cm;
159 SoLineSet* line =
new SoLineSet();
160 SoVertexProperty* vertices =
new SoVertexProperty();
161 vertices->vertex.set1Value(0, p1.x(), p1.y(), p1.z());
162 vertices->vertex.set1Value(1, p2.x(), p2.y(), p2.z());
163 line->numVertices.set1Value(0, 2);
166 SoPointSet* points =
new SoPointSet;
167 SoVertexProperty* vertices2 =
new SoVertexProperty;
168 vertices2->vertex.set1Value(0, p1.x(), p1.y(), p1.z());
169 points->numPoints = 1;
170 line->vertexProperty = vertices;
171 points->vertexProperty = vertices2;
176 (isHole && (
trackHandle()->customColouredTSOSParts() &
178 SoMaterial* mat = isHole
181 SoSeparator* sep =
new SoSeparator;
184 sep->addChild(points);
185 param_simple->addChild(sep);
186 param_detailed->addChild(sep);
188 param_simple->addChild(line);
189 param_simple->addChild(points);
190 param_detailed->addChild(line);
191 param_detailed->addChild(points);
193 if (showParsErrors) {
196 shape_simple->addChild(param_simple);
197 shape_detailed->addChild(param_detailed);
203 SoSeparator*& shape_detailed) {
211 if (
surface.type()==Acts::Surface::SurfaceType::Straw &&
common()->controller()->hideTubeSurfaces())
215 shape_detailed->addChild(sotra);
249 case Acts::Surface::SurfaceType::Plane: {
253 case Acts::Surface::SurfaceType::Straw: {
265 SoNode*& shape_detailed) {
268 if (shape_detailed->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
270 static_cast<SoSeparator*
>(shape_detailed)->insertChild(mat,0);
278 SoSeparator * sep =
new SoSeparator;
280 sep->addChild(shape_detailed);
281 shape_detailed = sep;
287 SoSeparator*& shape_detailed,
288 const Acts::Surface&
surface) {
290 SoNode * nodeToAddSimple =
nullptr;
291 SoNode * nodeToAddDetailed =
nullptr;
294 switch (
surface.bounds().type()) {
295 case Acts::SurfaceBounds::BoundsType::eBoundless: {
296 const double halfX = 100.0;
297 const double halfY = 100.0;
302 nodeToAddDetailed = box;
305 case Acts::SurfaceBounds::BoundsType::eRectangle: {
307 const Acts::RectangleBounds& rectBounds =
308 dynamic_cast<const Acts::RectangleBounds&
>(
surface.bounds());
309 const double halfX = rectBounds.halfLengthX();
310 const double halfY = rectBounds.halfLengthY();
315 nodeToAddDetailed = box;
325 if (nodeToAddDetailed!=
nullptr){
327 shape_simple->addChild(nodeToAddDetailed);
328 shape_detailed->addChild(nodeToAddDetailed);
333 SoSeparator*& shape_detailed,
334 const Acts::Surface&
surface) {
335 SoNode * nodeToAddSimple =
nullptr;
336 SoNode * nodeToAddDetailed =
nullptr;
338 switch (
surface.bounds().type()) {
339 case Acts::SurfaceBounds::BoundsType::eLine: {
340 const Acts::LineBounds& lineBounds =
341 dynamic_cast<const Acts::LineBounds&
>(
surface.bounds());
342 double hlength = lineBounds.get(Acts::LineBounds::eHalfLengthZ);
344 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
345 scatVtxProperty->vertex.set1Value(0, 0.0,0.0,-hlength);
346 scatVtxProperty->vertex.set1Value(1, 0.0,0.0, hlength);
347 SoLineSet * lineSurface =
new SoLineSet();
348 lineSurface->numVertices = 2;
349 lineSurface->vertexProperty = scatVtxProperty;
351 nodeToAddSimple = lineSurface;
353 double radius = lineBounds.get(Acts::LineBounds::eR);
356 (*lineSurfaceDetailed).pRMin = 0.;
357 (*lineSurfaceDetailed).pRMax = radius;
358 (*lineSurfaceDetailed).pDz = hlength;
360 nodeToAddDetailed = lineSurfaceDetailed;
368 if (nodeToAddDetailed!=
nullptr){
370 shape_simple->addChild(nodeToAddDetailed);
371 shape_detailed->addChild(nodeToAddDetailed);
377 SoSeparator*& , SoSeparator*& ) {}
380 SoSeparator*& shape_detailed) {
386 !flag.hasMeasurement() ||
403 shape_simple->addChild(mat);
404 shape_detailed->addChild(mat);
409 assert(sl !=
nullptr);
414 switch (measurementType) {
435 "AscObj_TrackState::addMeasurementToShapes: Unable to handle this "
436 "measurement type ");
445 SoSeparator*& shape_detailed) {
447 shape_simple =
new SoSeparator;
449 shape_detailed =
new SoSeparator;
454 SoSeparator*& shape_detailed) {
498 if (
common()->controller()->orientAndZoomOnSingleSelection() )
504 std::set<SoCamera*>::iterator it,itE = cameras.end();
505 for (it=cameras.begin();it!=itE;++it) {
static double surfaceThickness
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
void addPlaneSurfaceToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed, const Acts::Surface &surface)
const ActsTrk::TrackStateBackend::ConstTrackStateProxy m_trackstate
void addCylindricalSurfaceToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed, const Acts::Surface &surface)
virtual void setVisible(bool)
static void ensureInitSeps(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
void zoomView()
Depending on the controller settings, will attempt to zoom the view to this TSOS, for example in clic...
unsigned m_indexOfPointOnTrack
const Acts::Surface & surface() const
void setDistToNextPar(const double &)
QTreeWidgetItem * m_objBrowseTree
void buildShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
void addSurfaceToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
Amg::Vector3D approxCenter() const
void addTrackParamInfoToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed, bool showPars, bool showParsErrors, bool showSurfaces)
void addMaterialEffectsToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
void addMaterialToSurfaceShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
void addMeasurementToShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)
AscObj_TrackState(TrackHandleBase *, unsigned indexOfPointOnTrack, const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state)
TrackCommonFlags::TSOSPartsFlags m_parts
SoSeparator * shapeSimple() const
AssociatedObjectHandleBase(TrackHandleBase *)
virtual void setVisible(bool)
TrackSysCommonData * common() const
TrackHandleBase * trackHandle() const
friend class TrackHandleBase
SoSeparator * shapeDetailed() const
void setParametersForBox(float dx, float dy, float dz, float xcenter=0.0, float ycenter=0.0, float zcenter=0.0)
SoTubs - Inventor version of the G4Tubs Geant Geometry entity.
@ TSOS_SurfacesDetElem
bit 9
@ TSOS_SurfacesCustom
bit 10
@ TSOS_MeasRioOnTrackOutlier
bit 6
@ TSOS_MeasRioOnTrackNotOutlier
bit 4
@ TSOS_MaterialEffects
bit 13
VP1TrackSystem * system() const
TrackSystemController * controller() const
SoMaterial * customMatParameters() const
SoMaterial * customMatHoleParameters() const
SoMaterial * customMatMeasurementsOutliers() const
SoMaterial * customMatSurfaces() const
SoMaterial * customMatMeasurements() const
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)
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
static void messageVerbose(const QString &)
static void message(const QString &, IVP1System *sys=0)
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
Eigen::Matrix< double, 3, 1 > Vector3D
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
UncalibMeasType
Define the type of the uncalibrated measurement.