Skip to content

Commit

Permalink
Only copy UB to new peaks workspace. Re #6926.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Apr 25, 2013
1 parent 10daa82 commit 8d1e9d0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ void InstrumentWindowPickTab::addPeak(double x,double y)
InstrumentActor* instrActor = m_instrWindow->getInstrumentActor();
Mantid::API::MatrixWorkspace_const_sptr ws = instrActor->getWorkspace();
std::string peakTableName;
bool newPeaksWorkspace = false;
if ( tw )
{
peakTableName = tw->name();
Expand All @@ -682,6 +683,7 @@ void InstrumentWindowPickTab::addPeak(double x,double y)
tw = Mantid::API::WorkspaceFactory::Instance().createPeaks("PeaksWorkspace");
tw->setInstrument(instr);
Mantid::API::AnalysisDataService::Instance().add(peakTableName,tw);
newPeaksWorkspace = true;
}
else
{
Expand Down Expand Up @@ -709,8 +711,8 @@ void InstrumentWindowPickTab::addPeak(double x,double y)
alg->setProperty( "BinCount", y );
alg->execute();

// if peaks workspace doesn't have UB but the data ws has one copy it to peaks
if ( !tw->sample().hasOrientedLattice() && ws->sample().hasOrientedLattice() )
// if data WS has UB copy it to the new peaks workspace
if ( newPeaksWorkspace && ws->sample().hasOrientedLattice() )
{
auto UB = ws->sample().getOrientedLattice().getUB();
auto lattice = new Mantid::Geometry::OrientedLattice;
Expand Down

0 comments on commit 8d1e9d0

Please sign in to comment.