00001 #ifndef UtilAlgos_TFileService_h 00002 #define UtilAlgos_TFileService_h 00003 /* \class TFileService 00004 * 00005 * \author Luca Lista, INFN 00006 * 00007 */ 00008 #include "PhysicsTools/UtilAlgos/interface/TFileDirectory.h" 00009 00010 namespace edm { 00011 class ActivityRegistry; 00012 class ParameterSet; 00013 class ModuleDescription; 00014 } 00015 00016 class TFileService : public TFileDirectory { 00017 public: 00019 TFileService(const edm::ParameterSet &, edm::ActivityRegistry &); 00021 ~TFileService(); 00023 TFile & file() const { return * file_; } 00024 00026 void afterBeginJob(); 00027 00028 private: 00030 TFile * file_; 00031 std::string fileName_; 00032 bool fileNameRecorded_; 00033 bool closeFileFast_; 00034 // set current directory according to module name and prepair to create directory 00035 void setDirectoryName( const edm::ModuleDescription & desc ); 00036 }; 00037 00038 #endif