CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edm::InputFile Class Reference

#include <InputFile.h>

Inheritance diagram for edm::InputFile:

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)
 
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
 
void reportInputLumiSection (unsigned int run, unsigned int lumi) const
 
void reportInputRunNumber (unsigned int run) const
 
void SetCacheRead (TFileCacheRead *tfcr)
 
 ~InputFile ()
 

Private Attributes

boost::scoped_ptr< TFile > file_
 
std::string fileName_
 
JobReport::Token reportToken_
 

Detailed Description

Definition at line 21 of file InputFile.h.

Constructor & Destructor Documentation

edm::InputFile::InputFile ( char const *  fileName,
char const *  msg 
)
explicit

Definition at line 14 of file InputFile.cc.

References file_, and logFileAction().

16  file_.reset(TFile::Open(fileName));
17  if(!file_) {
18  return;
19  }
20  if(file_->IsZombie()) {
21  file_.reset();
22  return;
23  }
24  logFileAction(" Successfully opened file ", fileName);
25  }
JobReport::Token reportToken_
Definition: InputFile.h:43
void logFileAction(char const *msg, char const *fileName) const
Definition: InputFile.cc:83
std::string fileName_
Definition: InputFile.h:42
boost::scoped_ptr< TFile > file_
Definition: InputFile.h:41
edm::InputFile::~InputFile ( )

Definition at line 27 of file InputFile.cc.

References Close().

27  {
28  Close();
29  }
void Close()
Definition: InputFile.cc:68

Member Function Documentation

void edm::InputFile::Close ( )

Definition at line 68 of file InputFile.cc.

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

Referenced by ~InputFile().

68  {
69  if(file_->IsOpen()) {
70  file_->Close();
71  try {
72  logFileAction(" Closed file ", fileName_.c_str());
73  Service<JobReport> reportSvc;
74  reportSvc->inputFileClosed(reportToken_);
75  } catch(...) {
76  // If Close() called in a destructor after an exception throw, the services may no longer be active.
77  // Therefore, we catch any new exception.
78  }
79  }
80  }
JobReport::Token reportToken_
Definition: InputFile.h:43
void logFileAction(char const *msg, char const *fileName) const
Definition: InputFile.cc:83
std::string fileName_
Definition: InputFile.h:42
boost::scoped_ptr< TFile > file_
Definition: InputFile.h:41
void edm::InputFile::eventReadFromFile ( unsigned int  run,
unsigned int  event 
) const

Definition at line 50 of file InputFile.cc.

References reportToken_.

50  {
51  Service<JobReport> reportSvc;
52  reportSvc->eventReadFromFile(reportToken_, run, event);
53  }
JobReport::Token reportToken_
Definition: InputFile.h:43
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
TObject* edm::InputFile::Get ( char const *  name)
inline

Definition at line 36 of file InputFile.h.

References file_.

36 {return file_->Get(name);}
boost::scoped_ptr< TFile > file_
Definition: InputFile.h:41
TFileCacheRead* edm::InputFile::GetCacheRead ( ) const
inline

Definition at line 37 of file InputFile.h.

References file_.

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

37 {return file_->GetCacheRead();}
boost::scoped_ptr< TFile > file_
Definition: InputFile.h:41
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_.

37  {
38  Service<JobReport> reportSvc;
39  reportToken_ = reportSvc->inputFileOpened(fileName_,
40  logicalFileName,
41  std::string(),
42  inputType,
43  moduleName,
44  label,
45  fid,
46  branchNames);
47  }
const std::string & label
Definition: MVAComputer.cc:186
JobReport::Token reportToken_
Definition: InputFile.h:43
std::string fileName_
Definition: InputFile.h:42
list fid
Definition: NewTree.py:51
void edm::InputFile::logFileAction ( char const *  msg,
char const *  fileName 
) const

Definition at line 83 of file InputFile.cc.

References convertXMLtoSQLite_cfg::fileName, and edm::FlushMessageLog().

Referenced by Close(), and InputFile().

83  {
84  LogAbsolute("fileAction") << std::setprecision(0) << TimeOfDay() << msg << fileName;
86  }
void FlushMessageLog()
void edm::InputFile::reportInputLumiSection ( unsigned int  run,
unsigned int  lumi 
) const

Definition at line 62 of file InputFile.cc.

62  {
63  Service<JobReport> reportSvc;
64  reportSvc->reportInputLumiSection(run, lumi);
65  }
tuple lumi
Definition: fjr2json.py:41
void edm::InputFile::reportInputRunNumber ( unsigned int  run) const

Definition at line 56 of file InputFile.cc.

56  {
57  Service<JobReport> reportSvc;
58  reportSvc->reportInputRunNumber(run);
59  }
void edm::InputFile::SetCacheRead ( TFileCacheRead *  tfcr)
inline

Definition at line 38 of file InputFile.h.

References file_.

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

38 {file_->SetCacheRead(tfcr);}
boost::scoped_ptr< TFile > file_
Definition: InputFile.h:41

Member Data Documentation

boost::scoped_ptr<TFile> edm::InputFile::file_
private

Definition at line 41 of file InputFile.h.

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

std::string edm::InputFile::fileName_
private

Definition at line 42 of file InputFile.h.

Referenced by Close(), and inputFileOpened().

JobReport::Token edm::InputFile::reportToken_
private

Definition at line 43 of file InputFile.h.

Referenced by Close(), eventReadFromFile(), and inputFileOpened().