Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setMomentum for particles #185

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,9 @@ struct ExampleFunctionalProducerMultiple final
floatVector.push_back(25.);
floatVector.push_back(m_event);

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;
auto particles = edm4hep::MCParticleCollection();
auto particle = particles.create();
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
Loading