1 #include "run_index_list.h"
9 void run_index_list::Add(
const run_index_list& list)
12 for (
auto& r : list)
Add(r);
20 void run_index_list::Remove(
const run_index_list& list)
23 for (
auto& r : list) Remove(r);
37 TString run_index_list::GetList(
bool no_commas)
const
48 TString separator = (no_commas ?
" " :
", ");
49 for (
auto& r : fRunList) {
52 list +=
r.as_string();
67 void run_index_list::SetList(
const TString& slist)
79 auto n =
b.Next(kTRUE);
106 void run_index_list::SetListSelection(
const TString& slist,
const run_index_list& full_list)
131 while (!_list.End()) {
133 if (
n.Contains(
"-")) {
136 for (
auto run : nl) {
137 runs_all_files.
Add(run);
140 else if (!
n.Contains(
".")) {
141 runs_all_files.
Add(
n.Atoi());
145 n.ReplaceAll(
".0",
".-1");
149 if (!runs_all_files.
IsEmpty()) {
151 for (
auto& run : full_list) {
152 if (runs_all_files.
Contains(run.run()))
181 auto tmp = GetList();
184 if (tmp.Length() > maxlen) {
185 Int_t len_left = maxlen - 3;
186 Int_t len_start = len_left / 2;
187 Int_t len_end = len_left - len_start;
188 TString tmp2 = tmp(0, len_start);
190 tmp2 += tmp2(tmp2.
Length() - len_end, tmp2.
Length() - 1);
203 void run_index_list::Inter(
const run_index_list& list)
210 for (
auto& t : tmp) {
211 if (list.Contains(t))
Add(t);
224 for (
auto& r : *
this)
l.Add(
r.run());
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
void Add(Int_t)
Add value 'n' to the list.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Specifies a runfile according to run number and file index ,.
Double_t Max(Double_t a, Double_t b)