Skip to content

Commit

Permalink
Remove the colorFlow member from the MCParticle
Browse files Browse the repository at this point in the history
Not actually used anywhere
  • Loading branch information
tmadlener committed Dec 18, 2024
1 parent d651cd6 commit b72809c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(EDM4HEP LANGUAGES CXX)
# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 0 )
SET( ${PROJECT_NAME}_VERSION_MINOR 99 )
SET( ${PROJECT_NAME}_VERSION_PATCH 1 )
SET( ${PROJECT_NAME}_VERSION_PATCH 99 )

SET( ${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}" )

Expand Down
1 change: 0 additions & 1 deletion edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ datatypes:
- edm4hep::Vector3d momentum [GeV] // particle 3-momentum at the production vertex
- edm4hep::Vector3d momentumAtEndpoint [GeV] // particle 3-momentum at the endpoint
- edm4hep::Vector3f spin // spin (helicity) vector of the particle
- edm4hep::Vector2i colorFlow // color flow as defined by the generator
OneToManyRelations:
- edm4hep::MCParticle parents // The parents of this particle
- edm4hep::MCParticle daughters // The daughters this particle
Expand Down
1 change: 0 additions & 1 deletion scripts/createEDM4hepFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def create_MCParticleCollection():
edm4hep.Vector3d(next(counter), next(counter), next(counter))
)
particle.setSpin(edm4hep.Vector3f(next(counter), next(counter), next(counter)))
particle.setColorFlow(edm4hep.Vector2i(next(counter), next(counter)))

p_list[0].addToDaughters(p_list[1])
p_list[0].addToParents(p_list[2])
Expand Down
14 changes: 12 additions & 2 deletions test/test_EDM4hepFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def track(event):
return event.get("TrackCollection")[0]


@pytest.fixture(scope="module")
def edm4hep_version(reader):
return reader.current_file_version("edm4hep")


def check_cov_matrix(cov_matrix, n_dim):
"""Check the contents of the passed covariance matrix"""
counter = count(COUNT_START)
Expand Down Expand Up @@ -125,7 +130,7 @@ def test_EventHeaderCollection(event):
assert weight == next(counter)


def test_MCParticleCollection(event):
def test_MCParticleCollection(event, edm4hep_version):
"""Check the MCParticleCollection"""
counter = count(COUNT_START)
particles = event.get("MCParticleCollection")
Expand All @@ -151,7 +156,12 @@ def test_MCParticleCollection(event):
next(counter), next(counter), next(counter)
)
assert particle.getSpin() == edm4hep.Vector3f(next(counter), next(counter), next(counter))
assert particle.getColorFlow() == edm4hep.Vector2i(next(counter), next(counter))

if edm4hep_version < podio.version.parse("0.99.2"):
# The colorFlow as here so we have increase the counter here to
# maintain the expected values for all elements of the collection
next(counter)
next(counter)

assert particles[0].getDaughters()[0] == particles[1]
assert particles[0].getParents()[0] == particles[2]
Expand Down
1 change: 0 additions & 1 deletion test/utils/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def test_p4(self):
edm4hep.Vector3d(1.0, 2.0, 3.0), # momentum
edm4hep.Vector3d(0, 0, 0), # momentumAtEndpoint
edm4hep.Vector3f(0, 0, 0), # spin
edm4hep.Vector2i(0, 0), # colorFlow
)

self.assertEqual(p4(p), LVM(1.0, 2.0, 3.0, 125.0))
Expand Down

0 comments on commit b72809c

Please sign in to comment.