Commit c3646411 authored by Chao Peng's avatar Chao Peng
Browse files

Merge branch 'master' into 'master'

minor fixes

See merge request !14
parents fdc8245b 5873406d
...@@ -37,6 +37,7 @@ public: ...@@ -37,6 +37,7 @@ public:
m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this}; m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this};
// Pointer to the geometry service // Pointer to the geometry service
SmartIF<IGeoSvc> m_geoSvc; SmartIF<IGeoSvc> m_geoSvc;
double m_depthCorr;
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm; // ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
ClusterRecoCoG(const std::string& name, ISvcLocator* svcLoc) ClusterRecoCoG(const std::string& name, ISvcLocator* svcLoc)
...@@ -56,6 +57,9 @@ public: ...@@ -56,6 +57,9 @@ public:
<< "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << endmsg; << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << endmsg;
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
// depth: z length of the crystal block
m_depthCorr = m_geoSvc->detector()->constantAsDouble(m_moduleDimZName);
//info() << "z_length " << depth << endmsg;
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -108,14 +112,7 @@ private: ...@@ -108,14 +112,7 @@ 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();
// depth auto gpos = alignment.localToWorld(dd4hep::Position(x/tw, y/tw, z/tw + m_depthCorr));
// @TODO, assume on the surface
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(centerID);
// z length of the crystal block
double depth = m_geoSvc->detector()->constantAsDouble(m_moduleDimZName);
//info() << "z_length " << depth << endmsg;
// 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()});
} }
......
Supports Markdown
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