ROOTTools
 
Loading...
Searching...
No Matches
ThrObj.hpp File Reference

Contains useful set of containers to simplify and/or speed up the process of writing multithreaded applications with ROOT TThreadedObject<T> objects. More...

#include <vector>
#include <array>
#include <string>
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "ROOT/TThreadedObject.hxx"

Go to the source code of this file.

Classes

class  ROOTTools::ThrObj< T >
 Class ThrObj can be used to simplify the work with TThreadedObject histograms in multithreaded applications. More...
 

Namespaces

namespace  ROOTTools
 
namespace  ThrObjHolder
 container that stores histograms of ThrObj class
 
namespace  ROOTTools::ThrObjHolder
 

Functions

void ROOTTools::ThrObjHolder::Write ()
 Call this function to merge and write histograms in the current open TDirectory (i.e. gDirectory)
 
void ROOTTools::ThrObjHolder::Write (const std::string &outputFileName)
 Call this function to merge and write histograms in the specified file which will be overwritten if it already exists, otherwise it will be created.
 
std::shared_ptr< TH1F > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH1F > *hist, const std::string &directory)
 Not intended for user. Adds TH1F histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH2F > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH2F > *hist, const std::string &directory)
 Not intended for user. Adds TH2F histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH3F > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH3F > *hist, const std::string &directory)
 Not intended for user. Adds TH3F histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH1D > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH1D > *hist, const std::string &directory)
 Not intended for user. Adds TH1D histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH2D > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH2D > *hist, const std::string &directory)
 Not intended for user. Adds TH2D histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH3D > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH3D > *hist, const std::string &directory)
 Not intended for user. Adds TH3D histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH1L > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH1L > *hist, const std::string &directory)
 Not intended for user. Adds TH1L histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH2L > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH2L > *hist, const std::string &directory)
 Not intended for user. Adds TH2L histogram to the corresponding container; this function is called in ThrObj constructor.
 
std::shared_ptr< TH3L > ROOTTools::ThrObjHolder::AddHistogram (ROOT::TThreadedObject< TH3L > *hist, const std::string &directory)
 Not intended for user. Adds TH3L histogram to the corresponding container; this function is called in ThrObj constructo.
 
void ROOTTools::ThrObjHolder::Clear ()
 Not intended for user. Not intended for user. Clears containers with histogram after histograms were merged and written.
 
void ROOTTools::ThrObjHolder::AddTFileDirectory (const std::string &directory, const int thrObjIndex)
 Not intended for user. Adds index of ThrObj to the directory index. This function is called in AddHistogram function.
 

Variables

std::vector< std::unique_ptr< ROOT::TThreadedObject< TH1F > > > ROOTTools::ThrObjHolder::containerTH1F
 container for TH1F histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH2F > > > ROOTTools::ThrObjHolder::containerTH2F
 container for TH2F histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH3F > > > ROOTTools::ThrObjHolder::containerTH3F
 container for TH3F histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH1D > > > ROOTTools::ThrObjHolder::containerTH1D
 container for TH1D histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH2D > > > ROOTTools::ThrObjHolder::containerTH2D
 container for TH2D histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH3D > > > ROOTTools::ThrObjHolder::containerTH3D
 container for TH3D histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH1L > > > ROOTTools::ThrObjHolder::containerTH1L
 container for TH1L histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH2L > > > ROOTTools::ThrObjHolder::containerTH2L
 container for TH2L histograms
 
std::vector< std::unique_ptr< ROOT::TThreadedObject< TH3L > > > ROOTTools::ThrObjHolder::containerTH3L
 container for TH3L histograms
 
std::vector< std::string > ROOTTools::ThrObjHolder::containerTFileDir
 containers of TFile directory names
 
std::array< std::vector< int >, 9 > ROOTTools::ThrObjHolder::containerTFileDirIndex
 

Detailed Description

Contains useful set of containers to simplify and/or speed up the process of writing multithreaded applications with ROOT TThreadedObject<T> objects.

In order to use these containers libThrObj.so must be loaded

This file is a part of a project CppTools (https://github.com/Sergeyir/ROOTTools).

Author
Sergei Antsupov (antsu.nosp@m.pov0.nosp@m.124@g.nosp@m.mail.nosp@m..com)