Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Computing
cbmroot
Commits
c716cfee
Commit
c716cfee
authored
4 years ago
by
Administrator
Committed by
Florian Uhlig
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
MQ: Add gFile + gDirectory protection
parent
e6553509
No related branches found
No related tags found
1 merge request
!283
Core tfile glob point
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MQ/histoServer/CbmMqHistoServer.cxx
+10
-6
10 additions, 6 deletions
MQ/histoServer/CbmMqHistoServer.cxx
with
10 additions
and
6 deletions
MQ/histoServer/CbmMqHistoServer.cxx
+
10
−
6
View file @
c716cfee
...
@@ -388,11 +388,13 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) {
...
@@ -388,11 +388,13 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) {
}
}
bool
CbmMqHistoServer
::
SaveHistograms
()
{
bool
CbmMqHistoServer
::
SaveHistograms
()
{
/// Save old global file and folder pointer to avoid messing with FairRoot
TFile
*
oldFile
=
gFile
;
TDirectory
*
oldDir
=
gDirectory
;
/// (Re-)Create ROOT file to store the histos
/// (Re-)Create ROOT file to store the histos
TDirectory
*
oldDir
=
NULL
;
TFile
*
histoFile
=
nullptr
;
TFile
*
histoFile
=
NULL
;
// Store current directory position to allow restore later
oldDir
=
gDirectory
;
// open separate histo file in recreate mode
// open separate histo file in recreate mode
histoFile
=
new
TFile
(
fsHistoFileName
.
data
(),
"RECREATE"
);
histoFile
=
new
TFile
(
fsHistoFileName
.
data
(),
"RECREATE"
);
...
@@ -423,8 +425,10 @@ bool CbmMqHistoServer::SaveHistograms() {
...
@@ -423,8 +425,10 @@ bool CbmMqHistoServer::SaveHistograms() {
histoFile
->
cd
();
histoFile
->
cd
();
}
// for( UInt_t uHisto = 0; uHisto < fvCanvas.size(); ++uHisto )
}
// for( UInt_t uHisto = 0; uHisto < fvCanvas.size(); ++uHisto )
// Restore original directory position
/// Restore old global file and folder pointer to avoid messing with FairRoot
oldDir
->
cd
();
gFile
=
oldFile
;
gDirectory
=
oldDir
;
histoFile
->
Close
();
histoFile
->
Close
();
return
true
;
return
true
;
...
...
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