Belle II Software  release-08-01-10
EventDataPlotter Class Reference

A class that can plot event related data types. More...

#include <EventDataPlotter.h>

Collaboration diagram for EventDataPlotter:

Public Types

using AttributeMap = PrimitivePlotter::AttributeMap
 Forward the Attributre map from the primitive plotter.
 

Public Member Functions

 EventDataPlotter (bool animate=false, bool forwardFade=false)
 Default constructor for ROOT compatibility. Uses an SVGPrimitivePlotter as backend.
 
 EventDataPlotter (std::unique_ptr< PrimitivePlotter > ptrPrimitivePlotter, bool animate=false, bool forwardFade=false)
 Constructor taking the specifc PrimitivePlotter instance as backend. More...
 
 EventDataPlotter (const EventDataPlotter &eventDataPlotter)
 Copy constructor.
 
const std::string save (const std::string &fileName)
 Saves the current plot stead to a file. More...
 
void clear ()
 Clears all drawed elements from the plotter.
 
BoundingBox getBoundingBox () const
 Getter for the current bounding box.
 
void setBoundingBox (const BoundingBox &boundingBox)
 Setter for the bounding box of all drawed objects.
 
float getCanvasWidth () const
 Getter for the canvas width in pixels.
 
float getCanvasHeight () const
 Getter for the canvas height in pixels.
 
void setCanvasWidth (float width)
 Setter for the canvas width in pixels. More...
 
void setCanvasHeight (float height)
 Setter for the canvas height in pixels The canvas height denotes the size of the image being produced. More...
 
void startGroup (const AttributeMap &attributeMap=AttributeMap())
 Indicates the start of a group of drawn elements.
 
void endGroup ()
 Indicates the end of a group of drawn elements.
 
std::string getAnimationTimeFromNanoSeconds (float nanoseconds)
 Converts a time given in nanoseconds to a time sting of the from "%fs".
 
void drawInteractionPoint ()
 Marks the position of the interaction point with a filled circle.
 
void drawInnerCDCWall (const AttributeMap &attributeMap=AttributeMap())
 Draw the inner wall of the CDC.
 
void drawOuterCDCWall (const AttributeMap &attributeMap=AttributeMap())
 Draw the outer wall of the CDC.
 
void drawSuperLayerBoundaries (const AttributeMap &attributeMap=AttributeMap())
 Draw the super layer bounds of the CDC.
 
void drawLine (float startX, float startY, float endX, float endY, const AttributeMap &attributeMap=AttributeMap())
 Draws a straight Line.
 
void draw (const Belle2::TrackFindingCDC::Circle2D &circle, AttributeMap attributeMap=AttributeMap())
 Draws a filled circle. More...
 
void draw (const Belle2::TrackFindingCDC::CDCWire &wire, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCWire as a small circle at the reference position. More...
 
void draw (const Belle2::TrackFindingCDC::CDCWireSuperLayer &wireSuperLayer, const AttributeMap &attributeMap=AttributeMap())
 Draws the inner and the outer bound of the super layer. More...
 
void draw (const Belle2::TrackFindingCDC::CDCWireTopology &wireTopology, AttributeMap attributeMap=AttributeMap())
 Draws the all wires in the CDC. More...
 
void draw (const Belle2::CDCSimHit &simHit, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCSimHit as a momentum arrow starting at the track position with a length proportional to its momentum. More...
 
void draw (const Belle2::CDCHit &hit, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCHit as the wire position and its drift circle at the wire reference position. More...
 
void draw (const Belle2::TrackFindingCDC::CDCWireHit &wireHit, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCWireHit as the wire position and its drift circle at the wire reference position. More...
 
void draw (const Belle2::TrackFindingCDC::CDCRecoHit2D &recoHit2D, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCRecoHit2D as a drift circle at the two dimensional reference wire position and a point at the reconstructed position""". More...
 
void draw (const Belle2::TrackFindingCDC::CDCRecoHit3D &recoHit3D, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCRecoHit3D as a drift circle at the two dimensional reference wire position and a point at the reconstructed position""".
 
void draw (const Belle2::TrackFindingCDC::CDCTangent &tangent, const AttributeMap &attributeMap=AttributeMap())
 Draws the CDCRecoHit3D as a drift circle at the two dimensional reference wire position and a point at the reconstructed position""". More...
 
void draw (const CDCTrajectory2D &trajectory2D, AttributeMap attributeMap=AttributeMap())
 Draws the CDCTrajectory from the start point until it first exits the CDC. More...
 
void draw (const CDCWireHitCluster &wireHitCluster, const AttributeMap &attributeMap=AttributeMap())
 Draws all CDCWireHits of the cluster.
 
void draw (const CDCSegment2D &segment2D, const AttributeMap &attributeMap=AttributeMap())
 Draws all CDCRecoHits2D of the segment.
 
void draw (const CDCSegment3D &segment3D, const AttributeMap &attributeMap=AttributeMap())
 Draws all CDCRecoHits3D of the segment.
 
void draw (const CDCAxialSegmentPair &axialSegmentPair, const AttributeMap &attributeMap=AttributeMap())
 Draws the pair of segments as an arrow connecting the centers of them.
 
void draw (const CDCSegmentPair &segmentPair, const AttributeMap &attributeMap=AttributeMap())
 Draws the pair of segments as an arrow connecting the centers of them.
 
void draw (const CDCSegmentTriple &segmentTriple, const AttributeMap &attributeMap=AttributeMap())
 Draws the triple of segments as two arrows connecting the centers from start to the middle segment and from the middle to the end segment.
 
void draw (const CDCTrack &track, const AttributeMap &attributeMap=AttributeMap())
 Draws all CDCRecoHits3D of the segment.
 
void draw (const RecoTrack &recoTrack, const AttributeMap &attributeMap=AttributeMap())
 Draws the hit content of the RecoTrack.
 
void drawTrajectory (const MCParticle &mcParticle, const AttributeMap &attributeMap=AttributeMap())
 Draws the trajectory that is represented by the MC particle.
 
void drawTrajectory (const CDCSegment2D &segment, const AttributeMap &attributeMap=AttributeMap())
 Draws trajectory of the CDCSegment2D.
 
void drawTrajectory (const CDCSegmentTriple &segmentTriple, const AttributeMap &attributeMap=AttributeMap())
 Draws trajectory of the CDCSegmentTriple.
 
void drawTrajectory (const CDCTrack &track, const AttributeMap &attributeMap=AttributeMap())
 Draws trajectory of the CDCTrack.
 
void drawTrajectory (const RecoTrack &recoTrack, const AttributeMap &attributeMap=AttributeMap())
 Draws curve along the fitted points of the RecoTrack.
 
template<class T >
void draw (const T *ptr, const AttributeMap &attributeMap=AttributeMap())
 Allow the drawing of pointers checking if the pointer is nonzero.
 
template<class T >
void draw (const StoreArray< T > &storeArray, const AttributeMap &attributeMap=AttributeMap())
 Draw store array.
 
template<class ARange >
void drawRange (const ARange &range, const AttributeMap &attributeMap=AttributeMap())
 Draws a range iterable collection of drawable elements.
 
template<class ARange >
void drawRangeWithFade (const ARange &range, const AttributeMap &attributeMap=AttributeMap())
 Draws a range iterable collection of drawable elements.
 

Private Member Functions

void startAnimationGroup (const Belle2::CDCSimHit &simHit)
 Start a group in the underlying plotter with an animation uncovering the elements at the time of flight of the CDCSimHit.
 
void startAnimationGroup (const Belle2::CDCHit *ptrHit)
 Start a group in the underlying plotter with an animation uncovering the elements at the time of flight of the related CDCSimHit.
 

Private Attributes

std::unique_ptr< PrimitivePlotterm_ptrPrimitivePlotter
 Reference to the primitivePlotter instance used as backend for the draw commands.
 
bool m_animate = false
 Memory for the flag if the event data should be animated. If animation is supported is backend dependent.
 
bool m_forwardFade = false
 Memory for the flag whether the orientation of tracks segments etc should be shown as diming opacity.
 

Detailed Description

A class that can plot event related data types.

Definition at line 54 of file EventDataPlotter.h.

Constructor & Destructor Documentation

◆ EventDataPlotter()

EventDataPlotter ( std::unique_ptr< PrimitivePlotter ptrPrimitivePlotter,
bool  animate = false,
bool  forwardFade = false 
)
explicit

Constructor taking the specifc PrimitivePlotter instance as backend.

Note that the EventDataPlotter takes ownership of the PrimitivePlotter and destroys it on its on own deconstruction.

Definition at line 54 of file EventDataPlotter.cc.

57  : m_ptrPrimitivePlotter(std::move(ptrPrimitivePlotter))
58  , m_animate(animate)
59  , m_forwardFade(forwardFade)
60 {
61  B2ASSERT("EventDataPlotter initialized with nullptr. Using default backend SVGPrimitivePlotter.",
63 }
bool m_forwardFade
Memory for the flag whether the orientation of tracks segments etc should be shown as diming opacity.
bool m_animate
Memory for the flag if the event data should be animated. If animation is supported is backend depend...
std::unique_ptr< PrimitivePlotter > m_ptrPrimitivePlotter
Reference to the primitivePlotter instance used as backend for the draw commands.

Member Function Documentation

◆ draw() [1/10]

void draw ( const Belle2::CDCHit hit,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCHit as the wire position and its drift circle at the wire reference position.

------------------— Draw CDCHit ---------------------—

Definition at line 363 of file EventDataPlotter.cc.

◆ draw() [2/10]

void draw ( const Belle2::CDCSimHit simHit,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCSimHit as a momentum arrow starting at the track position with a length proportional to its momentum.

------------------— Draw CDCSimHit ---------------------—

Definition at line 335 of file EventDataPlotter.cc.

◆ draw() [3/10]

void draw ( const Belle2::TrackFindingCDC::CDCRecoHit2D recoHit2D,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCRecoHit2D as a drift circle at the two dimensional reference wire position and a point at the reconstructed position""".

------------------— Draw CDCRecoHit2D ---------------------—

Definition at line 391 of file EventDataPlotter.cc.

◆ draw() [4/10]

void draw ( const Belle2::TrackFindingCDC::CDCTangent tangent,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCRecoHit3D as a drift circle at the two dimensional reference wire position and a point at the reconstructed position""".

------------------— Draw CDCRecoHit2D ---------------------—

Definition at line 418 of file EventDataPlotter.cc.

◆ draw() [5/10]

void draw ( const Belle2::TrackFindingCDC::CDCWire wire,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCWire as a small circle at the reference position.

------------------— Draw CDCWire ---------------------—

Definition at line 292 of file EventDataPlotter.cc.

◆ draw() [6/10]

void draw ( const Belle2::TrackFindingCDC::CDCWireHit wireHit,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the CDCWireHit as the wire position and its drift circle at the wire reference position.

------------------— Draw CDCWireHit ---------------------—

Definition at line 370 of file EventDataPlotter.cc.

◆ draw() [7/10]

void draw ( const Belle2::TrackFindingCDC::CDCWireSuperLayer wireSuperLayer,
const AttributeMap attributeMap = AttributeMap() 
)

Draws the inner and the outer bound of the super layer.

------------------— Draw CDCWireSuperLayer ---------------------—

Definition at line 301 of file EventDataPlotter.cc.

◆ draw() [8/10]

void draw ( const Belle2::TrackFindingCDC::CDCWireTopology wireTopology,
AttributeMap  attributeMap = AttributeMap() 
)

Draws the all wires in the CDC.

------------------— Draw CDCWireTopology---------------------—

Definition at line 317 of file EventDataPlotter.cc.

◆ draw() [9/10]

void draw ( const Belle2::TrackFindingCDC::Circle2D circle,
AttributeMap  attributeMap = AttributeMap() 
)

Draws a filled circle.

------------------— Draw Circle2D ---------------------—

Definition at line 269 of file EventDataPlotter.cc.

◆ draw() [10/10]

void draw ( const CDCTrajectory2D trajectory2D,
AttributeMap  attributeMap = AttributeMap() 
)

Draws the CDCTrajectory from the start point until it first exits the CDC.

------------------— Draw CDCTrajectory2D ---------------------—

Definition at line 448 of file EventDataPlotter.cc.

◆ save()

const std::string save ( const std::string &  fileName)

Saves the current plot stead to a file.

Deriving instances may should implement the approriate thing here and may return a modified string indicating the file name to which the plot as been written. It is allowed to append or change the file extension if the concret implementation PrimitivePlotter decides to do so.

Parameters
fileNamefileName where the plot shall be saved
Returns
Potentially modifed file name where the file has actually been written to.

Definition at line 72 of file EventDataPlotter.cc.

◆ setCanvasHeight()

void setCanvasHeight ( float  height)

Setter for the canvas height in pixels The canvas height denotes the size of the image being produced.

The coordinates space that is visible in the picture is a seperate concept which is stored in the bounding box (getBoundingBox()).

Definition at line 136 of file EventDataPlotter.cc.

◆ setCanvasWidth()

void setCanvasWidth ( float  width)

Setter for the canvas width in pixels.

The canvas height denotes the size of the image being produced. The coordinates space that is visible in the picture is a seperate concept which is stored in the bounding box (getBoundingBox()).

Definition at line 128 of file EventDataPlotter.cc.


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