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.
10public:
11 SuppressTH1GDirectory() : prev_status(TH1::AddDirectoryStatus()) { TH1::AddDirectory(false); }
16
17 ~SuppressTH1GDirectory() { TH1::AddDirectory(prev_status); }
18
19private:
21};
22
23#endif
SuppressTH1GDirectory & operator=(SuppressTH1GDirectory &&)=delete
SuppressTH1GDirectory(SuppressTH1GDirectory &&)=delete
SuppressTH1GDirectory & operator=(const SuppressTH1GDirectory &)=delete
SuppressTH1GDirectory(const SuppressTH1GDirectory &)=delete