Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
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
EIC
benchmarks
detector_benchmarks
Merge requests
!29
Resolve "Pion rejection plot"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "Pion rejection plot"
18-pion-rejection-plot
into
master
Overview
0
Commits
17
Pipelines
0
Changes
5
Merged
Resolve "Pion rejection plot"
Marshall Scott
requested to merge
18-pion-rejection-plot
into
master
May 5, 2021
Overview
0
Commits
17
Pipelines
0
Changes
5
Closes
#18 (closed)
Edited
May 24, 2021
by
Marshall Scott
0
0
Merge request reports
Compare
master
version 66
6d001a66
May 24, 2021
version 65
60beb713
May 24, 2021
version 64
311ec073
May 21, 2021
version 63
08c5a6c9
May 21, 2021
version 62
3e6c23ae
May 21, 2021
version 61
f7977b68
May 21, 2021
version 60
87d0e886
May 20, 2021
version 59
489b7c88
May 20, 2021
version 58
2fc2e078
May 20, 2021
version 57
2cb543a8
May 20, 2021
version 56
c3589773
May 20, 2021
version 55
dfef35a5
May 20, 2021
version 54
6b5cebc7
May 20, 2021
version 53
0a8426b8
May 18, 2021
version 52
73dd007a
May 14, 2021
version 51
f3217120
May 14, 2021
version 50
4db002e4
May 14, 2021
version 49
34c79513
May 12, 2021
version 48
ad5492fe
May 12, 2021
version 47
cedd60d7
May 11, 2021
version 46
d5ea7f7c
May 11, 2021
version 45
4ca55ac2
May 11, 2021
version 44
0aebbc29
May 11, 2021
version 43
680f6b15
May 11, 2021
version 42
a427d77b
May 11, 2021
version 41
b459a53e
May 11, 2021
version 40
f9bcae5a
May 11, 2021
version 39
9d1fee36
May 11, 2021
version 38
cb128fca
May 11, 2021
version 37
c2bd0a4d
May 11, 2021
version 36
a95efc05
May 11, 2021
version 35
bf3393a6
May 11, 2021
version 34
298f4f24
May 11, 2021
version 33
b3d93755
May 11, 2021
version 32
65f86faf
May 11, 2021
version 31
f2f4045d
May 11, 2021
version 30
f311b1ba
May 11, 2021
version 29
0d2cd471
May 11, 2021
version 28
fb3244a4
May 11, 2021
version 27
7eea3248
May 11, 2021
version 26
4c87d2bd
May 11, 2021
version 25
27f37dac
May 11, 2021
version 24
d770f4e1
May 11, 2021
version 23
20a252cd
May 10, 2021
version 22
c4c8a869
May 10, 2021
version 21
b9dc712b
May 10, 2021
version 20
0ee98684
May 10, 2021
version 19
7623ee1f
May 10, 2021
version 18
de934ba5
May 10, 2021
version 17
f047e758
May 10, 2021
version 16
b4e60383
May 7, 2021
version 15
b7831309
May 7, 2021
version 14
218d8c0e
May 7, 2021
version 13
d51626fb
May 7, 2021
version 12
b19a0b48
May 7, 2021
version 11
3efb4d9f
May 7, 2021
version 10
5070e846
May 7, 2021
version 9
f5a3ac29
May 7, 2021
version 8
499bd8e4
May 7, 2021
version 7
2e05132f
May 7, 2021
version 6
1497787c
May 7, 2021
version 5
a2722784
May 7, 2021
version 4
9c2a837b
May 7, 2021
version 3
9fd9ba07
May 7, 2021
version 2
6d391841
May 7, 2021
version 1
ed8b0cdd
May 7, 2021
master (base)
and
version 51
latest version
24c57499
17 commits,
May 24, 2021
version 66
6d001a66
16 commits,
May 24, 2021
version 65
60beb713
15 commits,
May 24, 2021
version 64
311ec073
14 commits,
May 21, 2021
version 63
08c5a6c9
13 commits,
May 21, 2021
version 62
3e6c23ae
11 commits,
May 21, 2021
version 61
f7977b68
8 commits,
May 21, 2021
version 60
87d0e886
7 commits,
May 20, 2021
version 59
489b7c88
6 commits,
May 20, 2021
version 58
2fc2e078
5 commits,
May 20, 2021
version 57
2cb543a8
4 commits,
May 20, 2021
version 56
c3589773
3 commits,
May 20, 2021
version 55
dfef35a5
2 commits,
May 20, 2021
version 54
6b5cebc7
1 commit,
May 20, 2021
version 53
0a8426b8
104 commits,
May 18, 2021
version 52
73dd007a
102 commits,
May 14, 2021
version 51
f3217120
101 commits,
May 14, 2021
version 50
4db002e4
100 commits,
May 14, 2021
version 49
34c79513
98 commits,
May 12, 2021
version 48
ad5492fe
48 commits,
May 12, 2021
version 47
cedd60d7
47 commits,
May 11, 2021
version 46
d5ea7f7c
46 commits,
May 11, 2021
version 45
4ca55ac2
45 commits,
May 11, 2021
version 44
0aebbc29
44 commits,
May 11, 2021
version 43
680f6b15
43 commits,
May 11, 2021
version 42
a427d77b
42 commits,
May 11, 2021
version 41
b459a53e
41 commits,
May 11, 2021
version 40
f9bcae5a
40 commits,
May 11, 2021
version 39
9d1fee36
39 commits,
May 11, 2021
version 38
cb128fca
38 commits,
May 11, 2021
version 37
c2bd0a4d
37 commits,
May 11, 2021
version 36
a95efc05
36 commits,
May 11, 2021
version 35
bf3393a6
35 commits,
May 11, 2021
version 34
298f4f24
34 commits,
May 11, 2021
version 33
b3d93755
33 commits,
May 11, 2021
version 32
65f86faf
32 commits,
May 11, 2021
version 31
f2f4045d
31 commits,
May 11, 2021
version 30
f311b1ba
30 commits,
May 11, 2021
version 29
0d2cd471
29 commits,
May 11, 2021
version 28
fb3244a4
28 commits,
May 11, 2021
version 27
7eea3248
27 commits,
May 11, 2021
version 26
4c87d2bd
26 commits,
May 11, 2021
version 25
27f37dac
25 commits,
May 11, 2021
version 24
d770f4e1
24 commits,
May 11, 2021
version 23
20a252cd
23 commits,
May 10, 2021
version 22
c4c8a869
22 commits,
May 10, 2021
version 21
b9dc712b
21 commits,
May 10, 2021
version 20
0ee98684
20 commits,
May 10, 2021
version 19
7623ee1f
19 commits,
May 10, 2021
version 18
de934ba5
18 commits,
May 10, 2021
version 17
f047e758
17 commits,
May 10, 2021
version 16
b4e60383
16 commits,
May 7, 2021
version 15
b7831309
15 commits,
May 7, 2021
version 14
218d8c0e
14 commits,
May 7, 2021
version 13
d51626fb
13 commits,
May 7, 2021
version 12
b19a0b48
12 commits,
May 7, 2021
version 11
3efb4d9f
11 commits,
May 7, 2021
version 10
5070e846
10 commits,
May 7, 2021
version 9
f5a3ac29
9 commits,
May 7, 2021
version 8
499bd8e4
8 commits,
May 7, 2021
version 7
2e05132f
7 commits,
May 7, 2021
version 6
1497787c
6 commits,
May 7, 2021
version 5
a2722784
5 commits,
May 7, 2021
version 4
9c2a837b
4 commits,
May 7, 2021
version 3
9fd9ba07
3 commits,
May 7, 2021
version 2
6d391841
2 commits,
May 7, 2021
version 1
ed8b0cdd
1 commit,
May 7, 2021
5 files
+
598
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
benchmarks/barrel_ecal/scripts/emcal_barrel_pions_electrons.cxx
0 → 100644
+
100
−
0
View file @ f3217120
Edit in single-file editor
Open in Web IDE
//////////////////////////////////////////////////////////////
// EMCAL Barrel detector
// Electron & Pion Minus dataset
// M. Scott 05/2021
//////////////////////////////////////////////////////////////
#include
"HepMC3/GenEvent.h"
#include
"HepMC3/Print.h"
#include
"HepMC3/ReaderAscii.h"
#include
"HepMC3/WriterAscii.h"
#include
<TMath.h>
#include
<cmath>
#include
<iostream>
#include
<math.h>
#include
<random>
using
namespace
HepMC3
;
void
emcal_barrel_pions_electrons
(
int
n_events
=
1e6
,
double
e_start
=
0.0
,
double
e_end
=
30.0
,
const
char
*
out_fname
=
"./data/emcal_barrel_pions_electrons.hepmc"
)
{
/*
n_events = 1000;
e_start = 5;
e_end = 5;
out_fname = "temp_pions_electrons.hepmc";
*/
WriterAscii
hepmc_output
(
out_fname
);
int
events_parsed
=
0
;
GenEvent
evt
(
Units
::
GEV
,
Units
::
MM
);
// Random number generator
TRandom
*
r1
=
new
TRandom
();
// Constraining the solid angle, but larger than that subtended by the
// detector
// https://indico.bnl.gov/event/7449/contributions/35966/attachments/27177/41430/EIC-DWG-Calo-03192020.pdf
// See a figure on slide 26
double
cos_theta_min
=
std
::
cos
(
M_PI
*
(
45.0
/
180.0
));
double
cos_theta_max
=
std
::
cos
(
M_PI
*
(
135.0
/
180.0
));
for
(
events_parsed
=
0
;
events_parsed
<
n_events
;
events_parsed
++
)
{
// FourVector(px,py,pz,e,pdgid,status)
// type 4 is beam
// pdgid 11 - electron
// pdgid 111 - pi0
// pdgid 2212 - proton
GenParticlePtr
p1
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
0.0
,
0.0
,
10.0
,
10.0
),
11
,
4
);
GenParticlePtr
p2
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
0.0
,
0.0
,
0.0
,
0.938
),
2212
,
4
);
// Define momentum
Double_t
p
=
r1
->
Uniform
(
e_start
,
e_end
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costheta
=
r1
->
Uniform
(
cos_theta_min
,
cos_theta_max
);
Double_t
theta
=
std
::
acos
(
costheta
);
Double_t
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
theta
);
Double_t
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
theta
);
Double_t
pz
=
p
*
std
::
cos
(
theta
);
// Generates random vectors, uniformly distributed over the surface of a
// sphere of given radius, in this case momentum.
// r1->Sphere(px, py, pz, p);
// type 1 is final state
// pdgid 211 - pion+ 139.570 MeV/c^2
// pdgid -211 - pion- 139.570 MeV/c^2
// pdgid 111 - pion0 134.977 MeV/c^2
GenParticlePtr
p3
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.139570
*
0.139570
))),
-
211
,
1
);
p
=
r1
->
Uniform
(
e_start
,
e_end
);
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
costheta
=
r1
->
Uniform
(
cos_theta_min
,
cos_theta_max
);
theta
=
std
::
acos
(
costheta
);
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
theta
);
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
theta
);
pz
=
p
*
std
::
cos
(
theta
);
GenParticlePtr
p4
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.000511
*
0.000511
))),
11
,
1
);
GenVertexPtr
v1
=
std
::
make_shared
<
GenVertex
>
();
GenVertexPtr
v2
=
std
::
make_shared
<
GenVertex
>
();
v1
->
add_particle_in
(
p1
);
v1
->
add_particle_in
(
p2
);
if
(
r1
->
Uniform
(
0
,
1
)
<=
0.5
)
{
v1
->
add_particle_out
(
p3
);}
else
{
v1
->
add_particle_out
(
p4
);}
evt
.
add_vertex
(
v1
);
if
(
events_parsed
==
0
)
{
std
::
cout
<<
"First event: "
<<
std
::
endl
;
Print
::
listing
(
evt
);
}
hepmc_output
.
write_event
(
evt
);
if
(
events_parsed
%
10000
==
0
)
{
std
::
cout
<<
"Event: "
<<
events_parsed
<<
std
::
endl
;
}
evt
.
clear
();
}
hepmc_output
.
close
();
std
::
cout
<<
"Events parsed and written: "
<<
events_parsed
<<
std
::
endl
;
}
Loading