KaliVeda
Toolkit for HIC analysis
run_index_list Class Reference

Detailed Description

List of runfiles specified by run number and file index ,.

Each experimental 'run' may produce 1 or more files. The conditions and settings of the experiment are assumed to be the same during the entire length of the run.

Each 'run' is assigned a number. Each file of the 'run' is assigned an index.

To fully specify a runfile requires both run number and index: run_index_t. A run_index_list is a container of run_index_t.

It can be iterated over as usual:

for(auto& run_index : toto)
{
}
List of runfiles specified by run number and file index ,.

Definition at line 31 of file run_index_list.h.

#include <run_index_list.h>

Public Member Functions

 run_index_list ()=default
 
 run_index_list (const run_index_list &)=default
 
 run_index_list (const TString &l)
 
 run_index_list (run_index_list &&)=default
 
void Add (const run_index_list &)
 Add all in list to this list. More...
 
void Add (const run_index_t &r)
 
TString AsString (Int_t maxlen=0) const
 
auto begin () const
 
void Clear ()
 
bool Contains (const run_index_t &r) const
 
auto end () const
 
const run_index_tFirst () const
 
Int_t GetEntries () const
 
TString GetList (bool no_commas=true) const
 
Int_t GetNValues () const
 
KVNumberList GetRunNumberList () const
 Returns just the list of run numbers. More...
 
void Inter (const run_index_list &)
 
bool IsEmpty () const
 
const run_index_tLast () const
 
void ls () const
 
run_index_listoperator= (const run_index_list &)=default
 
run_index_listoperator= (run_index_list &&)=default
 
auto rbegin () const
 
void Remove (const run_index_list &)
 Remove all in list to this list. More...
 
void Remove (const run_index_t &r)
 
auto rend () const
 
void SetList (const TString &slist)
 
void SetListSelection (const TString &slist, const run_index_list &full_list)
 

Private Attributes

std::set< run_index_tfRunList
 

Friends

run_index_list operator+ (const run_index_list &A, const run_index_list &B)
 
run_index_list operator- (const run_index_list &A, const run_index_list &B)
 

Constructor & Destructor Documentation

◆ run_index_list() [1/4]

run_index_list::run_index_list ( const TString l)
inline

Definition at line 34 of file run_index_list.h.

◆ run_index_list() [2/4]

run_index_list::run_index_list ( )
default

◆ run_index_list() [3/4]

run_index_list::run_index_list ( const run_index_list )
default

◆ run_index_list() [4/4]

run_index_list::run_index_list ( run_index_list &&  )
default

Member Function Documentation

◆ Add() [1/2]

void run_index_list::Add ( const run_index_list list)

Add all in list to this list.

Definition at line 9 of file run_index_list.cpp.

◆ Add() [2/2]

void run_index_list::Add ( const run_index_t r)
inline

Definition at line 61 of file run_index_list.h.

◆ AsString()

TString run_index_list::AsString ( Int_t  maxlen = 0) const

Get string containing list.

If maxlen>0, and if length of resulting string is longer than maxlen, we truncate the list to show only the beginning and the end of the list, with "..." in between, i.e. "6000-...-8910". Note that the minimum size of the resulting string is 5 i.e. "6...0".

Returns empty string if list is empty.

Definition at line 170 of file run_index_list.cpp.

◆ begin()

auto run_index_list::begin ( ) const
inline

Definition at line 44 of file run_index_list.h.

◆ Clear()

void run_index_list::Clear ( )
inline

Definition at line 92 of file run_index_list.h.

◆ Contains()

bool run_index_list::Contains ( const run_index_t r) const
inline

Definition at line 72 of file run_index_list.h.

◆ end()

auto run_index_list::end ( ) const
inline

Definition at line 48 of file run_index_list.h.

◆ First()

const run_index_t& run_index_list::First ( ) const
inline

Return first run/index in sorted list

Definition at line 117 of file run_index_list.h.

◆ GetEntries()

Int_t run_index_list::GetEntries ( ) const
inline

Definition at line 88 of file run_index_list.h.

◆ GetList()

TString run_index_list::GetList ( bool  no_commas = true) const

Return list of [run.index] as formatted string:

no_commas=true (default): "1 1.1 1.2 1.3 2 2.1" etc.

no_commas=false: "1, 1.1, 1.2, 1.3, 2, 2.1" etc.

Definition at line 37 of file run_index_list.cpp.

◆ GetNValues()

Int_t run_index_list::GetNValues ( ) const
inline

Definition at line 84 of file run_index_list.h.

◆ GetRunNumberList()

KVNumberList run_index_list::GetRunNumberList ( ) const

Returns just the list of run numbers.

Definition at line 220 of file run_index_list.cpp.

◆ Inter()

void run_index_list::Inter ( const run_index_list list)

keep the AND logic operation result between 'list' and this list i.e. keep only run_index_t which appear in both lists

Definition at line 203 of file run_index_list.cpp.

◆ IsEmpty()

bool run_index_list::IsEmpty ( ) const
inline

Definition at line 76 of file run_index_list.h.

◆ Last()

const run_index_t& run_index_list::Last ( ) const
inline

Return last run/index in sorted list

Definition at line 123 of file run_index_list.h.

◆ ls()

void run_index_list::ls ( ) const
inline

Definition at line 96 of file run_index_list.h.

◆ operator=() [1/2]

run_index_list& run_index_list::operator= ( const run_index_list )
default

◆ operator=() [2/2]

run_index_list& run_index_list::operator= ( run_index_list &&  )
default

◆ rbegin()

auto run_index_list::rbegin ( ) const
inline

Definition at line 52 of file run_index_list.h.

◆ Remove() [1/2]

void run_index_list::Remove ( const run_index_list list)

Remove all in list to this list.

Definition at line 20 of file run_index_list.cpp.

◆ Remove() [2/2]

void run_index_list::Remove ( const run_index_t r)
inline

Definition at line 66 of file run_index_list.h.

◆ rend()

auto run_index_list::rend ( ) const
inline

Definition at line 56 of file run_index_list.h.

◆ SetList()

void run_index_list::SetList ( const TString slist)

Set list from formatted string of [run.index] with or without commas:

"1, 1.1, 1.2, 1.3, 2, 2.1" "1 1.1 1.2 1.3 2 2.1" etc.

Definition at line 67 of file run_index_list.cpp.

◆ SetListSelection()

void run_index_list::SetListSelection ( const TString slist,
const run_index_list full_list 
)
Parameters
slista list of runfile names and/or run number ranges. Runfile names must contain '.', for the first file of a run use 'r.0'. Just 'r' represents the entire run, i.e. 'r.0', 'r.1', 'r.2', etc.
full_lista list of all existing runfiles

Examples of use:

Suppose that full_list contains the runfile list {1, 1.1, 1.2, 2, 3, 3.1}

slist="1 2 3"
slist="1,2,3"
slist="1-3"
slist="1,2-3"
=> fill list with {1, 1.1, 1.2, 2, 3, 3.1}
slist="1.0,3"
slist="1.0 3"
=> fill list with {1, 3, 3.1}
fill

Definition at line 106 of file run_index_list.cpp.

Friends And Related Function Documentation

◆ operator+

run_index_list operator+ ( const run_index_list A,
const run_index_list B 
)
friend

Definition at line 110 of file run_index_list.h.

◆ operator-

run_index_list operator- ( const run_index_list A,
const run_index_list B 
)
friend

Definition at line 103 of file run_index_list.h.

Member Data Documentation

◆ fRunList

std::set<run_index_t> run_index_list::fRunList
private

Definition at line 32 of file run_index_list.h.