Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/8627_SEBLV_phantom_monit…
Browse files Browse the repository at this point in the history
…or_defence'
  • Loading branch information
AndreiSavici committed Dec 16, 2013
2 parents 64aac06 + 85e6e9a commit 713ea36
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp
Expand Up @@ -331,17 +331,22 @@ namespace Algorithms
// Loop over the spectra - there will be one per monitor
for ( std::size_t spec = 0; spec < monitorWorkspace->getNumberHistograms(); ++spec )
{
// Create a column for this monitor
const std::string monitorName = monitorWorkspace->getDetector(spec)->getName();
auto monitorCounts = outputWorkspace->addColumn("int",monitorName);
const IEventList & eventList = monitorWorkspace->getEventList(spec);
// Accumulate things in a local vector before transferring to the table workspace
std::vector<int> Y(xLength);
filterEventList(eventList, minVal, maxVal, log, Y);
// Transfer the results to the table
for ( int i = 0; i < xLength; ++i )
{
monitorCounts->cell<int>(i) = Y[i];
try {
// Create a column for this monitor
const std::string monitorName = monitorWorkspace->getDetector(spec)->getName();
auto monitorCounts = outputWorkspace->addColumn("int",monitorName);
const IEventList & eventList = monitorWorkspace->getEventList(spec);
// Accumulate things in a local vector before transferring to the table workspace
std::vector<int> Y(xLength);
filterEventList(eventList, minVal, maxVal, log, Y);
// Transfer the results to the table
for ( int i = 0; i < xLength; ++i )
{
monitorCounts->cell<int>(i) = Y[i];
}
} catch (Exception::NotFoundError&) {
// ADARA-generated nexus files have sometimes been seen to contain 'phantom' monitors that aren't in the IDF.
// This handles that by ignoring those spectra.
}
}
}
Expand Down

0 comments on commit 713ea36

Please sign in to comment.