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
!11
Resolve "CI Workflow for EM Barrel"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "CI Workflow for EM Barrel"
7-ci-workflow-for-em-barrel
into
master
Overview
1
Commits
28
Pipelines
0
Changes
4
Merged
Resolve "CI Workflow for EM Barrel"
Jihee Kim
requested to merge
7-ci-workflow-for-em-barrel
into
master
Apr 2, 2021
Overview
1
Commits
28
Pipelines
0
Changes
4
Closes
#7 (closed)
Edited
Apr 4, 2021
by
Jihee Kim
0
0
Merge request reports
Compare
master
version 27
68c61e3e
Apr 4, 2021
version 26
6e4a7867
Apr 4, 2021
version 25
ddaac9a8
Apr 3, 2021
version 24
cfc2fa61
Apr 3, 2021
version 23
cc1fd160
Apr 3, 2021
version 22
fd1079ff
Apr 3, 2021
version 21
47fe337c
Apr 3, 2021
version 20
5f085165
Apr 3, 2021
version 19
85e6c5d0
Apr 3, 2021
version 18
1a8f4f00
Apr 3, 2021
version 17
679994c9
Apr 3, 2021
version 16
f7b110cf
Apr 3, 2021
version 15
c9bbeee3
Apr 3, 2021
version 14
fde49782
Apr 3, 2021
version 13
bb52c2e0
Apr 3, 2021
version 12
e344b182
Apr 3, 2021
version 11
f70e53a3
Apr 2, 2021
version 10
7d8cd4d0
Apr 2, 2021
version 9
6b7db35a
Apr 2, 2021
version 8
1dcf7a6e
Apr 2, 2021
version 7
7afeb22a
Apr 2, 2021
version 6
679bb80b
Apr 2, 2021
version 5
ae12f216
Apr 2, 2021
version 4
c7c92fe8
Apr 2, 2021
version 3
90692b68
Apr 2, 2021
version 2
6df766e6
Apr 2, 2021
version 1
e2f2c7f9
Apr 2, 2021
master (base)
and
version 10
latest version
4c879b1b
28 commits,
Apr 4, 2021
version 27
68c61e3e
27 commits,
Apr 4, 2021
version 26
6e4a7867
26 commits,
Apr 4, 2021
version 25
ddaac9a8
25 commits,
Apr 3, 2021
version 24
cfc2fa61
24 commits,
Apr 3, 2021
version 23
cc1fd160
23 commits,
Apr 3, 2021
version 22
fd1079ff
22 commits,
Apr 3, 2021
version 21
47fe337c
21 commits,
Apr 3, 2021
version 20
5f085165
20 commits,
Apr 3, 2021
version 19
85e6c5d0
19 commits,
Apr 3, 2021
version 18
1a8f4f00
18 commits,
Apr 3, 2021
version 17
679994c9
17 commits,
Apr 3, 2021
version 16
f7b110cf
16 commits,
Apr 3, 2021
version 15
c9bbeee3
15 commits,
Apr 3, 2021
version 14
fde49782
14 commits,
Apr 3, 2021
version 13
bb52c2e0
13 commits,
Apr 3, 2021
version 12
e344b182
12 commits,
Apr 3, 2021
version 11
f70e53a3
11 commits,
Apr 2, 2021
version 10
7d8cd4d0
10 commits,
Apr 2, 2021
version 9
6b7db35a
9 commits,
Apr 2, 2021
version 8
1dcf7a6e
8 commits,
Apr 2, 2021
version 7
7afeb22a
7 commits,
Apr 2, 2021
version 6
679bb80b
6 commits,
Apr 2, 2021
version 5
ae12f216
5 commits,
Apr 2, 2021
version 4
c7c92fe8
4 commits,
Apr 2, 2021
version 3
90692b68
3 commits,
Apr 2, 2021
version 2
6df766e6
2 commits,
Apr 2, 2021
version 1
e2f2c7f9
1 commit,
Apr 2, 2021
4 files
+
242
−
62
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
calorimeters/scripts/emcal_barrel_electrons.cxx
0 → 100644
+
87
−
0
View file @ 7d8cd4d0
Edit in single-file editor
Open in Web IDE
//////////////////////////////////////////////////////////////
// EMCAL Barrel detector
// Single Electron dataset
// J.KIM 04/02/2021
//////////////////////////////////////////////////////////////
#include
"HepMC3/GenEvent.h"
#include
"HepMC3/ReaderAscii.h"
#include
"HepMC3/WriterAscii.h"
#include
"HepMC3/Print.h"
#include
<iostream>
#include
<random>
#include
<cmath>
#include
<math.h>
#include
<TMath.h>
using
namespace
HepMC3
;
void
emcal_barrel_electrons
(
int
n_events
=
1e6
,
double
e_start
=
0.0
,
double
e_end
=
30.0
,
const
char
*
out_fname
=
"./data/emcal_barrel_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
// Momentum starting at 0 GeV/c to 30 GeV/c
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 11 - electron 0.510 MeV/c^2
GenParticlePtr
p3
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.000511
*
0.000511
))),
11
,
1
);
GenVertexPtr
v1
=
std
::
make_shared
<
GenVertex
>
();
v1
->
add_particle_in
(
p1
);
v1
->
add_particle_in
(
p2
);
v1
->
add_particle_out
(
p3
);
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