KaliVeda
Toolkit for HIC analysis
KVExpDB.h
1 
4 #ifndef __KVEXPDB_H
5 #define __KVEXPDB_H
6 
7 #include "KVDataBase.h"
8 #include "KVDBRun.h"
9 #include "KVNumberList.h"
10 
11 class KVDBSystem;
12 
20 class KVExpDB : public KVDataBase {
21 
22 protected:
26 
30 
31  Bool_t OpenCalibFile(const Char_t* type, std::ifstream& fs) const;
32  virtual void ReadSystemList();
33  virtual void ReadComments();
34  void init();
35 
36 public:
37  KVExpDB();
38  KVExpDB(const Char_t* name);
39  KVExpDB(const Char_t* name, const Char_t* title);
40 
41  Bool_t FindCalibFile(const Char_t* type, TString& fullpath, const TString& array_name = "") const;
42  void SetDataSet(const TString& s)
43  {
44  fDataSet = s;
45  }
47  {
48  return fDBType;
49  }
50  void SetDBType(const TString& s)
51  {
52  fDBType = s;
53  }
54 
55  virtual ~KVExpDB();
56 
57  virtual void LinkListToRunRanges(TList* list, UInt_t rr_number,
58  UInt_t run_ranges[][2]);
59  virtual void LinkRecordToRunRanges(KVDBRecord* rec, UInt_t rr_number,
60  UInt_t run_ranges[][2]);
61  virtual void LinkRecordToRunRange(KVDBRecord* rec, UInt_t first_run,
62  UInt_t last_run);
63  virtual void LinkListToRunRange(TList* list, const KVNumberList& nl);
64  virtual void LinkRecordToRunRange(KVDBRecord* rec, const KVNumberList& nl);
65  virtual void LinkRecordToRun(KVDBRecord* rec, Int_t run);
66 
67  void AddRun(KVDBRun* r)
68  {
69  fRuns->AddRecord(r);
70  fListOfRuns.Add(r->GetNumber());
71  }
72  virtual KVSeqCollection* GetRuns() const
73  {
74  return fRuns->GetRecords();
75  }
76  KVDBRun* GetDBRun(Int_t number) const
77  {
78  return (KVDBRun*)fRuns->GetRecord(number);
79  }
80  const KVNumberList& GetRunList() const
81  {
83  return fListOfRuns;
84  }
85  virtual KVDBSystem* GetSystem(const Char_t* system) const
86  {
87  return (KVDBSystem*) fSystems->GetRecord(system);
88  }
89  virtual KVSeqCollection* GetSystems() const
90  {
91  return fSystems->GetRecords();
92  }
93 
95  {
97  }
99  {
101  }
102 
103  void WriteSystemsFile() const;
104  void WriteRunListFile() const;
105 
106  virtual void Save(const Char_t*);
107 
108  virtual TString GetDBEnv(const Char_t*) const;
109  TString GetCalibFileName(const Char_t* type) const
110  {
111  return GetDBEnv(type);
112  }
113 
114  virtual void WriteObjects(TFile*)
115  {
121  }
122 
123  virtual void ReadObjects(TFile*)
124  {
130  }
131 
132  virtual void PrintRuns(KVNumberList&) const;
133 
134  virtual void cd();
135 
136  const Char_t* GetDataSetDir() const
137  {
138  return fDataSetDir;
139  }
140  void SetDataSetDir(const Char_t* d)
141  {
142  fDataSetDir = d;
143  }
144  virtual void Build()
145  {
146  AbstractMethod("Build");
147  }
148 
149  static KVExpDB* MakeDataBase(const Char_t* name, const Char_t* datasetdir);
150 
151  ULong64_t GetTotalEvents(int first_run, int last_run = -1) const;
152  ULong64_t GetTotalEvents(const KVString& system) const;
153 
154  ClassDef(KVExpDB, 2) //base class to describe database of an experiment
155 };
156 
158 R__EXTERN KVExpDB* gExpDB;
159 
160 #endif
int Int_t
unsigned int UInt_t
#define R__EXTERN
ROOT::R::TRInterface & r
#define d(i)
bool Bool_t
char Char_t
#define ClassDef(name, id)
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 Atom_t Time_t type
Record folder for the database.
Definition: KVDBRecord.h:43
Description of an experimental run in database ,,.
Definition: KVDBRun.h:36
Database class used to store information on different colliding systems studied during an experiment....
Definition: KVDBSystem.h:52
Table in a database.
Definition: KVDBTable.h:34
virtual Bool_t AddRecord(KVDBRecord *add)
Definition: KVDBTable.cpp:74
virtual void RemoveRecord(KVDBRecord *add)
Remove a KVDBRecord from the list of available records.
Definition: KVDBTable.cpp:93
virtual KVDBRecord * GetRecord(const Char_t *rec_name) const
Definition: KVDBTable.h:58
virtual KVSeqCollection * GetRecords() const
Definition: KVDBTable.h:63
Simple cross-referenced database structure.
Definition: KVDataBase.h:137
Base class to describe database of an experiment ,,.
Definition: KVExpDB.h:20
KVNumberList fListOfRuns
list of all run numbers
Definition: KVExpDB.h:27
void AddSystem(KVDBSystem *r)
Definition: KVExpDB.h:94
virtual void Build()
Definition: KVExpDB.h:144
virtual ~KVExpDB()
Destructor.
Definition: KVExpDB.cpp:73
virtual KVDBSystem * GetSystem(const Char_t *system) const
Definition: KVExpDB.h:85
virtual void ReadComments()
Definition: KVExpDB.cpp:706
virtual void ReadSystemList()
Definition: KVExpDB.cpp:249
virtual void cd()
Definition: KVExpDB.cpp:577
void AddRun(KVDBRun *r)
Definition: KVExpDB.h:67
KVDBTable * fRuns
table of runs
Definition: KVExpDB.h:28
void SetDBType(const TString &s)
Definition: KVExpDB.h:50
virtual void LinkRecordToRun(KVDBRecord *rec, Int_t run)
Definition: KVExpDB.cpp:125
KVDBRun * GetDBRun(Int_t number) const
Definition: KVExpDB.h:76
virtual KVSeqCollection * GetRuns() const
Definition: KVExpDB.h:72
void RemoveSystem(KVDBSystem *s)
Definition: KVExpDB.h:98
TString GetCalibFileName(const Char_t *type) const
Definition: KVExpDB.h:109
TString GetDBType() const
Definition: KVExpDB.h:46
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).
Definition: KVExpDB.cpp:164
KVDBTable * fSystems
table of systems
Definition: KVExpDB.h:29
const KVNumberList & GetRunList() const
Definition: KVExpDB.h:80
virtual void PrintRuns(KVNumberList &) const
Definition: KVExpDB.cpp:547
ULong64_t GetTotalEvents(int first_run, int last_run=-1) const
Definition: KVExpDB.cpp:633
virtual KVSeqCollection * GetSystems() const
Definition: KVExpDB.h:89
virtual void Save(const Char_t *)
Definition: KVExpDB.cpp:362
TString fDBType
used by GetDBEnv
Definition: KVExpDB.h:25
virtual void LinkRecordToRunRanges(KVDBRecord *rec, UInt_t rr_number, UInt_t run_ranges[][2])
Definition: KVExpDB.cpp:144
virtual void LinkListToRunRange(TList *list, const KVNumberList &nl)
Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).
Definition: KVExpDB.cpp:200
void WriteSystemsFile() const
Definition: KVExpDB.cpp:329
KVExpDB()
Default constructor.
Definition: KVExpDB.cpp:35
const Char_t * GetDataSetDir() const
Definition: KVExpDB.h:136
void init()
default initialisations
Definition: KVExpDB.cpp:21
virtual void WriteObjects(TFile *)
Definition: KVExpDB.h:114
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
Definition: KVExpDB.cpp:87
virtual void ReadObjects(TFile *)
Definition: KVExpDB.h:123
TString fDataSetDir
the directory containing the dataset files
Definition: KVExpDB.h:24
void SetDataSet(const TString &s)
Definition: KVExpDB.h:42
void SetDataSetDir(const Char_t *d)
Definition: KVExpDB.h:140
static KVExpDB * MakeDataBase(const Char_t *name, const Char_t *datasetdir)
Definition: KVExpDB.cpp:599
void WriteRunListFile() const
Definition: KVExpDB.cpp:382
virtual TString GetDBEnv(const Char_t *) const
Definition: KVExpDB.cpp:680
Bool_t OpenCalibFile(const Char_t *type, std::ifstream &fs) const
Definition: KVExpDB.cpp:433
TString fDataSet
the name of the dataset to which this database is associated
Definition: KVExpDB.h:23
Bool_t FindCalibFile(const Char_t *type, TString &fullpath, const TString &array_name="") const
Definition: KVExpDB.cpp:487
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
void Add(Int_t)
Add value 'n' to the list.
KaliVeda extensions to ROOT collection classes.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void AbstractMethod(const char *method) const
unsigned long long ULong64_t