Belle II Software development
|
A class that can plot event related data types. More...
#include <EventDataPlotter.h>
Public Types | |
using | AttributeMap = PrimitivePlotter::AttributeMap |
Forward the Attribute 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 specific PrimitivePlotter instance as backend. | |
EventDataPlotter (const EventDataPlotter &eventDataPlotter) | |
Copy constructor. | |
const std::string | save (const std::string &fileName) |
Saves the current plot stead to a file. | |
void | clear () |
Clears all drawn 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 drawn 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. | |
void | setCanvasHeight (float height) |
Setter for the canvas height in pixels The canvas height denotes the size of the image being produced. | |
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 string 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. | |
void | draw (const Belle2::TrackFindingCDC::CDCWire &wire, const AttributeMap &attributeMap=AttributeMap()) |
Draws the CDCWire as a small circle at the reference position. | |
void | draw (const Belle2::TrackFindingCDC::CDCWireSuperLayer &wireSuperLayer, const AttributeMap &attributeMap=AttributeMap()) |
Draws the inner and the outer bound of the super layer. | |
void | draw (const Belle2::TrackFindingCDC::CDCWireTopology &wireTopology, AttributeMap attributeMap=AttributeMap()) |
Draws the all wires in the CDC. | |
void | draw (const 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. | |
void | draw (const CDCHit &hit, const AttributeMap &attributeMap=AttributeMap()) |
Draws the CDCHit as the wire position and its drift circle at the wire reference position. | |
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. | |
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""". | |
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""". | |
void | draw (const CDCTrajectory2D &trajectory2D, AttributeMap attributeMap=AttributeMap()) |
Draws the CDCTrajectory from the start point until it first exits the CDC. | |
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< PrimitivePlotter > | m_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 dimming opacity. | |
A class that can plot event related data types.
Definition at line 54 of file EventDataPlotter.h.
Forward the Attribute map from the primitive plotter.
Definition at line 59 of file EventDataPlotter.h.
|
explicit |
Default constructor for ROOT compatibility. Uses an SVGPrimitivePlotter as backend.
Definition at line 46 of file EventDataPlotter.cc.
|
explicit |
Constructor taking the specific 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.
EventDataPlotter | ( | const EventDataPlotter & | eventDataPlotter | ) |
void clear | ( | ) |
Clears all drawn elements from the plotter.
Definition at line 82 of file EventDataPlotter.cc.
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.
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""".
Definition at line 441 of file EventDataPlotter.cc.
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.
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.
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.
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.
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.
void draw | ( | const Belle2::TrackFindingCDC::Circle2D & | circle, |
AttributeMap | attributeMap = AttributeMap() |
||
) |
Draws a filled circle.
------------------— Draw Circle2D ---------------------—
Definition at line 269 of file EventDataPlotter.cc.
void draw | ( | const CDCAxialSegmentPair & | axialSegmentPair, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws the pair of segments as an arrow connecting the centers of them.
Definition at line 550 of file EventDataPlotter.cc.
void draw | ( | const 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.
void draw | ( | const CDCSegment2D & | segment2D, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws all CDCRecoHits2D of the segment.
Definition at line 532 of file EventDataPlotter.cc.
void draw | ( | const CDCSegment3D & | segment3D, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws all CDCRecoHits3D of the segment.
Definition at line 541 of file EventDataPlotter.cc.
void draw | ( | const CDCSegmentPair & | segmentPair, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws the pair of segments as an arrow connecting the centers of them.
Definition at line 586 of file EventDataPlotter.cc.
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.
Definition at line 621 of file EventDataPlotter.cc.
void draw | ( | const 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.
void draw | ( | const CDCTrack & | track, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws all CDCRecoHits3D of the segment.
Definition at line 678 of file EventDataPlotter.cc.
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.
void draw | ( | const CDCWireHitCluster & | wireHitCluster, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws all CDCWireHits of the cluster.
Definition at line 527 of file EventDataPlotter.cc.
void draw | ( | const RecoTrack & | recoTrack, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws the hit content of the RecoTrack.
Definition at line 687 of file EventDataPlotter.cc.
|
inline |
Draw store array.
Definition at line 260 of file EventDataPlotter.h.
|
inline |
Allow the drawing of pointers checking if the pointer is nonzero.
Definition at line 253 of file EventDataPlotter.h.
void drawInnerCDCWall | ( | const AttributeMap & | attributeMap = AttributeMap() | ) |
Draw the inner wall of the CDC.
Definition at line 208 of file EventDataPlotter.cc.
void drawInteractionPoint | ( | ) |
Marks the position of the interaction point with a filled circle.
Definition at line 196 of file EventDataPlotter.cc.
void drawLine | ( | float | startX, |
float | startY, | ||
float | endX, | ||
float | endY, | ||
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws a straight Line.
Definition at line 256 of file EventDataPlotter.cc.
void drawOuterCDCWall | ( | const AttributeMap & | attributeMap = AttributeMap() | ) |
Draw the outer wall of the CDC.
Definition at line 224 of file EventDataPlotter.cc.
|
inline |
Draws a range iterable collection of drawable elements.
Definition at line 268 of file EventDataPlotter.h.
|
inline |
Draws a range iterable collection of drawable elements.
Definition at line 281 of file EventDataPlotter.h.
void drawSuperLayerBoundaries | ( | const AttributeMap & | attributeMap = AttributeMap() | ) |
Draw the super layer bounds of the CDC.
Definition at line 240 of file EventDataPlotter.cc.
void drawTrajectory | ( | const CDCSegment2D & | segment, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws trajectory of the CDCSegment2D.
Definition at line 713 of file EventDataPlotter.cc.
void drawTrajectory | ( | const CDCSegmentTriple & | segmentTriple, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws trajectory of the CDCSegmentTriple.
Definition at line 719 of file EventDataPlotter.cc.
void drawTrajectory | ( | const CDCTrack & | track, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws trajectory of the CDCTrack.
Definition at line 725 of file EventDataPlotter.cc.
void drawTrajectory | ( | const MCParticle & | mcParticle, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws the trajectory that is represented by the MC particle.
Definition at line 702 of file EventDataPlotter.cc.
void drawTrajectory | ( | const RecoTrack & | recoTrack, |
const AttributeMap & | attributeMap = AttributeMap() |
||
) |
Draws curve along the fitted points of the RecoTrack.
Definition at line 730 of file EventDataPlotter.cc.
void endGroup | ( | ) |
Indicates the end of a group of drawn elements.
Definition at line 152 of file EventDataPlotter.cc.
|
inline |
Converts a time given in nanoseconds to a time string of the from "%fs".
Definition at line 134 of file EventDataPlotter.h.
BoundingBox getBoundingBox | ( | ) | const |
Getter for the current bounding box.
Definition at line 90 of file EventDataPlotter.cc.
float getCanvasHeight | ( | ) | const |
Getter for the canvas height in pixels.
Definition at line 118 of file EventDataPlotter.cc.
float getCanvasWidth | ( | ) | const |
Getter for the canvas width in pixels.
Definition at line 108 of file EventDataPlotter.cc.
const std::string save | ( | const std::string & | fileName | ) |
Saves the current plot stead to a file.
Deriving instances may should implement the appropriate 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 concrete implementation PrimitivePlotter decides to do so.
fileName | fileName where the plot shall be saved |
Definition at line 72 of file EventDataPlotter.cc.
void setBoundingBox | ( | const BoundingBox & | boundingBox | ) |
Setter for the bounding box of all drawn objects.
Definition at line 100 of file EventDataPlotter.cc.
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 separate concept which is stored in the bounding box (getBoundingBox()).
Definition at line 136 of file EventDataPlotter.cc.
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 separate concept which is stored in the bounding box (getBoundingBox()).
Definition at line 128 of file EventDataPlotter.cc.
|
private |
Start a group in the underlying plotter with an animation uncovering the elements at the time of flight of the related CDCSimHit.
Definition at line 177 of file EventDataPlotter.cc.
|
private |
Start a group in the underlying plotter with an animation uncovering the elements at the time of flight of the CDCSimHit.
Definition at line 160 of file EventDataPlotter.cc.
void startGroup | ( | const AttributeMap & | attributeMap = AttributeMap() | ) |
Indicates the start of a group of drawn elements.
Definition at line 144 of file EventDataPlotter.cc.
|
private |
Memory for the flag if the event data should be animated. If animation is supported is backend dependent.
Definition at line 305 of file EventDataPlotter.h.
|
private |
Memory for the flag whether the orientation of tracks segments etc should be shown as dimming opacity.
Definition at line 308 of file EventDataPlotter.h.
|
private |
Reference to the primitivePlotter instance used as backend for the draw commands.
Definition at line 302 of file EventDataPlotter.h.