KaliVeda
Toolkit for HIC analysis
KVSimDataManager Class Reference

Detailed Description

Manage database of simulations ,.

Database tables

models

id name ...
INTEGER TEXT ...

Each model can add arbitrary number of columns to this table to hold all necessary parameters used to describe a particular use of the model. Different parameter sets for the same model will have different id.

reactions

id nuc1 nuc2 energy spin_hbar impact_parameter ip_units
INTEGER TEXT TEXT REAL INTEGER REAL TEXT
  • nuc1: "129Xe", projectile nucleus for reactions, or compound nucleus for decay calculation;
  • nuc2: "119Sn", target nucleus for reactions, or NULL
  • energy: total projectile lab energy in MeV for reactions, or total compound excitation energy for decay calculation;
  • spin_hbar: fixed spin of compound in \(\hbar\) units or NULL;
  • impact_parameter: impact parameter of reaction if a fixed value was used, or NULL;
  • ip_units: units for impact parameter if given, either "rel" ( \(b/b_{max}\) units ) or "fm" (or NULL).

repositories

id root_dir type Xrdsrv Xrdroot
INTEGER TEXT TEXT TEXT TEXT
  • root_dir: root directory of repository;
  • type: "local" or "irods";
  • Xrdsrv: URL of xrootd server if one available, or NULL;
  • Xrdroot: root directory to use with xrootd server if one available, or NULL;

datasets

Dataset = a collection of files produced by a given model and set of parameters.

id user description model_id
INTEGER TEXT TEXT INTEGER

Each dataset is associated with a username and a short description. model_id links to the model and parameter set used in table models.

unfiltered_files

All files produced by simulations without being filtered with detector geometry, acceptance, etc.

id name path repository_id original_name original_path events type dataset_id reaction_id
INTEGER TEXT TEXT INTEGER TEXT TEXT INTEGER TEXT INTEGER INTEGER
  • name: filename without paths;
  • path: full path to file;
  • repository_id: if file is in a data repository, the relevant id, or NULL;
  • original_name: original name of file if it has been imported to the repository, or NULL;
  • original_path: original full path to file if it has been imported to the repository, or NULL;
  • events: total number of events in file
  • type: "primary" or "secondary", i.e. events before or after secondary decay;
  • dataset_id: dataset this file belongs to;
  • reaction_id: reaction this file simulates.

filters

Descriptions of how events were filtered.

id kinematics geometry run_number filter_type data_quality_audit random_phi gemini gem_add_erot
INTEGER INTEGER TEXT INTEGER TEXT TEXT TEXT INTEGER TEXT
  • kinematics: id of a reaction in reactions table: definition of kinematics used, e.g. lab->CM transformation;
  • geometry: experimental dataset used to define geometry of multidetector;
  • run_number: specific run number used to define experimental conditions, if used, or NULL;
  • filter_type: type of filter = "Geo" or "GeoThresh";
  • data_quality_audit: name of data quality audit defining identification performances, if used, or NULL;
  • random_phi: = "yes" if phi randomized for each event, NULL otherwise;
  • gemini: if KaliVeda Gemini++ used to perform secondary decay just before filter, number of decays per primary event, or NULL.
  • gem_add_erot: if KaliVeda Gemini++ used, "yes" if rotational (Yrast) energy added to E*, or NULL.

filtered_files

All files produced by filtering simulation results in table unfiltered_files

| id | name | path | repository_id | original_name | original_path | events | unfiltered_file_id | dataset_id | reaction_id | filter_id | |---—|-----—|---—|---------------—|------------—|------------—|-----------------—|---------—|----------—|--------—| | INTEGER | TEXT | TEXT | INTEGER | TEXT | TEXT |INTEGER | INTEGER | INTEGER | INTEGER | INTEGER |

  • name: filename without paths;
  • path: full path to file;
  • repository_id: if file is in a data repository, the relevant id, or NULL;
  • original_name: original name of file if it has been imported to the repository, or NULL;
  • original_path: original full path to file if it has been imported to the repository, or NULL;
  • events: total number of events in file
  • unfiltered_file_id: link to simulated file processed to produce this one, i.e. id from unfiltered_files table;
  • dataset_id: dataset this file belongs to in table datasets;
  • reaction_id: reaction this file simulates in table reactions;
  • filter_id: details of filtering in table filters;

Example of use

Given an existing directory containing some primary & secondary unfiltered files, and a filtered file:

$ ls auau40_hipse
total 913M
HIPSE_197Au_197Au_40.0AMeV.root.46
HIPSE_197Au_197Au_40.0AMeV_ASYM.root.46
HIPSE_asym_197Au_197Au40MeV_A_FILTER_INDRA_camp4_R10.root

let us create a local on-disk data repository

$ mkdir simu_repo

and import the simulated data both into the database and into the repository:

sdm.OpenDataBase("sim_data.sqlite");
auto repo_id = sdm.AddDataRepository("simu_repo");
auto reac_id = sdm.AddReaction({{"197Au",40.0},"197Au"});
auto mod_id = sdm.AddModel("HIPSE", {{"HARD",0.16},{"EXCH",0.36},{"NNCOL",0.038}});
auto ds_id = sdm.AddDataSet("HIPSE calculations for testing new filter", mod_id);
sdm.AddFilesFromDirectory(ds_id,reac_id,"./auau40_hipse");
Manage database of simulations ,.
model_id AddModel(const TString &, const KVNameValueList &)
repository_id AddDataRepository(const TString &root_dir, const TString &access="local", std::optional< TString > xrdsrv=std::nullopt, std::optional< TString > xrdroot=std::nullopt)
void OpenDataBase(const TString &)
dataset_id AddDataSet(const TString &short_description, const TString &model, const KVNameValueList &model_params)
void AddFilesFromDirectory(dataset_id dataset, reaction_id reaction, const TString &dirpath)
Use KVSimDir to analyse files in directory, all supposed to correspond to the same reaction,...
reaction_id AddReaction(const KV2Body &, std::optional< double >=std::nullopt, const TString &ip_units="fm")
void ImportFilesToRepository(repository_id=0)

(adding second argument "irods" to AddDataRepository() with optional xrootd specifications would do the same thing with a data repository behind an iRODS server).

Output looks like:

Info in <KVSimDir::AnalyseDirectory>: Analysing /home/frankland/work/kaliveda_debug/test_new_simdatamanager/auau40_hipse...
Creating new repository directory: simu_repo/HIPSE_1
Creating new repository directory: simu_repo/HIPSE_1/reaction197Au197Au40AMeV
[TFile::Cp] Total 59.28 MB |====================| 100.00 % [2277.7 MB/s]
[TFile::Cp] Total 190.96 MB |====================| 100.00 % [2363.3 MB/s]
Creating new repository directory: simu_repo/HIPSE_1/reaction197Au197Au40AMeV/filter_1
[TFile::Cp] Total 662.03 MB |====================| 100.00 % [2401.0 MB/s]

and after import, data repository contains:

$ ll simu_repo/[...]
simu_repo/HIPSE_1/reaction197Au197Au40AMeV/HIPSE_197Au_197Au_40.0AMeV.root.46
simu_repo/HIPSE_1/reaction197Au197Au40AMeV/HIPSE_197Au_197Au_40.0AMeV_ASYM.root.46
simu_repo/HIPSE_1/reaction197Au197Au40AMeV/filter_1/HIPSE_asym_197Au_197Au40MeV_A_FILTER_INDRA_camp4_R10.root

and database tables contain:

kaliveda [0] KVSQLite::database db("sim_data.sqlite");
kaliveda [1] db.print_selected_data("models");
+------------+--------------+--------------+--------------+---------------+
| models::id | models::name | models::HARD | models::EXCH | models::NNCOL |
+------------+--------------+--------------+--------------+---------------+
| 1 | HIPSE | 0.160000 | 0.360000 | 0.038000 |
+------------+--------------+--------------+--------------+---------------+
kaliveda [2] db.print_selected_data("reactions")
+---------------+-----------------+-----------------+-------------------+----------------------+-----------------------------+---------------------+
| reactions::id | reactions::nuc1 | reactions::nuc2 | reactions::energy | reactions::spin_hbar | reactions::impact_parameter | reactions::ip_units |
+---------------+-----------------+-----------------+-------------------+----------------------+-----------------------------+---------------------+
| 1 | 197Au | 197Au | 7880.000000 | | | |
+---------------+-----------------+-----------------+-------------------+----------------------+-----------------------------+---------------------+
kaliveda [3] db.print_selected_data("unfiltered_files")
+----------------------+-----------------------------------------+----------------------------------+---------------------------------+-----------------------------------------+--------------------------------------------------------------------------+--------------------------+------------------------+------------------------------+-------------------------------+
| unfiltered_files::id | unfiltered_files::name | unfiltered_files::path | unfiltered_files::repository_id | unfiltered_files::original_name | unfiltered_files::original_path | unfiltered_files::events | unfiltered_files::type | unfiltered_files::dataset_id | unfiltered_files::reaction_id |
+----------------------+-----------------------------------------+----------------------------------+---------------------------------+-----------------------------------------+--------------------------------------------------------------------------+--------------------------+------------------------+------------------------------+-------------------------------+
| 1 | HIPSE_197Au_197Au_40.0AMeV.root.46 | HIPSE_1/reaction197Au197Au40AMeV | 1 | HIPSE_197Au_197Au_40.0AMeV.root.46 | /home/frankland/work/kaliveda_debug/test_new_simdatamanager/auau40_hipse | 100002 | primary | 1 | 1 |
| 2 | HIPSE_197Au_197Au_40.0AMeV_ASYM.root.46 | HIPSE_1/reaction197Au197Au40AMeV | 1 | HIPSE_197Au_197Au_40.0AMeV_ASYM.root.46 | /home/frankland/work/kaliveda_debug/test_new_simdatamanager/auau40_hipse | 100002 | secondary | 1 | 1 |
+----------------------+-----------------------------------------+----------------------------------+---------------------------------+-----------------------------------------+--------------------------------------------------------------------------+--------------------------+------------------------+------------------------------+-------------------------------+
kaliveda [4] db.print_selected_data("filters")
+-------------+---------------------+-------------------+---------------------+----------------------+-----------------------------+---------------------+-----------------+-----------------------+
| filters::id | filters::kinematics | filters::geometry | filters::run_number | filters::filter_type | filters::data_quality_audit | filters::random_phi | filters::gemini | filters::gem_add_erot |
+-------------+---------------------+-------------------+---------------------+----------------------+-----------------------------+---------------------+-----------------+-----------------------+
| 1 | 1 | INDRA_camp4 | 4261 | GeoThresh | INDRA_camp4/197Au197Au40 | yes | | |
+-------------+---------------------+-------------------+---------------------+----------------------+-----------------------------+---------------------+-----------------+-----------------------+
kaliveda [5] db.print_selected_data("filtered_files")
+--------------------+-----------------------------------------------------------+-------------------------------------------+-------------------------------+-----------------------------------------------------------+--------------------------------------------------------------------------+------------------------+------------------------------------+----------------------------+-----------------------------+---------------------------+
| filtered_files::id | filtered_files::name | filtered_files::path | filtered_files::repository_id | filtered_files::original_name | filtered_files::original_path | filtered_files::events | filtered_files::unfiltered_file_id | filtered_files::dataset_id | filtered_files::reaction_id | filtered_files::filter_id |
+--------------------+-----------------------------------------------------------+-------------------------------------------+-------------------------------+-----------------------------------------------------------+--------------------------------------------------------------------------+------------------------+------------------------------------+----------------------------+-----------------------------+---------------------------+
| 1 | HIPSE_asym_197Au_197Au40MeV_A_FILTER_INDRA_camp4_R10.root | HIPSE_1/reaction197Au197Au40AMeV/filter_1 | 1 | HIPSE_asym_197Au_197Au40MeV_A_FILTER_INDRA_camp4_R10.root | /home/frankland/work/kaliveda_debug/test_new_simdatamanager/auau40_hipse | 100002 | 2 | 1 | 1 | 1 |
+--------------------+-----------------------------------------------------------+-------------------------------------------+-------------------------------+-----------------------------------------------------------+--------------------------------------------------------------------------+------------------------+------------------------------------+----------------------------+-----------------------------+---------------------------+
Interface to ROOT SQLite database backend.
Definition: SQLiteDB.h:473

Definition at line 211 of file KVSimDataManager.h.

#include <KVSimDataManager.h>

Inheritance diagram for KVSimDataManager:

Public Types

using dataset_id = int
 
using file_id = int
 
using filter_id = int
 
using model_id = int
 
enum class  primary_or_secondary { primary , secondary }
 
using reaction_id = int
 
using repository_id = int
 
- Public Types inherited from KVBase
enum  EKaliVedaBits { kIsKaliVedaObject = BIT(23) }
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 

Public Member Functions

 KVSimDataManager ()=default
 
repository_id AddDataRepository (const TString &root_dir, const TString &access="local", std::optional< TString > xrdsrv=std::nullopt, std::optional< TString > xrdroot=std::nullopt)
 
dataset_id AddDataSet (const TString &short_description, const TString &model, const KVNameValueList &model_params)
 
dataset_id AddDataSet (const TString &short_description, model_id modid)
 
void AddFilesFromDirectory (dataset_id dataset, reaction_id reaction, const TString &dirpath)
 Use KVSimDir to analyse files in directory, all supposed to correspond to the same reaction, and add them to the given dataset. More...
 
filter_id AddFilter (reaction_id kinematics, const TString &geometry, const TString &filter_type, bool random_phi, std::optional< int > run_number={}, std::optional< TString > data_quality_audit={}, std::optional< int > gem_decay_per_event={}, std::optional< bool > gem_add_rot_energy={})
 
void AddFilteredSimulation (const KVSimFile &f, dataset_id dataset, reaction_id reaction)
 
model_id AddModel (const TString &, const KVNameValueList &)
 
reaction_id AddReaction (const KV2Body &, std::optional< double >=std::nullopt, const TString &ip_units="fm")
 
void AddUnfilteredSimulation (const TString &filepath, Int_t events, primary_or_secondary P, dataset_id dataset, reaction_id reaction)
 
std::optional< model_idGetModelId (const TString &, const KVNameValueList &) const
 
TString GetModelName (model_id id) const
 
std::optional< reaction_idGetReactionId (const KV2Body &, std::optional< double >=std::nullopt, const TString &ip_units="fm") const
 
TString GetReactionName (reaction_id id) const
 
void ImportFilesToRepository (repository_id=0)
 
void OpenDataBase (const TString &)
 
- Public Member Functions inherited from KVBase
 KVBase ()
 Default constructor. More...
 
 KVBase (const Char_t *name, const Char_t *title="")
 Ctor for object with given name and type. More...
 
 KVBase (const KVBase &)
 copy ctor More...
 
void Clear (Option_t *opt="") override
 Clear object properties : name, type/title, number, label. More...
 
void Copy (TObject &) const override
 Make a copy of this object. More...
 
void Error (const char *method, const char *msgfmt,...) const override
 colourised errors (red) ! More...
 
const Char_tGetLabel () const
 
UInt_t GetNumber () 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 More...
 
void Print (Option_t *option="") const override
 
void SetLabel (const Char_t *lab)
 
virtual void SetNumber (UInt_t num)
 
virtual void SetType (const Char_t *str)
 
void Warning (const char *method, const char *msgfmt,...) const override
 colourised warnings (orange) ! More...
 
- 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 ()
 
TObjectClone (const char *newname="") const override
 
Int_t Compare (const TObject *obj) 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="")
 
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 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 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
 

Private Member Functions

void add_file_to_collection (const TString &method_name, const TString &table_name, KVNameValueList &params, const TString &filepath, dataset_id dataset, reaction_id reaction, std::optional< filter_id > filt_id={})
 
void enter_data_row (const TString &table_name, const KVNameValueList &params)
 
std::optional< int > find_index_in_table (const TString &table_name, const KVNameValueList &params) const
 
KVNameValueList get_data_for_unique_index (const TString &table_name, int id) const
 
const KVDataRepositoryget_data_repository (repository_id id)
 
KVNameValueList get_params_for_reaction (std::optional< double > opt, bool reaction, const KV2Body &R, const TString &ip_units) const
 
std::pair< TString, TStringimport_file_to_repository (const TString &filepath, repository_id repo, dataset_id dset, reaction_id reac, std::optional< filter_id > filt_id={})
 
void initialize_repository (repository_id id, const TString &root_dir, const TString &access="local", std::optional< TString > xrdsrv=std::nullopt, std::optional< TString > xrdroot=std::nullopt)
 Initialize a new data repository with the given informations. More...
 

Private Attributes

KVSQLite::database fDB
 
std::map< int, std::unique_ptr< KVDataRepository > > fRepos
 
Bool_t import_data_into_repository = false
 
repository_id import_repo = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from KVBase
static std::optional< TStringAbsoluteUnixPath (const TString &)
 
static Bool_t AreEqual (Double_t x, Double_t y, Long64_t maxdif=1)
 Comparison between two 64-bit floating-point values. More...
 
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 KVString &class_name, KVString &imp_file, KVString &dec_file, const KVString &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 KVString GetDataSetEnv (const KVString &dataset, const KVString &type, const char *defval)
 
template<typename ValType >
static ValType GetDataSetEnv (const KVString &dataset, const KVString &type, const ValType &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.) More...
 
static const Char_tGetINCDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetKVBuildDate ()
 Returns KaliVeda build date. More...
 
static const Char_tGetKVBuildDir ()
 Returns top-level directory used for build. More...
 
static const Char_tGetKVBuildTime ()
 Returns KaliVeda build time. More...
 
static const Char_tGetKVBuildType ()
 Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...) More...
 
static const Char_tGetKVBuildUser ()
 Returns username of person who performed build. More...
 
static int GetKVMajorVersion ()
 
static int GetKVMinorVersion ()
 
static int GetKVPatchVersion ()
 
static const Char_tGetKVSourceDir ()
 Returns top-level directory of source tree used for build. More...
 
static const Char_tGetKVVersion ()
 Returns KaliVeda version string. More...
 
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. More...
 
static const Char_tgitCommit ()
 Returns last git commit of sources. More...
 
static void InitEnvironment ()
 
static bool is_gnuinstall ()
 
static Bool_t IsEnvInit ()
 
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. More...
 
static Double_t ProtectedGetX (const TF1 &func, Double_t val, int &status, Double_t xmin=0.0, Double_t xmax=0.0)
 
static Double_t ProtectedGetX (const TF1 *func, Double_t val, int &status, Double_t xmin=0.0, Double_t xmax=0.0)
 
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)
 
- 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 Typedef Documentation

◆ dataset_id

Definition at line 213 of file KVSimDataManager.h.

◆ file_id

Definition at line 216 of file KVSimDataManager.h.

◆ filter_id

Definition at line 218 of file KVSimDataManager.h.

◆ model_id

Definition at line 214 of file KVSimDataManager.h.

◆ reaction_id

Definition at line 215 of file KVSimDataManager.h.

◆ repository_id

Definition at line 217 of file KVSimDataManager.h.

Member Enumeration Documentation

◆ primary_or_secondary

Enumerator
primary 
secondary 

Definition at line 220 of file KVSimDataManager.h.

Constructor & Destructor Documentation

◆ KVSimDataManager()

KVSimDataManager::KVSimDataManager ( )
default

Member Function Documentation

◆ add_file_to_collection()

void KVSimDataManager::add_file_to_collection ( const TString method_name,
const TString table_name,
KVNameValueList params,
const TString filepath,
dataset_id  dataset,
reaction_id  reaction,
std::optional< filter_id filt_id = {} 
)
private

Definition at line 317 of file KVSimDataManager.cpp.

◆ AddDataRepository()

KVSimDataManager::repository_id KVSimDataManager::AddDataRepository ( const TString root_dir,
const TString access = "local",
std::optional< TString xrdsrv = std::nullopt,
std::optional< TString xrdroot = std::nullopt 
)

Initialize a (possibly new) data repository and return its id

If the same repository is not already in the database, it is added

If the repository is not in the list of currently active repositories, it is initialized and added to the list

Definition at line 232 of file KVSimDataManager.cpp.

◆ AddDataSet() [1/2]

KVSimDataManager::dataset_id KVSimDataManager::AddDataSet ( const TString short_description,
const TString model,
const KVNameValueList model_params 
)

Add a new dataset for given model with a short description

Parameters
[in]short_descriptionshort description (1 phrase) of dataset
[in]model(short) name of model
[in]model_paramsarbitrary list of key-value pairs giving full description of model parameters used in dataset
Returns
index of dataset in table

Definition at line 745 of file KVSimDataManager.cpp.

◆ AddDataSet() [2/2]

KVSimDataManager::dataset_id KVSimDataManager::AddDataSet ( const TString short_description,
model_id  modid 
)

Add a new dataset for given model with a short description

Parameters
[in]modidindex of model with a given set of parameters in the database
[in]short_descriptionshort description (1 phrase) of dataset
Returns
index of dataset in table

Definition at line 715 of file KVSimDataManager.cpp.

◆ AddFilesFromDirectory()

void KVSimDataManager::AddFilesFromDirectory ( dataset_id  dataset,
reaction_id  reaction,
const TString dirpath 
)

Use KVSimDir to analyse files in directory, all supposed to correspond to the same reaction, and add them to the given dataset.

Definition at line 410 of file KVSimDataManager.cpp.

◆ AddFilter()

KVSimDataManager::filter_id KVSimDataManager::AddFilter ( reaction_id  kinematics,
const TString geometry,
const TString filter_type,
bool  random_phi,
std::optional< int >  run_number = {},
std::optional< TString data_quality_audit = {},
std::optional< int >  gem_decay_per_event = {},
std::optional< bool >  gem_add_rot_energy = {} 
)

Add a set of filtering conditions to the database and return the corresponding index

Parameters
[in]kinematicsindex of reaction used to define lab->CM transform
[in]geometryname of experimental dataset used to define multidetector array geometry
[in]filter_typecan be "Geo" or "GeoThresh" (or "Full" for old filtered simulations before KaliVeda v1.15)
[in]random_phi[default=true] whether each event underwent a random azimuthal rotation before filtering
[in]run_number[optional] specific run number of dataset used to define experimental conditions
[in]data_quality_audit[optional] name of audit used to define identification performances
[in]gem_decay_per_event[optional] if Gemini++ used to perform secondary decay just before filtering, number of decays per primary event
[in]gem_add_rot_energy[optional] if Gemini++ used, was rotational (Yrast) energy added to E* before decay?

Definition at line 132 of file KVSimDataManager.cpp.

◆ AddFilteredSimulation()

void KVSimDataManager::AddFilteredSimulation ( const KVSimFile f,
dataset_id  dataset,
reaction_id  reaction 
)

Add a filtered simulation to the collection get kinematics used for transform lab<->CM. if the system name contains '@' it is an ad hoc kinematics if not, we have to look for it in the experimental dataset database

Definition at line 355 of file KVSimDataManager.cpp.

◆ AddModel()

KVSimDataManager::model_id KVSimDataManager::AddModel ( const TString name,
const KVNameValueList params 
)

Add model with given name and parameter values to database.

Parameters
[in]name(short) name of model
[in]paramsarbitrary list of key-value pairs giving full description of model parameters
Returns
index in models table
Note
that for the same model, different parameter values have different indices.

Definition at line 655 of file KVSimDataManager.cpp.

◆ AddReaction()

KVSimDataManager::reaction_id KVSimDataManager::AddReaction ( const KV2Body R,
std::optional< double >  opt = std::nullopt,
const TString ip_units = "fm" 
)

Add new reaction to database

Parameters
[in]Rtwo-body reaction or compound nucleus definition (KV2Body)
[in]optif given:
  • for reactions, fixed value of impact parameter
  • for CN decay, fixed spin of compound nucleus (integer value)
[in]ip_unitsfor impact parameter given in opt, either "fm" (default) or "rel" (=> b/bmax)
Returns
index of reaction in database

Definition at line 591 of file KVSimDataManager.cpp.

◆ AddUnfilteredSimulation()

void KVSimDataManager::AddUnfilteredSimulation ( const TString filepath,
Int_t  events,
primary_or_secondary  P,
dataset_id  dataset,
reaction_id  reaction 
)

Add a file containing data from an unfiltered simulation

Parameters
[in]filepathfull path to file
[in]eventsnumber of events in file
[in]Pwhether events are primary or secondary (before or after secondary decay)
[in]datasetindex of dataset file is part of
[in]reactionindex of reaction file corresponds to

if ImportFilesToRepository() has been called with a valid data repository id, the file will be copied to the repository, and any future access to the file will be via the data repository

Definition at line 287 of file KVSimDataManager.cpp.

◆ enter_data_row()

void KVSimDataManager::enter_data_row ( const TString table_name,
const KVNameValueList params 
)
inlineprivate

Definition at line 240 of file KVSimDataManager.h.

◆ find_index_in_table()

std::optional<int> KVSimDataManager::find_index_in_table ( const TString table_name,
const KVNameValueList params 
) const
inlineprivate

Definition at line 232 of file KVSimDataManager.h.

◆ get_data_for_unique_index()

KVNameValueList KVSimDataManager::get_data_for_unique_index ( const TString table_name,
int  id 
) const
inlineprivate

fill list with all columns in row corresponding to the unique value of "id"

Definition at line 247 of file KVSimDataManager.h.

◆ get_data_repository()

const KVDataRepository & KVSimDataManager::get_data_repository ( repository_id  id)
private

Return reference to repository corresponding to an entry in the repositories table

If not already initialized, the repository is initialized using the infos in the table

If the repository can not be initialized because it is not in the database, throw a std::runtime_error()

Definition at line 551 of file KVSimDataManager.cpp.

◆ get_params_for_reaction()

KVNameValueList KVSimDataManager::get_params_for_reaction ( std::optional< double >  opt,
bool  reaction,
const KV2Body R,
const TString ip_units 
) const
private

Definition at line 520 of file KVSimDataManager.cpp.

◆ GetModelId()

std::optional< KVSimDataManager::model_id > KVSimDataManager::GetModelId ( const TString name,
const KVNameValueList params 
) const

Look for model with given name and parameter values in database

Parameters
[in]name(short) name of model
[in]paramsarbitrary list of key-value pairs giving full description of model parameters
Returns
index in models table if found, std::nullopt if not
Note
that for the same model, different parameter values have different indices.

Definition at line 687 of file KVSimDataManager.cpp.

◆ GetModelName()

TString KVSimDataManager::GetModelName ( model_id  id) const

for given model, return name as "AMD_1", "HIPSE_11", etc., where "_N" is the index which can be different for different parameter sets of the model

Definition at line 507 of file KVSimDataManager.cpp.

◆ GetReactionId()

std::optional< KVSimDataManager::reaction_id > KVSimDataManager::GetReactionId ( const KV2Body R,
std::optional< double >  opt = std::nullopt,
const TString ip_units = "fm" 
) const
Parameters
[in]Rtwo-body reaction or compound nucleus definition (KV2Body)
[in]optif given:
  • for reactions, fixed value of impact parameter
  • for CN decay, fixed spin of compound nucleus (integer value)
[in]ip_unitsfor impact parameter given in opt, either "fm" (default) or "rel" (=> b/bmax)
Returns
index of reaction in database, if found

Definition at line 628 of file KVSimDataManager.cpp.

◆ GetReactionName()

TString KVSimDataManager::GetReactionName ( reaction_id  id) const

for given reaction index, return a string with a name like:

"reaction64Ni58Ni32AMeV"
"decay64Ni170MeV"

Definition at line 476 of file KVSimDataManager.cpp.

◆ import_file_to_repository()

std::pair< TString, TString > KVSimDataManager::import_file_to_repository ( const TString filepath,
repository_id  repo,
dataset_id  dset,
reaction_id  reac,
std::optional< filter_id filt_id = {} 
)
private

Copy the file into the data repository and return a pair of TString {path,filename} with the path and filename in the repository.

The path will be of the form

[model]/[reaction]/[filename]
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 filename

or

[model]/[reaction]/[filter]/[filename]

for filtered files get model id from dataset

Definition at line 198 of file KVSimDataManager.cpp.

◆ ImportFilesToRepository()

void KVSimDataManager::ImportFilesToRepository ( repository_id  repo = 0)

Call with the id of a previously initialised data repository (see AddDataRepository()) for all following files added with AddFilesFromDirectory() to be imported (copied) into this data repository.

Call with no argument (default repo_id = 0 => no repository) to stop importing.

Definition at line 441 of file KVSimDataManager.cpp.

◆ initialize_repository()

void KVSimDataManager::initialize_repository ( repository_id  id,
const TString root_dir,
const TString access = "local",
std::optional< TString xrdsrv = std::nullopt,
std::optional< TString xrdroot = std::nullopt 
)
private

Initialize a new data repository with the given informations.

Definition at line 173 of file KVSimDataManager.cpp.

◆ OpenDataBase()

void KVSimDataManager::OpenDataBase ( const TString filepath)

Open/create the SQLite database file with given path

Creates default table(s) if not already done

Definition at line 15 of file KVSimDataManager.cpp.

Member Data Documentation

◆ fDB

KVSQLite::database KVSimDataManager::fDB
mutableprivate

Definition at line 226 of file KVSimDataManager.h.

◆ fRepos

std::map<int, std::unique_ptr<KVDataRepository> > KVSimDataManager::fRepos
private

Definition at line 227 of file KVSimDataManager.h.

◆ import_data_into_repository

Bool_t KVSimDataManager::import_data_into_repository = false
private

Definition at line 229 of file KVSimDataManager.h.

◆ import_repo

repository_id KVSimDataManager::import_repo = 0
private

Definition at line 230 of file KVSimDataManager.h.