R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3B::DataMonitor Class Reference

#include <R3BDataMonitor.h>

Public Member Functions

 DataMonitor ()=default
 
template<typename... Args>
auto create_canvas (std::string_view canvas_name, std::string_view canvas_title, Args &&... args) -> DataMonitorCanvas &
 
auto add_hist (std::unique_ptr< TH1 > hist) -> TH1 *
 
template<typename Hist, typename... Args>
auto add_hist (std::string_view histName, std::string_view histTitle, Args &&... args) -> Hist *
 
template<typename GraphType>
auto add_graph (std::string_view graph_name, std::unique_ptr< GraphType > graph) -> GraphType *
 
template<typename... Args>
auto add_graph (std::string_view graph_name, Args &&... args) -> TGraph *
 
auto get (const std::string &histName) -> TH1 *
 
auto get_canvas (const std::string &histName) -> DataMonitorCanvas &
 
void save_to_sink (std::string_view folderName="", FairSink *sinkFile=FairRun::Instance() ->GetSink())
 
void save_to_file (std::string_view filename="")
 
void draw_canvases ()
 
void register_canvases (FairRun *run)
 
void reset_all_hists ()
 

Private Member Functions

void write_all (TDirectory *dir)
 

Static Private Member Functions

static auto get_hist_dir (FairSink *sinkFile) -> TDirectory *
 
template<typename ElementType, typename ContainerType>
static auto add_to_map (std::unique_ptr< ElementType > element, ContainerType &container) -> ElementType *
 
template<typename ElementType, typename ContainerType>
static auto add_to_vector (std::unique_ptr< ElementType > element, ContainerType &container) -> ElementType *
 

Private Attributes

std::string save_filename_ { "histograms_save" }
 
std::map< std::string, std::unique_ptr< TH1 > > histograms_
 
std::map< std::string, std::unique_ptr< TGraph > > graphs_
 
std::map< std::string, DataMonitorCanvascanvases_
 

Detailed Description

Definition at line 37 of file R3BDataMonitor.h.

Constructor & Destructor Documentation

◆ DataMonitor()

R3B::DataMonitor::DataMonitor ( )
default

Member Function Documentation

◆ add_graph() [1/2]

template<typename... Args>
auto R3B::DataMonitor::add_graph ( std::string_view graph_name,
Args &&... args ) -> TGraph*
inline

Definition at line 61 of file R3BDataMonitor.h.

◆ add_graph() [2/2]

template<typename GraphType>
auto R3B::DataMonitor::add_graph ( std::string_view graph_name,
std::unique_ptr< GraphType > graph ) -> GraphType*
inline

Definition at line 54 of file R3BDataMonitor.h.

◆ add_hist() [1/2]

template<typename Hist, typename... Args>
auto R3B::DataMonitor::add_hist ( std::string_view histName,
std::string_view histTitle,
Args &&... args ) -> Hist*

Definition at line 114 of file R3BDataMonitor.h.

◆ add_hist() [2/2]

auto R3B::DataMonitor::add_hist ( std::unique_ptr< TH1 > hist) -> TH1*
inline

Definition at line 48 of file R3BDataMonitor.h.

◆ add_to_map()

template<typename ElementType, typename ContainerType>
auto R3B::DataMonitor::add_to_map ( std::unique_ptr< ElementType > element,
ContainerType & container ) -> ElementType*
staticprivate

Definition at line 100 of file R3BDataMonitor.h.

◆ add_to_vector()

template<typename ElementType, typename ContainerType>
static auto R3B::DataMonitor::add_to_vector ( std::unique_ptr< ElementType > element,
ContainerType & container ) -> ElementType*
inlinestaticprivate

Definition at line 91 of file R3BDataMonitor.h.

◆ create_canvas()

template<typename... Args>
auto R3B::DataMonitor::create_canvas ( std::string_view canvas_name,
std::string_view canvas_title,
Args &&... args ) -> DataMonitorCanvas&

Definition at line 121 of file R3BDataMonitor.h.

◆ draw_canvases()

void R3B::DataMonitor::draw_canvases ( )

Definition at line 99 of file R3BDataMonitor.cxx.

◆ get()

auto R3B::DataMonitor::get ( const std::string & histName) -> TH1*

Definition at line 47 of file R3BDataMonitor.cxx.

◆ get_canvas()

auto R3B::DataMonitor::get_canvas ( const std::string & histName) -> DataMonitorCanvas&

Definition at line 56 of file R3BDataMonitor.cxx.

◆ get_hist_dir()

auto R3B::DataMonitor::get_hist_dir ( FairSink * sinkFile) -> TDirectory*
staticprivate

Definition at line 83 of file R3BDataMonitor.cxx.

◆ register_canvases()

void R3B::DataMonitor::register_canvases ( FairRun * run)

Definition at line 107 of file R3BDataMonitor.cxx.

◆ reset_all_hists()

void R3B::DataMonitor::reset_all_hists ( )

Definition at line 118 of file R3BDataMonitor.cxx.

◆ save_to_file()

void R3B::DataMonitor::save_to_file ( std::string_view filename = "")

Definition at line 126 of file R3BDataMonitor.cxx.

◆ save_to_sink()

void R3B::DataMonitor::save_to_sink ( std::string_view folderName = "",
FairSink * sinkFile = FairRun::Instance()->GetSink() )

Definition at line 65 of file R3BDataMonitor.cxx.

◆ write_all()

void R3B::DataMonitor::write_all ( TDirectory * dir)
private

Definition at line 137 of file R3BDataMonitor.cxx.

Member Data Documentation

◆ canvases_

std::map<std::string, DataMonitorCanvas> R3B::DataMonitor::canvases_
private

Definition at line 84 of file R3BDataMonitor.h.

◆ graphs_

std::map<std::string, std::unique_ptr<TGraph> > R3B::DataMonitor::graphs_
private

Definition at line 83 of file R3BDataMonitor.h.

◆ histograms_

std::map<std::string, std::unique_ptr<TH1> > R3B::DataMonitor::histograms_
private

Definition at line 82 of file R3BDataMonitor.h.

◆ save_filename_

std::string R3B::DataMonitor::save_filename_ { "histograms_save" }
private

Definition at line 81 of file R3BDataMonitor.h.


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