KaliVeda
Toolkit for HIC analysis
KVINDRARunSheetReader Class Reference

Detailed Description

Read the run sheets produced by the standard INDRA acquisition control program.

For each run, an entry is made in a new database of INDRA runs (KVINDRADB, global pointer gIndraDB). If required, a TTree can be created and filled with the informations read from the run sheets, for drawing histograms etc.

Examples of use:

KVINDRARunSheetReader s(kTRUE);// will create and fill a TTree with info from runsheets
r.SetRunSheetDir("/space/eindra/e475s/acquisition/run");// directory containing runsheets
r.SetFileFormat("RUN_%04d.TXT");// format for file name, including run number. This example works for e.g. RUN_0100.TXT
r.SetMakeTree(kTRUE);// in case you change your mind about the TTree ;-)
s.SetMakeTree(kFALSE);
r.ReadRunSheet( 100 );// read run sheet for run number 100
r.ReadAllRunSheets();// read all run sheets in the directory (default: from run 1 to 9999)
r.ReadAllRunSheets(100, 199);// read all run sheets in the directory from 100 to 199
r.GetTree()->StartViewer();// draw histograms of info stored in the TTree
gIndraDB->GetRuns()->ls();// view runs stored in database
ROOT::R::TRInterface & r
virtual KVSeqCollection * GetRuns() const
Definition: KVExpDB.h:140
Read the run sheets produced by the standard INDRA acquisition control program.
void ls(Option_t *option="") const override
const long double s
Definition: KVUnits.h:98

Definition at line 49 of file KVINDRARunSheetReader.h.

#include <KVINDRARunSheetReader.h>

Public Member Functions

 KVINDRARunSheetReader (Bool_t make_tree=kFALSE)
 
virtual ~ KVINDRARunSheetReader ()
 
void CreateTree ()
 
TString GetDateField (TString &, const Char_t *delim=":")
 
const Char_tGetFileFormat ()
 
Double_t GetNumberField (TString &, const Char_t *delim=":", int index=1)
 
const Char_tGetRunSheetDir ()
 
const Char_tGetRunSheetFileName (Int_t run)
 
TString GetStringField (TString &, const Char_t *delim=":", int index=1)
 
TTreeGetTree () const
 
Bool_t IsMakeTree () const
 
Int_t ReadAllRunSheets (Int_t first=1, Int_t last=9999)
 
Bool_t ReadRunSheet (Int_t run)
 
void SetFileFormat (const Char_t *fmt)
 
void SetMakeTree (Bool_t yes=kTRUE)
 
void SetRunSheetDir (const Char_t *dir)
 
void StartTreeViewer () const
 

Constructor & Destructor Documentation

◆ KVINDRARunSheetReader()

KVINDRARunSheetReader::KVINDRARunSheetReader ( Bool_t  make_tree = kFALSE)

Default ctor. If make_tree = kTRUE, a TTree will be created and filled with data from runsheets.

Definition at line 26 of file KVINDRARunSheetReader.cpp.

◆ ~ KVINDRARunSheetReader()

virtual KVINDRARunSheetReader::~ KVINDRARunSheetReader ( )
inlinevirtual

Definition at line 75 of file KVINDRARunSheetReader.h.

Member Function Documentation

◆ CreateTree()

void KVINDRARunSheetReader::CreateTree ( )

Definition at line 75 of file KVINDRARunSheetReader.cpp.

◆ GetDateField()

TString KVINDRARunSheetReader::GetDateField ( TString line,
const Char_t delim = ":" 
)

Special case of GetStringField for date-strings with ':' used in between hours, minutes, seconds. If ':' is also the delimiter of the string, we need to stick the time back together.

Definition at line 303 of file KVINDRARunSheetReader.cpp.

◆ GetFileFormat()

const Char_t* KVINDRARunSheetReader::GetFileFormat ( )
inline

Definition at line 87 of file KVINDRARunSheetReader.h.

◆ GetNumberField()

Double_t KVINDRARunSheetReader::GetNumberField ( TString line,
const Char_t delim = ":",
int  index = 1 
)

Split line according to delimiter. Return the index-th element (index = 0, 1, 2, ...) as a Double_t

Definition at line 265 of file KVINDRARunSheetReader.cpp.

◆ GetRunSheetDir()

const Char_t* KVINDRARunSheetReader::GetRunSheetDir ( )
inline

Definition at line 79 of file KVINDRARunSheetReader.h.

◆ GetRunSheetFileName()

const Char_t * KVINDRARunSheetReader::GetRunSheetFileName ( Int_t  run)

Uses directory path and file format to create full path to runsheet file for run number 'run'.

Definition at line 57 of file KVINDRARunSheetReader.cpp.

◆ GetStringField()

TString KVINDRARunSheetReader::GetStringField ( TString line,
const Char_t delim = ":",
int  index = 1 
)

Split line according to delimiter. Return the index-th element (index = 0, 1, 2, ...) as a string

Definition at line 284 of file KVINDRARunSheetReader.cpp.

◆ GetTree()

TTree* KVINDRARunSheetReader::GetTree ( ) const
inline

Definition at line 113 of file KVINDRARunSheetReader.h.

◆ IsMakeTree()

Bool_t KVINDRARunSheetReader::IsMakeTree ( ) const
inline

Definition at line 102 of file KVINDRARunSheetReader.h.

◆ ReadAllRunSheets()

Int_t KVINDRARunSheetReader::ReadAllRunSheets ( Int_t  first = 1,
Int_t  last = 9999 
)

Read all run sheets in the directory fRunSheetDir from run number 'first' to 'last' (default values are 1 and 9999). Returns the number of run sheets actually read.

Definition at line 332 of file KVINDRARunSheetReader.cpp.

◆ ReadRunSheet()

Bool_t KVINDRARunSheetReader::ReadRunSheet ( Int_t  run)

Read runsheet corresponding to run number 'run' Store the informations we read in the runsheet in the run database. Create TTree if required and if not already done Return kTRUE if all goes well.

Definition at line 110 of file KVINDRARunSheetReader.cpp.

◆ SetFileFormat()

void KVINDRARunSheetReader::SetFileFormat ( const Char_t fmt)
inline

Definition at line 91 of file KVINDRARunSheetReader.h.

◆ SetMakeTree()

void KVINDRARunSheetReader::SetMakeTree ( Bool_t  yes = kTRUE)
inline

Definition at line 106 of file KVINDRARunSheetReader.h.

◆ SetRunSheetDir()

void KVINDRARunSheetReader::SetRunSheetDir ( const Char_t dir)
inline

Definition at line 83 of file KVINDRARunSheetReader.h.

◆ StartTreeViewer()

void KVINDRARunSheetReader::StartTreeViewer ( ) const
inline

Definition at line 117 of file KVINDRARunSheetReader.h.