CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InputFile.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_InputFile_h
2 #define IOPool_Input_InputFile_h
3 
4 /*----------------------------------------------------------------------
5 
6 Holder for an input TFile.
7 ----------------------------------------------------------------------*/
11 
12 #include "TFile.h"
13 
14 #include <map>
15 #include <string>
16 #include <vector>
17 
18 class TObject;
19 
20 namespace edm {
21  class InputFile {
22  public:
23  explicit InputFile(char const* fileName, char const* msg, InputType inputType);
24  ~InputFile();
25 
26  InputFile(InputFile const&) = delete; // Disallow copying and moving
27  InputFile& operator=(InputFile const&) = delete; // Disallow copying and moving
28 
29  void Close();
30  void inputFileOpened(std::string const& logicalFileName,
31  std::string const& inputType,
32  std::string const& moduleName,
33  std::string const& label,
34  std::string const& fid,
35  std::vector<std::string> const& branchNames);
36  void eventReadFromFile() const;
37  void reportInputRunNumber(unsigned int run) const;
38  void reportInputLumiSection(unsigned int run, unsigned int lumi) const;
39  static void reportSkippedFile(std::string const& fileName, std::string const& logicalFileName);
40  static void reportFallbackAttempt(std::string const& pfn, std::string const& logicalFileName, std::string const& errorMessage);
41  // reportReadBranches is a per job report, rather than per file report.
42  // Nevertheless, it is defined here for convenience.
43  static void reportReadBranches();
44  static void reportReadBranch(InputType inputType, std::string const& branchname);
45 
46  TObject* Get(char const* name) {return file_->Get(name);}
47  TFileCacheRead* GetCacheRead() const {return file_->GetCacheRead();}
48  void SetCacheRead(TFileCacheRead* tfcr) {file_->SetCacheRead(tfcr, NULL, TFile::kDoNotDisconnect);}
49  void logFileAction(char const* msg, char const* fileName) const;
50  private:
55  };
56 }
57 #endif
void Close()
Definition: InputFile.cc:99
InputType
Definition: InputType.h:5
InputFile & operator=(InputFile const &)=delete
JobReport::Token reportToken_
Definition: InputFile.h:53
InputType inputType_
Definition: InputFile.h:54
tuple lumi
Definition: fjr2json.py:35
TFileCacheRead * GetCacheRead() const
Definition: InputFile.h:47
#define NULL
Definition: scimark2.h:8
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)
Definition: InputFile.cc:51
static void reportReadBranch(InputType inputType, std::string const &branchname)
Definition: InputFile.cc:126
void reportInputRunNumber(unsigned int run) const
Definition: InputFile.cc:75
void logFileAction(char const *msg, char const *fileName) const
Definition: InputFile.cc:114
static void reportFallbackAttempt(std::string const &pfn, std::string const &logicalFileName, std::string const &errorMessage)
Definition: InputFile.cc:93
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
static void reportReadBranches()
Definition: InputFile.cc:120
void reportInputLumiSection(unsigned int run, unsigned int lumi) const
Definition: InputFile.cc:81
static void reportSkippedFile(std::string const &fileName, std::string const &logicalFileName)
Definition: InputFile.cc:87
edm::propagate_const< std::unique_ptr< TFile > > file_
Definition: InputFile.h:51
std::size_t Token
Definition: JobReport.h:107
std::string fileName_
Definition: InputFile.h:52
TObject * Get(char const *name)
Definition: InputFile.h:46
InputFile(char const *fileName, char const *msg, InputType inputType)
Definition: InputFile.cc:18
void SetCacheRead(TFileCacheRead *tfcr)
Definition: InputFile.h:48
void eventReadFromFile() const
Definition: InputFile.cc:69