Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
06f749ae
Commit
06f749ae
authored
Jul 04, 2018
by
Simon Spannagel
Browse files
Make histogram file unique pointer
parent
0b14a837
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core/Analysis.cpp
View file @
06f749ae
...
...
@@ -145,7 +145,7 @@ void Analysis::load_modules() {
// Create histogram output file
std
::
string
histogramFile
=
global_config
.
getPath
(
"histogramFile"
);
m_histogramFile
=
new
TFile
(
histogramFile
.
c_str
(),
"RECREATE"
);
m_histogramFile
=
std
::
make_unique
<
TFile
>
(
histogramFile
.
c_str
(),
"RECREATE"
);
m_directory
=
m_histogramFile
->
mkdir
(
"corryvreckan"
);
if
(
m_histogramFile
->
IsZombie
())
{
throw
RuntimeError
(
"Cannot create main ROOT file "
+
histogramFile
);
...
...
src/core/Analysis.hpp
View file @
06f749ae
...
...
@@ -66,7 +66,7 @@ namespace corryvreckan {
// Log file if specified
std
::
ofstream
log_file_
;
TFile
*
m_histogramFile
;
std
::
unique_ptr
<
TFile
>
m_histogramFile
;
TDirectory
*
m_directory
;
int
m_events
;
int
m_tracks
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment