Skip to content
Snippets Groups Projects

Calorimeter Truth partial fix

Merged Whitney Armstrong requested to merge dd4pod_fix into master
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
@@ -200,10 +200,8 @@ namespace dd4hep::sim {
auto cal_hit =
dynamic_cast<dd4hep::sim::Geant4Calorimeter::Hit*>(h);
//Geant4HitData::Contributions& c = cal_hit->truth;
//for (Geant4HitData::Contributions::iterator j = c.begin();
// j != c.end(); ++j) {
//for (Geant4HitData::Contributions::iterator j = c.begin(); j != c.end(); ++j) {
// Geant4HitData::Contribution& t = *j;
// int trackID = t.trackID;
// t.trackID = m_truth->particleID(trackID);
@@ -215,6 +213,16 @@ namespace dd4hep::sim {
phit.g4ID(cal_hit->g4ID);
phit.position({cal_hit->position.x(), cal_hit->position.y(),
cal_hit->position.z(), 0.0});
const auto& first_truth = cal_hit->truth[0];
phit.truth(dd4pod::MonteCarloContrib({
(int)first_truth.trackID,
(int)first_truth.pdgID,
(double)first_truth.deposit,
(double)first_truth.time,
(double)first_truth.length,
(double)first_truth.x,
(double)first_truth.y,
(double)first_truth.z}));
//phit.truth({cal_hit->truth.trackID, cal_hit->truth.pdgID, cal_hit->truth.deposit, cal_hit->truth.time,
// cal_hit->truth.length, cal_hit->truth.x, cal_hit->truth.y, cal_hit->truth.z});
phit.energyDeposit(cal_hit->energyDeposit);
Loading