ATLAS Offline Software
TDirectoryReset.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: TDirectoryReset.h 597264 2014-05-15 15:52:37Z krasznaa $
8 #ifndef XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H
9 #define XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H
10 
11 // ROOT include(s):
12 #include <TDirectory.h>
13 
14 namespace xAOD {
15 
29 
30  public:
32  TDirectoryReset( ::TDirectory* dir = gDirectory ) : m_dir( dir ) {}
34  ~TDirectoryReset() { if( m_dir ) m_dir->cd(); }
35 
36  private:
38  ::TDirectory* m_dir;
39 
40  }; // class TDirectoryReset
41 
42 } // namespace xAOD
43 
44 #endif // XAODROOTACCESS_TOOLS_TDIRECTORYRESET_H
xAOD::TDirectoryReset::TDirectoryReset
TDirectoryReset(::TDirectory *dir=gDirectory)
Constructor with the current directory.
Definition: TDirectoryReset.h:32
xAOD::TDirectoryReset
Helper class for making sure the current directory is preserved.
Definition: TDirectoryReset.h:28
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
beamspotman.dir
string dir
Definition: beamspotman.py:623
xAOD::TDirectoryReset::m_dir
::TDirectory * m_dir
The directory that we need to return to.
Definition: TDirectoryReset.h:38
xAOD::TDirectoryReset::~TDirectoryReset
~TDirectoryReset()
Destructor.
Definition: TDirectoryReset.h:34