Skip to content
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

feat: update csv writer for digitization #694

Conversation

asalzburger
Copy link
Contributor

@asalzburger asalzburger commented Feb 3, 2021

This PR is a mirror PR to #692, but updates the CSV writing infrastructure.

It breaks backward compatibility of the TrackML library, which will anyway have to adapted to the new digitization capabilities.

It does not yet remove the PlanarCluster infrastructure, which will be done in a follow-up PR.

@asalzburger asalzburger added Component - Examples Affects the Examples module 🚧 WIP Work-in-progress labels Feb 3, 2021
@asalzburger asalzburger self-assigned this Feb 3, 2021
@asalzburger asalzburger added this to the next milestone Feb 3, 2021
@asalzburger asalzburger removed the 🚧 WIP Work-in-progress label Feb 3, 2021
@asalzburger
Copy link
Contributor Author

Sorry @XiaocongAi for the many PR assignments, but his one is basically the same just with CSV instead of ROOT.

@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #694 (be1f415) into master (1ec8987) will decrease coverage by 0.01%.
The diff coverage is 30.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #694      +/-   ##
==========================================
- Coverage   49.03%   49.01%   -0.02%     
==========================================
  Files         331      325       -6     
  Lines       16549    16574      +25     
  Branches     7725     7744      +19     
==========================================
+ Hits         8115     8124       +9     
- Misses       3013     3019       +6     
- Partials     5421     5431      +10     
Impacted Files Coverage Δ
Core/include/Acts/Surfaces/ConeSurface.hpp 100.00% <ø> (ø)
Core/include/Acts/Surfaces/CylinderSurface.hpp 100.00% <ø> (ø)
Core/include/Acts/Surfaces/DiscSurface.hpp 100.00% <ø> (ø)
Core/include/Acts/Surfaces/LineSurface.hpp 100.00% <ø> (ø)
Core/include/Acts/Surfaces/PlaneSurface.hpp 100.00% <ø> (ø)
Core/include/Acts/Surfaces/Surface.hpp 60.00% <ø> (ø)
Core/src/Surfaces/ConeSurface.cpp 34.28% <17.24%> (-12.06%) ⬇️
Core/src/Surfaces/DiscSurface.cpp 30.61% <24.29%> (-7.60%) ⬇️
Core/src/Surfaces/CylinderSurface.cpp 34.57% <27.36%> (-7.37%) ⬇️
Core/src/Surfaces/LineSurface.cpp 35.84% <31.65%> (-29.16%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ec8987...e6e36df. Read the comment docs.

@asalzburger
Copy link
Contributor Author

Hi @XiaocongAi - if you have some time, this one should not take long, it's practically doing the same as the ROOT one from before.

asalzburger and others added 5 commits February 8, 2021 15:22
This PR moves all method definitions into the corresponding .cpp files.

In local testing, I don't observe runtime performance degradation and slight compile-time improvement. Let's see what the CI has to say on the latter topic.
Copy link
Contributor

@XiaocongAi XiaocongAi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @asalzburger , it's great to see this measurement writer. There are a few points I'm not sure about.

/// Where to place output files
std::string outputDir;
/// Write the optional measurement surfaces collection
bool writeMeasurementSurfaces = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this writeMeasurementSurfaces playing a role somewhere?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we are not writing out the MeasurementParticlesMap because it could be derived from the MeasurementSimHitsMap, right?

ActsExamples::ProcessCode ActsExamples::CsvMeasurementWriter::writeT(
const AlgorithmContext& ctx, const MeasurementContainer& measurements) {
const auto& simHits = ctx.eventStore.get<SimHitContainer>(m_cfg.inputSimHits);
// const auto& hitSimHitsMap = ctx.eventStore.get<IndexMultimap<Index>>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the hitSimHitsMap has not been written out yet?

Examples/Io/Csv/src/CsvMeasurementWriter.cpp Outdated Show resolved Hide resolved
bernies-bytes and others added 9 commits February 10, 2021 09:08
* Added a function adjustBinUtility() for rectangle bounds to BinAdjustment.hpp and modified BinUtility adjustBinUtility(const BinUtility& bu, const Surface& surface) accordingly.  This is to make material mapping on renctangle layers possible.
Modified the envelope from 1 mm to 0 mm in the TGeoLayerBuilder.hpp (otherwise I get a Radialbounds error when executing ActsExampleGeometryTGeo).

* added a check to the plane surface in adjustBinUtility(const BinUtility& bu, const Surface& surface) for rectangular bounds.

* added a unit test for the BinAdjustment of the rectangular plane.
also split the if that checks for a plane surface and rectangular bounds in two.

* changed the envelope of r and z in the TGeoLayerBuilder back to 1 mm.

* commit after running ./CI/check_format_local

Co-authored-by: Bernadette Kolbinger <bernadette.kolbinger@cern.ch>
Co-authored-by: Paul Gessinger <paul.gessinger@cern.ch>
Clean up the magnetic field types and options in the examples:

Magnetic field related headers are now consistently located in the ActsExamples/MagneticField include directory and all code is in the ActsExamples namespace. Before, the code still had the old Examples/Plugins/... layout and inconsistent or missing namespacing inherited from the old framework.
Move the magnetic field variant type ActsExamples::MagneticField into a separate header.
Magnetic field options have a well-documented order of preferrence (constant field overrides field map). If no field options are given, a null field is created, e.g. to support telescope-like detectors without a field. Expected units are clearly communicated as part of the parameter name, similar to what is done in other algorithms.
The field map readers are private implementation details and are not publicly available anymore.
Detector construction and magnetic field setup are now completely orthogonal: all magnetic fields can be setup for all detectors.
Co-authored-by: Andreas Salzburger <Andreas.Salzburger@cern.ch>
update licence statement

Co-authored-by: Xiaocong Ai <xiaocong.ai@cern.ch>
update licence statement

Co-authored-by: Xiaocong Ai <xiaocong.ai@cern.ch>
@asalzburger
Copy link
Contributor Author

Will be superseded by #711

asalzburger added a commit that referenced this pull request Feb 19, 2021
…711)

This PR replaces #694 and #700.

It follows the removal of the FatrasDigitization and introduces a new ActsExamples/Digitization which should in a follow-up PR be re-used in the reconstruction examples.

It also adds a round-trip test for writing / reading measurements.
@paulgessinger paulgessinger modified the milestones: next, v6.0.0 Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Examples Affects the Examples module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants