ATLAS Offline Software
Loading...
Searching...
No Matches
Monitored::HistogramDef Struct Reference

the internal class used to keep parsed Filler properties More...

#include <HistogramDef.h>

Collaboration diagram for Monitored::HistogramDef:

Public Types

enum class  RunMode { Online , Offline , Invalid }
enum class  RunPeriod { Run , LowStat , Lumiblock , Invalid }

Static Public Member Functions

static const HistogramDef parse (const std::string &histogramDefinition)
 Parses histogram defintion from json data.

Public Attributes

std::vector< std::string > name
 names of monitored variables
std::string alias
 unique alias for THistSvc
std::string type
 class name
std::string path
 booking path
std::string title
 title of the histogram
std::string opt
 options
std::string tld
 top level directory (below THistSvc stream)
std::string weight
 name of weight variable
std::string cutMask
 variable that defines whether event is accepted
std::string convention
 path naming convention (e.g.
RunMode runmode = RunMode::Invalid
 online or offline
RunPeriod runperiod = RunPeriod::Invalid
 rebook period in offline monitoring
bool Sumw2 {false}
 store sum of squares of weights
int kLBNHistoryDepth {0}
 length of lb history
bool kAddBinsDynamically {false}
 add new bins outside the existing range
bool kRebinAxes {false}
 increase the axis range without adding new bins
bool kCanRebin {false}
 allow all axes to be rebinned
bool kVec {false}
 add content to each bin from each element of a vector
bool kVecUO {false}
 add content to each bin from vector, including overflow/underflow
bool kCumulative {false}
 fill bin of monitored object's value, and every bin below it
int kLive {0}
 fill only the last N lumiblocks in y_vs_lb plots
bool kAlwaysCreate {false}
 always create this histogram, even if never filled
std::string xvar
 name of x variable
int xbins {0}
 number of y bins
float xmin {0}
 x axis minimum
float xmax {0}
 x axis maximum
std::vector< std::string > xlabels
 labels for x axis
std::vector< double > xarray
 array of x bin edges
std::string yvar
 name of y variable
int ybins {0}
 number of y bins
float ymin {0}
 y axis minimum
float ymax {0}
 y axis maximum
std::vector< std::string > ylabels
 labels for y axis
std::vector< double > yarray
 array of y bin edges
std::string zvar
 name of z variable
int zbins {0}
 number of z bins
float zmin {0}
 z axis minimum
float zmax {0}
 z axis maximum
std::vector< std::string > zlabels
 labels for z axis
std::string treeDef
 defines output TTree of monitored quantities
std::string merge
bool ok {false}
 good declaration: parsing or copying successful

Detailed Description

the internal class used to keep parsed Filler properties

Definition at line 15 of file HistogramDef.h.

Member Enumeration Documentation

◆ RunMode

Enumerator
Online 

monitoring data online

Offline 

monitoring data offline

Invalid 

monitoring mode not specified

Definition at line 27 of file HistogramDef.h.

27 {
28 Online,
29 Offline,
30 Invalid,
31 };

◆ RunPeriod

Enumerator
Run 

rebook histogram after each run

LowStat 

rebook histogram after every 20 lumiblocks

Lumiblock 

rebook histogram after every 1 lumiblock

Invalid 

rebook period not specified

Definition at line 33 of file HistogramDef.h.

33 {
34 Run,
35 LowStat,
36 Lumiblock,
37 Invalid,
38 };

Member Function Documentation

◆ parse()

const HistogramDef HistogramDef::parse ( const std::string & histogramDefinition)
static

Parses histogram defintion from json data.

Parameters
histogramDefinitionA string contains histogram definition to parse
Returns
HistogramDef Object that contains the parsed histogram definition

Definition at line 11 of file HistogramDef.cxx.

11 {
12 const json& setting = json::parse(histogramDefinition);
13 HistogramDef result;
14
15 result.name = setting["allvars"].get<std::vector<std::string>>();
16 result.alias = static_cast<std::string>(setting["alias"]);
17 result.type = static_cast<std::string>(setting["type"]);
18 result.path = static_cast<std::string>(setting["path"]);
19 result.title = static_cast<std::string>(setting["title"]);
20 result.weight = static_cast<std::string>(setting["weight"]);
21 result.cutMask = static_cast<std::string>(setting["cutMask"]);
22
23 result.convention = static_cast<std::string>(setting["convention"]);
24 size_t offline = result.convention.find("OFFLINE");
25 if (offline != std::string::npos) {
26 result.runmode = RunMode::Offline;
27 std::string durationString = result.convention.substr(offline);
28 if (durationString.find("run") != std::string::npos) {
29 result.runperiod = RunPeriod::Run;
30 } else if (durationString.find("lowStat") != std::string::npos) {
31 result.runperiod = RunPeriod::LowStat;
32 } else {
33 result.runperiod = RunPeriod::Lumiblock;
34 }
35 } else {
36 result.runmode = RunMode::Online;
37 }
38
39 // all histogram options arising from 'opt'
40 result.Sumw2 = setting["Sumw2"];
41 result.kLBNHistoryDepth = setting["kLBNHistoryDepth"];
42 result.kAddBinsDynamically = setting["kAddBinsDynamically"];
43 result.kRebinAxes = setting["kRebinAxes"];
44 result.kCanRebin = setting["kCanRebin"];
45 result.kVec = setting["kVec"];
46 result.kVecUO = setting["kVecUO"];
47 result.kCumulative = setting["kCumulative"];
48 result.kLive = setting["kLive"];
49 result.kAlwaysCreate = setting["kAlwaysCreate"];
50
51 result.xvar = static_cast<std::string>(setting["xvar"]);
52 result.xbins = setting["xbins"];
53 result.xmin = setting["xmin"];
54 result.xmax = setting["xmax"];
55 result.xlabels = setting["xlabels"].get<std::vector<std::string>>();
56 result.xarray = setting["xarray"].get<std::vector<double>>();
57
58 result.yvar = static_cast<std::string>(setting["yvar"]);
59 result.ybins = setting["ybins"];
60 result.ymin = setting["ymin"];
61 result.ymax = setting["ymax"];
62 result.ylabels = setting["ylabels"].get<std::vector<std::string>>();
63 result.yarray = setting["yarray"].get<std::vector<double>>();
64
65 result.zvar = static_cast<std::string>(setting["zvar"]);
66 result.zbins = setting["zbins"];
67 result.zmin = setting["zmin"];
68 result.zmax = setting["zmax"];
69 result.zlabels = setting["zlabels"].get<std::vector<std::string>>();
70
71 result.merge = static_cast<std::string>(setting["merge"]);
72
73 result.treeDef = static_cast<std::string>(setting["treeDef"]);
74
75 result.ok = true;
76 return result;
77}
nlohmann::json json
@ Online
monitoring data online
@ Offline
monitoring data offline
@ Lumiblock
rebook histogram after every 1 lumiblock
@ LowStat
rebook histogram after every 20 lumiblocks
@ Run
rebook histogram after each run

Member Data Documentation

◆ alias

std::string Monitored::HistogramDef::alias

unique alias for THistSvc

Definition at line 17 of file HistogramDef.h.

◆ convention

std::string Monitored::HistogramDef::convention

path naming convention (e.g.

OFFLINE:LowStat)

Definition at line 39 of file HistogramDef.h.

◆ cutMask

std::string Monitored::HistogramDef::cutMask

variable that defines whether event is accepted

Definition at line 24 of file HistogramDef.h.

◆ kAddBinsDynamically

bool Monitored::HistogramDef::kAddBinsDynamically {false}

add new bins outside the existing range

Definition at line 45 of file HistogramDef.h.

45{false};

◆ kAlwaysCreate

bool Monitored::HistogramDef::kAlwaysCreate {false}

always create this histogram, even if never filled

Definition at line 52 of file HistogramDef.h.

52{false};

◆ kCanRebin

bool Monitored::HistogramDef::kCanRebin {false}

allow all axes to be rebinned

Definition at line 47 of file HistogramDef.h.

47{false};

◆ kCumulative

bool Monitored::HistogramDef::kCumulative {false}

fill bin of monitored object's value, and every bin below it

Definition at line 50 of file HistogramDef.h.

50{false};

◆ kLBNHistoryDepth

int Monitored::HistogramDef::kLBNHistoryDepth {0}

length of lb history

Definition at line 44 of file HistogramDef.h.

44{0};

◆ kLive

int Monitored::HistogramDef::kLive {0}

fill only the last N lumiblocks in y_vs_lb plots

Definition at line 51 of file HistogramDef.h.

51{0};

◆ kRebinAxes

bool Monitored::HistogramDef::kRebinAxes {false}

increase the axis range without adding new bins

Definition at line 46 of file HistogramDef.h.

46{false};

◆ kVec

bool Monitored::HistogramDef::kVec {false}

add content to each bin from each element of a vector

Definition at line 48 of file HistogramDef.h.

48{false};

◆ kVecUO

bool Monitored::HistogramDef::kVecUO {false}

add content to each bin from vector, including overflow/underflow

Definition at line 49 of file HistogramDef.h.

49{false};

◆ merge

std::string Monitored::HistogramDef::merge

Definition at line 75 of file HistogramDef.h.

◆ name

std::vector<std::string> Monitored::HistogramDef::name

names of monitored variables

Definition at line 16 of file HistogramDef.h.

◆ ok

bool Monitored::HistogramDef::ok {false}

good declaration: parsing or copying successful

Definition at line 77 of file HistogramDef.h.

77{false};

◆ opt

std::string Monitored::HistogramDef::opt

options

Definition at line 21 of file HistogramDef.h.

◆ path

std::string Monitored::HistogramDef::path

booking path

Definition at line 19 of file HistogramDef.h.

◆ runmode

RunMode Monitored::HistogramDef::runmode = RunMode::Invalid

online or offline

Definition at line 40 of file HistogramDef.h.

◆ runperiod

RunPeriod Monitored::HistogramDef::runperiod = RunPeriod::Invalid

rebook period in offline monitoring

Definition at line 41 of file HistogramDef.h.

◆ Sumw2

bool Monitored::HistogramDef::Sumw2 {false}

store sum of squares of weights

Definition at line 43 of file HistogramDef.h.

43{false};

◆ title

std::string Monitored::HistogramDef::title

title of the histogram

Definition at line 20 of file HistogramDef.h.

◆ tld

std::string Monitored::HistogramDef::tld

top level directory (below THistSvc stream)

Definition at line 22 of file HistogramDef.h.

◆ treeDef

std::string Monitored::HistogramDef::treeDef

defines output TTree of monitored quantities

Definition at line 74 of file HistogramDef.h.

◆ type

std::string Monitored::HistogramDef::type

class name

Definition at line 18 of file HistogramDef.h.

◆ weight

std::string Monitored::HistogramDef::weight

name of weight variable

Definition at line 23 of file HistogramDef.h.

◆ xarray

std::vector<double> Monitored::HistogramDef::xarray

array of x bin edges

Definition at line 59 of file HistogramDef.h.

◆ xbins

int Monitored::HistogramDef::xbins {0}

number of y bins

Definition at line 55 of file HistogramDef.h.

55{0};

◆ xlabels

std::vector<std::string> Monitored::HistogramDef::xlabels

labels for x axis

Definition at line 58 of file HistogramDef.h.

◆ xmax

float Monitored::HistogramDef::xmax {0}

x axis maximum

Definition at line 57 of file HistogramDef.h.

57{0};

◆ xmin

float Monitored::HistogramDef::xmin {0}

x axis minimum

Definition at line 56 of file HistogramDef.h.

56{0};

◆ xvar

std::string Monitored::HistogramDef::xvar

name of x variable

Definition at line 54 of file HistogramDef.h.

◆ yarray

std::vector<double> Monitored::HistogramDef::yarray

array of y bin edges

Definition at line 66 of file HistogramDef.h.

◆ ybins

int Monitored::HistogramDef::ybins {0}

number of y bins

Definition at line 62 of file HistogramDef.h.

62{0};

◆ ylabels

std::vector<std::string> Monitored::HistogramDef::ylabels

labels for y axis

Definition at line 65 of file HistogramDef.h.

◆ ymax

float Monitored::HistogramDef::ymax {0}

y axis maximum

Definition at line 64 of file HistogramDef.h.

64{0};

◆ ymin

float Monitored::HistogramDef::ymin {0}

y axis minimum

Definition at line 63 of file HistogramDef.h.

63{0};

◆ yvar

std::string Monitored::HistogramDef::yvar

name of y variable

Definition at line 61 of file HistogramDef.h.

◆ zbins

int Monitored::HistogramDef::zbins {0}

number of z bins

Definition at line 69 of file HistogramDef.h.

69{0};

◆ zlabels

std::vector<std::string> Monitored::HistogramDef::zlabels

labels for z axis

Definition at line 72 of file HistogramDef.h.

◆ zmax

float Monitored::HistogramDef::zmax {0}

z axis maximum

Definition at line 71 of file HistogramDef.h.

71{0};

◆ zmin

float Monitored::HistogramDef::zmin {0}

z axis minimum

Definition at line 70 of file HistogramDef.h.

70{0};

◆ zvar

std::string Monitored::HistogramDef::zvar

name of z variable

Definition at line 68 of file HistogramDef.h.


The documentation for this struct was generated from the following files: