KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KVExpDB Class Reference

Base class to describe database of an experiment ,.

Definition at line 19 of file KVExpDB.h.

Public Member Functions

 KVExpDB ()
 Default constructor. More...
 
 KVExpDB (const Char_t *name)
 Constructor inherited from KVDataBase. More...
 
 KVExpDB (const Char_t *name, const Char_t *title)
 Constructor inherited from KVDataBase. More...
 
virtual ~KVExpDB ()
 Destructor. More...
 
void AddRun (KVDBRun *r)
 
void AddSystem (KVDBSystem *r)
 
virtual void Build ()
 
virtual void cd ()
 
Bool_t FindCalibFile (const Char_t *type, TString &fullpath) const
 
TString GetCalibFileName (const Char_t *type) const
 
const Char_tGetDataSetDir () const
 
virtual TString GetDBEnv (const Char_t *) const
 
KVDBRunGetDBRun (Int_t number) const
 
TString GetDBType () const
 
const KVNumberListGetRunList () const
 
virtual KVSeqCollectionGetRuns () const
 
virtual KVDBSystemGetSystem (const Char_t *system) const
 
virtual KVSeqCollectionGetSystems () const
 
ULong64_t GetTotalEvents (const KVString &system) const
 Return total number of events for given system. More...
 
ULong64_t GetTotalEvents (int first_run, int last_run=-1) const
 
virtual void LinkListToRunRange (TList *list, const KVNumberList &nl)
 Link the records contained in the list to the set of runs (see LinkRecordToRunRanges). More...
 
virtual void LinkListToRunRanges (TList *list, UInt_t rr_number, UInt_t run_ranges[][2])
 Link the records contained in the list to the set of runs (see LinkRecordToRunRanges). More...
 
virtual void LinkRecordToRun (KVDBRecord *rec, Int_t run)
 
virtual void LinkRecordToRunRange (KVDBRecord *rec, const KVNumberList &nl)
 
virtual void LinkRecordToRunRange (KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
 
virtual void LinkRecordToRunRanges (KVDBRecord *rec, UInt_t rr_number, UInt_t run_ranges[][2])
 
virtual void PrintRuns (KVNumberList &) const
 
virtual void ReadObjects (TFile *)
 
void RemoveSystem (KVDBSystem *s)
 
virtual void Save (const Char_t *)
 
void SetDataSet (const TString &s)
 
void SetDataSetDir (const Char_t *d)
 
void SetDBType (const TString &s)
 
virtual void WriteObjects (TFile *)
 
void WriteRunListFile () const
 
void WriteSystemsFile () const
 
- Public Member Functions inherited from KVDataBase
 KVDataBase ()
 
 KVDataBase (const Char_t *name)
 
 KVDataBase (const Char_t *name, const Char_t *title)
 
virtual ~ KVDataBase ()
 
virtual KVDBTableAddTable (const Char_t *name, const Char_t *title, Bool_t unique=kFALSE)
 
virtual Bool_t AddTable (KVDBTable *table)
 
virtual KVDBRecordGetRecord (const Char_t *table_name, const Char_t *rec_name) const
 
virtual KVDBTableGetTable (const Char_t *table) const
 
virtual TListGetTables () const
 
virtual void Print (Option_t *option="") const
 
- Public Member Functions inherited from TFolder
 TFolder ()
 
 TFolder (const char *name, const char *title)
 
virtual ~TFolder ()
 
virtual void Add (TObject *obj)
 
TFolderAddFolder (const char *name, const char *title, TCollection *collection=0)
 
virtual void Browse (TBrowser *b)
 
virtual void Clear (Option_t *option="")
 
virtual void Copy (TObject &) const
 
virtual const char * FindFullPathName (const char *name) const
 
virtual const char * FindFullPathName (const TObject *obj) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual TObjectFindObjectAny (const char *name) const
 
TCollectionGetListOfFolders () const
 
Bool_t IsFolder () const
 
Bool_t IsOwner () const
 
virtual void ls (Option_t *option="") const
 
virtual Int_t Occurence (const TObject *obj) const
 
virtual void RecursiveRemove (TObject *obj)
 
virtual void Remove (TObject *obj)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
virtual void SetOwner (Bool_t owner=kTRUE)
 
- 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 ()
 
virtual TObjectClone (const char *newname="") const
 
virtual Int_t Compare (const TObject *obj) const
 
virtual void FillBuffer (char *&buffer)
 
virtual const char * GetName () const
 
virtual const char * GetTitle () const
 
virtual ULong_t Hash () const
 
virtual Bool_t IsSortable () const
 
TNamedoperator= (const TNamed &rhs)
 
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
 
- 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="")
 
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=0)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) 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)
 
virtual Bool_t IsEqual (const TObject *obj) 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)
 
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)
 
void ResetBit (UInt_t f)
 
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)
 
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=0, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 

Static Public Member Functions

static KVExpDBMakeDataBase (const Char_t *name, const Char_t *datasetdir)
 
- Static Public Member Functions inherited from TObject
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 

Protected Member Functions

void init ()
 default initialisations More...
 
Bool_t OpenCalibFile (const Char_t *type, std::ifstream &fs) const
 
virtual void ReadComments ()
 
virtual void ReadSystemList ()
 
- 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

TString fDataSet
 the name of the dataset to which this database is associated More...
 
TString fDataSetDir
 the directory containing the dataset files More...
 
TString fDBType
 used by GetDBEnv More...
 
KVNumberList fListOfRuns
 list of all run numbers More...
 
KVDBTablefRuns
 table of runs More...
 
KVDBTablefSystems
 table of systems More...
 
- Protected Attributes inherited from TFolder
TCollectionfFolders
 
Bool_t fIsOwner
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Additional Inherited Members

- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 

#include <KVExpDB.h>

Inheritance diagram for KVExpDB:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVExpDB() [1/3]

KVExpDB::KVExpDB ( )

Default constructor.

Definition at line 35 of file KVExpDB.cpp.

◆ KVExpDB() [2/3]

KVExpDB::KVExpDB ( const Char_t name)

Constructor inherited from KVDataBase.

Definition at line 47 of file KVExpDB.cpp.

◆ KVExpDB() [3/3]

KVExpDB::KVExpDB ( const Char_t name,
const Char_t title 
)

Constructor inherited from KVDataBase.

Definition at line 60 of file KVExpDB.cpp.

◆ ~KVExpDB()

KVExpDB::~KVExpDB ( )
virtual

Destructor.

Definition at line 73 of file KVExpDB.cpp.

Member Function Documentation

◆ AddRun()

void KVExpDB::AddRun ( KVDBRun r)
inline

Definition at line 66 of file KVExpDB.h.

◆ AddSystem()

void KVExpDB::AddSystem ( KVDBSystem r)
inline

Definition at line 93 of file KVExpDB.h.

◆ Build()

virtual void KVExpDB::Build ( )
inlinevirtual

◆ cd()

void KVExpDB::cd ( )
virtual

Reimplemented in KVINDRADB, and KVFAZIADB.

Definition at line 548 of file KVExpDB.cpp.

◆ FindCalibFile()

Bool_t KVExpDB::FindCalibFile ( const Char_t type,
TString fullpath 
) const

Find calibration parameter file of given type. Return kTRUE if all OK. In this case fullpath contains the full path to the file.

Types are defined in $KVROOT/KVFiles/.kvrootrc by lines such as (use INDRA as example)

Default name for file describing systems for each dataset.
INDRADB.Systems: Systems.dat

A file with the given name will be looked for in the dataset calibration file directory given by GetDataSetDir()

Filenames specific to a given dataset may also be defined:

INDRA_camp5.INDRADB.Pedestals: Pedestals5.dat

where 'INDRA_camp5' is the name of the dataset in question.

Definition at line 477 of file KVExpDB.cpp.

◆ GetCalibFileName()

TString KVExpDB::GetCalibFileName ( const Char_t type) const
inline

Definition at line 108 of file KVExpDB.h.

◆ GetDataSetDir()

const Char_t* KVExpDB::GetDataSetDir ( ) const
inline

Definition at line 135 of file KVExpDB.h.

◆ GetDBEnv()

TString KVExpDB::GetDBEnv ( const Char_t type) const
virtual

Will look for gEnv->GetValue name "name_of_dataset.fDBType.type", then "fDBType.type" if no dataset-specific value is found, then "EXPDB.type" if no database-specific value is found

Definition at line 651 of file KVExpDB.cpp.

◆ GetDBRun()

KVDBRun* KVExpDB::GetDBRun ( Int_t  number) const
inline

Definition at line 75 of file KVExpDB.h.

◆ GetDBType()

TString KVExpDB::GetDBType ( ) const
inline

Definition at line 45 of file KVExpDB.h.

◆ GetRunList()

const KVNumberList& KVExpDB::GetRunList ( ) const
inline

list of numbers of all runs in database

Definition at line 79 of file KVExpDB.h.

◆ GetRuns()

virtual KVSeqCollection* KVExpDB::GetRuns ( ) const
inlinevirtual

Definition at line 71 of file KVExpDB.h.

◆ GetSystem()

virtual KVDBSystem* KVExpDB::GetSystem ( const Char_t system) const
inlinevirtual

Definition at line 84 of file KVExpDB.h.

◆ GetSystems()

virtual KVSeqCollection* KVExpDB::GetSystems ( ) const
inlinevirtual

Definition at line 88 of file KVExpDB.h.

◆ GetTotalEvents() [1/2]

ULong64_t KVExpDB::GetTotalEvents ( const KVString system) const

Return total number of events for given system.

Definition at line 626 of file KVExpDB.cpp.

◆ GetTotalEvents() [2/2]

ULong64_t KVExpDB::GetTotalEvents ( int  first_run,
int  last_run = -1 
) const

Return total number of events in range [first_run,last_run] (if last_run=-1, go to last known run)

Definition at line 604 of file KVExpDB.cpp.

◆ init()

void KVExpDB::init ( void  )
protected

default initialisations

Definition at line 21 of file KVExpDB.cpp.

◆ LinkListToRunRange()

void KVExpDB::LinkListToRunRange ( TList list,
const KVNumberList nl 
)
virtual

Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).

Definition at line 200 of file KVExpDB.cpp.

◆ LinkListToRunRanges()

void KVExpDB::LinkListToRunRanges ( TList list,
UInt_t  rr_number,
UInt_t  run_ranges[][2] 
)
virtual

Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).

Definition at line 164 of file KVExpDB.cpp.

◆ LinkRecordToRun()

void KVExpDB::LinkRecordToRun ( KVDBRecord rec,
Int_t  run 
)
virtual

Definition at line 125 of file KVExpDB.cpp.

◆ LinkRecordToRunRange() [1/2]

void KVExpDB::LinkRecordToRunRange ( KVDBRecord rec,
const KVNumberList nl 
)
virtual

If the KVDBRecord 'rec' (i.e. set of calibration parameters, reaction system, etc.) is associated to, or valid for, a range of runs, we use this method in order to link the record and the runs. The list of associated runs will be kept with the record, and each of the runs will have a link to the record.

Definition at line 107 of file KVExpDB.cpp.

◆ LinkRecordToRunRange() [2/2]

void KVExpDB::LinkRecordToRunRange ( KVDBRecord rec,
UInt_t  first_run,
UInt_t  last_run 
)
virtual

If the KVDBRecord 'rec' (i.e. set of calibration parameters, reaction system, etc.) is associated to, or valid for, a range of runs, we use this method in order to link the record and the runs. The list of associated runs will be kept with the record, and each of the runs will have a link to the record.

Definition at line 87 of file KVExpDB.cpp.

◆ LinkRecordToRunRanges()

void KVExpDB::LinkRecordToRunRanges ( KVDBRecord rec,
UInt_t  rr_number,
UInt_t  run_ranges[][2] 
)
virtual

Call LinkRecordToRunRange for a set of run ranges stored in the two-dimensional array in the following way: run_ranges[0][0] = first run of first run range run_ranges[0][1] = last run of first run range run_ranges[1][0] = first run of second run range etc. etc. rr_number is the number of run ranges in the array

Definition at line 144 of file KVExpDB.cpp.

◆ MakeDataBase()

KVExpDB * KVExpDB::MakeDataBase ( const Char_t name,
const Char_t datasetdir 
)
static

Static function which will create and 'Build' the database object corresponding to 'name' These are defined as 'Plugin' objects in the file $KVROOT/KVFiles/.kvrootrc :

Plugin.KVExpDB: INDRA_camp1 KVDataBase1 KVIndra "KVDataBase1()" +Plugin.KVExpDB: INDRA_camp2 KVDataBase2 KVIndra "KVDataBase2()" +Plugin.KVExpDB: INDRA_camp4 KVDataBase4 KVIndra "KVDataBase4()" +Plugin.KVExpDB: INDRA_camp5 KVDataBase5 KVIndra5 "KVDataBase5()"

The 'name' ("INDRA_camp1" etc.) corresponds to the name of a dataset in $KVROOT/KVFiles/manip.list This name is stored in member variable fDataSet. The constructors/macros used have arguments (const Char_t* name) does plugin exist for given name ?

Definition at line 570 of file KVExpDB.cpp.

◆ OpenCalibFile()

Bool_t KVExpDB::OpenCalibFile ( const Char_t type,
std::ifstream &  fs 
) const
protected

Find and open calibration parameter file of given type. Return kTRUE if all OK. types are defined in $KVROOT/KVFiles/.kvrootrc by lines such as (use INDRA as example)

Default name for file describing systems for each dataset. INDRADB.Systems: Systems.dat

A file with the given name will be looked for in the dataset calibration file directory given by GetDataSetDir()

Filenames specific to a given dataset may also be defined:

INDRA_camp5.INDRADB.Pedestals: Pedestals5.dat

where 'INDRA_camp5' is the name of the dataset in question.

Definition at line 433 of file KVExpDB.cpp.

◆ PrintRuns()

void KVExpDB::PrintRuns ( KVNumberList nl) const
virtual

Print compact listing of runs in the number list like this:

root [9] gIndraDB->PrintRuns("8100-8120")

RUN SYSTEM TRIGGER EVENTS COMMENTS

8100 129Xe + 58Ni 8 MeV/A M>=2 968673 8101 129Xe + 58Ni 8 MeV/A M>=2 969166 8102 129Xe + 58Ni 8 MeV/A M>=2 960772 8103 129Xe + 58Ni 8 MeV/A M>=2 970029 8104 129Xe + 58Ni 8 MeV/A M>=2 502992 disjonction ht chassis 1 8105 129Xe + 58Ni 8 MeV/A M>=2 957015 intensite augmentee a 200 pA

Definition at line 518 of file KVExpDB.cpp.

◆ ReadComments()

void KVExpDB::ReadComments ( )
protectedvirtual

Looks for file with name given by one of the following variables:

[DBtype].Comments [dataset].[DBtype].Comments

and opens it to read and add comments on runs. Format of file is:

run=3830-3836 | really amazing data in these runs

Reimplemented in KVFAZIADB.

Definition at line 677 of file KVExpDB.cpp.

◆ ReadObjects()

virtual void KVExpDB::ReadObjects ( TFile )
inlinevirtual

Abstract method. Can be overridden in child classes. When the database is read from disk (by the currently active dataset, see KVDataSet::OpenDBFile) any associated objects (histograms, trees, etc.) stored in the file can be read using this method. The pointer to the file being read is passed as argument.

Reimplemented in KVINDRADB.

Definition at line 122 of file KVExpDB.h.

◆ ReadSystemList()

void KVExpDB::ReadSystemList ( )
protectedvirtual

Reads list of systems with associated run ranges, creates KVDBSystem records for these systems, and links them to the appropriate KVDBRun records using LinkListToRunRanges.

There are 2 formats for the description of systems:

+129Xe + natSn 25 MeV/A '+' indicates beginning of system description 129 54 119 50 0.1 25.0 A,Z of projectile and target, target thickness (mg/cm2), beam energy (MeV/A) Run Range : 614 636 runs associated with system Run Range : 638 647 runs associated with system

This is sufficient in the simple case where the experiment has a single layer target oriented perpendicular to the beam. However, for more complicated targets we can specify as follows :

+155Gd + 238U 36 MeV/A 155 64 238 92 0.1 36.0 Target : 3 0.0 target with 3 layers, angle 0 degrees C 0.02 1st layer : carbon, 20 g/cm2 238U 0.1 2nd layer : uranium-238, 100 g/cm2 C 0.023 3rd layer : carbon, 23 g/cm2 Run Range : 770 804

Lines beginning '#' are comments.

Definition at line 249 of file KVExpDB.cpp.

◆ RemoveSystem()

void KVExpDB::RemoveSystem ( KVDBSystem s)
inline

Definition at line 97 of file KVExpDB.h.

◆ Save()

void KVExpDB::Save ( const Char_t what)
virtual

Save (in the appropriate text file) the informations on: what = "Systems" : write Systems.dat file what = "Runlist" : write Runlist.csv

Definition at line 362 of file KVExpDB.cpp.

◆ SetDataSet()

void KVExpDB::SetDataSet ( const TString s)
inline

Definition at line 41 of file KVExpDB.h.

◆ SetDataSetDir()

void KVExpDB::SetDataSetDir ( const Char_t d)
inline

Definition at line 139 of file KVExpDB.h.

◆ SetDBType()

void KVExpDB::SetDBType ( const TString s)
inline

Definition at line 49 of file KVExpDB.h.

◆ WriteObjects()

virtual void KVExpDB::WriteObjects ( TFile )
inlinevirtual

Abstract method. Can be overridden in child classes. When the database is written to disk (by the currently active dataset, see KVDataSet::WriteDBFile) any associated objects (histograms, trees, etc.) can be written using this method. The pointer to the file being written is passed as argument.

Reimplemented in KVINDRADB.

Definition at line 113 of file KVExpDB.h.

◆ WriteRunListFile()

void KVExpDB::WriteRunListFile ( ) const

Write a file containing a line describing each run in the database. The delimiter symbol used in each line is '|' by default. The first line of the file will be a header description, given by calling KVDBRun::WriteRunListHeader() for the first run in the database. Then we call KVDBRun::WriteRunListLine() for each run. These are virtual methods redefined by child classes of KVDBRun.

Definition at line 382 of file KVExpDB.cpp.

◆ WriteSystemsFile()

void KVExpDB::WriteSystemsFile ( ) const

Write the 'Systems.dat' file for this database. The actual name of the file is given by the value of the environment variable [dataset_name].INDRADB.Systems (if it exists), otherwise the value of INDRADB.Systems is used. The file is written in the $KVROOT/[dataset_directory] directory.

Definition at line 329 of file KVExpDB.cpp.

Member Data Documentation

◆ fDataSet

TString KVExpDB::fDataSet
protected

the name of the dataset to which this database is associated

Definition at line 22 of file KVExpDB.h.

◆ fDataSetDir

TString KVExpDB::fDataSetDir
protected

the directory containing the dataset files

Definition at line 23 of file KVExpDB.h.

◆ fDBType

TString KVExpDB::fDBType
protected

used by GetDBEnv

Definition at line 24 of file KVExpDB.h.

◆ fListOfRuns

KVNumberList KVExpDB::fListOfRuns
protected

list of all run numbers

Definition at line 26 of file KVExpDB.h.

◆ fRuns

KVDBTable* KVExpDB::fRuns
protected

table of runs

Definition at line 27 of file KVExpDB.h.

◆ fSystems

KVDBTable* KVExpDB::fSystems
protected

table of systems

Definition at line 28 of file KVExpDB.h.


The documentation for this class was generated from the following files: