ATLAS Offline Software
Loading...
Searching...
No Matches
Directory.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
19
20
21#ifndef RESPLOT_DIRECTORY_H
22#define RESPLOT_DIRECTORY_H
23
24#include "TDirectory.h"
25#include "TH1.h"
26
27// #include "utils.h"
28
29namespace Resplot {
30
31class Directory {
32
33 public:
34
35 Directory() : m_HAddState(true), m_DAddState(true), m_Pop(NULL), m_Dir(NULL) { }
36 Directory(const std::string& n) :m_HAddState(true), m_DAddState(true), m_Pop(gDirectory), m_Dir(gDirectory->mkdir(n.c_str())) {
37 }
38
39 virtual ~Directory() { }
40
41 void push() { m_Pop = gDirectory; if (m_Dir) m_Dir->cd(); }
42 void pop() { if (m_Pop) m_Pop->cd(); }
43
44 void Write() { push(); m_Dir->Write(); pop(); }
45
46 void pwd() const { m_Dir->pwd(); }
47 TDirectory* cwd() { return m_Dir; }
48
49 void disable() { }
50 void restore() { }
51
52 protected:
53
56
57 TDirectory* m_Pop;
58 TDirectory* m_Dir;
59
60};
61
62}
63
64#endif /* RESPLOT_DIRECTORY_H */
65
66
67
68
69
70
71
72
73
74
virtual ~Directory()
Definition Directory.h:39
Directory(const std::string &n)
Definition Directory.h:36
void pwd() const
Definition Directory.h:46
TDirectory * m_Pop
Definition Directory.h:57
TDirectory * cwd()
Definition Directory.h:47
TDirectory * m_Dir
Definition Directory.h:58