CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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 "Rtypes.h"
00011 #include "TFile.h"
00012 #include "TObject.h"
00013 
00014 #include "boost/scoped_ptr.hpp"
00015 #include "boost/utility.hpp"
00016 
00017 #include <string>
00018 #include <vector>
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 
00036     TObject* Get(char const* name) {return file_->Get(name);}
00037     TFileCacheRead* GetCacheRead() const {return file_->GetCacheRead();}
00038     void SetCacheRead(TFileCacheRead* tfcr) {file_->SetCacheRead(tfcr);}
00039     void logFileAction(char const* msg, char const* fileName) const;
00040   private:
00041     boost::scoped_ptr<TFile> file_;
00042     std::string fileName_;
00043     JobReport::Token reportToken_;
00044   }; 
00045 }
00046 #endif