Skip to content

Commit f4948e9

Browse files
wdconincCopilot
andauthored
feat: improve EDM4hep 0.99.1, 0.99.2, 0.99.3 support (#2181)
### Briefly, what does this PR introduce? This PR adds improved support for EDM4hep 0.99.3 (and, I think, explicit constructors that prevent Vector3f to Vector3d construction in newer podio). ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] 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: Copilot <[email protected]>
1 parent 180e922 commit f4948e9

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

src/tests/algorithms_test/calorimetry_CalorimeterClusterRecoCoG.cc

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
8989
0., // double mass
9090
edm4hep::Vector3d(), // edm4hep::Vector3d vertex
9191
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
92+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 1)
9293
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
9394
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
94-
edm4hep::Vector3f() // edm4hep::Vector3f spin
95+
#else
96+
edm4hep::Vector3d(), // edm4hep::Vector3d momentum
97+
edm4hep::Vector3d(), // edm4hep::Vector3d momentumAtEndpoint
98+
#endif
99+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 3)
100+
edm4hep::Vector3f() // edm4hep::Vector3f spin
101+
#else
102+
9 // int32_t helicity (9 if unset)
103+
#endif
95104
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
96105
,
97106
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
@@ -107,9 +116,18 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
107116
0., // double mass
108117
edm4hep::Vector3d(), // edm4hep::Vector3d vertex
109118
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
110-
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
111-
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
112-
edm4hep::Vector3f() // edm4hep::Vector3f spin
119+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 1)
120+
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
121+
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
122+
#else
123+
edm4hep::Vector3d(), // edm4hep::Vector3d momentum
124+
edm4hep::Vector3d(), // edm4hep::Vector3d momentumAtEndpoint
125+
#endif
126+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 3)
127+
edm4hep::Vector3f() // edm4hep::Vector3f spin
128+
#else
129+
9 // int32_t helicity (9 if unset)
130+
#endif
113131
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
114132
,
115133
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow
@@ -168,9 +186,18 @@ TEST_CASE("the calorimeter CoG algorithm runs", "[CalorimeterClusterRecoCoG]") {
168186
0., // double mass
169187
edm4hep::Vector3d(), // edm4hep::Vector3d vertex
170188
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
171-
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
172-
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
173-
edm4hep::Vector3f() // edm4hep::Vector3f spin
189+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 1)
190+
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
191+
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
192+
#else
193+
edm4hep::Vector3d(), // edm4hep::Vector3d momentum
194+
edm4hep::Vector3d(), // edm4hep::Vector3d momentumAtEndpoint
195+
#endif
196+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 3)
197+
edm4hep::Vector3f() // edm4hep::Vector3f spin
198+
#else
199+
9 // int32_t helicity (9 if unset)
200+
#endif
174201
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
175202
,
176203
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow

src/tests/algorithms_test/pid_lut_PIDLookup.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,18 @@ TEST_CASE("particles acquire PID", "[PIDLookup]") {
7373
0., // double mass
7474
edm4hep::Vector3d(), // edm4hep::Vector3d vertex
7575
edm4hep::Vector3d(), // edm4hep::Vector3d endpoint
76+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 1)
7677
edm4hep::Vector3f(), // edm4hep::Vector3f momentum
7778
edm4hep::Vector3f(), // edm4hep::Vector3f momentumAtEndpoint
78-
edm4hep::Vector3f() // edm4hep::Vector3f spin
79+
#else
80+
edm4hep::Vector3d(), // edm4hep::Vector3d momentum
81+
edm4hep::Vector3d(), // edm4hep::Vector3d momentumAtEndpoint
82+
#endif
83+
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 3)
84+
edm4hep::Vector3f() // edm4hep::Vector3f spin
85+
#else
86+
9 // int32_t helicity (9 if unset)
87+
#endif
7988
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 2)
8089
,
8190
edm4hep::Vector2i() // edm4hep::Vector2i colorFlow

0 commit comments

Comments
 (0)