Return information on objects, for use by InfoWidget, Eve titles (popups) etc.
More...
|
TString | getName (const TObject *obj) |
| human-readable name (e.g.
|
|
TString | getIdentifier (const TObject *obj) |
| Where is this object in the datastore?
|
|
TString | getInfo (const TObject *obj) |
| Get object info HTML (e.g.
|
|
TString | getTitle (const TObject *obj) |
| Get plain text for TEve object titles (shown on mouse-over).
|
|
std::pair< std::string, int > | getDataStorePosition (const TObject *obj) |
| return entry name & index for arrays, with index = -1 for objects.
|
|
Return information on objects, for use by InfoWidget, Eve titles (popups) etc.
Expands on RelationsObject::getInfoHTML()/getName() by also providing info on e.g. genfit2::Track objects.
◆ getDataStorePosition()
std::pair< std::string, int > getDataStorePosition |
( |
const TObject * |
obj | ) |
|
return entry name & index for arrays, with index = -1 for objects.
Definition at line 78 of file ObjectInfo.cc.
79{
80 std::string name;
81 int index = -1;
83 name = relObj->getArrayName();
84 index = relObj->getArrayIndex();
85 } else {
86
89 if (entry)
91 }
92 if (index == -1) {
93
95 if (pair.second.object == obj) {
96 name = pair.second.name;
97 break;
98 }
99 }
100 }
101
102 return std::make_pair(name, index);
103}
bool findStoreEntry(const TObject *object, StoreEntry *&entry, int &index)
Find an object in an array in the data store.
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
static DataStore & Instance()
Instance of singleton Store.
Defines interface for accessing relations of objects in StoreArray.
Wraps a stored array/object, stored under unique (name, durability) key.
std::string name
Name of the entry.
◆ getIdentifier()
TString getIdentifier |
( |
const TObject * |
obj | ) |
|
Where is this object in the datastore?
Definition at line 105 of file ObjectInfo.cc.
106{
108 if (pos.second != -1)
109 return TString::Format("%s[%d]", pos.first.c_str(), pos.second);
110 return pos.first;
111}
std::pair< std::string, int > getDataStorePosition(const TObject *obj)
return entry name & index for arrays, with index = -1 for objects.
◆ getInfo()
TString getInfo |
( |
const TObject * |
obj | ) |
|
Get object info HTML (e.g.
via RelationsObject::getInfoHTML()).
Definition at line 55 of file ObjectInfo.cc.
56{
57 if (!obj)
58 B2ERROR("ObjectInfo::getInfo() got null?");
60 return relObj->getInfoHTML();
61 } else if (auto vertex = dynamic_cast<const genfit::GFRaveVertex*>(obj)) {
62 return "<b>V</b>=" +
HTML::getString(ROOT::Math::XYZVector(vertex->getPos())) +
"<br>" +
63 TString::Format("pVal=%e", TMath::Prob(vertex->getChi2(), vertex->getNdf()));
64 }
65 return callStringMethod(obj, "getInfoHTML");
66}
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
◆ getName()
TString getName |
( |
const TObject * |
obj | ) |
|
human-readable name (e.g.
pi+)
Definition at line 45 of file ObjectInfo.cc.
46{
47 if (!obj)
48 B2ERROR("ObjectInfo::getName() got null?");
50 return relObj->getName();
51 }
52 return callStringMethod(obj, "getName");
53}
◆ getTitle()
TString getTitle |
( |
const TObject * |
obj | ) |
|
Get plain text for TEve object titles (shown on mouse-over).
Definition at line 68 of file ObjectInfo.cc.
69{
71 const TString& name =
getName(obj);
72 if (name.Length() != 0)
73 out += " - " + name;
74
76}
std::string htmlToPlainText(const std::string &html)
Reformat given HTML string into terminal-friendly plain text.
TString getName(const TObject *obj)
human-readable name (e.g.
TString getIdentifier(const TObject *obj)
Where is this object in the datastore?
TString getInfo(const TObject *obj)
Get object info HTML (e.g.