Skip to content

Commit

Permalink
New algorithm to group detectors using info from Muon Nexus.
Browse files Browse the repository at this point in the history
Refs #7229
  • Loading branch information
arturbekasov committed Oct 11, 2013
1 parent 01c5905 commit 8a41efd
Show file tree
Hide file tree
Showing 4 changed files with 432 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Code/Mantid/Framework/DataHandling/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set ( SRC_FILES
src/AppendGeometryToSNSNexus.cpp
src/ApplyGroupingFromMuonNexus.cpp
src/CompressEvents.cpp
src/CreateChopperModel.cpp
src/CreateModeratorModel.cpp
Expand All @@ -18,7 +19,6 @@ set ( SRC_FILES
src/ISISRunLogs.cpp
src/Load.cpp
src/LoadAscii.cpp
src/LoadHelper.cpp
src/LoadCalFile.cpp
src/LoadCanSAS1D.cpp
src/LoadCanSAS1D2.cpp
Expand All @@ -32,6 +32,7 @@ set ( SRC_FILES
src/LoadEventPreNexus2.cpp
src/LoadFullprofResolution.cpp
src/LoadGSS.cpp
src/LoadHelper.cpp
src/LoadIDFFromNexus.cpp
src/LoadILL.cpp
src/LoadILLSANS.cpp
Expand All @@ -49,8 +50,8 @@ set ( SRC_FILES
src/LoadMappingTable.cpp
src/LoadMask.cpp
src/LoadMaskingFile.cpp
src/LoadMcStasNexus.cpp
src/LoadMcStasEventNexus.cpp
src/LoadMcStasNexus.cpp
src/LoadMuonLog.cpp
src/LoadMuonNexus.cpp
src/LoadMuonNexus1.cpp
Expand All @@ -61,7 +62,6 @@ set ( SRC_FILES
src/LoadNexusMonitors.cpp
src/LoadNexusProcessed.cpp
src/LoadPDFgetNFile.cpp
src/LoadSINQ.cpp
src/LoadParameterFile.cpp
src/LoadPreNexus.cpp
src/LoadPreNexusMonitors.cpp
Expand All @@ -78,6 +78,7 @@ set ( SRC_FILES
src/LoadRawBin0.cpp
src/LoadRawHelper.cpp
src/LoadRawSpectrum0.cpp
src/LoadSINQ.cpp
src/LoadSNSEventNexus.cpp
src/LoadSNSNexus.cpp
src/LoadSNSspec.cpp
Expand Down Expand Up @@ -133,6 +134,7 @@ set ( SRC_FILES

set ( INC_FILES
inc/MantidDataHandling/AppendGeometryToSNSNexus.h
inc/MantidDataHandling/ApplyGroupingFromMuonNexus.h
inc/MantidDataHandling/CompressEvents.h
inc/MantidDataHandling/CreateChopperModel.h
inc/MantidDataHandling/CreateModeratorModel.h
Expand All @@ -151,7 +153,6 @@ set ( INC_FILES
inc/MantidDataHandling/ISISRunLogs.h
inc/MantidDataHandling/Load.h
inc/MantidDataHandling/LoadAscii.h
inc/MantidDataHandling/LoadHelper.h
inc/MantidDataHandling/LoadCalFile.h
inc/MantidDataHandling/LoadCanSAS1D.h
inc/MantidDataHandling/LoadCanSAS1D2.h
Expand All @@ -165,6 +166,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadEventPreNexus2.h
inc/MantidDataHandling/LoadFullprofResolution.h
inc/MantidDataHandling/LoadGSS.h
inc/MantidDataHandling/LoadHelper.h
inc/MantidDataHandling/LoadIDFFromNexus.h
inc/MantidDataHandling/LoadILL.h
inc/MantidDataHandling/LoadILLSANS.h
Expand All @@ -182,8 +184,8 @@ set ( INC_FILES
inc/MantidDataHandling/LoadMappingTable.h
inc/MantidDataHandling/LoadMask.h
inc/MantidDataHandling/LoadMaskingFile.h
inc/MantidDataHandling/LoadMcStasNexus.h
inc/MantidDataHandling/LoadMcStasEventNexus.h
inc/MantidDataHandling/LoadMcStasNexus.h
inc/MantidDataHandling/LoadMuonLog.h
inc/MantidDataHandling/LoadMuonNexus.h
inc/MantidDataHandling/LoadMuonNexus1.h
Expand All @@ -194,7 +196,6 @@ set ( INC_FILES
inc/MantidDataHandling/LoadNexusMonitors.h
inc/MantidDataHandling/LoadNexusProcessed.h
inc/MantidDataHandling/LoadPDFgetNFile.h
inc/MantidDataHandling/LoadSINQ.h
inc/MantidDataHandling/LoadParameterFile.h
inc/MantidDataHandling/LoadPreNexus.h
inc/MantidDataHandling/LoadPreNexusMonitors.h
Expand All @@ -206,6 +207,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadRawBin0.h
inc/MantidDataHandling/LoadRawHelper.h
inc/MantidDataHandling/LoadRawSpectrum0.h
inc/MantidDataHandling/LoadSINQ.h
inc/MantidDataHandling/LoadSNSEventNexus.h
inc/MantidDataHandling/LoadSNSNexus.h
inc/MantidDataHandling/LoadSNSspec.h
Expand Down Expand Up @@ -267,6 +269,7 @@ set ( INC_FILES
set ( TEST_FILES
#LoadSNSNexusTest.h # TODO has no active tests in it
AppendGeometryToSNSNexusTest.h
ApplyGroupingFromMuonNexusTest.h
CompressEventsTest.h
CreateChopperModelTest.h
CreateModeratorModelTest.h
Expand Down Expand Up @@ -307,8 +310,8 @@ set ( TEST_FILES
LoadLogsFromSNSNexusTest.h
LoadMappingTableTest.h
LoadMaskTest.h
LoadMcStasNexusTest.h
LoadMcStasEventNexusTest.h
LoadMcStasNexusTest.h
LoadMuonLogTest.h
LoadMuonNexus1Test.h
LoadMuonNexus2Test.h
Expand All @@ -318,7 +321,6 @@ set ( TEST_FILES
LoadNexusProcessedTest.h
LoadNexusTest.h
LoadPDFgetNFileTest.h
LoadSINQTest.h
LoadParameterFileTest.h
LoadPreNexusMonitorsTest.h
LoadPreNexusTest.h
Expand All @@ -330,6 +332,7 @@ set ( TEST_FILES
LoadRawSaveNxsLoadNxsTest.h
LoadRawSpectrum0Test.h
LoadRawTest.h
LoadSINQTest.h
LoadSNSEventNexusTest.h
LoadSNSspecTest.h
LoadSPETest.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#ifndef MANTID_DATAHANDLING_APPLYGROUPINGFROMMUONNEXUS_H_
#define MANTID_DATAHANDLING_APPLYGROUPINGFROMMUONNEXUS_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/Workspace2D.h"

namespace Mantid
{
namespace DataHandling
{
using namespace DataObjects;
/**
Applies grouping information from Muon Nexus file to the workspace.
@author Arturs Bekasovs
@date 10/10/2013
Copyright © 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport ApplyGroupingFromMuonNexus : public API::Algorithm
{
public:
virtual const std::string name() const;
virtual int version() const;
virtual const std::string category() const;

private:
virtual void initDocs();
void init();
void exec();

bool checkGroups();
bool processGroups();

/// Applies grouping to a given workspace
Workspace2D_sptr applyGrouping(const std::vector<int>& detectorGrouping, Workspace2D_const_sptr inputWs);
};


} // namespace DataHandling
} // namespace Mantid

#endif /* MANTID_DATAHANDLING_APPLYGROUPINGFROMMUONNEXUS_H_ */

0 comments on commit 8a41efd

Please sign in to comment.