#include </builds/gaudi/Gaudi/GaudiSvc/src/FileMgr/RootFileHandler.h>
Definition at line 26 of file RootFileHandler.h.
◆ RootFileHandler()
Definition at line 19 of file RootFileHandler.cpp.
19 :
m_log( msg,
"RootFileHandler" ) {
20
21 if ( !gROOT ) {
static TROOT
root(
"root",
"ROOT I/O" ); }
22 m_level =
msg->outputLevel(
"RootFileHandler" );
23}
◆ closeRootFile()
| Io::close_t RootFileHandler::closeRootFile |
( |
void * | ptr | ) |
|
Definition at line 85 of file RootFileHandler.cpp.
85 {
86
88
89 if ( !ptr ) {
91 return -1;
92 }
93
94 TFile* tf = static_cast<TFile*>( ptr );
95
96 try {
97 tf->Close();
98 } catch ( const std::exception& Exception ) {
101 return -1;
102 } catch ( ... ) {
104 return -1;
105 }
106
107 return 0;
108}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
◆ openRootFile()
| Io::open_t RootFileHandler::openRootFile |
( |
const std::string & | n, |
|
|
const Io::IoFlags & | f, |
|
|
const std::string & | desc, |
|
|
Io::Fd & | fd, |
|
|
void *& | ptr ) |
Definition at line 27 of file RootFileHandler.cpp.
28 {
29
31
34
35 ptr = nullptr;
37
38 std::string opt;
39
41 opt = "READ";
43 opt = "NEW";
45 opt = "RECREATE";
47 opt = "UPDATE";
48 } else {
50 return 1;
51 }
52
53 std::unique_ptr<TFile> tf;
54
55 try {
56 tf.reset( TFile::Open(
n.c_str(), opt.c_str() ) );
57 } catch ( const std::exception& Exception ) {
59 <<
" file for reading: " <<
Exception.what() << std::endl
60 <<
" -> file probably corrupt." <<
endmsg;
61 return 1;
62 } catch ( ... ) {
64 return 1;
65 }
66
67 if ( !tf || !tf->IsOpen() ) {
68 m_log <<
MSG::ERROR <<
"Unable to open ROOT file \"" <<
n <<
"\" with options \"" << opt <<
"\"" <<
endmsg;
69
70 tf.reset();
71 return 1;
72 }
73
75
76 ptr = tf.release();
77
79
80 return 0;
81}
◆ reopenRootFile()
◆ m_level
| int RootFileHandler::m_level |
|
private |
◆ m_log
The documentation for this class was generated from the following files: