Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Feb 21, 2024
1 parent 156d7d0 commit dc7c0fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/createEDM4hepFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

frames = 10
vectorsize = 5
counter = count()
counter = count() # next(counter) will return 0, 1, 2, ...

parser = argparse.ArgumentParser(description='Create a file with EDM4hep data')
parser.add_argument('--use-pre1', action='store_true', help='Use a pre 1.0 version of EDM4hep')
Expand Down Expand Up @@ -238,6 +238,7 @@
v.setAlgorithmType(next(counter))
for j in range(vectorsize):
v.addToParameters(next(counter))
frame.put(vertex, "VertexCollection")

particles = edm4hep.ReconstructedParticleCollection()
particle = particles.create()
Expand All @@ -259,11 +260,9 @@
if args.use_pre1:
particle.addToParticleIDs(cppyy.ll.static_cast['edm4hep::ParticleID'](pid))
reco_particle = particle
frame.put(particles, "ReconstructedParticleCollection")

# Vertex needs particles and particles needs vertex
v.setAssociatedParticle(cppyy.ll.static_cast['edm4hep::ReconstructedParticle'](reco_particle))
frame.put(vertex, "VertexCollection")
frame.put(particles, "ReconstructedParticleCollection")

if not args.use_pre1:
pid.setParticle(cppyy.ll.static_cast['edm4hep::ReconstructedParticle'](reco_particle))
Expand Down

0 comments on commit dc7c0fe

Please sign in to comment.