ROOTTools
 
Loading...
Searching...
No Matches
ROOTTools::ThrObj< T > Class Template Reference

Class ThrObj can be used to simplify the work with TThreadedObject histograms in multithreaded applications. More...

#include <ThrObj.hpp>

Public Member Functions

 ThrObj (const std::string &name, const std::string &title, const int xNBins, const double xLow, const double xMax, const std::string &fileDirectory="")
 Constructor for TH1F, TH1D, and TH1L types.
 
 ThrObj (const std::string &name, const std::string &title, const int xNBins, const double xLow, const double xMax, const int yNBins, const double yMin, const double yMax, const std::string &fileDirectory="")
 Constructor for TH2F, TH2D, and TH2L types.
 
 ThrObj (const std::string &name, const std::string &title, const int xNBins, const double xLow, const double xMax, const int yNBins, const double yMin, const double yMax, const int zNBins, const double zMin, const double zMax, const std::string &fileDirectory="")
 Constructor for TH3F, TH3D, and TH3L types.
 
std::shared_ptr< T > Get ()
 Returns shared pointer to the object.
 

Protected Attributes

std::shared_ptr< T > objPtr
 Pointer to the TThreadedObject.
 

Detailed Description

template<typename T>
class ROOTTools::ThrObj< T >

Class ThrObj can be used to simplify the work with TThreadedObject histograms in multithreaded applications.

This class is especially useful when working with TTreeProcessorMT

Examples on usage will be added later

Constructor & Destructor Documentation

◆ ThrObj() [1/3]

template<typename T>
template ROOTTools::ThrObj< T >::ThrObj ( const std::string & name,
const std::string & title,
const int xNBins,
const double xLow,
const double xMax,
const std::string & fileDirectory = "" )

Constructor for TH1F, TH1D, and TH1L types.

Parameters
[in]namename of the histogram
[in]titletitle of the histogram
[in]xNBinsnumber of bins on X axis
[in]xLowlower edge of the first bin on X axis
[in]xUpupper edge of the last bin on X axis
[in]fileDirectorydirectory in which histogram will be written. If it does not exist it will be created

◆ ThrObj() [2/3]

template<typename T>
template ROOTTools::ThrObj< T >::ThrObj ( const std::string & name,
const std::string & title,
const int xNBins,
const double xLow,
const double xMax,
const int yNBins,
const double yMin,
const double yMax,
const std::string & fileDirectory = "" )

Constructor for TH2F, TH2D, and TH2L types.

Parameters
[in]namename of the histogram
[in]titletitle of the histogram
[in]xNBinsnumber of bins on X axis
[in]xLowlower edge of the first bin on X axis
[in]xUpupper edge of the last bin on X axis
[in]yNBinsnumber of bins on Y axis
[in]yLowlower edge of the first bin on Y axis
[in]yUpupper edge of the last bin on Y axis
[in]fileDirectorydirectory in which histogram will be written. If it does not exist it will be created

◆ ThrObj() [3/3]

template<typename T>
template ROOTTools::ThrObj< T >::ThrObj ( const std::string & name,
const std::string & title,
const int xNBins,
const double xLow,
const double xMax,
const int yNBins,
const double yMin,
const double yMax,
const int zNBins,
const double zMin,
const double zMax,
const std::string & fileDirectory = "" )

Constructor for TH3F, TH3D, and TH3L types.

Parameters
[in]namename of the histogram
[in]titletitle of the histogram
[in]xNBinsnumber of bins on X axis
[in]xLowlower edge of the first bin on X axis
[in]xUpupper edge of the last bin on X axis
[in]yNBinsnumber of bins on Y axis
[in]yLowlower edge of the first bin on Y axis
[in]yUpupper edge of the last bin on Y axis
[in]zNBinsnumber of bins on Z axis
[in]zLowlower edge of the first bin on Z axis
[in]zUpupper edge of the last bin on Z axis
[in]fileDirectorydirectory in which histogram will be written. If it does not exist it will be created

Member Function Documentation

◆ Get()

template<typename T>
template std::shared_ptr< TH3L > ROOTTools::ThrObj< T >::Get ( )

Returns shared pointer to the object.

This pointer is used to create one intance of TThreadedObject on a single thread for uninterrupted access to the object which makes writes safer and faster. Different instances from all threads can be merged after the process on each thread is finished

Member Data Documentation

◆ objPtr

template<typename T>
std::shared_ptr<T> ROOTTools::ThrObj< T >::objPtr
protected

Pointer to the TThreadedObject.


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