Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Framework/Algorithms/test/RemoveBinsTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/Axis.h"
#include "MantidAlgorithms/RemoveBins.h"
#include "MantidDataHandling/LoadMuonNexus2.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
#include "MantidHistogramData/LinearGenerator.h"
Expand Down
8 changes: 0 additions & 8 deletions Framework/DataHandling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ set(SRC_FILES
src/LoadMcStas.cpp
src/LoadMcStasNexus.cpp
src/LoadMuonLog.cpp
src/LoadMuonNexus.cpp
src/LoadMuonNexus1.cpp
src/LoadMuonNexus2.cpp
src/LoadMuonNexusV2.cpp
src/LoadMuonNexusV2NexusHelper.cpp
src/LoadMuonStrategy.cpp
Expand Down Expand Up @@ -315,9 +312,6 @@ set(INC_FILES
inc/MantidDataHandling/LoadMcStas.h
inc/MantidDataHandling/LoadMcStasNexus.h
inc/MantidDataHandling/LoadMuonLog.h
inc/MantidDataHandling/LoadMuonNexus.h
inc/MantidDataHandling/LoadMuonNexus1.h
inc/MantidDataHandling/LoadMuonNexus2.h
inc/MantidDataHandling/LoadMuonNexusV2.h
inc/MantidDataHandling/LoadMuonNexusV2NexusHelper.h
inc/MantidDataHandling/LoadMuonStrategy.h
Expand Down Expand Up @@ -532,8 +526,6 @@ set(TEST_FILES
LoadMcStasNexusTest.h
LoadMcStasTest.h
LoadMuonLogTest.h
LoadMuonNexus1Test.h
LoadMuonNexus2Test.h
LoadMuonNexusV2Test.h
LoadNGEMTest.h
LoadNXSPETest.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace DataHandling {
class LoadMuonNexusV2NexusHelper;

// Create time zero table
DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, const std::vector<double> &timeZeros);
MANTID_DATAHANDLING_DLL DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec,
const std::vector<double> &timeZeros);

class MANTID_DATAHANDLING_DLL LoadMuonStrategy {
public:
Expand Down
4 changes: 3 additions & 1 deletion Framework/DataHandling/src/LoadNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ void LoadNexus::exec() {
}

void LoadNexus::runLoadMuonNexus() {
auto loadMuonNexus = createChildAlgorithm("LoadMuonNexus", 0., 1.);
// The Load algorithm will choose the correct LoadMuonNexus algorithm
auto loadMuonNexus = createChildAlgorithm("Load", 0., 1.);

// Pass through the same input filename
loadMuonNexus->setPropertyValue("Filename", m_filename);
// Set the workspace property
Expand Down
8 changes: 4 additions & 4 deletions Framework/DataHandling/test/GroupDetectors2Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "MantidAPI/NumericAxis.h"
#include "MantidAPI/SpectraAxis.h"
#include "MantidAPI/SpectrumInfo.h"
#include "MantidDataHandling/LoadMuonNexus1.h"
#include "MantidDataHandling/MaskDetectors.h"
#include "MantidDataObjects/ScanningWorkspaceBuilder.h"
#include "MantidDataObjects/WorkspaceCreation.h"
Expand All @@ -27,6 +26,7 @@
#include "MantidIndexing/IndexInfo.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/UnitFactory.h"
#include "MantidMuon/LoadMuonNexus1.h"
#include "MantidTypes/SpectrumDefinition.h"

#include <Poco/Path.h>
Expand Down Expand Up @@ -405,7 +405,7 @@ class GroupDetectors2Test : public CxxTest::TestSuite {
}

void testReadingFromXML() {
Mantid::DataHandling::LoadMuonNexus1 nxLoad;
Mantid::Algorithms::LoadMuonNexus1 nxLoad;
nxLoad.initialize();

// Now set required filename and output workspace name
Expand Down Expand Up @@ -444,7 +444,7 @@ class GroupDetectors2Test : public CxxTest::TestSuite {
}

void testReadingFromXMLCheckDuplicateIndex() {
Mantid::DataHandling::LoadMuonNexus1 nxLoad;
Mantid::Algorithms::LoadMuonNexus1 nxLoad;
nxLoad.initialize();

// Now set required filename and output workspace name
Expand Down Expand Up @@ -483,7 +483,7 @@ class GroupDetectors2Test : public CxxTest::TestSuite {
}

void testReadingFromXMLCheckDublicateIndex2() {
Mantid::DataHandling::LoadMuonNexus1 nxLoad;
Mantid::Algorithms::LoadMuonNexus1 nxLoad;
nxLoad.initialize();

// Now set required filename and output workspace name
Expand Down
18 changes: 0 additions & 18 deletions Framework/DataHandling/test/LoadMuonNexusTest.h

This file was deleted.

1 change: 0 additions & 1 deletion Framework/DataHandling/test/LoadRawSaveNxsLoadNxsTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "MantidAPI/Axis.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidDataHandling/LoadNexus.h"
#include "MantidDataHandling/LoadNexusProcessed.h"
#include "MantidDataHandling/LoadRaw3.h"
Expand Down
1 change: 0 additions & 1 deletion Framework/DataHandling/test/SaveNexusProcessedTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "MantidAPI/WorkspaceGroup.h"
#include "MantidDataHandling/LoadEmptyInstrument.h"
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidDataHandling/LoadNexus.h"
#include "MantidDataHandling/LoadRaw3.h"
#include "MantidDataHandling/SaveNexusProcessed.h"
Expand Down
1 change: 0 additions & 1 deletion Framework/DataHandling/test/SaveNexusTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidDataHandling/LoadNexus.h"
#include "MantidDataHandling/SaveNexus.h"
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
Expand Down
14 changes: 11 additions & 3 deletions Framework/Muon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ set(SRC_FILES
src/CalMuonDeadTime.cpp
src/CalMuonDetectorPhases.cpp
src/ConvertFitFunctionForMuonTFAsymmetry.cpp
src/LoadAndApplyMuonDetectorGrouping.cpp
src/EstimateMuonAsymmetryFromCounts.cpp
src/LoadAndApplyMuonDetectorGrouping.cpp
src/LoadMuonNexus.cpp
src/LoadMuonNexus1.cpp
src/LoadMuonNexus2.cpp
src/MuonAlgorithmHelper.cpp
src/MuonAsymmetryHelper.cpp
src/MuonGroupDetectors.cpp
Expand All @@ -34,8 +37,11 @@ set(INC_FILES
inc/MantidMuon/CalMuonDeadTime.h
inc/MantidMuon/CalMuonDetectorPhases.h
inc/MantidMuon/ConvertFitFunctionForMuonTFAsymmetry.h
inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
inc/MantidMuon/EstimateMuonAsymmetryFromCounts.h
inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
inc/MantidMuon/LoadMuonNexus.h
inc/MantidMuon/LoadMuonNexus1.h
inc/MantidMuon/LoadMuonNexus2.h
inc/MantidMuon/MuonAlgorithmHelper.h
inc/MantidMuon/MuonAsymmetryHelper.h
inc/MantidMuon/MuonGroupDetectors.h
Expand All @@ -61,6 +67,8 @@ set(TEST_FILES
CalMuonDetectorPhasesTest.h
ConvertFitFunctionForMuonTFAsymmetryTest.h
LoadAndApplyMuonDetectorGroupingTest.h
LoadMuonNexus1Test.h
LoadMuonNexus2Test.h
MuonAlgorithmHelperTest.h
EstimateMuonAsymmetryFromCountsTest.h
MuonGroupDetectorsTest.h
Expand Down Expand Up @@ -104,7 +112,7 @@ set_property(TARGET Muon PROPERTY FOLDER "MantidFramework")
target_link_libraries(
Muon
PUBLIC Mantid::API Mantid::Kernel Mantid::Geometry
PRIVATE Mantid::DataObjects Mantid::Indexing
PRIVATE Mantid::DataHandling Mantid::DataObjects Mantid::Indexing Mantid::Nexus
)
# Add the unit tests directory
add_subdirectory(test)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/IFileLoader.h"
#include "MantidDataHandling/DllConfig.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/NexusDescriptor.h"
#include "MantidMuon/DllConfig.h"

//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
class MuonNexusReader;

namespace Mantid {
namespace DataHandling {
namespace Algorithms {
/** @class LoadMuonNexus LoadMuonNexus.h DataHandling/LoadMuonNexus.h

It is a base class for loaders for versions 1 and 2 of the muon nexus file
Expand All @@ -47,7 +47,7 @@ multiperiod file)
together based on the groupings in the NeXus file. </LI>
</UL>
*/
class MANTID_DATAHANDLING_DLL LoadMuonNexus : public API::IFileLoader<Kernel::NexusDescriptor> {
class MANTID_MUON_DLL LoadMuonNexus : public API::IFileLoader<Kernel::NexusDescriptor> {
public:
/// Default constructor
LoadMuonNexus();
Expand Down Expand Up @@ -109,5 +109,5 @@ class MANTID_DATAHANDLING_DLL LoadMuonNexus : public API::IFileLoader<Kernel::Ne
void init() override;
};

} // namespace DataHandling
} // namespace Algorithms
} // namespace Mantid
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidMuon/DllConfig.h"
#include "MantidMuon/LoadMuonNexus.h"

// Forward declaration (here, because is not in Mantid namespace)
class MuonNexusReader;
Expand All @@ -24,7 +25,7 @@ namespace NeXus {
class NXRoot;
}

namespace DataHandling {
namespace Algorithms {
/** @class LoadMuonNexus LoadMuonNexus.h DataHandling/LoadMuonNexus.h

Loads an file in Nexus Muon format version 1 and stores it in a 2D workspace
Expand Down Expand Up @@ -52,24 +53,9 @@ multiperiod file)
together based on the groupings in the NeXus file. </LI>
</UL>
*/
class MANTID_DATAHANDLING_DLL LoadMuonNexus1 : public LoadMuonNexus {
class MANTID_MUON_DLL LoadMuonNexus1 : public LoadMuonNexus {
public:
/// Default constructor
LoadMuonNexus1();
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadMuonNexus"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
"file Version 1 and use the results to populate the named "
"workspace. LoadMuonNexus may be invoked by LoadNexus if it is "
"given a NeXus file of this type.";
}

/// Algorithm's version for identification overriding a virtual method
int version() const override { return 1; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "DataHandling\\Nexus;Muon\\DataHandling"; }

/// Returns a confidence value that this algorithm can load a file
int confidence(Kernel::NexusDescriptor &descriptor) const override;
Expand All @@ -79,7 +65,7 @@ class MANTID_DATAHANDLING_DLL LoadMuonNexus1 : public LoadMuonNexus {
void exec() override;

private:
void loadData(size_t hist, specnum_t &i, specnum_t specNo, MuonNexusReader &nxload, const int64_t lengthIn,
void loadData(size_t hist, specnum_t const &i, specnum_t specNo, MuonNexusReader &nxload, const int64_t lengthIn,
const DataObjects::Workspace2D_sptr &localWorkspace);
void runLoadMappingTable(DataObjects::Workspace2D_sptr);
void runLoadLog(const DataObjects::Workspace2D_sptr &);
Expand All @@ -91,15 +77,17 @@ class MANTID_DATAHANDLING_DLL LoadMuonNexus1 : public LoadMuonNexus {
void loadDeadTimes(Mantid::NeXus::NXRoot &root);

/// Creates Dead Time Table using all the data between begin and end
DataObjects::TableWorkspace_sptr createDeadTimeTable(std::vector<int> specToLoad, std::vector<double> deadTimes);
DataObjects::TableWorkspace_sptr createDeadTimeTable(std::vector<int> const &specToLoad,
std::vector<double> const &deadTimes);

/// Loads detector grouping information
API::Workspace_sptr loadDetectorGrouping(Mantid::NeXus::NXRoot &root,
const Mantid::Geometry::Instrument_const_sptr &inst);

/// Creates Detector Grouping Table using all the data from the range
DataObjects::TableWorkspace_sptr createDetectorGroupingTable(std::vector<int> specToLoad, std::vector<int> grouping);
DataObjects::TableWorkspace_sptr createDetectorGroupingTable(std::vector<int> const &specToLoad,
std::vector<int> const &grouping);
};

} // namespace DataHandling
} // namespace Algorithms
} // namespace Mantid
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/DllConfig.h"
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidMuon/DllConfig.h"
#include "MantidMuon/LoadMuonNexus.h"
#include "MantidNexus/NexusClasses.h"

namespace Mantid {

namespace DataHandling {
namespace Algorithms {

/**
Loads an file in NeXus Muon format version 1 and 2 and stores it in a 2D
Expand Down Expand Up @@ -44,34 +44,18 @@ multiperiod file)
together based on the groupings in the NeXus file. </LI>
</UL>
*/
class MANTID_DATAHANDLING_DLL LoadMuonNexus2 : public LoadMuonNexus {
class MANTID_MUON_DLL LoadMuonNexus2 : public LoadMuonNexus {
public:
/// Default constructor
LoadMuonNexus2();
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadMuonNexus"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
"file Version 2 and use the results to populate the named "
"workspace. LoadMuonNexus may be invoked by LoadNexus if it is "
"given a NeXus file of this type.";
}

/// Algorithm's version for identification overriding a virtual method
int version() const override { return 2; }
const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "DataHandling\\Nexus;Muon\\DataHandling"; }

/// Returns a confidence value that this algorithm can load a file
int confidence(Kernel::NexusDescriptor &descriptor) const override;

private:
/// Overwrites Algorithm method
void exec() override;
/// Execute this version of the algorithm
void doExec();

HistogramData::Histogram loadData(const Mantid::HistogramData::BinEdges &edges, const Mantid::NeXus::NXInt &counts,
int period, int spec);
Expand All @@ -80,5 +64,5 @@ class MANTID_DATAHANDLING_DLL LoadMuonNexus2 : public LoadMuonNexus {
std::map<int, std::set<int>> loadDetectorMapping(const Mantid::NeXus::NXInt &spectrumIndex);
};

} // namespace DataHandling
} // namespace Algorithms
} // namespace Mantid
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidMuon/LoadMuonNexus.h"
#include "MantidAPI/FileProperty.h"
#include "MantidAPI/Progress.h"
#include "MantidAPI/TableRow.h"
Expand All @@ -33,7 +33,7 @@
#include <nexus/NeXusException.hpp>
// clang-format on

namespace Mantid::DataHandling {
namespace Mantid::Algorithms {

using namespace Kernel;
using namespace API;
Expand Down Expand Up @@ -214,4 +214,4 @@ void LoadMuonNexus::addToSampleLog(const std::string &logName, const std::string
alg->setProperty("LogText", logString);
alg->executeAsChildAlg();
}
} // namespace Mantid::DataHandling
} // namespace Mantid::Algorithms
Loading
Loading