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

Switch to new Vertex functionality #74

Merged
merged 3 commits into from
Jul 8, 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 @@ -420,7 +420,7 @@ std::unique_ptr<lcio::LCCollectionVec> convertVertices(const edm4hep::VertexColl
for (const auto& edm_vertex : (*edmCollection)) {
if (edm_vertex.isAvailable()) {
auto* lcio_vertex = new lcio::VertexImpl();
lcio_vertex->setPrimary(edm_vertex.getPrimary());
lcio_vertex->setPrimary(edm_vertex.isPrimary());
lcio_vertex->setAlgorithmType(std::to_string(edm_vertex.getAlgorithmType()));
lcio_vertex->setChi2(edm_vertex.getChi2());
lcio_vertex->setProbability(TMath::Prob(edm_vertex.getChi2(), edm_vertex.getNdf()));
Expand Down
3 changes: 1 addition & 2 deletions tests/src/CompareEDM4hepLCIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ bool compare(const lcio::LCCollection* lcioCollection, const edm4hep::TrackerHit
// ================= Vertex ================

bool compare(const EVENT::Vertex* lcioElem, const edm4hep::Vertex& edm4hepElem, const ObjectMappings& objectMaps) {
// LCIO has isPrimary (bool), EDM4hep has getPrimary (int32_t)
ASSERT_COMPARE_VALS(lcioElem->isPrimary(), edm4hepElem.getPrimary(), "primary in Vertex");
ASSERT_COMPARE(lcioElem, edm4hepElem, isPrimary, "primary in Vertex");
ASSERT_COMPARE(lcioElem, edm4hepElem, getChi2, "chi2 in Vertex");
ASSERT_COMPARE_VALS_FLOAT(lcioElem->getProbability(), TMath::Prob(edm4hepElem.getChi2(), edm4hepElem.getNdf()), 1e-6,
"probability in Vertex");
Expand Down
Loading