#include <RootFile_service.h>
This Service centralizes creation of a root file for histograms
◆ RootFile_service()
◆ ~RootFile_service()
| RootFile_service::~RootFile_service |
( |
| ) |
|
|
inlineoverride |
◆ acquire_services()
| void RootFile_service::acquire_services |
( |
JServiceLocator * |
| ) |
|
|
inlineoverride |
◆ CloseHistFile()
| void RootFile_service::CloseHistFile |
( |
| ) |
|
|
inline |
Close the histogram file. If no histogram file was opened, then this does nothing.
This should generally never be called by anything other than the destructor so that it is automatically closed when the service is destructed at the end of processing. This is only here for use in execptional circumstances like the program is suffering a fatal crash and we want to try and save the work by closing the file cleanly.
◆ GetHistFile()
| TDirectory * RootFile_service::GetHistFile |
( |
bool |
create_if_needed = true | ) |
|
|
inline |
This will return a pointer to the top-level directory of the common output root file for histograms. If create_if_needed is true and the root file has not already been created, then one will be created. If create_if_needed is false, the pointer to the existing file will be returned or nullptr if it does not already exist.
NOTE: This should only be called by a thread already holding the global root lock, e.g.:
auto rootfile_service = japp->GetService<RootFile_service>(); auto globalRootLock = japp->GetService<JGlobalRootLock>(); globalRootLock->acquire_write_lock(); auto rootfile = rootfile_service->GetHistFile(); globalWriteLock->release_lock();
- Parameters
-
| create_if_needed | create file if not already created |
- Returns
The documentation for this class was generated from the following file: