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
cf469f0c
Commit
cf469f0c
authored
Aug 11, 2021
by
Alex Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Working on updating particle gun and hits reader for B0.
parent
13318567
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
+7
-7
7 additions, 7 deletions
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
+9
-4
9 additions, 4 deletions
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
with
16 additions
and
11 deletions
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
+
7
−
7
View file @
cf469f0c
...
@@ -40,21 +40,21 @@ void b0_tracker_hits(const char* fname = "./sim_output/sim_forward_protons.root"
...
@@ -40,21 +40,21 @@ void b0_tracker_hits(const char* fname = "./sim_output/sim_forward_protons.root"
std
::
vector
<
double
>
result
;
std
::
vector
<
double
>
result
;
for
(
const
auto
&
h
:
hits
)
{
for
(
const
auto
&
h
:
hits
)
{
ROOT
::
Math
::
XYZVector
vec
(
h
.
position
.
x
,
h
.
position
.
y
,
h
.
position
.
z
);
ROOT
::
Math
::
XYZVector
vec
(
h
.
position
.
x
,
h
.
position
.
y
,
h
.
position
.
z
);
result
.
push_back
(
vec
.
eta
());
result
.
push_back
(
1000
*
vec
.
th
eta
());
std
::
cout
<<
vec
.
eta
()
<<
"
\n
"
;
std
::
cout
<<
1000
*
vec
.
th
eta
()
<<
"
\n
"
;
}
}
return
result
;
return
result
;
};
};
auto
d1
=
d0
.
Define
(
"hits_eta"
,
hits_eta
,
{
"B0TrackerHits"
});
auto
d1
=
d0
.
Define
(
"hits_
th
eta"
,
hits_
th
eta
,
{
"B0TrackerHits"
});
auto
h1
=
d1
.
Histo1D
({
"h1"
,
"hits_eta"
,
100
,
0
,
20
},
"hits_eta"
);
auto
h1
=
d1
.
Histo1D
({
"h1"
,
"hits_
th
eta"
,
100
,
0
,
20
},
"hits_
th
eta"
);
TCanvas
*
c
=
new
TCanvas
();
TCanvas
*
c
=
new
TCanvas
();
h1
->
DrawCopy
();
h1
->
DrawCopy
();
c
->
SaveAs
(
"results/b0_tracker_hits_eta.png"
);
c
->
SaveAs
(
"results/b0_tracker_hits_
th
eta.png"
);
c
->
SaveAs
(
"results/b0_tracker_hits_eta.pdf"
);
c
->
SaveAs
(
"results/b0_tracker_hits_
th
eta.pdf"
);
auto
n1
=
h1
->
GetMean
();
auto
n1
=
h1
->
GetMean
();
std
::
cout
<<
"P
seudorapidity
of hits: "
<<
n1
<<
std
::
endl
;
std
::
cout
<<
"P
olar angle
of hits: "
<<
n1
<<
std
::
endl
;
//if (n1 < 5) {
//if (n1 < 5) {
// std::quick_exit(1);
// std::quick_exit(1);
...
...
This diff is collapsed.
Click to expand it.
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
+
9
−
4
View file @
cf469f0c
...
@@ -20,8 +20,13 @@ using namespace HepMC3;
...
@@ -20,8 +20,13 @@ using namespace HepMC3;
void
gen_forward_protons
(
int
n_events
=
100
,
void
gen_forward_protons
(
int
n_events
=
100
,
const
char
*
out_fname
=
"forward_protons.hepmc"
)
const
char
*
out_fname
=
"forward_protons.hepmc"
)
{
{
double
cos_theta_min
=
std
::
cos
(
1.0
*
(
M_PI
/
180.0
));
double
cos_theta_max
=
std
::
cos
(
0.0
*
(
M_PI
/
180.0
));
// generate protons in B0 acceptance - roughly 5 - 20 mrad
double
cos_theta_min
=
std
::
cos
(
0.005
*
(
M_PI
/
180.0
));
double
cos_theta_max
=
std
::
cos
(
0.020
*
(
M_PI
/
180.0
));
double
partEnergyMin
=
270.0
;
// xL 0.98
double
partEnergyMax
=
275.0
;
// top beam energy
const
double
M_p
=
common_bench
::
particleMap
.
at
(
2212
).
mass
;
const
double
M_p
=
common_bench
::
particleMap
.
at
(
2212
).
mass
;
...
@@ -39,12 +44,12 @@ void gen_forward_protons(int n_events = 100,
...
@@ -39,12 +44,12 @@ void gen_forward_protons(int n_events = 100,
// pdgid 111 - pi0
// pdgid 111 - pi0
// pdgid 2212 - proton
// pdgid 2212 - proton
GenParticlePtr
p1
=
GenParticlePtr
p1
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
0.0
,
0.0
,
10.0
,
10.0
),
2212
,
4
);
std
::
make_shared
<
GenParticle
>
(
FourVector
(
0.0
,
0.0
,
partEnergyMax
,
partEnergyMax
),
2212
,
4
);
GenParticlePtr
p2
=
std
::
make_shared
<
GenParticle
>
(
GenParticlePtr
p2
=
std
::
make_shared
<
GenParticle
>
(
FourVector
(
0.0
,
0.0
,
0.0
,
M_p
),
2212
,
4
);
FourVector
(
0.0
,
0.0
,
0.0
,
M_p
),
2212
,
4
);
// Define momentum
// Define momentum
Double_t
p
=
r1
->
Uniform
(
1.0
,
10.0
);
Double_t
p
=
r1
->
Uniform
(
partEnergyMin
,
partEnergyMax
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
r1
->
Uniform
(
cos_theta_min
,
cos_theta_max
);
Double_t
costh
=
r1
->
Uniform
(
cos_theta_min
,
cos_theta_max
);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
th
=
std
::
acos
(
costh
);
...
...
This diff is collapsed.
Click to expand it.
Whitney Armstrong
@whit
mentioned in commit
af5f7c13
·
Aug 27, 2021
mentioned in commit
af5f7c13
mentioned in commit af5f7c132916f39f515a2884d5e6b8178c538a78
Toggle commit list
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