Skip to content

Commit

Permalink
re #7176 removing the method doneAddingEventLists()
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDraper committed Jun 17, 2013
1 parent 6e995f8 commit 920ffe8
Show file tree
Hide file tree
Showing 26 changed files with 1 addition and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,6 @@ void DiffractionFocussing2::execEvent()
PARALLEL_CHECK_INTERUPT_REGION
} // (done with parallel by groups)

//Finalize the maps
out->doneAddingEventLists();

//Now that the data is cleaned up, go through it and set the X vectors to the input workspace we first talked about.
delete prog; prog = new Progress(this,0.9,1.0,nGroups);
for (size_t workspaceIndex = 0; workspaceIndex < this->m_validGroups.size(); workspaceIndex++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ namespace Algorithms
double dtmsec = static_cast<double>(dt)/1000.0;
outEL.addEventQuickly( WeightedEventNoTime( dtmsec, values[i], values[i]) );
}
outEventWS->doneAddingEventLists();
// Ensure thread-safety
outEventWS->sortAll(TOF_SORT, NULL);

Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/FilterByLogValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ void FilterByLogValue::exec()
}
PARALLEL_CHECK_INTERUPT_REGION

outputWS->doneAddingEventLists();

//To split/filter the runs, first you make a vector with just the one output run
std::vector< LogManager *> output_runs;
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/FilterByTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ void FilterByTime::exec()
}
PARALLEL_CHECK_INTERUPT_REGION

outputWS->doneAddingEventLists();

//Now filter out the run, using the DateAndTime type.
outputWS->mutableRun().filterByTime(start, stop);
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/FilterEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ namespace Algorithms
int wsindex = wsiter->first;
DataObjects::EventWorkspace_sptr opws = wsiter->second;

// 2a Done adding event
opws->doneAddingEventLists();

// 2b To split/filter the selected run of the workspace output
Kernel::TimeSplitterType splitters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ namespace Algorithms
workspaceIndex += 1;
}
}
outputWS->doneAddingEventLists();

// Clear
pixel_to_wkspindex.clear();
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/MergeRuns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ void MergeRuns::execEvent()
m_progress->report();
}

//Finalize the workspace, since it might have more entries now.
outWS->doneAddingEventLists();

// Set the final workspace to the output property
setProperty("OutputWorkspace", boost::dynamic_pointer_cast<MatrixWorkspace>(outWS));
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/SmoothNeighbours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,6 @@ void SmoothNeighbours::execEvent(Mantid::DataObjects::EventWorkspace_sptr ws)
}
PARALLEL_CHECK_INTERUPT_REGION

//Finalize the data
outWS->doneAddingEventLists();

//Give the 0-th X bins to all the output spectra.
Kernel::cow_ptr<MantidVec> outX = inWS->refX(0);
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/SumSpectra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,6 @@ void SumSpectra::execEvent(EventWorkspace_const_sptr localworkspace, std::set<in
progress.report();
}

//Finalize spectra map etc.
outputWorkspace->doneAddingEventLists();

//Set all X bins on the output
cow_ptr<MantidVec> XValues;
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/WorkspaceJoiners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ namespace Algorithms
m_progress->report();
}

output->doneAddingEventLists();

//Set the same bins for all output pixels
output->setAllX(XValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ IEventWorkspace_sptr createEventWorkspace(const int numberspectra, const int nDi
retVal->getEventList(pix).addDetectorID(pix);
retVal->getEventList(pix).setSpectrumNo(pix);
}
retVal->doneAddingEventLists();

// Add the required start time.
PropertyWithValue<std::string>* testProperty = new PropertyWithValue<std::string>("start_time", runStart.toSimpleString(), Direction::Input);
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Crystal/src/AnvredCorrection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ void AnvredCorrection::execEvent()
}
PARALLEL_CHECK_INTERUPT_REGION

correctionFactors->doneAddingEventLists();
// set the absorption correction values in the run parameters
API::Run & run = correctionFactors->mutableRun();
run.addProperty<double>("Radius", radius, true);
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Crystal/test/AnvredCorrectionTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class AnvredCorrectionTest : public CxxTest::TestSuite

}

retVal->doneAddingEventLists();
/// Clean up the generators
for (size_t d=0; d<nd; ++d)
delete gens[d];
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Crystal/test/CentroidPeaksTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class CentroidPeaksTest : public CxxTest::TestSuite
el += TofEvent(5844.+10.*(((*gens[0])()+(*gens[0])()+(*gens[0])())*2.-3.), run_start+double(i));
}
}
retVal->doneAddingEventLists();

/// Clean up the generators
for (size_t d=0; d<nd; ++d)
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Crystal/test/NormaliseVanadiumTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class NormaliseVanadiumTest : public CxxTest::TestSuite

}

retVal->doneAddingEventLists();
/// Clean up the generators
for (size_t d=0; d<nd; ++d)
delete gens[d];
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Crystal/test/PeakIntegrationTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class PeakIntegrationTest : public CxxTest::TestSuite
el += TofEvent(5844.+10.*(((*gens[0])()+(*gens[0])()+(*gens[0])())*2.-3.), run_start+double(i));
}
}
retVal->doneAddingEventLists();

/// Clean up the generators
for (size_t d=0; d<nd; ++d)
Expand Down
4 changes: 0 additions & 4 deletions Code/Mantid/Framework/DataHandling/src/GroupDetectors2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,6 @@ size_t GroupDetectors2::formGroupsEvent( DataObjects::EventWorkspace_const_sptr
outIndex ++;
}

// Refresh the spectraDetectorMap
outputWS->doneAddingEventLists();

if ( bhv == 1 && requireDivide )
{
Expand Down Expand Up @@ -1051,8 +1049,6 @@ void GroupDetectors2::moveOthersEvent(const std::set<int64_t> &unGroupedSet, Dat
interruption_point();
}
}
// Refresh the spectraDetectorMap
outputWS->doneAddingEventLists();

g_log.debug() << name() << " copied " << unGroupedSet.size()-1 << " ungrouped spectra\n";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ void LoadEventPreNexus::procEvents(DataObjects::EventWorkspace_sptr & workspace)
workspaceIndex += 1;
}
}
workspace->doneAddingEventLists();

//For slight speed up
loadOnlySomeSpectra = (this->spectra_list.size() > 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ void LoadEventPreNexus2::procEvents(DataObjects::EventWorkspace_sptr & workspace
workspaceIndex += 1;
}
}
workspace->doneAddingEventLists();

//For slight speed up
loadOnlySomeSpectra = (this->spectra_list.size() > 0);
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ API::MatrixWorkspace_sptr LoadNexusProcessed::loadEventEntry(NXData & wksp_cls,
}
PARALLEL_CHECK_INTERUPT_REGION

// Clean up some stuff
ws->doneAddingEventLists();

return ws;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class MaskDetectorsTest : public CxxTest::TestSuite
spaceEvent->getEventList(j).setDetectorID(j);
spaceEvent->getAxis(1)->setValue(j, j);
}
spaceEvent->doneAddingEventLists();
x.access().push_back(0.0);
x.access().push_back(10.0);
spaceEvent->setAllX(x);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ class DLLExport EventWorkspace : public API::IEventWorkspace
void padSpectra();
// Remove pixels in the workspace that do not contain events.
void deleteEmptyLists();

// Make all the mapping stuff
void doneAddingEventLists();



//------------------------------------------------------------
// The total number of events across all of the spectra.
std::size_t getNumberEvents() const;
Expand Down
12 changes: 0 additions & 12 deletions Code/Mantid/Framework/DataObjects/src/EventWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ namespace DataObjects
//-----------------------------------------------------------------------------
/** Either return an existing EventList from the list, or
* create a new one if needed and expand the list.
* NOTE: After you are done adding event lists, call doneAddingEventLists()
* to finalize the stuff that needs to.
**
* @param workspace_index :: The workspace index number.
Expand Down Expand Up @@ -608,17 +607,6 @@ namespace DataObjects
}


//-----------------------------------------------------------------------------
/** Call this method when you are done manually adding event lists
* at specific workspace indices.
* Used to deal with the axis and spectramapping. Doesn't really do anything any longer.
*/
void EventWorkspace::doneAddingEventLists()
{
//Clearing the MRU list is a good idea too.
this->clearMRU();
}



//-----------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions Code/Mantid/Framework/DataObjects/test/EventWorkspaceTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class EventWorkspaceTest : public CxxTest::TestSuite
retVal->getEventList(pix).addDetectorID(pix);
retVal->getEventList(pix).setSpectrumNo(pix);
}
retVal->doneAddingEventLists();
}
else
{
Expand Down Expand Up @@ -142,7 +141,6 @@ class EventWorkspaceTest : public CxxTest::TestSuite
// retVal->getEventList(pix).addDetectorID(pix);
// retVal->getEventList(pix).setSpectrumNo(pix);
// }
// retVal->doneAddingEventLists();
//
// //Create the x-axis for histogramming.
// Kernel::cow_ptr<MantidVec> axis;
Expand Down Expand Up @@ -217,7 +215,6 @@ class EventWorkspaceTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS( el.getDetectorIDs().size(), 0);
TS_ASSERT( !el.hasDetectorID(1023) );

ew->doneAddingEventLists();
TS_ASSERT_EQUALS( ew->getAxis(1)->length(), 1023+1);

}
Expand Down Expand Up @@ -330,7 +327,6 @@ class EventWorkspaceTest : public CxxTest::TestSuite
uneven->getEventList(wi).setSpectrumNo(pix);
wi++;
}
uneven->doneAddingEventLists();

//Create the x-axis for histogramming.
Kernel::cow_ptr<MantidVec> axis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ namespace MDEventsTestHelper
}
retVal->getEventList(pix).addDetectorID(pix);
}
retVal->doneAddingEventLists();

//Create the x-axis for histogramming.
Mantid::MantidVecPtr x1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ namespace WorkspaceCreationHelper
ws->getEventList(wi).setDetectorID(detID);
detID++;
}
ws->doneAddingEventLists();
return ws;
}

Expand Down Expand Up @@ -524,7 +523,6 @@ namespace WorkspaceCreationHelper
workspaceIndex++;
}
}
retVal->doneAddingEventLists();

//Create the x-axis for histogramming.
MantidVecPtr x1;
Expand Down Expand Up @@ -564,7 +562,6 @@ namespace WorkspaceCreationHelper
}
}

retVal->doneAddingEventLists();

//Create the x-axis for histogramming.
MantidVecPtr x1;
Expand Down Expand Up @@ -627,7 +624,6 @@ namespace WorkspaceCreationHelper
}
events.addDetectorID( detid_t(i) );
}
retVal->doneAddingEventLists();
retVal->setAllX(axis);
retVal->replaceAxis(0,pAxis0);

Expand Down Expand Up @@ -937,7 +933,6 @@ namespace WorkspaceCreationHelper
workspaceIndex += 1;
}
}
outputWS->doneAddingEventLists();

// Clear
pixel_to_wkspindex.clear();
Expand Down

0 comments on commit 920ffe8

Please sign in to comment.