Skip to content

Commit

Permalink
Refs #4459: fix QuadEnBackground test
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Feb 10, 2012
1 parent 997c09a commit 698ace6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class IMDWorkspace;
class MANTID_API_DLL IMDIterator
{
public:
IMDIterator();

void setNormalization(Mantid::API::MDNormalization normalization);
Mantid::API::MDNormalization getNormalization() const;
Expand Down
7 changes: 7 additions & 0 deletions Code/Mantid/Framework/API/src/IMDIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ namespace Mantid
namespace API
{

/** Default constructor */
IMDIterator::IMDIterator()
: m_normalization(Mantid::API::VolumeNormalization)
{
}


/** Set how the signal will be normalized when calling getNormalizedSignal()
*
* @param normalization :: method to use
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/src/MDBoxIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace MDEvents
case VolumeNormalization:
return m_current->getSignal() * m_current->getInverseVolume();
case NumEventsNormalization:
return m_current->getSignal() * m_current->getNPoints();
return m_current->getSignal() * double(m_current->getNPoints());
}
return std::numeric_limits<signal_t>::quiet_NaN();
}
Expand All @@ -226,7 +226,7 @@ namespace MDEvents
case VolumeNormalization:
return m_current->getError() * m_current->getInverseVolume();
case NumEventsNormalization:
return m_current->getError() * m_current->getNPoints();
return m_current->getError() * double(m_current->getNPoints());
}
return std::numeric_limits<signal_t>::quiet_NaN();
}
Expand Down
7 changes: 4 additions & 3 deletions Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,25 @@ void SliceViewer::initMenus()
QActionGroup* group = new QActionGroup( this );

action = new QAction(QPixmap(), "No Normalization", this);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_menuView->addAction(action);
action->setActionGroup(group);
action->setCheckable(true);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_actionNormalizeNone = action;

action = new QAction(QPixmap(), "Volume Normalization", this);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_menuView->addAction(action);
action->setActionGroup(group);
action->setCheckable(true);
action->setChecked(true);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_actionNormalizeVolume = action;

action = new QAction(QPixmap(), "Num. Events Normalization", this);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_menuView->addAction(action);
action->setActionGroup(group);
action->setCheckable(true);
connect(action, SIGNAL(triggered()), this, SLOT(changeNormalization()));
m_actionNormalizeNumEvents = action;


Expand Down

0 comments on commit 698ace6

Please sign in to comment.