KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVBase Class Reference

Detailed Description

Base class for KaliVeda framework.

This is the base class for many classes in the KaliVeda framework. Each KVBase object has:

  • a name - Get/SetName()
  • a type - Get/SetType()
  • a number - Get/SetNumber()
  • a label - Get/SetLabel()

When objects are accessed through a TObject/TNamed base pointer, it is possible to test whether an object is derived from KVBase, using the bit KVBase::kIsKaliVedaObject:

TObject* ob = (address of some object);
@ kIsKaliVedaObject
Definition KVBase.h:163
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const

This class also provides a number of general utilities, often as static (stand-alone) methods.

KaliVeda build/installation information

The static methods

Base class for KaliVeda framework.
Definition KVBase.h:142
static const Char_t * GetKVBuildDate()
Returns KaliVeda build date.
Definition KVBase.cpp:900
static const Char_t * GetKVBuildUser()
Returns username of person who performed build.
Definition KVBase.cpp:887
static const Char_t * GetKVSourceDir()
Returns top-level directory of source tree used for build.
Definition KVBase.cpp:938
static const Char_t * GetKVBuildType()
Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...)
Definition KVBase.cpp:925
static const Char_t * GetKVVersion()
Returns KaliVeda version string.
Definition KVBase.cpp:874

give info on the sources, when and where they were built, and by whom.

Initialisation

The entire KaliVeda framework is initialised by the static method KVBase::InitEnvironment()

Finding/opening files

Static methods for easily locating and/or opening files within the KaliVeda installation tree are given:

static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition KVBase.cpp:538
static Bool_t SearchAndOpenKVFile(const Char_t *name, KVSQLite::database &dbfile, const Char_t *kvsubdir="")
Definition KVBase.cpp:649

Note that in the second case, two methods exist: one for reading, the other for writing the (ascii) files. A global function for searching files is also defined:

Bool_t SearchFile(const Char_t* name, TString& fullpath, int ndirs, ...)
bool Bool_t
char Char_t

This will search for a file in an arbitrary number of locations, return kTRUE if file is found and put full path to file in 'fullpath':

  • 'name' is a filename (not an absolute pathname) i.e. "toto.dat"
  • 'fullpath' will contain the full path to the file if it is found (if file not found, fullpath="")
  • 'ndirs' is the number of directories to search in

The remaining arguments are the names of 'ndirs' paths to search in,

Finding class source files

Source files for a class can be found using static method

static Bool_t FindClassSourceFiles(const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".")
Definition KVBase.cpp:1102

It will look for appropriately-named files corresponding to the header and implementation file of a class, testing several popular suffixes in each case.

Finding executables

To find an executable in the current user's 'PATH' (or elsewhere), use static method

static Bool_t FindExecutable(TString &exec, const Char_t *path="$(PATH)")
Definition KVBase.cpp:1001

Temporary files

The static methods

static void OpenTempFile(TString &base, std::ofstream &fp)
Definition KVBase.cpp:827
static void GetTempFileName(TString &base)
Definition KVBase.cpp:848

can generate and handle uniquely-named temporary (ascii) files.

Backing-up files

The static method

static void BackupFileWithDate(const Char_t *path)
Definition KVBase.cpp:753

can be used to create a dated backup of an existing file before it is replaced with a new version.

Handling plugins

As plugins are extensively used in the KaliVeda framework, a few utilities for handling them are defined. They are static methods

static const Char_t * GetPluginURI(const Char_t *base, const Char_t *plugin)
Definition KVBase.cpp:1177
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Definition KVBase.cpp:793
Examples
base_kvbase.C.

Definition at line 142 of file KVBase.h.

#include <KVBase.h>

Inherits TNamed.

Inherited by KVTemplateParticleCondition< KVNucleus >, KVTemplateParticleCondition< Particle >, DMSFile_t, INDRAGeometryBuilder, KV2Body, KVAutoFit, KVAvailableRunsFile, KVBatchJob, KVBatchSystem, KVBatchSystemGUI, KVCalibrator, KVClassFactory::KVClassMember, KVClassMonitor, KVColouredBase, KVDBKey, KVDMS, KVDataAnalysisTask, KVDataBranchHandler, KVDataPatch, KVDataPatchList, KVDataQualityAudit, KVDataQualityAuditReportMaker, KVDataQualityAuditReporting_INDRAFAZIA, KVDataRepository, KVDataSelector, KVDataSet, KVDetectionSimulator, KVDetectorEvent, KVDetectorSignal, KVDigitalFilter, KVEBYEDAT_ACQParam, KVElasticScatterEvent, KVEvent, KVEventReconstructor, KVEventViewer, KVFAZIATrigger, KVFileReader, KVFissionKinematics, KVGemini, KVGenPhaseSpace, KVGeoDNTrajectory, KVGeoDetectorNode, KVGeoNavigator, KVGeoNodeIterator, KVGeoStrucElement, KVGroupReconstructor, KVHistogram, KVIDGridEditor, KVIDGridManager, KVIDTelescope, KVINDRAPulserDataTree, KVIdentificationResult, KVImpactParameters::bayesian_estimator< FittingFunction, FluctuationKernel >, KVImpactParameters::cavata_prescription, KVImpactParameters::impact_parameter_distribution, KVIonRangeTable, KVIonRangeTableMaterial, KVMaterial, KVNuclearChart, KVRawDataReader, KVRunFile, KVRungeKutta, KVSQLROOTFile, KVSimDir, KVSimDirGUI, KVSimFile, KVTarArchive, KVTemplateParticleCondition< ParticleType >, KVTestListView, KVTriggerConditions, KVUserAnalysisOptionList, KVValueRange< ValueType >, KVVarGlob, KVVirtualIDFitter, KVZALineFinder, KVedaLossRangeFitter, and MicroStat::MCSampler.

Public Types

enum  EKaliVedaBits { kIsKaliVedaObject = BIT(23) }
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 

Public Member Functions

 KVBase ()
 Default constructor.
 
 KVBase (const Char_t *name, const Char_t *title="")
 Ctor for object with given name and type.
 
 KVBase (const KVBase &)
 copy ctor
 
virtual ~KVBase ()
 
virtual void Clear (Option_t *opt="")
 Clear object properties : name, type/title, number, label.
 
virtual void Copy (TObject &) const
 Make a copy of this object.
 
const Char_tGetLabel () const
 
UInt_t GetNumber () const
 
UInt_t GetNumberOfObjects () const
 
virtual TObjectGetObject () const
 
virtual const Char_tGetType () const
 
Bool_t HasLabel () const
 
virtual Bool_t IsCalled (const Char_t *name) const
 
Bool_t IsLabelled (const Char_t *l) const
 
virtual Bool_t IsType (const Char_t *typ) const
 
virtual void List ()
 
KVBaseoperator= (const KVBase &)
 copy assignment operator
 
virtual void Print (Option_t *option="") const
 
Double_t ProtectedGetX (const TF1 *func, Double_t val, int &status, Double_t xmin=0.0, Double_t xmax=0.0) const
 
void SetLabel (const Char_t *lab)
 
virtual void SetNumber (UInt_t num)
 
virtual void SetType (const Char_t *str)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 
void Clear (Option_t *option="") override
 
TObjectClone (const char *newname="") const override
 
Int_t Compare (const TObject *obj) const override
 
void Copy (TObject &named) const override
 
virtual void FillBuffer (char *&buffer)
 
const char * GetName () const override
 
const char * GetTitle () const override
 
ULong_t Hash () const override
 
TClassIsA () const override
 
Bool_t IsSortable () const override
 
void ls (Option_t *option="") const override
 
TNamedoperator= (const TNamed &rhs)
 
void Print (Option_t *option="") const override
 
virtual void SetName (const char *name)
 
virtual void SetNameTitle (const char *name, const char *title)
 
virtual void SetTitle (const char *title="")
 
virtual Int_t Sizeof () const
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
virtual void Browse (TBrowser *b)
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Delete (Option_t *option="")
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
virtual void DrawClass () const
 
virtual TObjectDrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Option_tGetOption () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
virtual void Inspect () const
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void MayNotUse (const char *method) const
 
virtual Bool_t Notify ()
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Paint (Option_t *option="")
 
virtual void Pop ()
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetUniqueID (UInt_t uid)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 

Static Public Member Functions

static Bool_t AreEqual (Double_t x, Double_t y, Long64_t maxdif=1)
 Comparison between two 64-bit floating-point values.
 
static void BackupFileWithDate (const Char_t *path)
 
static void CombineFiles (const Char_t *file1, const Char_t *file2, const Char_t *newfilename, Bool_t keep=kTRUE)
 
static void Deprecated (const char *method, const char *advice)
 
static Bool_t FindClassSourceFiles (const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".")
 
static Bool_t FindExecutable (TString &exec, const Char_t *path="$(PATH)")
 
static const Char_tFindFile (const Char_t *search, TString &wfil)
 
static const Char_tGetBINDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetDATABASEFilePath ()
 
static const Char_tGetDATADIRFilePath (const Char_t *namefile="")
 
static Bool_t GetDataSetEnv (const Char_t *dataset, const Char_t *type, Bool_t defval)
 
static const Char_tGetDataSetEnv (const Char_t *dataset, const Char_t *type, const Char_t *defval)
 
static Double_t GetDataSetEnv (const Char_t *dataset, const Char_t *type, Double_t defval)
 
static const Char_tGetETCDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetExampleFilePath (const Char_t *library, const Char_t *namefile)
 Return full path to example file for given library (="KVMultiDet", "BackTrack", etc.)
 
static const Char_tGetINCDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetKVBuildDate ()
 Returns KaliVeda build date.
 
static const Char_tGetKVBuildDir ()
 Returns top-level directory used for build.
 
static const Char_tGetKVBuildTime ()
 Returns KaliVeda build time.
 
static const Char_tGetKVBuildType ()
 Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...)
 
static const Char_tGetKVBuildUser ()
 Returns username of person who performed build.
 
static const Char_tGetKVSourceDir ()
 Returns top-level directory of source tree used for build.
 
static const Char_tGetKVVersion ()
 Returns KaliVeda version string.
 
static const Char_tGetLIBDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetListOfPlugins (const Char_t *base)
 
static const Char_tGetListOfPluginURIs (const Char_t *base)
 
static const Char_tGetPluginURI (const Char_t *base, const Char_t *plugin)
 
static void GetTempFileName (TString &base)
 
static const Char_tGetTEMPLATEDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetWORKDIRFilePath (const Char_t *namefile="")
 
static const Char_tgitBranch ()
 Returns git branch of sources.
 
static const Char_tgitCommit ()
 Returns last git commit of sources.
 
static void InitEnvironment ()
 
static bool is_gnuinstall ()
 
static Bool_t IsThisAPlugin (const TString &uri, TString &base)
 
static TPluginHandlerLoadPlugin (const Char_t *base, const Char_t *uri="0")
 
static Bool_t OpenContextMenu (const char *method, TObject *obj, const char *alt_method_name="")
 
static void OpenTempFile (TString &base, std::ofstream &fp)
 
static void PrintSplashScreen ()
 Prints welcome message and infos on version etc.
 
static Bool_t SearchAndOpenKVFile (const Char_t *name, KVSQLite::database &dbfile, const Char_t *kvsubdir="")
 
static Bool_t SearchAndOpenKVFile (const Char_t *name, std::ifstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0)
 
static Bool_t SearchAndOpenKVFile (const Char_t *name, std::ofstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0)
 
static Bool_t SearchKVFile (const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
 
static const Char_tWorkingDirectory ()
 
- Static Public Member Functions inherited from TNamed
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 

Private Member Functions

void init ()
 Default initialisation.
 

Static Private Member Functions

static void ReadConfigFiles ()
 
static void ReadGUIMimeTypes ()
 

Private Attributes

TString fLabel
 label for the object
 
UInt_t fNumber
 for numbering objects
 

Static Private Attributes

static Bool_t fEnvIsInit = kFALSE
 set when environment is initialised
 
static UInt_t fNbObj = 0
 Total number of KaliVeda objects (actually counts number of calls to default ctor)
 
static TString fWorkingDirectory = "$(HOME)/.kaliveda"
 user working directory for e.g. database files
 

Additional Inherited Members

- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Member Enumeration Documentation

◆ EKaliVedaBits

Enumerator
kIsKaliVedaObject 

Definition at line 162 of file KVBase.h.

Constructor & Destructor Documentation

◆ KVBase() [1/3]

KVBase::KVBase ( )

Default constructor.

Definition at line 317 of file KVBase.cpp.

◆ KVBase() [2/3]

KVBase::KVBase ( const Char_t name,
const Char_t title = "" 
)

Ctor for object with given name and type.

Definition at line 328 of file KVBase.cpp.

◆ KVBase() [3/3]

KVBase::KVBase ( const KVBase obj)

copy ctor

Definition at line 339 of file KVBase.cpp.

◆ ~KVBase()

KVBase::~KVBase ( )
virtual

Definition at line 369 of file KVBase.cpp.

Member Function Documentation

◆ AreEqual()

Bool_t KVBase::AreEqual ( Double_t  A,
Double_t  B,
Long64_t  maxdif = 1 
)
static

Comparison between two 64-bit floating-point values.

Returns kTRUE if the integer representations of the two values are within maxdif of each other. By default maxdif=1, which means that we consider that x==y if the difference between them is no greater than the precision of Double_t variables, i.e. 4.94065645841246544e-324

Based on the function AlmostEqual2sComplement(float, float, int) by Bruce Dawson http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm

Definition at line 1442 of file KVBase.cpp.

◆ BackupFileWithDate()

void KVBase::BackupFileWithDate ( const Char_t path)
static

path gives the full path (can include environment variables, special symbols) to a file which will be renamed with an extension containing the current date and time (in SQL format).

Example:

KVBase::BackupFileWithDate("$(HOME)/toto.txt")

The file toto.txt will be renamed toto.txt.2007-05-02_16:22:37

Definition at line 753 of file KVBase.cpp.

◆ Clear()

void KVBase::Clear ( Option_t opt = "")
virtual

◆ CombineFiles()

void KVBase::CombineFiles ( const Char_t file1,
const Char_t file2,
const Char_t newfilename,
Bool_t  keep = kTRUE 
)
static

STATIC method which allows to combine the contents of two ROOT files (file1 and file2) into a new ROOT file (newfilename). All objects from the two files will be written in the new file.

if keep=kFALSE, the two files will be deleted after the operation

Definition at line 1527 of file KVBase.cpp.

◆ Copy()

◆ Deprecated()

void KVBase::Deprecated ( const char *  where,
const char *  advice 
)
static

Print a message to indicate when the called method is deprecated and give advice how to do better

Don't call directly: use the macro Deprecate(advice) which will automatically fill in the method name (see KVMacros.h)

Definition at line 1734 of file KVBase.cpp.

◆ FindClassSourceFiles()

Bool_t KVBase::FindClassSourceFiles ( const Char_t class_name,
KVString imp_file,
KVString dec_file,
const Char_t dir_name = "." 
)
static

Look for the source files corresponding to class_name i.e. taking class_name as a base, we look for one of

class_name.C,class_name.cpp,class_name.cxx

and one of

class_name.h,class_name.hh,class_name.H

By default we look in the current working directory, unless argument dir_name is given

If found, the names of the two files are written in imp_file and dec_file

Definition at line 1102 of file KVBase.cpp.

◆ FindExecutable()

Bool_t KVBase::FindExecutable ( TString exec,
const Char_t path = "$(PATH)" 
)
static

By default, FindExecutable(exec) will look for the executable named by exec in the directories contained in the environment variable PATH. You can override this by giving your own search path as second argument (remember to write environment variables as $(PATH), for cross-platform compatibility).

If exec is not found, and if it does not end with .exe, we look for exec.exe This is for compatibility with Windows/cygwin environments.

If the executable is found, returns kTRUE and exec then holds full path to executable. Returns kFALSE if exec not found in paths.

If exec is an absolute pathname, we return kTRUE if the file exists (we do not use path).

Examples
base_kvbase.C.

Definition at line 1001 of file KVBase.cpp.

◆ FindFile()

const Char_t * KVBase::FindFile ( const Char_t search,
TString wfil 
)
static

Backwards compatible fix for TSystem::FindFile which only exists from ROOT version 5.12/00 onwards. Use this method as a replacement for gSystem->FindFile (same arguments)

Definition at line 1060 of file KVBase.cpp.

◆ GetBINDIRFilePath()

const Char_t * KVBase::GetBINDIRFilePath ( const Char_t namefile = "")
static

Definition at line 118 of file KVBase.cpp.

◆ GetDATABASEFilePath()

const Char_t * KVBase::GetDATABASEFilePath ( )
static

Definition at line 92 of file KVBase.cpp.

◆ GetDATADIRFilePath()

const Char_t * KVBase::GetDATADIRFilePath ( const Char_t namefile = "")
static

Definition at line 74 of file KVBase.cpp.

◆ GetDataSetEnv() [1/3]

Bool_t KVBase::GetDataSetEnv ( const Char_t dataset,
const Char_t type,
Bool_t  defval 
)
static

Static method to interrogate dataset-specific variables in configuration Will look for gEnv->GetValue "dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value

Definition at line 1660 of file KVBase.cpp.

◆ GetDataSetEnv() [2/3]

const Char_t * KVBase::GetDataSetEnv ( const Char_t dataset,
const Char_t type,
const Char_t defval 
)
static

Static method to interrogate dataset-specific variables in configuration Will look for gEnv->GetValue "dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value (="" by default)

Definition at line 1619 of file KVBase.cpp.

◆ GetDataSetEnv() [3/3]

Double_t KVBase::GetDataSetEnv ( const Char_t dataset,
const Char_t type,
Double_t  defval 
)
static

Static method to interrogate dataset-specific variables in configuration Will look for gEnv->GetValue "dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value

Definition at line 1639 of file KVBase.cpp.

◆ GetETCDIRFilePath()

const Char_t * KVBase::GetETCDIRFilePath ( const Char_t namefile = "")
static

Definition at line 65 of file KVBase.cpp.

◆ GetExampleFilePath()

const Char_t * KVBase::GetExampleFilePath ( const Char_t library,
const Char_t namefile 
)
static

Return full path to example file for given library (="KVMultiDet", "BackTrack", etc.)

Definition at line 1577 of file KVBase.cpp.

◆ GetINCDIRFilePath()

const Char_t * KVBase::GetINCDIRFilePath ( const Char_t namefile = "")
static

Definition at line 109 of file KVBase.cpp.

◆ GetKVBuildDate()

const Char_t * KVBase::GetKVBuildDate ( )
static

Returns KaliVeda build date.

Definition at line 900 of file KVBase.cpp.

◆ GetKVBuildDir()

const Char_t * KVBase::GetKVBuildDir ( )
static

Returns top-level directory used for build.

Definition at line 951 of file KVBase.cpp.

◆ GetKVBuildTime()

const Char_t * KVBase::GetKVBuildTime ( )
static

Returns KaliVeda build time.

Definition at line 912 of file KVBase.cpp.

◆ GetKVBuildType()

const Char_t * KVBase::GetKVBuildType ( )
static

Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...)

Definition at line 925 of file KVBase.cpp.

◆ GetKVBuildUser()

const Char_t * KVBase::GetKVBuildUser ( )
static

Returns username of person who performed build.

Definition at line 887 of file KVBase.cpp.

◆ GetKVSourceDir()

const Char_t * KVBase::GetKVSourceDir ( )
static

Returns top-level directory of source tree used for build.

Definition at line 938 of file KVBase.cpp.

◆ GetKVVersion()

const Char_t * KVBase::GetKVVersion ( )
static

Returns KaliVeda version string.

Definition at line 874 of file KVBase.cpp.

◆ GetLabel()

const Char_t * KVBase::GetLabel ( ) const
inline

Definition at line 199 of file KVBase.h.

◆ GetLIBDIRFilePath()

const Char_t * KVBase::GetLIBDIRFilePath ( const Char_t namefile = "")
static

Definition at line 100 of file KVBase.cpp.

◆ GetListOfPlugins()

const Char_t * KVBase::GetListOfPlugins ( const Char_t base)
static

Return whitespace-separated list of all plugin classes defined for the given base class.

E.g. if plugins exist for BaseClass:

Plugin.BaseClass: URI PluginClass PluginLibrary "PluginClassConstructor(arguments)" +Plugin.BaseClass: URI2 PluginClass2 PluginLibrary2 "PluginClass2Constructor(arguments)"

then KVBase::GetListOfPlugins("BaseClass") will return "PluginClass PluginClass2"

Most of the code is copied from TPluginManager::LoadHandlersFromEnv

Definition at line 1260 of file KVBase.cpp.

◆ GetListOfPluginURIs()

const Char_t * KVBase::GetListOfPluginURIs ( const Char_t base)
static

For a given base class, return a whitespace-separated list of plugin identifiers which are known/defined. E.g. if plugins exist for BaseClass:

Plugin.BaseClass: URI PluginClass PluginLibrary "PluginClassConstructor(arguments)" +Plugin.BaseClass: URI2 PluginClass2 PluginLibrary2 "PluginClass2Constructor(arguments)"

then KVBase::GetListOfPluginURIs("BaseClass") will return "URI URI2"

Definition at line 1327 of file KVBase.cpp.

◆ GetNumber()

UInt_t KVBase::GetNumber ( ) const
inline

Definition at line 220 of file KVBase.h.

◆ GetNumberOfObjects()

UInt_t KVBase::GetNumberOfObjects ( ) const
inline

Definition at line 224 of file KVBase.h.

◆ GetObject()

TObject * KVBase::GetObject ( ) const
virtual

Dummy method (returns NULL). This method may be used in 'container' classes used with KVListView. In order to open the context menu of the 'contained' object, GetLabel() should return the real class of the object, and this method should return its address. Then call KVListView::SetUseObjLabelAsRealClass(kTRUE).

Reimplemented in KVHistogram.

Definition at line 1560 of file KVBase.cpp.

◆ GetPluginURI()

const Char_t * KVBase::GetPluginURI ( const Char_t base,
const Char_t derived 
)
static

Inverse of gPluginMgr->FindHandler(const Char_t* base, const Char_t* uri)

Given a base class base and a derived class derived, we search gEnv to find the URI corresponding to this plugin.

Example: given a plugin such as

Plugin.KVIDTelescope: ^PHOS$ KVIDPhoswich KVIndra "KVIDPhoswich()"
Identification in Phoswich telescopes of INDRA.

then calling KVBase::GetPluginURI("KVIDTelescope", "KVIDPhoswich") will return "PHOS".

Most of the code is copied from TPluginManager::LoadHandlersFromEnv

Definition at line 1177 of file KVBase.cpp.

◆ GetTempFileName()

void KVBase::GetTempFileName ( TString base)
static

When called with base="toto.dat", the returned value of 'base' is "/full/path/to/temp/dir/toto.dat15930693" i.e. the full path to a file in the system temp directory (gSystem->TempDirectory) appended with the current time as returned by gSystem->Now() in order to make its name unique

Definition at line 848 of file KVBase.cpp.

◆ GetTEMPLATEDIRFilePath()

const Char_t * KVBase::GetTEMPLATEDIRFilePath ( const Char_t namefile = "")
static

Definition at line 83 of file KVBase.cpp.

◆ GetType()

virtual const Char_t * KVBase::GetType ( ) const
inlinevirtual

Reimplemented in KVDetectorSignal.

Definition at line 177 of file KVBase.h.

◆ GetWORKDIRFilePath()

const Char_t * KVBase::GetWORKDIRFilePath ( const Char_t namefile = "")
static

Definition at line 127 of file KVBase.cpp.

◆ gitBranch()

const Char_t * KVBase::gitBranch ( )
static

Returns git branch of sources.

Definition at line 964 of file KVBase.cpp.

◆ gitCommit()

const Char_t * KVBase::gitCommit ( )
static

Returns last git commit of sources.

Definition at line 976 of file KVBase.cpp.

◆ HasLabel()

Bool_t KVBase::HasLabel ( ) const
inline

Definition at line 203 of file KVBase.h.

◆ init()

void KVBase::init ( void  )
private

Default initialisation.

Definition at line 138 of file KVBase.cpp.

◆ InitEnvironment()

void KVBase::InitEnvironment ( )
static

STATIC method to Initialise KaliVeda environment Reads config files in $(pkgdatadir)/etc and sets up environment (data repositories, datasets, etc. etc.). Adds directory where kaliveda shared libs are installed to the dynamic path - for finding and loading plugins. Resets the gRandom random number sequence using a clock-based seed (i.e. random sequences do not repeat).

Normally, the first object created which inherits from KVBase will perform this initialisation; if you need to set up the environment before creating a KVBase object, or if you just want to be absolutely sure that the environment has been initialised, you can call this method.

Note for GNU-style installations

If KaliVeda is built with the cmake option -Dgnuinstall=yes then each user will have a working directory which will be used to store any files generated by KaliVeda at runtime.

By default the location of user's working directory is set to

$(HOME)/.kaliveda

but can be changed with variable

KaliVeda.WorkingDirectory: [directory]

in configuration file .kvrootrc. [directory] must be an absolute pathname, but can use shell variables like $(HOME).

Definition at line 181 of file KVBase.cpp.

◆ is_gnuinstall()

static bool KVBase::is_gnuinstall ( )
inlinestatic

return true if built with option -Dgnuinstall=yes i.e. GNU-style installation directories, any generated files stored in user's working directory i.e. not in installation path

Definition at line 277 of file KVBase.h.

◆ IsCalled()

virtual Bool_t KVBase::IsCalled ( const Char_t name) const
inlinevirtual

Returns true if object has given name (test value returned by GetName())

Definition at line 190 of file KVBase.h.

◆ IsLabelled()

Bool_t KVBase::IsLabelled ( const Char_t l) const
inline

return true if object label is "l"

Definition at line 207 of file KVBase.h.

◆ IsThisAPlugin()

Bool_t KVBase::IsThisAPlugin ( const TString uri,
TString base 
)
static

Returns kTRUE if 'uri' is the name of a defined plugin, in which case 'base' is the name of the base class extended by this plugin.

Most of the code is copied from TPluginManager::LoadHandlersFromEnv

Definition at line 1357 of file KVBase.cpp.

◆ IsType()

virtual Bool_t KVBase::IsType ( const Char_t typ) const
inlinevirtual

Returns true if GetType() returns the given type name

Definition at line 185 of file KVBase.h.

◆ List()

virtual void KVBase::List ( )
inlinevirtual

Definition at line 213 of file KVBase.h.

◆ LoadPlugin()

TPluginHandler * KVBase::LoadPlugin ( const Char_t base,
const Char_t uri = "0" 
)
static

Load plugin library in order to extend capabilities of base class "base", depending on the given uri (these arguments are used to call TPluginManager::FindHandler). Returns pointer to TPluginHandler. Returns 0 in case of problems. does plugin exist for given name ?

Definition at line 793 of file KVBase.cpp.

◆ OpenContextMenu()

Bool_t KVBase::OpenContextMenu ( const char *  method,
TObject obj,
const char *  alt_method_name = "" 
)
static

Open context menu for given method of object *obj. By default title of menu is 'obj->ClassName()::method' You can give an alternative method name in 'alt_method_name' Returns kFALSE if the given method is not defined for the class of object in question.

WARNING: even if this method returns kTRUE, this is no guarantee that the method has indeed been executed. The user may have pressed the 'Cancel' button...

Definition at line 1495 of file KVBase.cpp.

◆ OpenTempFile()

void KVBase::OpenTempFile ( TString base,
std::ofstream &  fp 
)
static

Opens a uniquely-named file in system temp directory (gSystem->TempDirectory) Name of file is "basexxxxxxxxxx" where "xxxxxxxxx" is current time as returned by gSystem->Now(). After opening file, 'base' contains full path to file.

Definition at line 827 of file KVBase.cpp.

◆ operator=()

KVBase & KVBase::operator= ( const KVBase other)

copy assignment operator

Definition at line 355 of file KVBase.cpp.

◆ Print()

◆ PrintSplashScreen()

void KVBase::PrintSplashScreen ( )
static

Prints welcome message and infos on version etc.

Definition at line 1593 of file KVBase.cpp.

◆ ProtectedGetX()

Double_t KVBase::ProtectedGetX ( const TF1 func,
Double_t  val,
int &  status,
Double_t  xmin = 0.0,
Double_t  xmax = 0.0 
) const

Since ROOT6, the TF1::GetX() method can no longer be used without precaution.

In ROOT5, if the value val was larger or smaller than the maximum or minimum value of the function (within its defined range) then TF1::GetX() would return X of the maximum or minimum, respectively.

In ROOT6, TF1::GetX() has been reimplemented so that, in the above case, it prints out 3 warning messages and returns a TMath::QuietNaN()! Therefore we provide this function in order to replicate the previous behaviour.

The status = 0 if the value is within the limits of the function. status = +1 if value is above the maximum, or status = -1 if value is below the minimum

When compiled with ROOT5, this method just calls TF1::GetX() (and status = 0 always).

Definition at line 1691 of file KVBase.cpp.

◆ ReadConfigFiles()

void KVBase::ReadConfigFiles ( )
staticprivate

Read all configuration files System config files are read first in the order they appear in file ${ETCDIR}/config.files Then we read any of the following files if they exist: ${HOME}/.kvrootrc ${PWD}/.kvrootrc

Definition at line 272 of file KVBase.cpp.

◆ ReadGUIMimeTypes()

void KVBase::ReadGUIMimeTypes ( )
staticprivate

Add to standard ROOT mime types some new ones defined in .kvrootrc for icons associated with graphs, runs, etc. by lines such as:

KaliVeda.GUI.MimeTypes : KVIDMap
KaliVeda.GUI.MimeTypes.KVIDMap.Icon : rootdb_t.xpm
+KaliVeda.GUI.MimeTypes : KVIDZAGrid
KaliVeda.GUI.MimeTypes.KVIDZAGrid.Icon : draw_t.xpm
Collection of graphical contours used for particle identification.
Definition KVIDMap.h:22
KVIDMap()
Default constructor.
Definition KVIDMap.cpp:18
Identification grid with lines corresponding to different nuclear isotopes (KVIDZALine)
Definition KVIDZAGrid.h:66
KVIDZAGrid()
default ctor.

etc.

Definition at line 1397 of file KVBase.cpp.

◆ SearchAndOpenKVFile() [1/3]

Bool_t KVBase::SearchAndOpenKVFile ( const Char_t name,
KVSQLite::database dbfile,
const Char_t kvsubdir = "" 
)
static

Search and open for reading/writing a sqlite database file:

search for file (and open it, if found) in the following order: if 'name' = absolute path the function returns kTRUE if the file exists if name != absolute path:

  1. a. if 'kvsubdir'="" (default) look for file in directory
  1. b. if 'kvsubdir'!="" look for file in /'kvsubdir'
  2. look for file with this name in user's home directory
  3. look for file with this name in working directory if the file is not found, kFALSE is returned.

Definition at line 649 of file KVBase.cpp.

◆ SearchAndOpenKVFile() [2/3]

static Bool_t KVBase::SearchAndOpenKVFile ( const Char_t name,
std::ifstream &  file,
const Char_t kvsubdir = "",
KVLockfile locks = 0 
)
static

◆ SearchAndOpenKVFile() [3/3]

static Bool_t KVBase::SearchAndOpenKVFile ( const Char_t name,
std::ofstream &  file,
const Char_t kvsubdir = "",
KVLockfile locks = 0 
)
static

◆ SearchKVFile()

Bool_t KVBase::SearchKVFile ( const Char_t name,
TString fullpath,
const Char_t kvsubdir = "" 
)
static

search for files in the following order: if 'name' = absolute path the function returns kTRUE if the file exists if name != absolute path:

  1. a. if 'kvsubdir'="" (default) look for file in directory
  1. b. if 'kvsubdir'!="": if 'kvsubdir' is an absolute pathname, look in 'kvsubdir' if 'kvsubdir' is not an absolute pathname, look in '/kvsubdir'
  2. look for file with this name in user's home directory
  3. look for file with this name in working directory in all cases the function returns kTRUE if the file was found. 'fullpath' then contains the absolute path to the file

Definition at line 538 of file KVBase.cpp.

◆ SetLabel()

void KVBase::SetLabel ( const Char_t lab)
inline
Examples
base_kvbase.C.

Definition at line 195 of file KVBase.h.

◆ SetNumber()

virtual void KVBase::SetNumber ( UInt_t  num)
inlinevirtual

Reimplemented in KVGroup.

Definition at line 216 of file KVBase.h.

◆ SetType()

virtual void KVBase::SetType ( const Char_t str)
inlinevirtual

Reimplemented in KVINDRADetector, and KVDetectorSignal.

Definition at line 173 of file KVBase.h.

◆ WorkingDirectory()

static const Char_t * KVBase::WorkingDirectory ( )
inlinestatic

Definition at line 181 of file KVBase.h.

Member Data Documentation

◆ fEnvIsInit

Bool_t KVBase::fEnvIsInit = kFALSE
staticprivate

set when environment is initialised

Definition at line 151 of file KVBase.h.

◆ fLabel

TString KVBase::fLabel
private

label for the object

Definition at line 148 of file KVBase.h.

◆ fNbObj

UInt_t KVBase::fNbObj = 0
staticprivate

Total number of KaliVeda objects (actually counts number of calls to default ctor)

Definition at line 145 of file KVBase.h.

◆ fNumber

UInt_t KVBase::fNumber
private

for numbering objects

Definition at line 146 of file KVBase.h.

◆ fWorkingDirectory

TString KVBase::fWorkingDirectory = "$(HOME)/.kaliveda"
staticprivate

user working directory for e.g. database files

Definition at line 152 of file KVBase.h.