Belle II Software development
DisplayData.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <TObject.h>
11
12//for dictionaries
13#include <TH1.h>
14#include <Math/Vector3D.h>
15
16#include <vector>
17#include <map>
18#include <string>
19#include <utility>
20
21
22namespace Belle2 {
55 class DisplayData : public TObject {
56 public:
57
60
63
71 void addArrow(const std::string& name, const ROOT::Math::XYZVector& start, const ROOT::Math::XYZVector& end, int color = -1);
72
77 void addHistogram(const std::string& name, const TH1* hist);
78
80 void addLabel(const std::string& text, const ROOT::Math::XYZVector& pos);
81
82
87 void addPoint(const std::string& name, const ROOT::Math::XYZVector& pos);
88
89
97 void select(const TObject* object);
98
100 struct Arrow {
101 std::string name;
102 ROOT::Math::XYZVector start;
103 ROOT::Math::XYZVector end;
104 int color;
105 };
106 private:
107
108 std::map<std::string, std::vector<ROOT::Math::XYZVector> > m_pointSets;
109 std::vector<std::pair<std::string, ROOT::Math::XYZVector> > m_labels;
111 std::vector<TH1*> m_histograms; //->
112
113 std::vector<std::pair<std::string, unsigned int> > m_selectedObjects;
114 std::vector<Arrow> m_arrows;
118 friend class DisplayUI;
119 friend class EVEVisualization;
120
121 }; //class
123} // namespace Belle2
Add custom information to the display.
Definition: DisplayData.h:55
void select(const TObject *object)
Select the given object in the display.
Definition: DisplayData.cc:46
void addHistogram(const std::string &name, const TH1 *hist)
Add histogram with the given name.
Definition: DisplayData.cc:39
ClassDef(DisplayData, 5)
Add custom information to the display.
DisplayData()
Constructor.
Definition: DisplayData.h:59
void addPoint(const std::string &name, const ROOT::Math::XYZVector &pos)
Add a point at the given position, as part of a collection specified by name.
Definition: DisplayData.cc:29
std::vector< TH1 * > m_histograms
Histograms to be shown in Eve.
Definition: DisplayData.h:111
std::vector< Arrow > m_arrows
List of arrows.
Definition: DisplayData.h:114
void addArrow(const std::string &name, const ROOT::Math::XYZVector &start, const ROOT::Math::XYZVector &end, int color=-1)
Add an arrow in the display (for axes, to point out some specific location).
Definition: DisplayData.cc:24
void addLabel(const std::string &text, const ROOT::Math::XYZVector &pos)
Add a text label at the given position.
Definition: DisplayData.cc:34
std::map< std::string, std::vector< ROOT::Math::XYZVector > > m_pointSets
name -> points map
Definition: DisplayData.h:108
std::vector< std::pair< std::string, unsigned int > > m_selectedObjects
List of selected objects (array name, index).
Definition: DisplayData.h:113
std::vector< std::pair< std::string, ROOT::Math::XYZVector > > m_labels
text labels (to be shown at a given position).
Definition: DisplayData.h:109
~DisplayData()
Destructor.
Definition: DisplayData.cc:15
Control TEve browser user interface.
Definition: DisplayUI.h:41
Produces visualisation for MCParticles, simhits, genfit::Tracks, geometry and other things.
Abstract base class for different kinds of events.
Stores data associated with an arrow.
Definition: DisplayData.h:100
int color
Color_t, e.g.
Definition: DisplayData.h:104
ROOT::Math::XYZVector start
arrow starts here.
Definition: DisplayData.h:102
std::string name
label.
Definition: DisplayData.h:101
ROOT::Math::XYZVector end
and ends here.
Definition: DisplayData.h:103