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
Commits
21a7d556
Commit
21a7d556
authored
Sep 27, 2021
by
Zhenyu Ye
Browse files
Options
Downloads
Patches
Plain Diff
Debug TOF
parent
ad4fadd3
Branches
tcs-ff-reconstructed-particles
No related tags found
1 merge request
!92
Draft: Resolve "Add TOF benchmark"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/tof/scripts/gen_tof_hits.cxx
+23
-24
23 additions, 24 deletions
benchmarks/tof/scripts/gen_tof_hits.cxx
with
23 additions
and
24 deletions
benchmarks/tof/scripts/gen_tof_hits.cxx
+
23
−
24
View file @
21a7d556
...
...
@@ -35,43 +35,42 @@ void gen_tof_hits(int n_events = 100,
// pdgid 111 - pi0
// pdgid 2212 - proton
Double_t
p
=
r1
->
Uniform
(
0.2
,
2
);
for
(
int
ip
=
0
;
ip
<
n_parts
;
ip
++
)
{
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
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
0
;
//r1->Uniform(cos_theta_min, cos_theta_max);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
Double_t
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
Double_t
pz
=
p
*
std
::
cos
(
th
);
for
(
int
ip
=
0
;
ip
<
n_parts
;
ip
++
)
{
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
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
pz
=
p
*
std
::
cos
(
th
);
GenParticlePtr
p3
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.000511
*
0.000511
))),
((
ip
%
2
==
0
)
?
11
:
-
11
),
1
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
0
;
//r1->Uniform(cos_theta_min, cos_theta_max);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
Double_t
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
Double_t
pz
=
p
*
std
::
cos
(
th
);
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
pz
=
p
*
std
::
cos
(
th
);
GenParticlePtr
p4
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.938272
*
0.938272
))),
((
ip
%
2
==
0
)
?
2212
:
-
2212
),
1
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
0
;
//r1->Uniform(cos_theta_min, cos_theta_max);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
Double_t
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
Double_t
pz
=
p
*
std
::
cos
(
th
);
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
pz
=
p
*
std
::
cos
(
th
);
GenParticlePtr
p5
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.493677
*
0.493677
))),
((
ip
%
2
==
0
)
?
321
:
-
321
),
1
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
0
;
//r1->Uniform(cos_theta_min, cos_theta_max);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
Double_t
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
Double_t
pz
=
p
*
std
::
cos
(
th
);
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
px
=
p
*
std
::
cos
(
phi
)
*
std
::
sin
(
th
);
py
=
p
*
std
::
sin
(
phi
)
*
std
::
sin
(
th
);
pz
=
p
*
std
::
cos
(
th
);
GenParticlePtr
p6
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
px
,
py
,
pz
,
sqrt
(
p
*
p
+
(
0.139570
*
0.139570
))),
((
ip
%
2
==
0
)
?
211
:
-
211
),
1
);
...
...
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