Commit 4a98181e authored by Chao Peng's avatar Chao Peng
Browse files

add cluster depth

parent 1a24a7e7
......@@ -65,8 +65,8 @@ public:
// reconstruct hit position for the cluster
for (auto &cl : clusters) {
reconstruct(cl);
info() << cl.energy()/GeV << " GeV, (" << cl.position().x/mm << ", "
<< cl.position().y/mm << ", " << cl.position().z/mm << ")" << endmsg;
// info() << cl.energy()/GeV << " GeV, (" << cl.position().x/mm << ", "
// << cl.position().y/mm << ", " << cl.position().z/mm << ")" << endmsg;
}
return StatusCode::SUCCESS;
......@@ -107,7 +107,12 @@ private:
// convert local position to global position, use the cell with max edep as a reference
auto volman = m_geoSvc->detector()->volumeManager();
auto alignment = volman.lookupDetector(centerID).nominal();
auto gpos = alignment.localToWorld(dd4hep::Position(x/tw, y/tw, z/tw));
// depth
// @TODO, assume on the surface
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(centerID);
double depth = -dim[2]/2.;
// info() << depth << " (" << dim[0] << ", " << dim[1] << ", " << dim[2] << ")" << endmsg;
auto gpos = alignment.localToWorld(dd4hep::Position(x/tw, y/tw, z/tw + depth));
cl.position({gpos.x(), gpos.y(), gpos.z()});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment