CMS 3D CMS Logo

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,
41  std::string const& logicalFileName,
42  std::string const& errorMessage);
43  // reportReadBranches is a per job report, rather than per file report.
44  // Nevertheless, it is defined here for convenience.
45  static void reportReadBranches();
46  static void reportReadBranch(InputType inputType, std::string const& branchname);
47 
48  TObject* Get(char const* name) { return file_->Get(name); }
49  TFileCacheRead* GetCacheRead() const { return file_->GetCacheRead(); }
50  void SetCacheRead(TFileCacheRead* tfcr) { file_->SetCacheRead(tfcr, nullptr, TFile::kDoNotDisconnect); }
51  void logFileAction(char const* msg, char const* fileName) const;
52 
53  private:
58  };
59 } // namespace edm
60 #endif
edm::InputFile::logFileAction
void logFileAction(char const *msg, char const *fileName) const
Definition: InputFile.cc:101
propagate_const.h
edm::InputFile::operator=
InputFile & operator=(InputFile const &)=delete
edm::InputFile::fileName_
std::string fileName_
Definition: InputFile.h:55
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::JobReport::Token
std::size_t Token
Definition: JobReport.h:106
edm::moduleName
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::InputFile::reportReadBranch
static void reportReadBranch(InputType inputType, std::string const &branchname)
Definition: InputFile.cc:111
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::InputFile
Definition: InputFile.h:21
edm::InputType
InputType
Definition: InputType.h:5
edm::propagate_const
Definition: propagate_const.h:32
edm::InputFile::reportReadBranches
static void reportReadBranches()
Definition: InputFile.cc:106
edm::InputFile::reportSkippedFile
static void reportSkippedFile(std::string const &fileName, std::string const &logicalFileName)
Definition: InputFile.cc:75
edm::InputFile::inputType_
InputType inputType_
Definition: InputFile.h:57
InputType.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::InputFile::file_
edm::propagate_const< std::unique_ptr< TFile > > file_
Definition: InputFile.h:54
edm::InputFile::Get
TObject * Get(char const *name)
Definition: InputFile.h:48
edm::InputFile::reportInputRunNumber
void reportInputRunNumber(unsigned int run) const
Definition: InputFile.cc:65
edm::InputFile::GetCacheRead
TFileCacheRead * GetCacheRead() const
Definition: InputFile.h:49
edm::InputFile::reportInputLumiSection
void reportInputLumiSection(unsigned int run, unsigned int lumi) const
Definition: InputFile.cc:70
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::InputFile::InputFile
InputFile(char const *fileName, char const *msg, InputType inputType)
Definition: InputFile.cc:18
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::InputFile::reportFallbackAttempt
static void reportFallbackAttempt(std::string const &pfn, std::string const &logicalFileName, std::string const &errorMessage)
Definition: InputFile.cc:80
JobReport.h
edm::InputFile::eventReadFromFile
void eventReadFromFile() const
Definition: InputFile.cc:60
edm::InputFile::inputFileOpened
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:49
lumi
Definition: LumiSectionData.h:20
edm::InputFile::Close
void Close()
Definition: InputFile.cc:87
edm::InputFile::SetCacheRead
void SetCacheRead(TFileCacheRead *tfcr)
Definition: InputFile.h:50
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::InputFile::reportToken_
JobReport::Token reportToken_
Definition: InputFile.h:56
edm::InputFile::~InputFile
~InputFile()
Definition: InputFile.cc:47