Skip to content
Snippets Groups Projects
Commit 4a98181e authored by Chao Peng's avatar Chao Peng
Browse files

add cluster depth

parent 1a24a7e7
No related branches found
No related tags found
1 merge request!11Use local positions for clustering, and convert to global position in reconstruction
...@@ -65,8 +65,8 @@ public: ...@@ -65,8 +65,8 @@ public:
// reconstruct hit position for the cluster // reconstruct hit position for the cluster
for (auto &cl : clusters) { for (auto &cl : clusters) {
reconstruct(cl); reconstruct(cl);
info() << cl.energy()/GeV << " GeV, (" << cl.position().x/mm << ", " // info() << cl.energy()/GeV << " GeV, (" << cl.position().x/mm << ", "
<< cl.position().y/mm << ", " << cl.position().z/mm << ")" << endmsg; // << cl.position().y/mm << ", " << cl.position().z/mm << ")" << endmsg;
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -107,7 +107,12 @@ private: ...@@ -107,7 +107,12 @@ private:
// convert local position to global position, use the cell with max edep as a reference // convert local position to global position, use the cell with max edep as a reference
auto volman = m_geoSvc->detector()->volumeManager(); auto volman = m_geoSvc->detector()->volumeManager();
auto alignment = volman.lookupDetector(centerID).nominal(); 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()}); cl.position({gpos.x(), gpos.y(), gpos.z()});
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment