Skip to content

Commit

Permalink
Refs #5021: check units sooner rather than later
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Mar 28, 2012
1 parent b61342b commit 3ddb5d1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ namespace MDEvents
Workspace2D_sptr inWS2D = boost::dynamic_pointer_cast<Workspace2D>(m_inWS);
m_inEventWS = boost::dynamic_pointer_cast<EventWorkspace>(m_inWS);

// check the input units
if (m_inWS->getAxis(0)->unit()->unitID() != "TOF")
throw std::invalid_argument("Input event workspace's X axis must be in TOF units.");

if (!m_inEventWS && !OneEventPerBin)
{
// We DONT want 1 event per bin, but we didn't give an EventWorkspace
Expand All @@ -365,10 +369,6 @@ namespace MDEvents
}


// check the input units
if (m_inWS->getAxis(0)->unit()->unitID() != "TOF")
throw std::invalid_argument("Input event workspace's X axis must be in TOF units.");

// Try to get the output workspace
IMDEventWorkspace_sptr i_out = getProperty("OutputWorkspace");
ws = boost::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<3>,3> >( i_out );
Expand Down

0 comments on commit 3ddb5d1

Please sign in to comment.