-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This updates our code so it compiles with both EDM4hep versions below `0.99` and above/equal to `0.99`. Breaking changes are: - `TrackerHit` becomes `TrackerHit3D`. - `SimTrackerHit::getMCParticle` becomes `SimTrackerHit::getParticle`, with the original name being deprecated. I'm aliasing the new name `TrackerHit3D` and `TrackerHit3DCollection` to the old types, so that when we drop support for < `0.99` versions, they're already correct. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced compatibility with different versions of the EDM4hep library for particle handling. - Introduced utility functions for retrieving and setting particle information in `SimTrackerHit` objects. - Added type aliases to streamline the handling of tracker hit collections. - **Bug Fixes** - Improved error handling in the `EDM4hepReader` for missing particles. - **Refactor** - Updated function signatures and internal logic to utilize new utility functions for better maintainability. - Streamlined the `EDM4hepMeasurementWriter` and `EDM4hepMeasurementReader` to accommodate new data structures. - Adjusted header inclusions and conditional compilation for better flexibility. - **Documentation** - Added comments to indicate changes in parameter handling for clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
9c9444e
commit eb6a5f1
Showing
9 changed files
with
105 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Plugins/EDM4hep/include/Acts/Plugins/EDM4hep/TrackerHitCompatibility.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file is part of the ACTS project. | ||
// | ||
// Copyright (C) 2016 CERN for the benefit of the ACTS project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
// Compatibility with EDM4hep < 0.99 and >= 0.99 | ||
#if __has_include(<edm4hep/TrackerHit3D.h>) | ||
#include "edm4hep/TrackerHit3D.h" | ||
#include "edm4hep/TrackerHit3DCollection.h" | ||
#else | ||
#include "edm4hep/TrackerHit.h" | ||
#include "edm4hep/TrackerHitCollection.h" | ||
namespace edm4hep { | ||
using TrackerHit3DCollection = edm4hep::TrackerHitCollection; | ||
using TrackerHit3D = edm4hep::TrackerHit; | ||
} // namespace edm4hep | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters