Skip to content

Commit

Permalink
Use setMomentum for particles
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Mar 18, 2024
1 parent 017cba2 commit 84ee538
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ struct ExampleFunctionalProducerMultiple final

auto particles = edm4hep::MCParticleCollection();
auto particle = particles.create();
auto& p4 = particle.getMomentum();
p4.x = m_magicNumberOffset + m_event + 5;
p4.y = m_magicNumberOffset + 6;
p4.z = m_magicNumberOffset + 7;
particle.setMomentum({m_magicNumberOffset + m_event + 5.0, m_magicNumberOffset + 6.0, m_magicNumberOffset + 7.0});
particle.setMass(m_magicNumberOffset + m_event + 8);

auto simTrackerHits = edm4hep::SimTrackerHitCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ StatusCode k4FWCoreTest_AlgorithmWithTFile::execute(const EventContext&) const {
edm4hep::MCParticleCollection* particles = m_mcParticleHandle.createAndPut();

auto particle = particles->create();

auto& p4 = particle.getMomentum();
p4.x = m_magicNumberOffset + 5;
p4.y = m_magicNumberOffset + 6;
p4.z = m_magicNumberOffset + 7;
particle.setMomentum({m_magicNumberOffset + 5.0, m_magicNumberOffset + 6.0, m_magicNumberOffset + 7.0});
particle.setMass(m_magicNumberOffset + 8);

auto* hits = m_simTrackerHitHandle.createAndPut();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ StatusCode k4FWCoreTest_CreateExampleEventData::execute(const EventContext&) con
edm4hep::MCParticleCollection* particles = m_mcParticleHandle.createAndPut();

auto particle = particles->create();

auto& p4 = particle.getMomentum();
p4.x = m_magicNumberOffset + m_event + 5;
p4.y = m_magicNumberOffset + 6;
p4.z = m_magicNumberOffset + 7;
particle.setMomentum({m_magicNumberOffset + m_event + 5.0, m_magicNumberOffset + 6.0, m_magicNumberOffset + 7.0});
particle.setMass(m_magicNumberOffset + m_event + 8);

edm4hep::SimTrackerHitCollection* simTrackerHits = m_simTrackerHitHandle.createAndPut();
Expand Down

0 comments on commit 84ee538

Please sign in to comment.