Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
datasets
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
EIC
datasets
Commits
aa7fb727
Commit
aa7fb727
authored
4 years ago
by
Tom Polakovic
Browse files
Options
Downloads
Patches
Plain Diff
histogram
parent
8cb66cfb
No related branches found
No related tags found
1 merge request
!1
Forward ions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
forward_ions_reader.cxx
+44
-0
44 additions, 0 deletions
forward_ions_reader.cxx
results/forward_ions_reader.pdf
+0
-0
0 additions, 0 deletions
results/forward_ions_reader.pdf
results/forward_ions_reader.png
+0
-0
0 additions, 0 deletions
results/forward_ions_reader.png
with
44 additions
and
0 deletions
forward_ions_reader.cxx
0 → 100644
+
44
−
0
View file @
aa7fb727
#include
"HepMC3/GenEvent.h"
#include
"HepMC3/ReaderAscii.h"
#include
"HepMC3/WriterAscii.h"
#include
"HepMC3/Print.h"
#include
"TH1F.h"
#include
<iostream>
using
namespace
HepMC3
;
void
forward_ions_reader
(){
//-------------------------------------
ReaderAscii
hepmc_input
(
"data/forward_ions.hepmc"
);
int
events_parsed
=
0
;
GenEvent
evt
(
Units
::
GEV
,
Units
::
MM
);
TH1F
*
h_neutron_energy
=
new
TH1F
(
"eta"
,
"; eta"
,
100
,
0
,
10
);
while
(
!
hepmc_input
.
failed
())
{
// Read event from input file
hepmc_input
.
read_event
(
evt
);
// If reading failed - exit loop
if
(
hepmc_input
.
failed
()
)
break
;
for
(
const
auto
&
v
:
evt
.
vertices
()
)
{
for
(
const
auto
&
p
:
v
->
particles_out
()
)
{
if
(
p
->
pid
()
==
2212
)
{
h_neutron_energy
->
Fill
(
p
->
momentum
().
eta
());
}
}
}
evt
.
clear
();
events_parsed
++
;
}
std
::
cout
<<
"Events parsed and written: "
<<
events_parsed
<<
std
::
endl
;
TCanvas
*
c
=
new
TCanvas
();
h_neutron_energy
->
Draw
();
c
->
SaveAs
(
"results/forward_ions_reader.png"
);
c
->
SaveAs
(
"results/forward_ions_reader.pdf"
);
}
This diff is collapsed.
Click to expand it.
results/forward_ions_reader.pdf
0 → 100644
+
0
−
0
View file @
aa7fb727
File added
This diff is collapsed.
Click to expand it.
results/forward_ions_reader.png
0 → 100644
+
0
−
0
View file @
aa7fb727
7.02 KiB
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