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

#include <R3BParRootFileIo.h>

Public Member Functions

 ParRootFileIo (bool is_input)
 ParRootFileIo (const ParRootFileIo &)=delete
 ParRootFileIo (ParRootFileIo &&)=delete
ParRootFileIooperator= (const ParRootFileIo &)=delete
ParRootFileIooperator= (ParRootFileIo &&)=delete
 ~ParRootFileIo () override
void open (std::string_view file_name, std::string_view file_option)
void open (const std::vector< std::string > &filenames, std::string_view file_option="read")
void open (std::unique_ptr< TFile > root_file)
bool read_parameter (FairParSet *par)
 Read a parameter from the input root file.
int write_parameter (FairParSet *par)
 Write the parameter to the output root file.
auto get_first_root_file () -> auto *
 ClassDefOverride (ParRootFileIo, 1)

Static Public Member Functions

static auto Input ()
 Factory method to create an instance for parameter input.
static auto Output ()
 Factory method to create an instance for parameter output.

Private Member Functions

auto read_parameter_from_run (FairParSet *par, bool is_ignored) -> bool
void readVersions (FairRtdbRun *current_par_run) override
auto check () -> bool override
void close () override
void print () override
void cd () override

Private Attributes

bool is_input_ = true
std::string run_name_
std::vector< std::unique_ptr< TFile > > root_files_

Detailed Description

Definition at line 15 of file R3BParRootFileIo.h.

Constructor & Destructor Documentation

◆ ParRootFileIo() [1/3]

R3B::ParRootFileIo::ParRootFileIo ( bool is_input)
explicit

Definition at line 39 of file R3BParRootFileIo.cxx.

◆ ParRootFileIo() [2/3]

R3B::ParRootFileIo::ParRootFileIo ( const ParRootFileIo & )
delete

◆ ParRootFileIo() [3/3]

R3B::ParRootFileIo::ParRootFileIo ( ParRootFileIo && )
delete

◆ ~ParRootFileIo()

R3B::ParRootFileIo::~ParRootFileIo ( )
overridedefault

Member Function Documentation

◆ cd()

void R3B::ParRootFileIo::cd ( )
overrideprivate

Definition at line 148 of file R3BParRootFileIo.cxx.

◆ check()

auto R3B::ParRootFileIo::check ( ) -> bool
overrideprivate

Definition at line 156 of file R3BParRootFileIo.cxx.

◆ ClassDefOverride()

R3B::ParRootFileIo::ClassDefOverride ( ParRootFileIo ,
1  )

◆ close()

void R3B::ParRootFileIo::close ( )
overrideprivate

Definition at line 185 of file R3BParRootFileIo.cxx.

◆ get_first_root_file()

auto R3B::ParRootFileIo::get_first_root_file ( ) -> auto*
inline

Definition at line 62 of file R3BParRootFileIo.h.

◆ Input()

auto R3B::ParRootFileIo::Input ( )
inlinestatic
Returns
Instance of the file io

Definition at line 53 of file R3BParRootFileIo.h.

◆ open() [1/3]

void R3B::ParRootFileIo::open ( const std::vector< std::string > & filenames,
std::string_view file_option = "read" )

Definition at line 75 of file R3BParRootFileIo.cxx.

◆ open() [2/3]

void R3B::ParRootFileIo::open ( std::string_view file_name,
std::string_view file_option )

Definition at line 70 of file R3BParRootFileIo.cxx.

◆ open() [3/3]

void R3B::ParRootFileIo::open ( std::unique_ptr< TFile > root_file)

Definition at line 46 of file R3BParRootFileIo.cxx.

◆ operator=() [1/2]

ParRootFileIo & R3B::ParRootFileIo::operator= ( const ParRootFileIo & )
delete

◆ operator=() [2/2]

ParRootFileIo & R3B::ParRootFileIo::operator= ( ParRootFileIo && )
delete

◆ Output()

auto R3B::ParRootFileIo::Output ( )
inlinestatic
Returns
Instance of the file io

Definition at line 60 of file R3BParRootFileIo.h.

◆ print()

void R3B::ParRootFileIo::print ( )
inlineoverrideprivate

Definition at line 76 of file R3BParRootFileIo.h.

◆ read_parameter()

bool R3B::ParRootFileIo::read_parameter ( FairParSet * par)

Reading the parameter from the input root file and store the values directly to the given parset. The input parset pointer must point to an already allocated parset.

Parameters
parParset variable to store the value.
Returns
true if the read operation is succeeded and false if not.

Definition at line 83 of file R3BParRootFileIo.cxx.

◆ read_parameter_from_run()

auto R3B::ParRootFileIo::read_parameter_from_run ( FairParSet * par,
bool is_ignored ) -> bool
private

Definition at line 116 of file R3BParRootFileIo.cxx.

◆ readVersions()

void R3B::ParRootFileIo::readVersions ( FairRtdbRun * current_par_run)
overrideprivate

Definition at line 146 of file R3BParRootFileIo.cxx.

◆ write_parameter()

int R3B::ParRootFileIo::write_parameter ( FairParSet * par)

Writing the parameter to the output root file and return the cycle number of the written parameter.

Parameters
parParameter to be written
Returns
The cycle number of the written parameter. -1 if the writting process failed.

Definition at line 93 of file R3BParRootFileIo.cxx.

Member Data Documentation

◆ is_input_

bool R3B::ParRootFileIo::is_input_ = true
private

Definition at line 65 of file R3BParRootFileIo.h.

◆ root_files_

std::vector<std::unique_ptr<TFile> > R3B::ParRootFileIo::root_files_
private

Definition at line 67 of file R3BParRootFileIo.h.

◆ run_name_

std::string R3B::ParRootFileIo::run_name_
private

Definition at line 66 of file R3BParRootFileIo.h.


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