Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Davide Di Croce
athena
Commits
7825376a
Commit
7825376a
authored
1 year ago
by
Marcin Nowak
Committed by
Julien Maurer
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Isolate file opening so it does not change gDirectory
Isolate file opening so it does not change gDirectory
parent
a85601be
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Database/APR/RootCollection/src/RootCollection.cpp
+13
-18
13 additions, 18 deletions
Database/APR/RootCollection/src/RootCollection.cpp
with
13 additions
and
18 deletions
Database/APR/RootCollection/src/RootCollection.cpp
+
13
−
18
View file @
7825376a
/*
Copyright (C) 2002-202
2
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-202
3
CERN for the benefit of the ATLAS collaboration
*/
#include
"RootCollection.h"
...
...
@@ -92,7 +92,7 @@ namespace pool {
}
m_poolOut
<<
coral
::
Info
<<
"File "
<<
m_fileName
<<
" opened in "
<<
method
<<
coral
::
MessageStream
::
endmsg
;
m_tree
->
SetDirectory
(
gDirectory
);
m_tree
->
SetDirectory
(
m_file
);
m_schemaEditor
->
writeSchema
();
}
}
...
...
@@ -279,8 +279,7 @@ namespace pool {
}
}
TDirectory
*
dirsav
=
gDirectory
;
TDirectory
::
TContext
dirctxt
;
if
(
m_session
==
0
||
m_mode
==
ICollection
::
READ
||
m_mode
==
ICollection
::
UPDATE
)
{
// first step: Try to open the file
m_poolOut
<<
coral
::
Info
<<
"Opening Collection File "
<<
m_fileName
<<
" in mode: "
...
...
@@ -301,20 +300,16 @@ namespace pool {
root_mode
=
"UPDATE"
;
io_mode
=
(
Io
::
WRITE
|
Io
::
APPEND
);
}
if
(
m_fileMgr
==
0
)
{
IService
*
is
(
0
);
if
(
Gaudi
::
svcLocator
()
->
getService
(
"FileMgr"
,
is
,
true
).
isFailure
())
{
m_poolOut
<<
coral
::
Error
<<
"unable to get the FileMgr, will not manage TFiles"
<<
coral
::
MessageStream
::
endmsg
;
}
else
{
m_fileMgr
=
dynamic_cast
<
IFileMgr
*>
(
is
);
}
if
(
m_fileMgr
==
0
)
{
IService
*
is
(
0
);
if
(
Gaudi
::
svcLocator
()
->
getService
(
"FileMgr"
,
is
,
true
).
isFailure
())
{
m_poolOut
<<
coral
::
Error
<<
"unable to get the FileMgr, will not manage TFiles"
<<
coral
::
MessageStream
::
endmsg
;
}
else
{
m_fileMgr
=
dynamic_cast
<
IFileMgr
*>
(
is
);
}
}
// FIXME: hack to avoid issue with setting up RecExCommon links
if
(
m_fileMgr
!=
0
&&
m_fileMgr
->
hasHandler
(
Io
::
ROOT
).
isFailure
())
{
...
...
@@ -395,7 +390,7 @@ namespace pool {
m_tree
->
SetAutoFlush
(
TTREE_AUTO_FLUSH
);
if
(
m_session
&&
m_mode
==
ICollection
::
UPDATE
)
{
m_tree
->
SetDirectory
(
dirsav
);
m_tree
->
SetDirectory
(
0
);
int
n
(
0
);
if
(
m_fileMgr
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment