KaliVeda
Toolkit for HIC analysis

Detailed Description

Base class to describe database of an experiment ,,.

Each dataset has an associated database which contains all available information concerning the experimental data (reaction systems, runs and corresponding runfiles) and its calibrations. This database is built from the informations stored in the files found in the dataset directory, $KVROOT/share/kaliveda/[dataset], notably from 2 files

$KVROOT/share/kaliveda/[dataset]:
runinfos.root
Systems.dat

which contain all informations on the files associated with each run (in runinfos.root), and all informations on the reaction systems studied in the experiment (in Systems.dat).

runinfos.root contains a KVNameValueList object describing each experimental run:

KVNameValueList::run10 : (0x5d36f9e56f00)
<Run=10>
<IndexList=0-1>
<File.0=run_0010.dat.07-04-25_16h08m42s>
<Start.0=2025-04-07 16:08:42>
<End.0=2025-04-07 16:27:36>
<Size.0_hi=0>
<Size.0_lo=-101006919>
<File.1=run_0010.dat.07-04-25_16h08m42s.1>
<Start.1=2025-04-07 16:27:36>
<End.1=2025-04-07 16:40:12>
<Size.1_hi=0>
<Size.1_lo=-685746225>
<Events.1_hi=0>
<Events.1_lo=6831501>
<Events.0_hi=0>
<Events.0_lo=8239126>
void End()
const char * Size

In this example, run 10 consists of 2 files, with indices given by the parameter IndexList, names of the files given by File.0 and File.1, time and date of the start and end of each file given by Start.0, etc. etc. The Size.* and Events.* are 64 bit values: see KVNameValueList::GetValue64bit().

Definition at line 61 of file KVExpDB.h.

#include <KVExpDB.h>

Inheritance diagram for KVExpDB:

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 (bool=false)
 
virtual void cd ()
 
Bool_t FindCalibFile (const Char_t *type, TString &fullpath, const TString &array_name="") const
 
TString GetCalibFileName (const Char_t *type) const
 
const Char_tGetDataSetDir () const
 
virtual TString GetDBEnv (const Char_t *) const
 
KVDBRunGetDBRun (Int_t number) const
 
KVDBRunFileGetDBRunFile (const run_index_t &r)
 
const KVDBRunFileGetDBRunFile (const run_index_t &r) const
 
TString GetDBType () const
 
Int_t GetIndexMultiplier () const
 
run_index_t GetRunIndexFromGlobalRunFileNumber (int glob_runfile) 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
 
Bool_t HasIndexMultiplier () const
 
Bool_t HasRawFilesWithIndex () const
 
Bool_t IsMinimal () 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)
 
run_index_list SetRunIndexListFromString (const TString &) const
 
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
 
void Print (Option_t *option="") const override
 
- 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=nullptr)
 
void Browse (TBrowser *b) override
 
void Clear (Option_t *option="") override
 
void Copy (TObject &) const override
 
virtual const char * FindFullPathName (const char *name) const
 
virtual const char * FindFullPathName (const TObject *obj) const
 
TObjectFindObject (const char *name) const override
 
TObjectFindObject (const TObject *obj) const override
 
virtual TObjectFindObjectAny (const char *name) const
 
TCollectionGetListOfFolders () const
 
TClassIsA () const override
 
Bool_t IsFolder () const override
 
Bool_t IsOwner () const
 
void ls (Option_t *option="") const override
 
virtual Int_t Occurence (const TObject *obj) const
 
void RecursiveRemove (TObject *obj) override
 
virtual void Remove (TObject *obj)
 
void SaveAs (const char *filename="", Option_t *option="") const override
 
virtual void SetOwner (Bool_t owner=kTRUE)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- 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)
 
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="")
 
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 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
 
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)
 
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)
 
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 KVExpDBMakeDataBase (const Char_t *name, const Char_t *datasetdir, Bool_t minimal=false)
 
- Static Public Member Functions inherited from TFolder
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- 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 initialisations More...
 
Bool_t OpenCalibFile (const Char_t *type, std::ifstream &fs) const
 
void read_beams_targets_reactions ()
 
virtual void ReadComments ()
 
virtual void ReadSystemList ()
 
void refill_list_of_runs ()
 

Private 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...
 
std::map< int, run_index_tfMapGlobRunFileNumberToRunIndex
 cannot be saved, no streamer for run_index_t More...
 
KVDBTablefRuns
 table of runs More...
 
KVDBTablefSystems
 table of systems More...
 
int index_multiplier = 1
 
bool minimal_db = false
 
bool raw_files_have_index = false
 
bool with_index_multiplier = false
 

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
 
- 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 TFolder
TCollectionfFolders
 
Bool_t fIsOwner
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Constructor & Destructor Documentation

◆ KVExpDB() [1/3]

KVExpDB::KVExpDB ( )

Default constructor.

Definition at line 233 of file KVExpDB.cpp.

◆ KVExpDB() [2/3]

KVExpDB::KVExpDB ( const Char_t name)

Constructor inherited from KVDataBase.

Definition at line 245 of file KVExpDB.cpp.

◆ KVExpDB() [3/3]

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

Constructor inherited from KVDataBase.

Definition at line 258 of file KVExpDB.cpp.

◆ ~KVExpDB()

KVExpDB::~KVExpDB ( )
virtual

Destructor.

Definition at line 271 of file KVExpDB.cpp.

Member Function Documentation

◆ AddRun()

void KVExpDB::AddRun ( KVDBRun r)
inline

Definition at line 126 of file KVExpDB.h.

◆ AddSystem()

void KVExpDB::AddSystem ( KVDBSystem r)
inline

Definition at line 164 of file KVExpDB.h.

◆ Build()

virtual void KVExpDB::Build ( bool  = false)
inlinevirtual

Reimplemented in KVINDRADB_e613, KVINDRADB4, KVINDRADB2, KVINDRADB1, KVINDRADB, KVFAZIADB, and KVExpSetUpDB.

Definition at line 214 of file KVExpDB.h.

◆ cd()

void KVExpDB::cd ( )
virtual

Reimplemented in KVINDRADB, and KVFAZIADB.

Definition at line 757 of file KVExpDB.cpp.

◆ FindCalibFile()

Bool_t KVExpDB::FindCalibFile ( const Char_t type,
TString fullpath,
const TString array_name = "" 
) 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
char name[80]

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.

If 'array_name' is given and no file is found with this filename, we try looking for a file called 'array_name.filename', i.e. if a filename

INDRADB.Pressures: ChIoPressures.dat

is defined, but no ChIoPressures.dat file exists for the dataset, if array_name="INDRA" then we look for a file called INDRA.ChIoPressures.dat

Definition at line 667 of file KVExpDB.cpp.

◆ GetCalibFileName()

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

Definition at line 179 of file KVExpDB.h.

◆ GetDataSetDir()

const Char_t* KVExpDB::GetDataSetDir ( ) const
inline

Definition at line 206 of file KVExpDB.h.

◆ GetDBEnv()

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

Will look for

gEnv->GetValue("name_of_dataset.fDBType.type")
R__EXTERN TEnv * gEnv
virtual const char * GetValue(const char *name, const char *dflt) const

then

gEnv->GetValue("fDBType.type")

if no dataset-specific value is found, then

gEnv->GetValue("EXPDB.type")

if no database-specific value is found

Definition at line 1009 of file KVExpDB.cpp.

◆ GetDBRun()

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

Definition at line 135 of file KVExpDB.h.

◆ GetDBRunFile() [1/2]

KVDBRunFile& KVExpDB::GetDBRunFile ( const run_index_t r)
inline

Definition at line 143 of file KVExpDB.h.

◆ GetDBRunFile() [2/2]

const KVDBRunFile& KVExpDB::GetDBRunFile ( const run_index_t r) const
inline

Definition at line 139 of file KVExpDB.h.

◆ GetDBType()

TString KVExpDB::GetDBType ( ) const
inline

Definition at line 105 of file KVExpDB.h.

◆ GetIndexMultiplier()

Int_t KVExpDB::GetIndexMultiplier ( ) const
inline

Definition at line 232 of file KVExpDB.h.

◆ GetRunIndexFromGlobalRunFileNumber()

run_index_t KVExpDB::GetRunIndexFromGlobalRunFileNumber ( int  glob_runfile) const
Parameters
[in]glob_runfileglobal runfile number of a runfile (given by KVDBRunFile::GetGlobalRunFileNumber())
Returns
run/index information of runfile with given global runfile number
Note
only good runfiles (with KVDBRunFile::IsBad() == kFALSE) have a global runfile number, the bad runfiles are not included in the list

Definition at line 857 of file KVExpDB.cpp.

◆ GetRunList()

const KVNumberList& KVExpDB::GetRunList ( ) const
inline

list of numbers of all runs in database

Definition at line 147 of file KVExpDB.h.

◆ GetRuns()

virtual KVSeqCollection* KVExpDB::GetRuns ( ) const
inlinevirtual

Definition at line 131 of file KVExpDB.h.

◆ GetSystem()

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

Definition at line 155 of file KVExpDB.h.

◆ GetSystems()

virtual KVSeqCollection* KVExpDB::GetSystems ( ) const
inlinevirtual

Definition at line 159 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 833 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 811 of file KVExpDB.cpp.

◆ HasIndexMultiplier()

Bool_t KVExpDB::HasIndexMultiplier ( ) const
inline

Definition at line 228 of file KVExpDB.h.

◆ HasRawFilesWithIndex()

Bool_t KVExpDB::HasRawFilesWithIndex ( ) const
inline

Definition at line 224 of file KVExpDB.h.

◆ init()

void KVExpDB::init ( void  )
private

default initialisations

Definition at line 23 of file KVExpDB.cpp.

◆ IsMinimal()

Bool_t KVExpDB::IsMinimal ( ) const
inline
Returns
true if the full database has not been built, only runs/systems infos

Definition at line 241 of file KVExpDB.h.

◆ 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 394 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 368 of file KVExpDB.cpp.

◆ LinkRecordToRun()

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

Definition at line 329 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 309 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 285 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 348 of file KVExpDB.cpp.

◆ MakeDataBase()

KVExpDB * KVExpDB::MakeDataBase ( const Char_t name,
const Char_t datasetdir,
Bool_t  minimal = false 
)
static

Static function which will create and 'Build' the database object corresponding to 'name' defined as 'Plugin' classes for KVExpDB:

+Plugin.KVExpDB: [name] [class] [library] "class(const char*)"

The 'name' corresponds to the name of the dataset, it is the argument given to the constructor and stored in member variable fDataSet.

Parameters
[in]minimalif =true, only a minimal database with runs/systems infos will be built

Definition at line 778 of file KVExpDB.cpp.

◆ OpenCalibFile()

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

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 613 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 727 of file KVExpDB.cpp.

◆ read_beams_targets_reactions()

void KVExpDB::read_beams_targets_reactions ( )
private

Read infos on beams, targets, and reactions in files

Beams.dat
Targets.dat
Reactions.dat

(default filenames defined by config variables EXPDB.Beams, EXPDB.Targets, EXPDB.Reactions) and set up the corresponding KVTarget and KVDBSystem objects, adding to the database table Systems.

Beams

Format of file is

Beams: B1 B2 [...]
B1.Ion: 129Xe [nature of accelerated ion]
B1.Energy: 49.9976 [energy in MeV/A]
B2.Ion: [...]
const long double MeV
energies
Definition: KVUnits.h:91

Targets

Format of file is

Targets: T1 T2 [...]
T1.Material: 197Au
T1.AreaDensity: 0.66 [in mg/cm2]
[T1.Angle: 45] [angle to beam in degrees, if != 0]
[T1.Name: Au-660] [optional name]
T2.Layers: 2
T2.Layer.1.Material: 12C
T2.Layer.1.AreaDensity: 0.02 [in mg/cm2]
T2.Layer.2.Material: 238U
T2.Layer.2.AreaDensity: 0.4 [in mg/cm2]
T2.TargetNucleus: 238U [used for reaction kinematics]
Option_t Option_t TPoint TPoint angle
#define T2
#define T1
constexpr Double_t C()
const long double mg
Definition: KVUnits.h:77

Reactions

Format of file is

Reactions: R1 R2 [...]
R1.Name: Alpha source
R1.Runlist: 1-12
R2.Beam: B1 [beam defined in Beams.dat]
R2.Target: T1 [target defined in Targets.dat]
R2.Runlist: 13-25
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
#define R1(v, w, x, y, z, i)
#define R2(v, w, x, y, z, i)

Definition at line 90 of file KVExpDB.cpp.

◆ ReadComments()

void KVExpDB::ReadComments ( )
privatevirtual

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 1046 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 193 of file KVExpDB.h.

◆ ReadSystemList()

void KVExpDB::ReadSystemList ( )
privatevirtual

Set up all informations on the reactions studied during the experiment, store as KVDBSystem objects in the database table Systems.

For information on necessary input files and formats, see read_beams_targets_reactions()

Definition at line 423 of file KVExpDB.cpp.

◆ refill_list_of_runs()

void KVExpDB::refill_list_of_runs ( )
inlineprivate

inexplicably, the fListOfRuns member is not persistent & is empty when database is read in from file. we fill it with the numbers of all runs.

Definition at line 82 of file KVExpDB.h.

◆ RemoveSystem()

void KVExpDB::RemoveSystem ( KVDBSystem s)
inline

Definition at line 168 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 542 of file KVExpDB.cpp.

◆ SetDataSet()

void KVExpDB::SetDataSet ( const TString s)
inline

Definition at line 101 of file KVExpDB.h.

◆ SetDataSetDir()

void KVExpDB::SetDataSetDir ( const Char_t d)
inline

Definition at line 210 of file KVExpDB.h.

◆ SetDBType()

void KVExpDB::SetDBType ( const TString s)
inline

Definition at line 109 of file KVExpDB.h.

◆ SetRunIndexListFromString()

run_index_list KVExpDB::SetRunIndexListFromString ( const TString rlist) const
Parameters
[in]rliststring containing run numbers, runfile identifiers (run+index), and ranges of both
Returns
run_index_list containing the sequence of all good runfiles corresponding to the input string
Note
any bad runfiles (with KVDBRunFile::IsBad() == kTRUE) are excluded.

The string can contain individual run numbers, runfile (runindex) identifiers, either in sequences (separated by spaces and/or commas), or as part of a range, i.e. two values separated by '-'.

A number without a '.index' index suffix is interpreted as a run number, and corresponds to all runfiles of the given run. A number with '.index' suffix is interpreted as meaning the given individual runfile of the corresponding run.

A number with a '.0' (zero) index is interpreted as the first runfile of the given run (note that normally such a runfile is represented by the run number alone, without a suffix).

Examples:

"40-43" => all good runfiles from runs 40, 41, 42 & 43
"40-43.0" => all good runfiles from runs 40, 41 & 42, plus the first runfile of run 43
"40.3-42.7" => all good runfiles from 40.3 to 42.7

Definition at line 913 of file KVExpDB.cpp.

◆ 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 184 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 562 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 509 of file KVExpDB.cpp.

Member Data Documentation

◆ fDataSet

TString KVExpDB::fDataSet
private

the name of the dataset to which this database is associated

Definition at line 64 of file KVExpDB.h.

◆ fDataSetDir

TString KVExpDB::fDataSetDir
private

the directory containing the dataset files

Definition at line 65 of file KVExpDB.h.

◆ fDBType

TString KVExpDB::fDBType
private

used by GetDBEnv

Definition at line 66 of file KVExpDB.h.

◆ fListOfRuns

KVNumberList KVExpDB::fListOfRuns
private

list of all run numbers

Definition at line 68 of file KVExpDB.h.

◆ fMapGlobRunFileNumberToRunIndex

std::map<int, run_index_t> KVExpDB::fMapGlobRunFileNumberToRunIndex
mutableprivate

cannot be saved, no streamer for run_index_t

Definition at line 74 of file KVExpDB.h.

◆ fRuns

KVDBTable* KVExpDB::fRuns
private

table of runs

Definition at line 69 of file KVExpDB.h.

◆ fSystems

KVDBTable* KVExpDB::fSystems
private

table of systems

Definition at line 70 of file KVExpDB.h.

◆ index_multiplier

int KVExpDB::index_multiplier = 1
private

Definition at line 71 of file KVExpDB.h.

◆ minimal_db

bool KVExpDB::minimal_db = false
private

Definition at line 75 of file KVExpDB.h.

◆ raw_files_have_index

bool KVExpDB::raw_files_have_index = false
private

Definition at line 73 of file KVExpDB.h.

◆ with_index_multiplier

bool KVExpDB::with_index_multiplier = false
private

Definition at line 72 of file KVExpDB.h.