Skip to content

Commit 776ab78

Browse files
src/tests: fix for EDM4hep 00-99-02 (#2168)
### Briefly, what does this PR introduce? Upstream has removed colorFlow in key4hep/EDM4hep#389, we need to account for that in creating our test objects. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --------- Co-authored-by: Dmitry Kalinkin <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5fc5cb5 commit 776ab78

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

src/tests/algorithms_test/calorimetry_CalorimeterClusterRecoCoG.cc

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
#include <edm4eic/ProtoClusterCollection.h>
1212
#include <edm4eic/unit_system.h>
1313
#include <edm4hep/CaloHitContributionCollection.h>
14+
#include <edm4hep/EDM4hepVersion.h>
1415
#include <edm4hep/MCParticleCollection.h>
1516
#include <edm4hep/RawCalorimeterHitCollection.h>
1617
#include <edm4hep/SimCalorimeterHitCollection.h>
18+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
1719
#include <edm4hep/Vector2i.h>
20+
#endif
1821
#include <edm4hep/Vector3d.h>
1922
#include <edm4hep/Vector3f.h>
2023
#include <spdlog/common.h>
@@ -88,8 +91,11 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
8891
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
8992
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
9093
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
91-
edm4hep::Vector3f(), // edm4hep::Vector3f spin
92-
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
94+
edm4hep::Vector3f() // edm4hep::Vector3f spin
95+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
96+
,
97+
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
98+
#endif
9399
);
94100

95101
auto mcpart12 = mcparts_coll.create(
@@ -103,8 +109,11 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
103109
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
104110
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
105111
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
106-
edm4hep::Vector3f(), // edm4hep::Vector3f spin
107-
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
112+
edm4hep::Vector3f() // edm4hep::Vector3f spin
113+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
114+
,
115+
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
116+
#endif
108117
);
109118

110119
mcpart12.addToParents(mcpart11);
@@ -161,8 +170,11 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
161170
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
162171
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
163172
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
164-
edm4hep::Vector3f(), // edm4hep::Vector3f spin
165-
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
173+
edm4hep::Vector3f() // edm4hep::Vector3f spin
174+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
175+
,
176+
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
177+
#endif
166178
);
167179

168180
auto contrib2 = contribs_coll.create(0, // int32_t PDG

src/tests/algorithms_test/pid_lut_PIDLookup.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
#include <edm4eic/Cov4f.h>
77
#include <edm4eic/MCRecoParticleAssociationCollection.h>
88
#include <edm4eic/ReconstructedParticleCollection.h>
9+
#include <edm4hep/EDM4hepVersion.h>
910
#include <edm4hep/EventHeaderCollection.h>
1011
#include <edm4hep/MCParticleCollection.h>
1112
#include <edm4hep/ParticleIDCollection.h>
13+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
1214
#include <edm4hep/Vector2i.h>
15+
#endif
1316
#include <edm4hep/Vector3d.h>
1417
#include <edm4hep/Vector3f.h>
1518
#include <spdlog/common.h>
@@ -72,8 +75,11 @@ TEST_CASE("particles acquire PID", "[PIDLookup]") {
7275
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
7376
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
7477
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
75-
edm4hep::Vector3f(), // edm4hep::Vector3f spin
76-
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
78+
edm4hep::Vector3f() // edm4hep::Vector3f spin
79+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
80+
,
81+
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
82+
#endif
7783
);
7884

7985
auto assoc_in = assocs_in->create();

0 commit comments

Comments
 (0)