GRSISort
"v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
SuppressTH1GDirectory.h
Go to the documentation of this file.
1
#ifndef SUPPRESSTH1GDIRECTORY_H
2
#define SUPPRESSTH1GDIRECTORY_H
3
4
#include "TH1.h"
5
6
// Little helper class for temporarily preventing TH1* from being added to gDirectory.
7
// On destruction, returns auto-add status to same state as it was before.
8
// Not really thread-safe. At all. Hopefully better than the alternative.
9
class
SuppressTH1GDirectory
{
10
public
:
11
SuppressTH1GDirectory
() :
prev_status
(TH1::AddDirectoryStatus()) { TH1::AddDirectory(
false
); }
12
SuppressTH1GDirectory
(
const
SuppressTH1GDirectory
&) =
delete
;
13
SuppressTH1GDirectory
(
SuppressTH1GDirectory
&&) =
delete
;
14
SuppressTH1GDirectory
&
operator=
(
const
SuppressTH1GDirectory
&) =
delete
;
15
SuppressTH1GDirectory
&
operator=
(
SuppressTH1GDirectory
&&) =
delete
;
16
17
~SuppressTH1GDirectory
() { TH1::AddDirectory(
prev_status
); }
18
19
private
:
20
bool
prev_status
;
21
};
22
23
#endif
SuppressTH1GDirectory
Definition
SuppressTH1GDirectory.h:9
SuppressTH1GDirectory::operator=
SuppressTH1GDirectory & operator=(SuppressTH1GDirectory &&)=delete
SuppressTH1GDirectory::SuppressTH1GDirectory
SuppressTH1GDirectory(SuppressTH1GDirectory &&)=delete
SuppressTH1GDirectory::~SuppressTH1GDirectory
~SuppressTH1GDirectory()
Definition
SuppressTH1GDirectory.h:17
SuppressTH1GDirectory::operator=
SuppressTH1GDirectory & operator=(const SuppressTH1GDirectory &)=delete
SuppressTH1GDirectory::prev_status
bool prev_status
Definition
SuppressTH1GDirectory.h:20
SuppressTH1GDirectory::SuppressTH1GDirectory
SuppressTH1GDirectory()
Definition
SuppressTH1GDirectory.h:11
SuppressTH1GDirectory::SuppressTH1GDirectory
SuppressTH1GDirectory(const SuppressTH1GDirectory &)=delete
include
SuppressTH1GDirectory.h
GRSISort ("v4.0.0.5") Reference Guide Generated on Mon Feb 3 2025 16:38:04.