Skip to content

Commit

Permalink
Rename a couple of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 27, 2023
1 parent 63c8b54 commit a1a96cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions test/k4FWCoreTest/src/components/ExampleFunctionalConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ struct ExampleFunctionalConsumer final : Gaudi::Functional::Consumer<void(const
// Note that the function has to be const, as well as the collections
// we get from the input
void operator()(const colltype& input) const override {
auto* ptr = dynamic_cast<const edm4hep::MCParticleCollection*>(input.getData());
auto* coll = dynamic_cast<const edm4hep::MCParticleCollection*>(input.getData());
int i = 0;
for (const auto& p : *ptr) {
assert(p.getPDG() == 1 + i);
assert(p.getGeneratorStatus() == 2 + i);
assert(p.getSimulatorStatus() == 3 + i);
assert(p.getCharge() == 4 + i);
assert(p.getTime() == 5 + i);
assert(p.getMass() == 6 + i);
for (const auto& particle : *coll) {
assert(particle.getPDG() == 1 + i);
assert(particle.getGeneratorStatus() == 2 + i);
assert(particle.getSimulatorStatus() == 3 + i);
assert(particle.getCharge() == 4 + i);
assert(particle.getTime() == 5 + i);
assert(particle.getMass() == 6 + i);
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ struct ExampleFunctionalTransformer final :
// Note that the function has to be const, as well as all pointers to collections
// we get from the input
colltype_out operator()(const colltype_in& input) const override {
auto* ptr = dynamic_cast<const edm4hep::MCParticleCollection*>(input.getData());
auto* coll = dynamic_cast<const edm4hep::MCParticleCollection*>(input.getData());
auto coll_out = std::make_unique<edm4hep::MCParticleCollection>();
for (const auto& p : *ptr) {
for (const auto& particle : *coll) {
auto new_particle = edm4hep::MutableMCParticle();
new_particle.setPDG(p.getPDG() + 10);
new_particle.setGeneratorStatus(p.getGeneratorStatus() + 10);
new_particle.setSimulatorStatus(p.getSimulatorStatus() + 10);
new_particle.setCharge(p.getCharge() + 10);
new_particle.setTime(p.getTime() + 10);
new_particle.setMass(p.getMass() + 10);
new_particle.setPDG(particle.getPDG() + 10);
new_particle.setGeneratorStatus(particle.getGeneratorStatus() + 10);
new_particle.setSimulatorStatus(particle.getSimulatorStatus() + 10);
new_particle.setCharge(particle.getCharge() + 10);
new_particle.setTime(particle.getTime() + 10);
new_particle.setMass(particle.getMass() + 10);
// new_particle.
coll_out->push_back(new_particle);
}
Expand Down

0 comments on commit a1a96cf

Please sign in to comment.