CMS 3D CMS Logo

Public Member Functions | Static 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)
 InputFile (InputFile const &)
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
InputFileoperator= (InputFile const &)
void reportInputLumiSection (unsigned int run, unsigned int lumi) const
void reportInputRunNumber (unsigned int run) const
void SetCacheRead (TFileCacheRead *tfcr)
 ~InputFile ()

Static Public Member Functions

static void reportFallbackAttempt (std::string const &pfn, std::string const &logicalFileName, std::string const &errorMessage)
static void reportReadBranch (std::string const &branchname)
static void reportReadBranches ()
static void reportSkippedFile (std::string const &fileName, std::string const &logicalFileName)

Private Attributes

std::unique_ptr< TFile > file_
std::string fileName_
JobReport::Token reportToken_

Detailed Description

Definition at line 19 of file InputFile.h.


Constructor & Destructor Documentation

data refman pasoursint CMSSW_5_3_9_patch3 src IOPool Input src InputFile cc edm::InputFile::InputFile ( char const *  fileName,
char const *  msg 
) [explicit]

Definition at line 14 of file InputFile.cc.

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

edm::InputFile::~InputFile ( )

Definition at line 27 of file InputFile.cc.

edm::InputFile::InputFile ( InputFile const &  )

Member Function Documentation

void edm::InputFile::Close ( )

Definition at line 80 of file InputFile.cc.

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

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

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

Definition at line 50 of file InputFile.cc.

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

Definition at line 44 of file InputFile.h.

References file_.

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

Definition at line 45 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 32 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 95 of file InputFile.cc.

Referenced by Close().

InputFile& edm::InputFile::operator= ( InputFile const &  )
void edm::InputFile::reportFallbackAttempt ( std::string const &  pfn,
std::string const &  logicalFileName,
std::string const &  errorMessage 
) [static]

Definition at line 74 of file InputFile.cc.

Referenced by edm::RootInputFileSequence::initFile().

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

Definition at line 62 of file InputFile.cc.

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

Definition at line 56 of file InputFile.cc.

void edm::InputFile::reportReadBranch ( std::string const &  branchname) [static]

Definition at line 107 of file InputFile.cc.

void edm::InputFile::reportReadBranches ( ) [static]

Definition at line 101 of file InputFile.cc.

void edm::InputFile::reportSkippedFile ( std::string const &  fileName,
std::string const &  logicalFileName 
) [static]

Definition at line 68 of file InputFile.cc.

Referenced by edm::RootInputFileSequence::initFile().

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

Definition at line 46 of file InputFile.h.

References file_.

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

{file_->SetCacheRead(tfcr);}

Member Data Documentation

std::unique_ptr<TFile> edm::InputFile::file_ [private]

Definition at line 49 of file InputFile.h.

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

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

Definition at line 50 of file InputFile.h.

Referenced by Close(), and inputFileOpened().

Definition at line 51 of file InputFile.h.

Referenced by Close(), and inputFileOpened().