KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVINDRADB4.cpp
1/***************************************************************************
2$Id: KVINDRADB4.cpp,v 1.18 2007/04/26 16:40:58 franklan Exp $
3 KVINDRADB4.cpp - description
4 -------------------
5 begin : mars 2004
6 copyright : (C) 2004 by daniel cussol
7 email : cussol@in2p3.fr
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18#include "Riostream.h"
19#include "KVINDRA.h"
20#include "KVINDRADB4.h"
21#include "KVINDRADBRun.h"
22#include "KVDBParameterSet.h"
23#include "KVRunListLine.h"
24#include "TString.h"
25
26using namespace std;
27
29
30
31
33
35{
36 //default ctor
37}
38
39
40
41
43
48
49
50
51
54
56{
57 //Use KVINDRARunListReader utility subclass to read complete runlist
58
59 TString runlist_fullpath;
60 KVBase::SearchKVFile(GetCalibFileName("Runlist"), runlist_fullpath,
61 fDataSet);
64 GetLineReader()->SetFieldKeys("RUN", "BEAM", "TARGET");
65 GetLineReader()->SetRunKeys("RUN", "EVENTS");
66 ReadRunList(runlist_fullpath.Data());
69}
70
71
72
73
79
81{
82 //For each "good run line" in the run list file, we:
83 // add a KVINDRADBRun to the database if it doesn't already exist
84 // set properties of run objects
85 //kFirstRun & kLastRun are set
86
87 KVRunListLine* csv_line = GetLineReader();
88
89 //run number
90 Int_t run_n = csv_line->GetIntField("RUN");
91
92 if (!run_n) {
93 cout << "run_n = 0 ????????? line number =" << GetRLLineNumber() <<
94 endl;
96 return;
97 }
98
99
100 /*********************************************
101 WE CREATE A NEW RUN AND ADD
102 IT TO THE DATABASE. WE SET ALL
103 AVAILABLE INFORMATIONS ON
104 RUN FROM THE FILE. ERROR IF
105 DBASE RUN ALREADY EXISTS =>
106 SAME RUN APPEARS TWICE
107 *********************************************/
108 KVINDRADBRun* run = (KVINDRADBRun*) GetRun(run_n);
109 if (!run) {
110
111 run = new KVINDRADBRun(run_n);
112 AddRun(run);
113
114 if (csv_line->HasFieldValue("EVENTS"))
115 run->SetEvents(csv_line->GetIntField("EVENTS"));
116 else
117 Error("GoodRunLine", "No events field ? run=%d", run_n);
118 if (csv_line->HasField("TRIGGER"))
119 run->SetTrigger(GetRunListTrigger("TRIGGER", "M>=%d"));
120 else
121 Error("GoodRunLine", "No TRIGGER field ? run=%d", run_n);
122 if (csv_line->HasFieldValue("RUNCOMMENT"))
123 run->SetComments(csv_line->GetField("RUNCOMMENT"));
124 if (csv_line->HasFieldValue("TSTART"))
125 run->SetStartDate(csv_line->GetField("TSTART"));
126
127 }
128 else {
129 Error("GoodRunLine", "Run %d already exists", run_n);
130 }
131}
132
133
int Int_t
char Char_t
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition KVBase.cpp:538
void SetEvents(ULong64_t evt_number)
Definition KVDBRun.h:170
void SetComments(const KVString &comments)
Definition KVDBRun.h:182
void SetStartDate(const KVString &date)
Definition KVDBRun.h:186
void SetTrigger(Int_t trig)
Definition KVDBRun.h:99
virtual void ReadSystemList()
Definition KVExpDB.cpp:249
void AddRun(KVDBRun *r)
Definition KVExpDB.h:67
TString GetCalibFileName(const Char_t *type) const
Definition KVExpDB.h:109
TString fDataSet
the name of the dataset to which this database is associated
Definition KVExpDB.h:23
DataBase of parameters for 4th campaign of INDRA.
Definition KVINDRADB4.h:33
virtual ~KVINDRADB4()
virtual void Build()
Use KVINDRARunListReader utility subclass to read complete runlist.
virtual void GoodRunLine()
Database entry for each run of an INDRA experiment.
DataBase of parameters for an INDRA campaign.
Definition KVINDRADB.h:59
KVINDRADBRun * GetRun(Int_t run) const
Definition KVINDRADB.h:133
virtual void ReadChIoPressures()
void SetRLCommentChar(Char_t c)
void ReadRunList(const Char_t *name="")
Int_t GetRunListTrigger(const Char_t *field, const Char_t *fmt)
KVRunListLine * GetLineReader() const
void SetRLSeparatorChar(Char_t c)
Base class for reading runlists for experiments ,.
Bool_t HasFieldValue(const Char_t *) const
virtual void Print() const
void SetFieldKeys()
Bool_t HasField(const Char_t *) const
INLINES_______________________________________________________________________________.
Int_t GetIntField(const Char_t *)
virtual const Char_t * GetField(const Char_t *) const
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const
ClassImp(TPyArg)