CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TFileService.h
Go to the documentation of this file.
1 #ifndef UtilAlgos_TFileService_h
2 #define UtilAlgos_TFileService_h
3 /* \class TFileService
4  *
5  * \author Luca Lista, INFN
6  *
7  */
9 
10 namespace edm {
11  class ActivityRegistry;
12  class ParameterSet;
13  class ModuleDescription;
14 }
15 
16 class TFileService : public TFileDirectory {
17 public:
21  ~TFileService();
23  TFile & file() const { return * file_; }
24 
26  void afterBeginJob();
27 
28 private:
30  TFile * file_;
31  std::string fileName_;
34  // set current directory according to module name and prepair to create directory
35  void setDirectoryName( const edm::ModuleDescription & desc );
36 };
37 
38 namespace edm {
39  namespace service {
40  // This function is needed so that there will be only on instance
41  // of this service per process when "subprocesses" are being used.
42  inline
44  return true;
45  }
46  }
47 }
48 
49 #endif
bool isProcessWideService(TFileService const *)
Definition: TFileService.h:43
TFileService(const edm::ParameterSet &, edm::ActivityRegistry &)
constructor
Definition: TFileService.cc:13
TFile * file_
pointer to opened TFile
Definition: TFileService.h:30
std::string fileName_
Definition: TFileService.h:31
void setDirectoryName(const edm::ModuleDescription &desc)
Definition: TFileService.cc:40
TFile & file() const
return opened TFile
Definition: TFileService.h:23
~TFileService()
destructor
Definition: TFileService.cc:33
bool fileNameRecorded_
Definition: TFileService.h:32
bool closeFileFast_
Definition: TFileService.h:33
void afterBeginJob()
Hook for writing info into JR.
Definition: TFileService.cc:45