 |
Belle II Software
release-05-01-25
|
1 #include <display/ObjectInfo.h>
3 #include <framework/logging/Logger.h>
4 #include <framework/datastore/RelationsObject.h>
5 #include <framework/utilities/HTML.h>
7 #include <genfit/GFRaveVertex.h>
13 #include <TInterpreter.h>
18 std::string callStringMethod(
const TObject* obj,
const char* name)
21 TClass* cl = obj->IsA();
26 TMethod* m = cl->GetMethod(name,
"",
true);
28 if (m->GetReturnTypeName() != std::string(
"string"))
29 B2WARNING(cl->GetName() <<
"::" << name <<
" has return type " << m->GetReturnTypeName() <<
30 " instead of std::string, cannot show info.");
32 gInterpreter->ExecuteWithArgsAndReturn(m, (
void*)obj, 0, 0, &str);
41 B2ERROR(
"ObjectInfo::getName() got null?");
43 return relObj->getName();
45 return callStringMethod(obj,
"getName");
51 B2ERROR(
"ObjectInfo::getInfo() got null?");
53 return relObj->getInfoHTML();
56 TString::Format(
"pVal=%e", TMath::Prob(vertex->getChi2(), vertex->getNdf()));
58 return callStringMethod(obj,
"getInfoHTML");
64 const TString& name =
getName(obj);
65 if (name.Length() != 0)
76 name = relObj->getArrayName();
77 index = relObj->getArrayIndex();
88 if (pair.second.object == obj) {
89 name = pair.second.name;
95 return std::make_pair(name, index);
101 if (pos.second != -1)
102 return TString::Format(
"%s[%d]", pos.first.c_str(), pos.second);
TString getName(const TObject *obj)
human-readable name (e.g.
std::string htmlToPlainText(const std::string &html)
Reformat given HTML string into terminal-friendly plain text.
static DataStore & Instance()
Instance of singleton Store.
Wraps a stored array/object, stored under unique (name, durability) key.
std::string name
Name of the entry.
TString getTitle(const TObject *obj)
Get plain text for TEve object titles (shown on mouse-over).
TString getInfo(const TObject *obj)
Get object info HTML (e.g.
Abstract base class for different kinds of events.
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
TString getIdentifier(const TObject *obj)
Where is this object in the datastore?
bool findStoreEntry(const TObject *object, StoreEntry *&entry, int &index)
Find an object in an array in the data store.
std::pair< std::string, int > getDataStorePosition(const TObject *obj)
return entry name & index for arrays, with index = -1 for objects.
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Defines interface for accessing relations of objects in StoreArray.