ATLAS Offline Software
Directory.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
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 
29 class Directory {
30 
31  public:
32 
33  Directory() : m_HAddState(true), m_DAddState(true), m_Pop(NULL), m_Dir(NULL) { }
34  Directory(const std::string& n) :m_HAddState(true), m_DAddState(true), m_Pop(gDirectory), m_Dir(gDirectory->mkdir(n.c_str())) {
35  }
36 
37  virtual ~Directory() { }
38 
39  void push() { m_Pop = gDirectory; if (m_Dir) m_Dir->cd(); }
40  void pop() { if (m_Pop) m_Pop->cd(); }
41 
42  void Write() { push(); m_Dir->Write(); pop(); }
43 
44  void pwd() const { m_Dir->pwd(); }
45  TDirectory* cwd() { return m_Dir; }
46 
47  void disable() { }
48  void restore() { }
49 
50  protected:
51 
54 
55  TDirectory* m_Pop;
56  TDirectory* m_Dir;
57 
58 };
59 
60 
61 
62 #endif /* RESPLOT_DIRECTORY_H */
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
Directory::pwd
void pwd() const
Definition: Directory.h:44
Directory::m_HAddState
bool m_HAddState
Definition: Directory.h:52
Directory::Directory
Directory(const std::string &n)
Definition: Directory.h:34
plot_material.mkdir
def mkdir(path, recursive=True)
Definition: plot_material.py:16
Directory
Definition: Directory.h:29
Directory::m_DAddState
bool m_DAddState
Definition: Directory.h:53
Directory::Write
void Write()
Definition: Directory.h:42
Directory::Directory
Directory()
Definition: Directory.h:33
Directory::push
void push()
Definition: Directory.h:39
Directory::pop
void pop()
Definition: Directory.h:40
Directory::disable
void disable()
Definition: Directory.h:47
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
beamspotman.n
n
Definition: beamspotman.py:731
Directory::m_Pop
TDirectory * m_Pop
Definition: Directory.h:55
Directory::cwd
TDirectory * cwd()
Definition: Directory.h:45
Directory::~Directory
virtual ~Directory()
Definition: Directory.h:37
Directory::restore
void restore()
Definition: Directory.h:48
Directory::m_Dir
TDirectory * m_Dir
Definition: Directory.h:56