Belle II Software  release-05-02-19
CDCSVGPlotter.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: dschneider, Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/display/EventDataPlotter.h>
13 
14 namespace Belle2 {
19  namespace TrackFindingCDC {
20 
21  template <class T>
22  class Styling;
23 
25  class CDCSVGPlotter {
26 
27  public:
31  CDCSVGPlotter(bool animate = false, bool forwardFade = false);
32 
37 
41  void drawWires(const CDCWireTopology& cdcWireTopology);
42 
46  void drawInteractionPoint();
47 
52  void drawSuperLayerBoundaries(const std::string& stroke);
53 
58  void drawOuterCDCWall(const std::string& stroke);
59 
64  void drawInnerCDCWall(const std::string& stroke);
65 
72  void drawHits(const std::string& storeArrayName,
73  const std::string& stroke,
74  const std::string& strokeWidth);
75 
82  void drawSimHits(const std::string& storeArrayName,
83  const std::string& stroke,
84  const std::string& strokeWidth);
85 
92  void drawClusters(const std::string& storeObjName,
93  const std::string& stroke,
94  const std::string& strokeWidth);
95 
102  void drawSegments(const std::string& storeObjName,
103  const std::string& stroke,
104  const std::string& strokeWidth);
105 
112  void drawSegmentTrajectories(const std::string& storeObjName,
113  const std::string& stroke,
114  const std::string& strokeWidth);
115 
122  void drawSegmentPairs(const std::string& storeObjName,
123  const std::string& stroke,
124  const std::string& strokeWidth);
125 
132  void drawAxialSegmentPairs(const std::string& storeObjName,
133  const std::string& stroke,
134  const std::string& strokeWidth);
135 
142  void drawSegmentTriples(const std::string& storeObjName,
143  const std::string& stroke,
144  const std::string& strokeWidth);
145 
152  void drawSegmentTripleTrajectories(const std::string& storeObjName,
153  const std::string& stroke,
154  const std::string& strokeWidth);
155 
160  void drawTracks(const std::string& storeObjName,
161  const std::string& stroke,
162  const std::string& strokeWidth);
163 
170  void drawTrackTrajectories(const std::string& storeObjName,
171  const std::string& stroke,
172  const std::string& strokeWidth);
173 
178  void drawRecoTracks(const std::string& storeArrayName,
179  const std::string& stroke,
180  const std::string& strokeWidth);
181 
186  void drawRecoTrackTrajectories(const std::string& storeArrayName,
187  const std::string& stroke,
188  const std::string& strokeWidth);
189 
194  void drawMCParticleTrajectories(const std::string& storeArrayName,
195  const std::string& stroke,
196  const std::string& strokeWidth);
197 
198  public:
199  /* *** Section with some more complex operations *** */
200 
205  void drawWrongRLHitsInSegments(const std::string& segmentsStoreObjName);
206 
211  void drawWrongRLHitsInTracks(const std::string& tracksStoreObjName);
212 
213  private:
218  template<class ACDCHitCollection>
219  void drawWrongRLHits(const std::string& storeObjName);
220 
221  public:
228  void drawSimHitsConnectByToF(const std::string& simHitStoreArrayName,
229  const std::string& stroke,
230  const std::string& strokeWidth);
231 
243  void drawMCSegmentPairs(const std::string& segmentsStoreObjName,
244  const std::string& stroke,
245  const std::string& strokeWidth);
246 
258  void drawMCAxialSegmentPairs(const std::string& segmentsStoreObjName,
259  const std::string& stroke,
260  const std::string& strokeWidth);
261 
273  void drawMCSegmentTriples(const std::string& segmentsStoreObjName,
274  const std::string& stroke,
275  const std::string& strokeWidth);
276 
277  public:
282  std::string saveFile(const std::string& fileName = "display.svg");
283 
284  private:
294  template<class AItem, bool a_drawTrajectories = false>
295  void drawStoreArray(const std::string& storeArrayName, Styling<AItem>& styling);
296 
306  template<class AItem, bool a_drawTrajectories = false>
307  void drawStoreVector(const std::string& storeObjName, Styling<AItem>& styling);
308 
315  template <bool a_drawTrajectory = false, class AIterable, class AStyling>
316  void drawIterable(const AIterable& items, AStyling& styling);
317 
319  template <bool a_drawTrajectory = false, class AObject>
320  void draw(const AObject& object, const AttributeMap& attributeMap);
321 
322  private:
324  EventDataPlotter m_eventdataPlotter;
325  };
326  }
328 }
Belle2::TrackFindingCDC::CDCSVGPlotter::drawWrongRLHitsInSegments
void drawWrongRLHitsInSegments(const std::string &segmentsStoreObjName)
Draw the CDCRLWireHits in the CDCSegments colored by the match of the right left passage informations...
Definition: CDCSVGPlotter.cc:407
Belle2::TrackFindingCDC::CDCSVGPlotter::drawHits
void drawHits(const std::string &storeArrayName, const std::string &stroke, const std::string &strokeWidth)
Draws CDCHits.
Definition: CDCSVGPlotter.cc:157
Belle2::TrackFindingCDC::CDCSVGPlotter::m_eventdataPlotter
EventDataPlotter m_eventdataPlotter
The plotter instance to translate event data objects to svg expressions.
Definition: CDCSVGPlotter.h:332
Belle2::TrackFindingCDC::CDCSVGPlotter::drawClusters
void drawClusters(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draws CDCWireHitClusters.
Definition: CDCSVGPlotter.cc:194
Belle2::TrackFindingCDC::CDCSVGPlotter::drawRecoTrackTrajectories
void drawRecoTrackTrajectories(const std::string &storeArrayName, const std::string &stroke, const std::string &strokeWidth)
Draw RecoTracks trajectories.
Definition: CDCSVGPlotter.cc:297
Belle2::TrackFindingCDC::CDCSVGPlotter::drawMCAxialSegmentPairs
void drawMCAxialSegmentPairs(const std::string &segmentsStoreObjName, const std::string &stroke, const std::string &strokeWidth)
Draws the Monte Carlo true CDCAxialSegmentPairs.
Definition: CDCSVGPlotter.cc:472
Belle2::TrackFindingCDC::CDCSVGPlotter::clone
CDCSVGPlotter * clone()
Make a copy of the current status of the plotter.
Definition: CDCSVGPlotter.cc:121
Belle2::TrackFindingCDC::CDCSVGPlotter::drawMCSegmentPairs
void drawMCSegmentPairs(const std::string &segmentsStoreObjName, const std::string &stroke, const std::string &strokeWidth)
Draws the Monte Carlo true CDCSegmentPairs.
Definition: CDCSVGPlotter.cc:512
Belle2::TrackFindingCDC::CDCSVGPlotter::drawMCParticleTrajectories
void drawMCParticleTrajectories(const std::string &storeArrayName, const std::string &stroke, const std::string &strokeWidth)
Draw MCParticles.
Definition: CDCSVGPlotter.cc:308
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSegmentTriples
void drawSegmentTriples(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draw the axial, stereo, axial segment triples.
Definition: CDCSVGPlotter.cc:245
Belle2::TrackFindingCDC::CDCSVGPlotter::drawWrongRLHits
void drawWrongRLHits(const std::string &storeObjName)
Draw the CDCRLWireHits in the ACDCHitCollection colored by the match of the right left passage inform...
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSimHitsConnectByToF
void drawSimHitsConnectByToF(const std::string &simHitStoreArrayName, const std::string &stroke, const std::string &strokeWidth)
Draw the CDCSimHits connected in the order of their getFlightTime for each Monte Carlo particle.
Definition: CDCSVGPlotter.cc:319
Belle2::TrackFindingCDC::CDCSVGPlotter::drawStoreArray
void drawStoreArray(const std::string &storeArrayName, Styling< AItem > &styling)
Function Template for drawing the elements of a given StoreArray.
Belle2::TrackFindingCDC::CDCSVGPlotter::drawInteractionPoint
void drawInteractionPoint()
Draws the interaction point.
Definition: CDCSVGPlotter.cc:126
Belle2::TrackFindingCDC::CDCSVGPlotter::drawAxialSegmentPairs
void drawAxialSegmentPairs(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draw the axial to axial segment pairs.
Definition: CDCSVGPlotter.cc:225
Belle2::TrackFindingCDC::CDCSVGPlotter::drawWires
void drawWires(const CDCWireTopology &cdcWireTopology)
Draws the wires.
Definition: CDCSVGPlotter.cc:152
Belle2::TrackFindingCDC::CDCSVGPlotter::drawTrackTrajectories
void drawTrackTrajectories(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draws trajectories of the tracks.
Definition: CDCSVGPlotter.cc:276
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSegmentTrajectories
void drawSegmentTrajectories(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draws SegmentTrajectories.
Definition: CDCSVGPlotter.cc:214
Belle2::TrackFindingCDC::CDCSVGPlotter::drawWrongRLHitsInTracks
void drawWrongRLHitsInTracks(const std::string &tracksStoreObjName)
Draw the CDCRLWireHits in the CDCTracks colored by the match of the right left passage informations.
Definition: CDCSVGPlotter.cc:412
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSegments
void drawSegments(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draws CDCSegments.
Definition: CDCSVGPlotter.cc:204
Belle2::TrackFindingCDC::CDCSVGPlotter::drawInnerCDCWall
void drawInnerCDCWall(const std::string &stroke)
Draws the inner CDCWall.
Definition: CDCSVGPlotter.cc:145
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSuperLayerBoundaries
void drawSuperLayerBoundaries(const std::string &stroke)
Draws the individual super layer boundaries.
Definition: CDCSVGPlotter.cc:131
Belle2::TrackFindingCDC::CDCSVGPlotter::drawRecoTracks
void drawRecoTracks(const std::string &storeArrayName, const std::string &stroke, const std::string &strokeWidth)
Draw RecoTracks.
Definition: CDCSVGPlotter.cc:287
Belle2::TrackFindingCDC::CDCSVGPlotter::drawTracks
void drawTracks(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draws CDCTracks.
Definition: CDCSVGPlotter.cc:266
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSimHits
void drawSimHits(const std::string &storeArrayName, const std::string &stroke, const std::string &strokeWidth)
Draws CDCSimHits.
Definition: CDCSVGPlotter.cc:167
Belle2::TrackFindingCDC::CDCSVGPlotter::drawMCSegmentTriples
void drawMCSegmentTriples(const std::string &segmentsStoreObjName, const std::string &stroke, const std::string &strokeWidth)
Draws the Monte Carlo true CDCSegmentTriples.
Definition: CDCSVGPlotter.cc:568
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSegmentPairs
void drawSegmentPairs(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draw the axial to stereo segment pairs.
Definition: CDCSVGPlotter.cc:235
Belle2::TrackFindingCDC::CDCSVGPlotter::draw
void draw(const AObject &object, const AttributeMap &attributeMap)
Draws the object or its trajectory with the given attributes.
Belle2::TrackFindingCDC::CDCSVGPlotter::CDCSVGPlotter
CDCSVGPlotter(bool animate=false, bool forwardFade=false)
Constructor.
Definition: CDCSVGPlotter.cc:104
Belle2::TrackFindingCDC::CDCSVGPlotter::saveFile
std::string saveFile(const std::string &fileName="display.svg")
Save the current dom object representation to disk.
Definition: CDCSVGPlotter.cc:615
Belle2::TrackFindingCDC::CDCSVGPlotter::drawOuterCDCWall
void drawOuterCDCWall(const std::string &stroke)
Draws the outer CDCWall.
Definition: CDCSVGPlotter.cc:138
Belle2::TrackFindingCDC::CDCSVGPlotter::drawStoreVector
void drawStoreVector(const std::string &storeObjName, Styling< AItem > &styling)
Function Template for drawing the elements of a given StoreVector.
Belle2::TrackFindingCDC::CDCSVGPlotter::drawIterable
void drawIterable(const AIterable &items, AStyling &styling)
Draw every element of an iterable object.
Belle2::TrackFindingCDC::CDCSVGPlotter::drawSegmentTripleTrajectories
void drawSegmentTripleTrajectories(const std::string &storeObjName, const std::string &stroke, const std::string &strokeWidth)
Draw the trajectories of the axial, stereo, axial segment triples.
Definition: CDCSVGPlotter.cc:255