CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::InputFile Class Reference

#include <InputFile.h>

List of all members.

Public Member Functions

void Close ()
void eventReadFromFile (unsigned int run, unsigned int event) const
TObject * Get (char const *name)
TFileCacheRead * GetCacheRead () const
 InputFile (char const *fileName, char const *msg)
void inputFileOpened (std::string const &logicalFileName, std::string const &inputType, std::string const &moduleName, std::string const &label, std::string const &fid, std::vector< std::string > const &branchNames)
void logFileAction (char const *msg, char const *fileName) const
void reportInputLumiSection (unsigned int run, unsigned int lumi) const
void reportInputRunNumber (unsigned int run) const
void SetCacheRead (TFileCacheRead *tfcr)
 ~InputFile ()

Private Attributes

boost::scoped_ptr< TFile > file_
std::string fileName_
JobReport::Token reportToken_

Detailed Description

Definition at line 21 of file InputFile.h.


Constructor & Destructor Documentation

data doxygen doxygen gen CMSSW_4_2_8 src IOPool Input src InputFile cc edm::InputFile::InputFile ( char const *  fileName,
char const *  msg 
) [explicit]

Definition at line 15 of file InputFile.cc.

               { 
      return;
    }
    if(file_->IsZombie()) { 
      file_.reset();
      return;
    }
    logFileAction("  Successfully opened file ", fileName);
  }

edm::InputFile::~InputFile ( )

Definition at line 28 of file InputFile.cc.


Member Function Documentation

void edm::InputFile::Close ( )

Definition at line 69 of file InputFile.cc.

References file_, fileName_, logFileAction(), and reportToken_.

                        {
      file_->Close();
      try {
        logFileAction("  Closed file ", fileName_.c_str());
        Service<JobReport> reportSvc;
        reportSvc->inputFileClosed(reportToken_);
      } catch(...) {
        // If Close() called in a destructor after an exception throw, the services may no longer be active.
        // Therefore, we catch any new exception.
      }
    }
  }

void edm::InputFile::eventReadFromFile ( unsigned int  run,
unsigned int  event 
) const

Definition at line 51 of file InputFile.cc.

TObject* edm::InputFile::Get ( char const *  name) [inline]

Definition at line 36 of file InputFile.h.

References file_.

{return file_->Get(name);}
TFileCacheRead* edm::InputFile::GetCacheRead ( ) const [inline]

Definition at line 37 of file InputFile.h.

References file_.

Referenced by edm::roottree::trainCache().

{return file_->GetCacheRead();}
void edm::InputFile::inputFileOpened ( std::string const &  logicalFileName,
std::string const &  inputType,
std::string const &  moduleName,
std::string const &  label,
std::string const &  fid,
std::vector< std::string > const &  branchNames 
)

Definition at line 33 of file InputFile.cc.

References fileName_, and reportToken_.

                                                                      {
    Service<JobReport> reportSvc;
    reportToken_ = reportSvc->inputFileOpened(fileName_,
                                              logicalFileName,
                                              std::string(),
                                              inputType,
                                              moduleName,
                                              label,
                                              fid,
                                              branchNames);
  }

void edm::InputFile::logFileAction ( char const *  msg,
char const *  fileName 
) const

Definition at line 84 of file InputFile.cc.

Referenced by Close().

void edm::InputFile::reportInputLumiSection ( unsigned int  run,
unsigned int  lumi 
) const

Definition at line 63 of file InputFile.cc.

void edm::InputFile::reportInputRunNumber ( unsigned int  run) const

Definition at line 57 of file InputFile.cc.

void edm::InputFile::SetCacheRead ( TFileCacheRead *  tfcr) [inline]

Definition at line 38 of file InputFile.h.

References file_.

Referenced by edm::roottree::trainCache().

{file_->SetCacheRead(tfcr);}

Member Data Documentation

boost::scoped_ptr<TFile> edm::InputFile::file_ [private]

Definition at line 41 of file InputFile.h.

Referenced by Close(), Get(), GetCacheRead(), and SetCacheRead().

std::string edm::InputFile::fileName_ [private]

Definition at line 42 of file InputFile.h.

Referenced by Close(), and inputFileOpened().

Definition at line 43 of file InputFile.h.

Referenced by Close(), and inputFileOpened().