Skip to content

Commit

Permalink
fix: mv id() to getObjectID().index because id() now returns ObjectID…
Browse files Browse the repository at this point in the history
…, not uint_t

This adds forward compatibility with podio v0.17.1

See AIDASoft/podio#493
  • Loading branch information
wdconinc committed Nov 11, 2023
1 parent c4db9e2 commit 8989cf7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/algorithms/calorimetry/CalorimeterTruthClustering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ std::unique_ptr<edm4eic::ProtoClusterCollection> CalorimeterTruthClustering::pro
}
}

const auto &trackID = mc[mcIndex].getContributions(0).getParticle().id();
const auto &trackID = mc[mcIndex].getContributions(0).getParticle().getObjectID().index;
// Create a new protocluster if we don't have one for this trackID
if (protoIndex.count(trackID) == 0) {
output->create();
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/calorimetry/ImagingClusterReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace eicrecon {

// debug output
for (const auto& cl: *clusters) {
m_log->debug("Cluster {:d}: Edep = {:.3f} MeV, Dir = ({:.3f}, {:.3f}) deg", cl.id(),
m_log->debug("Cluster {:d}: Edep = {:.3f} MeV, Dir = ({:.3f}, {:.3f}) deg", cl.getObjectID().index,
cl.getEnergy() * 1000., cl.getIntrinsicTheta() / M_PI * 180.,
cl.getIntrinsicPhi() / M_PI * 180.
);
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/digi/PhotoMultiplierHitDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ eicrecon::PhotoMultiplierHitDigiResult eicrecon::PhotoMultiplierHitDigi::Algorit

// cell time, signal amplitude, truth photon
m_log->trace(" -> hit accepted");
m_log->trace(" -> MC hit id={}", sim_hit.id());
m_log->trace(" -> MC hit id={}", sim_hit.getObjectID().index);
auto time = sim_hit.getTime();
double amp = m_cfg.speMean + m_rngNorm() * m_cfg.speError;

Expand All @@ -130,7 +130,7 @@ eicrecon::PhotoMultiplierHitDigiResult eicrecon::PhotoMultiplierHitDigi::Algorit
for(auto &hit : hitVec) {
m_log->trace("hit_group: pixel id={:#018X} -> npe={} signal={} time={}", id, hit.npe, hit.signal, hit.time);
for(auto i : hit.sim_hit_indices)
m_log->trace(" - MC hit: EDep={}, id={}", sim_hits->at(i).getEDep(), sim_hits->at(i).id());
m_log->trace(" - MC hit: EDep={}, id={}", sim_hits->at(i).getEDep(), sim_hits->at(i).getObjectID().index);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/pid/ConvertParticleID.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace eicrecon {
// create output `ParticleID` object
auto out_index = out_pids.size();
auto out_pid = out_pids.create();
out_indices.insert({out_index, out_pid.id()});
out_indices.insert({out_index, out_pid.getObjectID().index});

// fill scalars
out_pid.setPDG( static_cast<decltype(edm4hep::ParticleIDData::PDG)> (in_hyp.PDG) );
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/pid/MergeParticleID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ std::unique_ptr<edm4eic::CherenkovParticleIDCollection> eicrecon::MergeParticleI
m_log->error("PID object found with no charged particle");
continue;
}
auto id_particle = charged_particle_track_segment.id();
auto id_particle = charged_particle_track_segment.getObjectId().index;
auto idx_paired = std::make_pair(idx_coll, idx_pid);
m_log->trace(" idx_pid={} id_particle={}", idx_pid, id_particle);

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/pid/ParticlesWithPID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ namespace eicrecon {
// relate matched ParticleID objects to output particle
for (const auto& [out_pids_index, out_pids_id] : out_pid_index_map) {
const auto& out_pid = out_pids->at(out_pids_index);
if (out_pid.id() != out_pids_id) { // sanity check
if (out_pid.getObjectID().index != out_pids_id) { // sanity check
m_log->error("indexing error in `edm4eic::ParticleID` collection");
return false;
}
Expand Down

0 comments on commit 8989cf7

Please sign in to comment.