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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
e24c2728
Commit
e24c2728
authored
3 years ago
by
Alex Jentsch
Committed by
Alex Jentsch
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Trying to add occupancy plots for the B0.
parent
726efc4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
+32
-2
32 additions, 2 deletions
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
+6
-4
6 additions, 4 deletions
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
with
38 additions
and
6 deletions
benchmarks/b0_tracker/scripts/b0_tracker_hits.cxx
+
32
−
2
View file @
e24c2728
...
...
@@ -46,13 +46,43 @@ void b0_tracker_hits(const char* fname = "./sim_output/sim_forward_protons.root"
return
result
;
};
auto
d1
=
d0
.
Define
(
"hits_theta"
,
hits_theta
,
{
"B0TrackerHits"
});
auto
x_pos_disk_1
=
[
&
](
const
std
::
vector
<
std
::
array
<
double
,
2
>>&
xypos
)
{
std
::
vector
<
double
>
result
;
for
(
const
auto
&
h
:
xypos
)
{
result
.
push_back
(
h
.
at
(
0
));
}
return
result
;
};
auto
y_pos_disk_1
=
[
&
](
const
std
::
vector
<
std
::
array
<
double
,
2
>>&
xypos
)
{
std
::
vector
<
double
>
result
;
for
(
const
auto
&
h
:
xypos
)
{
result
.
push_back
(
h
.
at
(
1
));
}
return
result
;
};
auto
d1
=
d0
.
Define
(
"nhits"
,
nhits
,
{
"B0TrackerHits"
})
.
Define
(
"xy_hit_pos"
,
local_position
,
{
"B0TrackerHits"
})
.
Define
(
"x_pos"
,
x_pos
,
{
"xy_hit_pos"
})
.
Define
(
"y_pos"
,
y_pos
,
{
"xy_hit_pos"
});
auto
h1
=
d1
.
Histo1D
({
"h1"
,
"hits_theta"
,
100
,
0
,
20
},
"hits_theta"
);
auto
h_local_pos
=
d1
.
Histo2D
({
"h_local_pos"
,
";x [mm]; y [mm] "
,
100
,
-
100.0
,
-
200.0
,
100
,
-
100.0
,
100.0
},
"x_pos"
,
"y_pos"
);
auto
d2
=
d0
.
Define
(
"hits_theta"
,
hits_theta
,
{
"B0TrackerHits"
});
auto
h1
=
d2
.
Histo1D
({
"h1"
,
"hits_theta"
,
100
,
0
,
20
},
"hits_theta"
);
TCanvas
*
c
=
new
TCanvas
();
h1
->
DrawCopy
();
c
->
SaveAs
(
"results/b0_tracker_hits_theta.png"
);
c
->
SaveAs
(
"results/b0_tracker_hits_theta.pdf"
);
h_local_pos
->
DrawCopy
(
"colz"
);
c
->
SaveAs
(
"results/b0_tracker_hits_occupancy_disk_1.png"
);
c
->
SaveAs
(
"results/b0_tracker_hits_occupancy_disk_1.pdf"
);
auto
n1
=
h1
->
GetMean
();
std
::
cout
<<
"Polar angle of hits: "
<<
n1
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
benchmarks/b0_tracker/scripts/gen_forward_protons.cxx
+
6
−
4
View file @
e24c2728
...
...
@@ -17,13 +17,15 @@ using namespace HepMC3;
/** Generate electrons in the central region.
* This is for testing detectors in the "barrel" region.
*/
void
gen_forward_protons
(
int
n_events
=
100
,
void
gen_forward_protons
(
int
n_events
=
100
0
,
const
char
*
out_fname
=
"forward_protons.hepmc"
)
{
// 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
cos_theta_min
=
0.005
;
//std::cos(0.005*(M_PI/180.0));
double
cos_theta_max
=
0.020
;
//std::cos(0.020*(M_PI/180.0));
double
partEnergyMin
=
270.0
;
// xL 0.98
double
partEnergyMax
=
275.0
;
// top beam energy
...
...
@@ -52,7 +54,7 @@ void gen_forward_protons(int n_events = 100,
Double_t
p
=
r1
->
Uniform
(
partEnergyMin
,
partEnergyMax
);
Double_t
phi
=
r1
->
Uniform
(
0.0
,
2.0
*
M_PI
);
Double_t
costh
=
r1
->
Uniform
(
cos_theta_min
,
cos_theta_max
);
Double_t
th
=
std
::
acos
(
costh
);
Double_t
th
=
costh
;
//
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
);
...
...
This diff is collapsed.
Click to expand it.
Whitney Armstrong
@whit
mentioned in commit
af5f7c13
·
3 years ago
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