Skip to content

Commit

Permalink
Add subdetector holes and Nholes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 5, 2024
1 parent 666f274 commit a7f022d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/CompareEDM4hepEDM4hep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ bool compare(const edm4hep::TrackCollection& origColl, const edm4hep::TrackColle

REQUIRE_SAME(origTrack.getChi2(), track.getChi2(), "chi2 in track " << i);
REQUIRE_SAME(origTrack.getNdf(), track.getNdf(), "chi2 in track " << i);
REQUIRE_SAME(origTrack.getNholes(), track.getNholes(), "Nholes in track " << i);

const auto origSubDetHoles = origTrack.getSubdetectorHoleNumbers();
const auto subDetHoles = track.getSubdetectorHoleNumbers();
REQUIRE_SAME(origSubDetHoles.size(), subDetHoles.size(), "number of subdetector holes in track " << i);
for (size_t iSN = 0; iSN < origSubDetHoles.size(); ++iSN) {
REQUIRE_SAME(origSubDetHoles[iSN], subDetHoles[iSN], "subdetector hole numbers " << iSN << " in track " << i);
}

const auto origSubDetHitNumbers = origTrack.getSubdetectorHitNumbers();
const auto subDetHitNumbers = track.getSubdetectorHitNumbers();
Expand Down
4 changes: 4 additions & 0 deletions tests/src/CompareEDM4hepLCIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ bool compare(const EVENT::Track* lcioElem, const edm4hep::Track& edm4hepElem, co
ASSERT_COMPARE(lcioElem, edm4hepElem, getType, "type in Track");
ASSERT_COMPARE(lcioElem, edm4hepElem, getChi2, "chi2 in Track");
ASSERT_COMPARE(lcioElem, edm4hepElem, getNdf, "ndf in Track");
ASSERT_COMPARE(lcioElem, edm4hepElem, getNholes, "Nholes in Track");

ASSERT_COMPARE(lcioElem, edm4hepElem, getSubdetectorHitNumbers, "subdetectorHitNumbers");
ASSERT_COMPARE(lcioElem, edm4hepElem, getSubdetectorHoleNumbers, "subdetectorHitNumbers");

// EDM4hep does not have the dEdx information inside the track, but rather
// inside a RecDqdx object
Expand Down
4 changes: 4 additions & 0 deletions tests/src/EDM4hep2LCIOUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ edm4hep::TrackCollection createTracks(const int num_elements, const int subdetec
for (int j = 0; j < subdetectorhitnumbers; ++j) {
elem.addToSubdetectorHitNumbers(i + 10 * j);
}
elem.setNholes(i + 3);
for (int j = 0; j < subdetectorhitnumbers; ++j) {
elem.addToSubdetectorHoleNumbers(j + 10 * i);
}

for (auto& idx : link_trackerhit_idcs) {
elem.addToTrackerHits(trackerHits[idx]);
Expand Down

0 comments on commit a7f022d

Please sign in to comment.