00001
00002
00003 #ifndef XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H
00004 #define XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H
00005
00006
00007 #include <TDirectory.h>
00008
00009 namespace xAOD {
00010
00023 class TDirectoryReset {
00024
00025 public:
00027 TDirectoryReset( ::TDirectory* dir = gDirectory ) : m_dir( dir ) {}
00029 ~TDirectoryReset() { if( m_dir ) m_dir->cd(); }
00030
00031 private:
00033 ::TDirectory* m_dir;
00034
00035 };
00036
00037 }
00038
00039 #endif // XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H