KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
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:72
Read the run sheets produced by the standard INDRA acquisition control program.
void ls(Option_t *option="") const override

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
 

Private Member Functions

void init_vars ()
 Set values of all runsheet/TTree variables to 0.
 

Private Attributes

Double_t acq_rate
 
Int_t buf_ctrl
 
Int_t buf_sav
 
Double_t ctrl_rate
 
Double_t data_rate
 
KVDatime endrun
 
Int_t eve_ctrl
 
Int_t eve_lus
 
Int_t eve_sav
 
TString fFileFormat
 format string for run sheet file names
 
TString fFilePath
 temporary string holding full filename of current runsheet
 
Bool_t fMakeTree
 set to kTRUE if TTree is to be filled
 
TString fRunSheetDir
 full path to directory holding run sheets
 
Int_t fScalers [1024]
 scalers for tree
 
UInt_t fTIME_START
 zero-time for all run start/stop times
 
TTreefTree
 TTree can be made and filled from info.
 
Int_t iend
 
Int_t istart
 
Double_t len_run
 
Int_t rempli_dlt_blocs
 
Double_t rempli_dlt_pc
 
Int_t run_num
 
Double_t size
 
KVDatime start_run
 
TString stat_eve
 
Double_t temps_mort
 
Double_t trait_rate
 

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.

◆ init_vars()

void KVINDRARunSheetReader::init_vars ( )
private

Set values of all runsheet/TTree variables to 0.

Definition at line 41 of file KVINDRARunSheetReader.cpp.

◆ 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.

Member Data Documentation

◆ acq_rate

Double_t KVINDRARunSheetReader::acq_rate
private

Definition at line 60 of file KVINDRARunSheetReader.h.

◆ buf_ctrl

Int_t KVINDRARunSheetReader::buf_ctrl
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ buf_sav

Int_t KVINDRARunSheetReader::buf_sav
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ ctrl_rate

Double_t KVINDRARunSheetReader::ctrl_rate
private

Definition at line 60 of file KVINDRARunSheetReader.h.

◆ data_rate

Double_t KVINDRARunSheetReader::data_rate
private

Definition at line 60 of file KVINDRARunSheetReader.h.

◆ endrun

KVDatime KVINDRARunSheetReader::endrun
private

Definition at line 59 of file KVINDRARunSheetReader.h.

◆ eve_ctrl

Int_t KVINDRARunSheetReader::eve_ctrl
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ eve_lus

Int_t KVINDRARunSheetReader::eve_lus
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ eve_sav

Int_t KVINDRARunSheetReader::eve_sav
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ fFileFormat

TString KVINDRARunSheetReader::fFileFormat
private

format string for run sheet file names

Definition at line 52 of file KVINDRARunSheetReader.h.

◆ fFilePath

TString KVINDRARunSheetReader::fFilePath
private

temporary string holding full filename of current runsheet

Definition at line 53 of file KVINDRARunSheetReader.h.

◆ fMakeTree

Bool_t KVINDRARunSheetReader::fMakeTree
private

set to kTRUE if TTree is to be filled

Definition at line 55 of file KVINDRARunSheetReader.h.

◆ fRunSheetDir

TString KVINDRARunSheetReader::fRunSheetDir
private

full path to directory holding run sheets

Definition at line 51 of file KVINDRARunSheetReader.h.

◆ fScalers

Int_t KVINDRARunSheetReader::fScalers[1024]
private

scalers for tree

Definition at line 65 of file KVINDRARunSheetReader.h.

◆ fTIME_START

UInt_t KVINDRARunSheetReader::fTIME_START
private

zero-time for all run start/stop times

Definition at line 68 of file KVINDRARunSheetReader.h.

◆ fTree

TTree* KVINDRARunSheetReader::fTree
private

TTree can be made and filled from info.

Definition at line 56 of file KVINDRARunSheetReader.h.

◆ iend

Int_t KVINDRARunSheetReader::iend
private

Definition at line 64 of file KVINDRARunSheetReader.h.

◆ istart

Int_t KVINDRARunSheetReader::istart
private

Definition at line 64 of file KVINDRARunSheetReader.h.

◆ len_run

Double_t KVINDRARunSheetReader::len_run
private

Definition at line 60 of file KVINDRARunSheetReader.h.

◆ rempli_dlt_blocs

Int_t KVINDRARunSheetReader::rempli_dlt_blocs
private

Definition at line 63 of file KVINDRARunSheetReader.h.

◆ rempli_dlt_pc

Double_t KVINDRARunSheetReader::rempli_dlt_pc
private

Definition at line 61 of file KVINDRARunSheetReader.h.

◆ run_num

Int_t KVINDRARunSheetReader::run_num
private

Definition at line 62 of file KVINDRARunSheetReader.h.

◆ size

Double_t KVINDRARunSheetReader::size
private

Definition at line 60 of file KVINDRARunSheetReader.h.

◆ start_run

KVDatime KVINDRARunSheetReader::start_run
private

Definition at line 59 of file KVINDRARunSheetReader.h.

◆ stat_eve

TString KVINDRARunSheetReader::stat_eve
private

Definition at line 66 of file KVINDRARunSheetReader.h.

◆ temps_mort

Double_t KVINDRARunSheetReader::temps_mort
private

Definition at line 61 of file KVINDRARunSheetReader.h.

◆ trait_rate

Double_t KVINDRARunSheetReader::trait_rate
private

Definition at line 60 of file KVINDRARunSheetReader.h.