KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVINDRADB4.cpp
Go to the documentation of this file.
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 
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  ReadChIoPressures();
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;
95  GetLineReader()->Print();
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
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char Char_t
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:541
void SetEvents(ULong64_t evt_number)
Definition: KVDBRun.h:169
void SetComments(const KVString &comments)
Definition: KVDBRun.h:181
void SetStartDate(const KVString &date)
Definition: KVDBRun.h:185
void SetTrigger(Int_t trig)
Definition: KVDBRun.h:98
DataBase of parameters for 4th campaign of INDRA.
Definition: KVINDRADB4.h:32
virtual void Build()
Use KVINDRARunListReader utility subclass to read complete runlist.
Definition: KVINDRADB4.cpp:55
virtual void GoodRunLine()
Definition: KVINDRADB4.cpp:80
Database entry for each run of an INDRA experiment.
Definition: KVINDRADBRun.h:29
DataBase of parameters for an INDRA campaign.
Definition: KVINDRADB.h:58
Base class for reading runlists for experiments ,.
Definition: KVRunListLine.h:25
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 *va_(fmt),...)