Skip to content

Commit

Permalink
Add some debugging statements to GetEi2.
Browse files Browse the repository at this point in the history
Refs #8057
  • Loading branch information
martyngigg committed Oct 4, 2013
1 parent 17c70ba commit 7c41d2d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/GetEi2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ double GetEi2::calculateEi(const double initial_guess)
*/
double GetEi2::getDistanceFromSource(size_t ws_index) const
{
g_log.debug() << "Computing distance between spectrum at index '" << ws_index << "' and the source\n";

const IObjComponent_const_sptr source = m_input_ws->getInstrument()->getSource();
// Retrieve a pointer detector
IDetector_const_sptr det = m_input_ws->getDetector(ws_index);
Expand All @@ -291,7 +293,14 @@ double GetEi2::getDistanceFromSource(size_t ws_index) const
msg << "A detector for monitor at workspace index " << ws_index << " cannot be found. ";
throw std::runtime_error(msg.str());
}
return det->getDistance(*source);
if(g_log.is(Logger::Priority::PRIO_DEBUG))
{
g_log.debug() << "Detector position = " << det->getPos()
<< ", Source position = " << source->getPos() << "\n";
}
const double dist = det->getDistance(*source);
g_log.debug() << "Distance = " << dist << " metres\n";
return dist;
}

/**
Expand Down

0 comments on commit 7c41d2d

Please sign in to comment.