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 
34 KVINDRADB4::KVINDRADB4(const Char_t* name): KVINDRADB(name)
35 {
36  //default ctor
37 }
38 
39 
40 
41 
43 
44 KVINDRADB4::~KVINDRADB4()
45 {
46 
47 }
48 
49 
50 
51 
54 
55 void KVINDRADB4::Build(bool minimal)
56 {
57  //Use KVINDRARunListReader utility subclass to read complete runlist
58 
59  TString runlist_fullpath;
60  KVBase::SearchKVFile(GetCalibFileName("Runlist"), runlist_fullpath,
61  fDataSet);
62  SetRLCommentChar('#');
63  SetRLSeparatorChar('|');
64  GetLineReader()->SetFieldKeys("RUN", "BEAM", "TARGET");
65  GetLineReader()->SetRunKeys("RUN", "EVENTS");
66  ReadRunList(runlist_fullpath.Data());
67  ReadSystemList();
68 
69  if(minimal)
70  return;
71 
72  ReadChIoPressures();
73 }
74 
75 
76 
77 
83 
85 {
86  //For each "good run line" in the run list file, we:
87  // add a KVINDRADBRun to the database if it doesn't already exist
88  // set properties of run objects
89  //kFirstRun & kLastRun are set
90 
91  KVRunListLine* csv_line = GetLineReader();
92 
93  //run number
94  Int_t run_n = csv_line->GetIntField("RUN");
95 
96  if (!run_n) {
97  cout << "run_n = 0 ????????? line number =" << GetRLLineNumber() <<
98  endl;
99  GetLineReader()->Print();
100  return;
101  }
102 
103 
104  /*********************************************
105  WE CREATE A NEW RUN AND ADD
106  IT TO THE DATABASE. WE SET ALL
107  AVAILABLE INFORMATIONS ON
108  RUN FROM THE FILE. ERROR IF
109  DBASE RUN ALREADY EXISTS =>
110  SAME RUN APPEARS TWICE
111  *********************************************/
112  KVINDRADBRun* run = (KVINDRADBRun*) GetRun(run_n);
113  if (!run) {
114 
115  run = new KVINDRADBRun(run_n);
116  AddRun(run);
117 
118  if (csv_line->HasFieldValue("EVENTS"))
119  run->SetEvents(csv_line->GetIntField("EVENTS"));
120  else
121  Error("GoodRunLine", "No events field ? run=%d", run_n);
122  if (csv_line->HasField("TRIGGER"))
123  run->SetTrigger(GetRunListTrigger("TRIGGER", "M>=%d"));
124  else
125  Error("GoodRunLine", "No TRIGGER field ? run=%d", run_n);
126  if (csv_line->HasFieldValue("RUNCOMMENT"))
127  run->SetComments(csv_line->GetField("RUNCOMMENT"));
128  if (csv_line->HasFieldValue("TSTART"))
129  run->SetStartDate(csv_line->GetField("TSTART"));
130 
131  }
132  else {
133  Error("GoodRunLine", "Run %d already exists", run_n);
134  }
135 }
136 
137 
int Int_t
char Char_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 Build(bool=false) override
Use KVINDRARunListReader utility subclass to read complete runlist.
Definition: KVINDRADB4.cpp:55
void GoodRunLine() override
Definition: KVINDRADB4.cpp:84
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
DataBase of parameters for an INDRA campaign.
Definition: KVINDRADB.h:59
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)