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

Add one-to-one relation with raw tracker/calorimeter hit for reconstructed tracker/calorimeter hit #1535

Merged
merged 18 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
7 changes: 7 additions & 0 deletions src/algorithms/calorimetry/CalorimeterHitReco.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <Math/GenVector/Cartesian3D.h>
#include <Math/GenVector/DisplacementVector3D.h>
#include <algorithms/service.h>
#include <edm4eic/EDM4eicVersion.h>
#include <fmt/core.h>
#include <fmt/format.h>
#include <algorithm>
Expand Down Expand Up @@ -265,6 +266,9 @@ void CalorimeterHitReco::process(
const decltype(edm4eic::CalorimeterHitData::local) local_position(pos.x() / dd4hep::mm, pos.y() / dd4hep::mm,
pos.z() / dd4hep::mm);

#if EDM4EIC_VERSION_MAJOR >= 7
auto recohit =
#endif
recohits->create(
rh.getCellID(),
energy,
Expand All @@ -276,6 +280,9 @@ void CalorimeterHitReco::process(
sid,
lid,
local_position);
#if EDM4EIC_VERSION_MAJOR >= 7
recohit.setRawHit(rh);
#endif
veprbl marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/algorithms/tracking/TrackerHitReconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <Math/GenVector/Cartesian3D.h>
#include <Math/GenVector/DisplacementVector3D.h>
#include <edm4eic/CovDiag3f.h>
#include <edm4eic/EDM4eicVersion.h>
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <spdlog/common.h>
Expand Down Expand Up @@ -66,7 +67,10 @@ std::unique_ptr<edm4eic::TrackerHitCollection> TrackerHitReconstruction::process
// - XYZ segmentation: xx -> sigma_x, yy-> sigma_y, zz -> sigma_z, tt -> 0
// This is properly in line with how we get the local coordinates for the hit
// in the TrackerSourceLinker.
rec_hits->create(
#if EDM4EIC_VERSION_MAJOR >= 7
auto rec_hit =
#endif
rec_hits->create(
raw_hit.getCellID(), // Raw DD4hep cell ID
edm4hep::Vector3f{static_cast<float>(pos.x() / mm), static_cast<float>(pos.y() / mm), static_cast<float>(pos.z() / mm)}, // mm
edm4eic::CovDiag3f{get_variance(dim[0] / mm), get_variance(dim[1] / mm), // variance (see note above)
Expand All @@ -75,6 +79,9 @@ std::unique_ptr<edm4eic::TrackerHitCollection> TrackerHitReconstruction::process
m_cfg.timeResolution, // in ns
static_cast<float>(raw_hit.getCharge() / 1.0e6), // Collected energy (GeV)
0.0F); // Error on the energy
#if EDM4EIC_VERSION_MAJOR >= 7
rec_hit.setRawHit(raw_hit);
#endif

}

Expand Down
Loading