-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolution plot updates with truth fitting examples #480
Conversation
c35194b
to
6fb42dd
Compare
examples/run/cpu/CMakeLists.txt
Outdated
@@ -16,6 +16,10 @@ traccc_add_executable( truth_finding_example "truth_finding_example.cpp" | |||
LINK_LIBRARIES vecmem::core detray::utils traccc::core traccc::io | |||
traccc::performance traccc::options) | |||
|
|||
traccc_add_executable( truth_fitting_example "truth_fitting_example.cpp" | |||
LINK_LIBRARIES vecmem::core detray::utils traccc::core traccc::io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also link against detray::io
explicitly (I guess it is part of traccc::io
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added now
traccc::fitting_performance_writer::config{}); | ||
|
||
// Output Stats | ||
uint64_t n_fitted_tracks = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to 64bits? Why not std::size_t
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to std::size_t
#include <TGraphErrors.h> | ||
#endif // TRACCC_HAVE_ROOT | ||
|
||
#include <iostream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. removed
|
||
// Find index of eta and pT for resolution histogram | ||
const scalar eta = getter::eta(ptc.mom); | ||
const scalar pT = getter::perp(vector2{ptc.mom[0], ptc.mom[1]}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const scalar pT = getter::perp(vector2{ptc.mom[0], ptc.mom[1]}); | |
const scalar pT = std::hypot(ptc.mom[0], ptc.mom[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
cache.ndf_hist = plot_helpers::book_histo("ndf", "NDF", b_ndf); | ||
cache.chi2_hist = plot_helpers::book_histo("chi2", "Chi2", b_chi2); | ||
cache.reduced_chi2_hist = | ||
plot_helpers::book_histo("reduced_chi2", "Chi2/NDF", b_reduced_chi2); | ||
cache.pval_hist = plot_helpers::book_histo("pval", "p value", b_pval); | ||
for (unsigned int D = 1; D <= 2; D++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (unsigned int D = 1; D <= 2; D++) { | |
for (unsigned int D = 1u; D <= 2u; D++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
ecbf5a0
to
8c579e7
Compare
detray::material<scalar> mat; | ||
if (!telescope_opts.empty_material) { | ||
mat = detray::silicon<scalar>(); | ||
} else { | ||
mat = detray::vacuum<scalar>(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detray::material<scalar> mat; | |
if (!telescope_opts.empty_material) { | |
mat = detray::silicon<scalar>(); | |
} else { | |
mat = detray::vacuum<scalar>(); | |
} | |
auto mat = telescope_opts.empty_material ? detray::vacuum<scalar>() : detray::silicon<scalar>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the compiler is not smart enough
/home/beomki/projects/traccc/traccc/examples/simulation/simulate_telescope.cpp:71:40: error: operands to ‘?:’ have different types ‘detray::vacuum<float>’ and ‘detray::silicon<float>’
70 | detray::material<scalar> mat = telescope_opts.empty_material
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 | ? detray::vacuum<scalar>()
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
72 | : detray::silicon<scalar>();
This PR adds some useful plots in
fitting_performance
and truth fitting examples. The PR is expected to be a milestone of new tag for ACTS workshop1. Measurement-level resolution (Figure: the p values of smoothed track parameters)
2. Residuals (Figure: residuals of q/p and q/p_T w.r.t eta)
3. Track-level resolution (Figure: sigma of q/p and q/p_T, gaussian fitting of residuals)
List of changes that are not implied by the title:
detail::get_event_filename()
totraccc::io::get_event_filename
fitter_info
)