CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
fwlite::TFileService Class Reference

#include <TFileService.h>

Inheritance diagram for fwlite::TFileService:
TFileDirectory

Public Member Functions

TFile & file () const
 return opened TFile More...
 
 TFileService (const std::string &fileName)
 constructor More...
 
 TFileService (TFile *aFile)
 constructor with external TFile More...
 
 ~TFileService ()
 destructor More...
 
- Public Member Functions inherited from TFileDirectory
bool cd () const
 
std::string fullPath () const
 return the full path of the stored histograms More...
 
TDirectory * getBareDirectory (const std::string &subdir="") const
 
template<typename T >
TgetObject (const std::string &objname, const std::string &subdir="")
 
template<typename T , typename... Args>
Tmake (const Args &...args) const
 make new ROOT object More...
 
TFileDirectory mkdir (const std::string &dir, const std::string &descr="")
 create a new subdirectory More...
 
 TFileDirectory ()
 
virtual ~TFileDirectory ()
 descructor More...
 

Private Attributes

TFile * file_
 pointer to opened TFile More...
 
std::string fileName_
 

Detailed Description

Definition at line 12 of file TFileService.h.

Constructor & Destructor Documentation

TFileService::TFileService ( const std::string &  fileName)

constructor

Definition at line 7 of file TFileService.cc.

7  :
8  TFileDirectory("", "", TFile::Open(fileName.c_str() , "RECREATE"), ""),
11 {
12 }
TFile * file_
pointer to opened TFile
Definition: TFileService.h:28
std::string fileName_
Definition: TFileService.h:29
TFileService::TFileService ( TFile *  aFile)

constructor with external TFile

Definition at line 15 of file TFileService.cc.

15  :
16  TFileDirectory("", "", aFile, ""),
18  fileName_(aFile->GetName())
19 {
20 }
TFile * file_
pointer to opened TFile
Definition: TFileService.h:28
std::string fileName_
Definition: TFileService.h:29
TFileService::~TFileService ( )

destructor

Definition at line 22 of file TFileService.cc.

References file_.

22  {
23  file_->Write();
24  file_->Close();
25  delete file_;
26 }
TFile * file_
pointer to opened TFile
Definition: TFileService.h:28

Member Function Documentation

TFile& fwlite::TFileService::file ( ) const
inline

return opened TFile

Definition at line 24 of file TFileService.h.

References file_.

24 { return * file_; }
TFile * file_
pointer to opened TFile
Definition: TFileService.h:28

Member Data Documentation

TFile* fwlite::TFileService::file_
private

pointer to opened TFile

Definition at line 28 of file TFileService.h.

Referenced by file(), and ~TFileService().

std::string fwlite::TFileService::fileName_
private

Definition at line 29 of file TFileService.h.