Commit 6547493b authored by Chao Peng's avatar Chao Peng
Browse files

add logging level propagation to CKF algorithm

parent 0cb66eec
......@@ -108,19 +108,17 @@ namespace Jug::Reco {
// A "Measurement" is constructed to for each hit which makes the connection to
// the tracking surface and covariance matrix
dd4hep::Position global_position(ahit.x(), ahit.y(), ahit.z());
auto volman = m_geoSvc->detector()->volumeManager();
auto alignment = volman.lookupDetElement(vol_id).nominal();
auto local_position = alignment.worldToLocal(global_position);
auto volman = m_geoSvc->detector()->volumeManager();
auto detelem = volman.lookupDetElement(vol_id);
auto local_pos = detelem.nominal().worldToLocal({ahit.x(), ahit.y(), ahit.z()});
auto acts_pos = surface->globalToLocal(Acts::GeometryContext(), {ahit.x(), ahit.y(), ahit.z()}, {0, 0, 0}).value();
debug() << "===== Debugging hit =====" << endmsg;
debug() << "global pos (" << global_position.x() << "," << global_position.y() << ","
<< global_position.z() << ")" << endmsg;
//debug() << "local pos (" << local_position.x() << "," << local_position.y() << ","
// << local_position.z() << ")" << endmsg;
auto acts_pos = surface->globalToLocal(Acts::GeometryContext(), {ahit.x(), ahit.y(), ahit.z()}, {0, 0, 0}).value();//, pos);
debug() << " ACTS local position : (" << acts_pos[0] << "," << acts_pos[1] << "," << acts_pos[2] << ")"<< endmsg;
debug() << "DD4hep global pos (" << ahit.x() << "," << ahit.y() << "," << ahit.z() << ")" << endmsg;
debug() << "DD4hep local pos (" << local_pos.x() << "," << local_pos.y() << "," << local_pos.z() << ")" << endmsg;
debug() << "ACTS local position : (" << acts_pos[0] << "," << acts_pos[1] << ")"<< endmsg;
debug() << "ACTS surface center : " << surface->center(Acts::GeometryContext()).transpose() << endmsg;
debug() << "DD4hep DetElement center : " << detelem.nominal().localToWorld(detelem.placement().position())/dd4hep::mm << endmsg;
// construct the vector of measured parameters (2d position in this case)
Acts::Vector2 pos(acts_pos.x(), acts_pos.y());
......
......@@ -48,6 +48,15 @@
#include <stdexcept>
static const std::map<int, Acts::Logging::Level> _msgMap = {
{MSG::DEBUG, Acts::Logging::DEBUG},
{MSG::VERBOSE, Acts::Logging::VERBOSE},
{MSG::INFO, Acts::Logging::INFO},
{MSG::WARNING, Acts::Logging::WARNING},
{MSG::FATAL, Acts::Logging::FATAL},
{MSG::ERROR, Acts::Logging::ERROR},
};
namespace Jug::Reco {
using namespace Acts::UnitLiterals;
......@@ -78,6 +87,10 @@ namespace Jug::Reco {
{Acts::GeometryIdentifier(), {15, 10}},
};
m_trackFinderFunc = TrackFindingAlgorithm::makeTrackFinderFunction(m_geoSvc->trackingGeometry(), m_BField);
auto im = _msgMap.find(msgLevel());
if (im != _msgMap.end()) {
m_actsLoggingLevel = im->second;
}
return StatusCode::SUCCESS;
}
......@@ -96,7 +109,7 @@ namespace Jug::Reco {
//// Construct a perigee surface as the target surface
auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3{0., 0., 0.});
ACTS_LOCAL_LOGGER(Acts::getDefaultLogger("TrackFindingAlgorithm Logger", Acts::Logging::VERBOSE));
ACTS_LOCAL_LOGGER(Acts::getDefaultLogger("TrackFindingAlgorithm Logger", m_actsLoggingLevel));
// Perform the track finding for each starting parameter
// @TODO: use seeds from track seeding algorithm as starting parameter
......
......@@ -71,6 +71,7 @@ namespace Jug::Reco {
Acts::MagneticFieldContext m_fieldctx;
Acts::MeasurementSelector::Config m_sourcelinkSelectorCfg;
Acts::Logging::Level m_actsLoggingLevel = Acts::Logging::INFO;
TrackFindingAlgorithm(const std::string& name, ISvcLocator* svcLoc);
......
......@@ -106,7 +106,7 @@ namespace Jug::Reco {
}
const Acts::Surface* surface = is->second;
auto surf_center = surface->center(Acts::GeometryContext());
debug() << " surface center : " << surface->center(Acts::GeometryContext()) << endmsg;
debug() << " surface center : " << surface->center(Acts::GeometryContext()).transpose() << endmsg;
// transform global position into local coordinates
Acts::Vector2 pos(0, 0);
// geometry context contains nothing here
......
......@@ -139,7 +139,7 @@ namespace Jug::Reco {
continue;
}
const Acts::Surface* surface = is->second;
debug() << " surface center : " << surface->center(Acts::GeometryContext()) << endmsg;
debug() << " surface center : " << surface->center(Acts::GeometryContext()).transpose() << endmsg;
//=======
//
// //allHits->push_back(ahit.clone());
......
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