CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/IOPool/Input/src/InputFile.h

Go to the documentation of this file.
00001 #ifndef IOPool_Input_InputFile_h
00002 #define IOPool_Input_InputFile_h
00003 
00004 /*----------------------------------------------------------------------
00005 
00006 Holder for an input TFile.
00007 ----------------------------------------------------------------------*/
00008 #include "FWCore/MessageLogger/interface/JobReport.h"
00009 
00010 #include "TFile.h"
00011 
00012 #include "boost/scoped_ptr.hpp"
00013 #include "boost/utility.hpp"
00014 
00015 #include <string>
00016 #include <vector>
00017 
00018 class TObject;
00019 
00020 namespace edm {
00021   class InputFile : private boost::noncopyable {
00022   public:  
00023     explicit InputFile(char const* fileName, char const* msg);
00024     ~InputFile();
00025     void Close();
00026     void inputFileOpened(std::string const& logicalFileName,
00027                          std::string const& inputType,
00028                          std::string const& moduleName,
00029                          std::string const& label,
00030                          std::string const& fid,
00031                          std::vector<std::string> const& branchNames);    
00032     void eventReadFromFile(unsigned int run, unsigned int event) const;
00033     void reportInputRunNumber(unsigned int run) const;
00034     void reportInputLumiSection(unsigned int run, unsigned int lumi) const;
00035     static void reportSkippedFile(std::string const& fileName, std::string const& logicalFileName);
00036 
00037     TObject* Get(char const* name) {return file_->Get(name);}
00038     TFileCacheRead* GetCacheRead() const {return file_->GetCacheRead();}
00039     void SetCacheRead(TFileCacheRead* tfcr) {file_->SetCacheRead(tfcr);}
00040     void logFileAction(char const* msg, char const* fileName) const;
00041   private:
00042     boost::scoped_ptr<TFile> file_;
00043     std::string fileName_;
00044     JobReport::Token reportToken_;
00045   }; 
00046 }
00047 #endif