KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
base_kvbase.C

Example of use of the KVBase class

This is the base class of most classes in the KaliVeda framework. It provides information on the version & installation layout of KaliVeda, plus various general "utility" methods.

To execute this function, do:

$ kaliveda
kaliveda[0] .L base_kvbase.C+
kaliveda[1] kvbase_example()
#include "KVBase.h"
#include "TList.h"
#include <iostream>
void kvbase_example()
{
KVBase base_obj;
base_obj.SetLabel("KVBase object");
TNamed tobject;
// list of mixed KVBase- & TObject-derived objects
TList list_obj;
list_obj.Add(&base_obj);
list_obj.Add(&tobject);
TIter next_obj(&list_obj);
TObject* obj_ptr;
while ((obj_ptr = next_obj())) {
// test if object is KVBase-based
// call a KVBase-only method
std::cout << "KVBase label = " <<
dynamic_cast<KVBase*>(obj_ptr)->GetLabel()
<< std::endl;
}
}
// look for location of an executable on the system
TString path_to_kaliveda = "kaliveda-config";
if (KVBase::FindExecutable(path_to_kaliveda)) {
// found executable
std::cout << "kaliveda-config executable located at "
<< path_to_kaliveda << std::endl;
}
}
Base class for KaliVeda framework.
Definition KVBase.h:142
void SetLabel(const Char_t *lab)
Definition KVBase.h:195
static Bool_t FindExecutable(TString &exec, const Char_t *path="$(PATH)")
Definition KVBase.cpp:1001
@ kIsKaliVedaObject
Definition KVBase.h:163
void Add(TObject *obj) override
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const