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

Fix a few warnings after the change Association -> Link #35

Merged
merged 4 commits into from
Sep 28, 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
10 changes: 5 additions & 5 deletions Tracking/components/PlotTrackHitResiduals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// edm4hep
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/TrackCollection.h"
#include "edm4hep/MCRecoTrackParticleAssociationCollection.h"
#include "edm4hep/TrackMCParticleLinkCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"

// marlin
Expand Down Expand Up @@ -40,7 +40,7 @@ namespace Gaudi::Accumulators {
*/

struct PlotTrackHitDistances final
: k4FWCore::Consumer<void(const edm4hep::SimTrackerHitCollection&, const edm4hep::MCRecoTrackParticleAssociationCollection&)> {
: k4FWCore::Consumer<void(const edm4hep::SimTrackerHitCollection&, const edm4hep::TrackMCParticleLinkCollection&)> {
PlotTrackHitDistances(const std::string& name, ISvcLocator* svcLoc)
: Consumer(
name, svcLoc,
Expand All @@ -49,11 +49,11 @@ struct PlotTrackHitDistances final
KeyValues("InputTracksFromGenParticlesAssociation", {"TracksFromGenParticlesAssociation"}),
}) {}

void operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits, const edm4hep::MCRecoTrackParticleAssociationCollection& trackParticleAssociations) const override {
void operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits, const edm4hep::TrackMCParticleLinkCollection& trackParticleAssociations) const override {

for (const auto& trackParticleAssociation : trackParticleAssociations) {
auto genParticle = trackParticleAssociation.getSim();
auto track = trackParticleAssociation.getRec();
auto genParticle = trackParticleAssociation.getTo();
auto track = trackParticleAssociation.getFrom();
edm4hep::TrackState trackStateAtIP;
bool found_trackStateAtIP = false;
for (const auto& trackState : track.getTrackStates()) {
Expand Down
14 changes: 7 additions & 7 deletions Tracking/components/TracksFromGenParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// edm4hep
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/TrackCollection.h"
#include "edm4hep/MCRecoTrackParticleAssociationCollection.h"
#include "edm4hep/TrackMCParticleLinkCollection.h"

// marlin
#include <marlinutil/HelixClass_double.h>
Expand All @@ -27,7 +27,7 @@
*/

struct TracksFromGenParticles final
: k4FWCore::MultiTransformer<std::tuple<edm4hep::TrackCollection, edm4hep::MCRecoTrackParticleAssociationCollection>(const edm4hep::MCParticleCollection&)> {
: k4FWCore::MultiTransformer<std::tuple<edm4hep::TrackCollection, edm4hep::TrackMCParticleLinkCollection>(const edm4hep::MCParticleCollection&)> {
TracksFromGenParticles(const std::string& name, ISvcLocator* svcLoc)
: MultiTransformer(
name, svcLoc,
Expand All @@ -36,10 +36,10 @@ struct TracksFromGenParticles final
KeyValues("OutputMCRecoTrackParticleAssociation", {"TracksFromGenParticlesAssociation"})}) {
}

std::tuple<edm4hep::TrackCollection, edm4hep::MCRecoTrackParticleAssociationCollection> operator()(const edm4hep::MCParticleCollection& genParticleColl) const override {
std::tuple<edm4hep::TrackCollection, edm4hep::TrackMCParticleLinkCollection> operator()(const edm4hep::MCParticleCollection& genParticleColl) const override {

auto outputTrackCollection = edm4hep::TrackCollection();
auto MCRecoTrackParticleAssociationCollection = edm4hep::MCRecoTrackParticleAssociationCollection();
auto MCRecoTrackParticleAssociationCollection = edm4hep::TrackMCParticleLinkCollection();

for (const auto& genParticle : genParticleColl) {
debug() << "Particle decayed in tracker: " << genParticle.isDecayedInTracker() << endmsg;
Expand Down Expand Up @@ -76,9 +76,9 @@ std::tuple<edm4hep::TrackCollection, edm4hep::MCRecoTrackParticleAssociationColl
outputTrackCollection.push_back(trackFromGen);

// Building the association between tracks and genParticles
auto MCRecoTrackParticleAssociation = edm4hep::MutableMCRecoTrackParticleAssociation();
MCRecoTrackParticleAssociation.setRec(trackFromGen);
MCRecoTrackParticleAssociation.setSim(genParticle);
auto MCRecoTrackParticleAssociation = edm4hep::MutableTrackMCParticleLink();
MCRecoTrackParticleAssociation.setFrom(trackFromGen);
MCRecoTrackParticleAssociation.setTo(genParticle);
MCRecoTrackParticleAssociationCollection.push_back(MCRecoTrackParticleAssociation);
}
return std::make_tuple(std::move(outputTrackCollection), std::move(MCRecoTrackParticleAssociationCollection));
Expand Down
Loading