KaliVeda
Toolkit for HIC analysis
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 
26 using namespace std;
27 
29 
30 
31 
32 //___________________________________________________________________________
33 
34 
35 
37 void KVINDRADB4::make_minimal_database()
38 {
39  TString runlist_fullpath;
40  KVBase::SearchKVFile(GetCalibFileName("Runlist"), runlist_fullpath,
41  fDataSet);
42  SetRLCommentChar('#');
43  SetRLSeparatorChar('|');
44  GetLineReader()->SetFieldKeys("RUN", "BEAM", "TARGET");
45  GetLineReader()->SetRunKeys("RUN", "EVENTS");
46  ReadRunList(runlist_fullpath.Data());
47  ReadSystemList();
48 }
49 
50 
51 
53 
55 {
56  ReadChIoPressures();
57 }
58 
59 
60 
61 
67 
69 {
70  //For each "good run line" in the run list file, we:
71  // add a KVINDRADBRun to the database if it doesn't already exist
72  // set properties of run objects
73  //kFirstRun & kLastRun are set
74 
75  KVRunListLine* csv_line = GetLineReader();
76 
77  //run number
78  Int_t run_n = csv_line->GetIntField("RUN");
79 
80  if (!run_n) {
81  cout << "run_n = 0 ????????? line number =" << GetRLLineNumber() <<
82  endl;
83  GetLineReader()->Print();
84  return;
85  }
86 
87 
88  /*********************************************
89  WE CREATE A NEW RUN AND ADD
90  IT TO THE DATABASE. WE SET ALL
91  AVAILABLE INFORMATIONS ON
92  RUN FROM THE FILE. ERROR IF
93  DBASE RUN ALREADY EXISTS =>
94  SAME RUN APPEARS TWICE
95  *********************************************/
96  KVINDRADBRun* run = (KVINDRADBRun*) GetRun(run_n);
97  if (!run) {
98 
99  run = new KVINDRADBRun(run_n);
100  AddRun(run);
101 
102  if (csv_line->HasFieldValue("EVENTS"))
103  run->SetEvents(csv_line->GetIntField("EVENTS"));
104  else
105  Error("GoodRunLine", "No events field ? run=%d", run_n);
106  if (csv_line->HasField("TRIGGER"))
107  run->SetTrigger(GetRunListTrigger("TRIGGER", "M>=%d"));
108  else
109  Error("GoodRunLine", "No TRIGGER field ? run=%d", run_n);
110  if (csv_line->HasFieldValue("RUNCOMMENT"))
111  run->SetComments(csv_line->GetField("RUNCOMMENT"));
112  if (csv_line->HasFieldValue("TSTART"))
113  run->SetStartDate(csv_line->GetField("TSTART"));
114 
115  }
116  else {
117  Error("GoodRunLine", "Run %d already exists", run_n);
118  }
119 }
120 
121 
int Int_t
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:541
void SetComments(const KVString &comments)
Definition: KVDBRun.h:272
void SetTrigger(Int_t trig)
Definition: KVDBRun.h:244
DataBase of parameters for 4th campaign of INDRA.
Definition: KVINDRADB4.h:33
void GoodRunLine() override
Definition: KVINDRADB4.cpp:68
void extend_minimal_database() override
Definition: KVINDRADB4.cpp:54
Database entry for each run of an INDRA experiment.
Definition: KVINDRADBRun.h:30
void SetStartDate(const KVString &date)
Definition: KVINDRADBRun.h:116
void SetEvents(ULong64_t evt_number)
Definition: KVINDRADBRun.h:112
Base class for reading runlists for experiments ,.
Definition: KVRunListLine.h:26
Bool_t HasFieldValue(const Char_t *) const
Bool_t HasField(const Char_t *) const
INLINES_______________________________________________________________________________.
Int_t GetIntField(const Char_t *)
virtual const Char_t * GetField(const Char_t *) const
const char * Data() const
void Error(const char *location, const char *fmt,...)
ClassImp(TPyArg)