Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hallc_replay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Melanie Cardona
hallc_replay
Commits
2aca96d0
Commit
2aca96d0
authored
Mar 6, 2017
by
Jure Bericic
Browse files
Options
Downloads
Patches
Plain Diff
Added a root file output when pdf is produced.
Fixed kpp online script to work with root6.
parent
a7180abb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
onlineGUI/Macros/kpp_analysis.C
+39
-39
39 additions, 39 deletions
onlineGUI/Macros/kpp_analysis.C
onlineGUI/onlineGUI_v1.2.1/online.C
+136
-103
136 additions, 103 deletions
onlineGUI/onlineGUI_v1.2.1/online.C
with
175 additions
and
142 deletions
onlineGUI/Macros/kpp_analysis.C
+
39
−
39
View file @
2aca96d0
...
...
@@ -649,19 +649,19 @@ void UserScript() {
}
// UserScript function
void
kpp_analysis
(
TString
histname
)
{
cout
<<
histname
<<
endl
;
// Grab the histo
TH1F
*
h1d
;
TH2F
*
h2d
;
h1d
=
dynamic_cast
<
TH1F
*>
gDirectory
->
Get
(
histname
);
h2d
=
dynamic_cast
<
TH2F
*>
gDirectory
->
Get
(
histname
);
h1d
=
dynamic_cast
<
TH1F
*>
(
gDirectory
->
Get
(
histname
)
)
;
h2d
=
dynamic_cast
<
TH2F
*>
(
gDirectory
->
Get
(
histname
)
)
;
// Grab histo directly if it does not already exist
if
(
!
h1d
&&
!
h2d
)
{
UserScript
();
h1d
=
(
TH1F
*
)
gDirectory
->
Get
(
histname
);
h2d
=
(
TH2F
*
)
gDirectory
->
Get
(
histname
);
h1d
=
(
TH1F
*
)
(
gDirectory
->
Get
(
histname
)
)
;
h2d
=
(
TH2F
*
)
(
gDirectory
->
Get
(
histname
)
)
;
// Throw error
if
(
!
h1d
||
!
h2d
)
{
cout
<<
"User histogram "
<<
histname
<<
" not found"
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
onlineGUI/onlineGUI_v1.2.1/online.C
+
136
−
103
View file @
2aca96d0
...
...
@@ -1886,7 +1886,40 @@ void OnlineGUI::PrintPages() {
}
if
(
!
useJPG
)
fCanvas
->
Print
(
filename
+
"]"
);
//
TFile
*
hroot
=
new
TFile
(
filename
+
"_hist.root"
,
"recreate"
);
cout
<<
"Writing histograms to root file '"
<<
filename
<<
"'."
<<
endl
;
filename
.
Resize
(
filename
.
Last
(
'.'
));
filename
+=
".root"
;
TFile
*
hroot
=
new
TFile
(
filename
,
"recreate"
);
UInt_t
pageCount
=
fConfig
->
GetPageCount
();
for
(
UInt_t
iPage
=
0
;
iPage
<
pageCount
;
++
iPage
)
{
UInt_t
drawCount
=
fConfig
->
GetDrawCount
(
iPage
);
for
(
UInt_t
iDraw
=
0
;
iDraw
<
drawCount
;
++
iDraw
)
{
TString
macro
=
fConfig
->
GetDrawCommand
(
iPage
,
iDraw
).
macro
;
if
(
macro
!=
""
)
{
TString
histName
=
macro
.
Remove
(
0
,
macro
.
First
(
'\"'
)
+
1
);
histName
.
Resize
(
macro
.
First
(
'\"'
));
fRootFile
.
RootFile
->
cd
();
TH1F
*
h1f
=
dynamic_cast
<
TH1F
*>
(
gDirectory
->
Get
(
histName
));
TH2F
*
h2f
=
dynamic_cast
<
TH2F
*>
(
gDirectory
->
Get
(
histName
));
hroot
->
cd
();
if
(
h1f
)
h1f
->
Write
();
else
if
(
h2f
)
h2f
->
Write
();
else
cout
<<
histName
<<
" not found!"
<<
endl
;
}
}
}
hroot
->
Write
();
hroot
->
Close
();
delete
hroot
;
cout
<<
"Root file '"
<<
filename
<<
"' done."
<<
endl
;
//
#ifdef STANDALONE
gApplication
->
Terminate
();
...
...
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