Mantid
Loading...
Searching...
No Matches
Classes | Functions
MuonWorkspaceCreationHelper Namespace Reference

Classes

struct  eData
 
struct  yDataAsymmetry
 
struct  yDataCounts
 

Functions

template<typename Function = yDataAsymmetry>
Mantid::API::MatrixWorkspace_sptr createAsymmetryWorkspace (std::size_t nspec, std::size_t maxt, Function dataGenerator=yDataAsymmetry())
 Create a matrix workspace appropriate for Group Asymmetry. More...
 
Mantid::API::MatrixWorkspace_sptr createCountsWorkspace (size_t nspec, size_t maxt, double seed, size_t detectorIDseed, bool isHist, double xStart, double xEnd)
 Create a matrix workspace appropriate for Group Counts. More...
 
Mantid::API::MatrixWorkspace_sptr createCountsWorkspace (size_t nspec, size_t maxt, double seed, size_t detectorIDseed=1)
 Create a matrix workspace appropriate for Group Counts. More...
 
Mantid::API::ITableWorkspace_sptr createDeadTimeTable (const size_t &nspec, std::vector< double > &deadTimes)
 Create a simple dead time TableWorkspace with two columns (spectrum number and dead time). More...
 
Mantid::API::WorkspaceGroup_sptr createMultiPeriodAsymmetryData (const int &nPeriods, size_t nspec, size_t maxt, const std::string &wsGroupName)
 
Mantid::API::WorkspaceGroup_sptr createMultiPeriodWorkspaceGroup (const int &nPeriods, size_t nspec, size_t maxt, const std::string &wsGroupName)
 Create a WorkspaceGroup and add to the ADS, populate with MatrixWorkspaces simulating periods as used in muon analysis. More...
 
Mantid::API::ITableWorkspace_sptr createTimeZeroTable (const size_t &numSpec, const std::vector< double > &timeZeros)
 Create a simple time zero TableWorkspace with one column (time zero) More...
 
Mantid::API::WorkspaceGroup_sptr createWorkspaceGroupConsecutiveDetectorIDs (const int &nWorkspaces, size_t nspec, size_t maxt, const std::string &wsGroupName)
 Creates a grouped workspace containing multiple workspaces with multiple spectra, the detector IDs are consecutive across the spectra, starting from 1. More...
 
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithInstrumentandRun (const std::string &instrName, int runNumber, size_t nSpectra)
 Creates a single-point workspace with instrument and runNumber set. More...
 

Function Documentation

◆ createAsymmetryWorkspace()

template<typename Function = yDataAsymmetry>
Mantid::API::MatrixWorkspace_sptr MuonWorkspaceCreationHelper::createAsymmetryWorkspace ( std::size_t  nspec,
std::size_t  maxt,
Function  dataGenerator = yDataAsymmetry() 
)

Create a matrix workspace appropriate for Group Asymmetry.

One detector per spectra, numbers starting from 1. The detector ID and spectrum number are equal.

Parameters
nspec:: The number of spectra
maxt:: The number of histogram bin edges (between 0.0 and 1.0). Number of bins = maxt - 1 .
dataGenerator:: A function object which takes a double (t) and integer (spectrum number) and gives back a double (the y-value for the data).
Returns
Pointer to the workspace.

Definition at line 59 of file MuonWorkspaceCreationHelper.h.

References WorkspaceCreationHelper::create2DWorkspaceFromFunction().

Referenced by createMultiPeriodAsymmetryData().

◆ createCountsWorkspace() [1/2]

MatrixWorkspace_sptr MuonWorkspaceCreationHelper::createCountsWorkspace ( size_t  nspec,
size_t  maxt,
double  seed,
size_t  detectorIDseed,
bool  isHist,
double  xStart,
double  xEnd 
)

Create a matrix workspace appropriate for Group Counts.

One detector per spectra, numbers starting from 1. The detector ID and spectrum number are equal. Y values increase from 0 in integer steps.

Parameters
nspec:: The number of spectra
maxt:: The number of histogram bin edges (between 0.0 and 1.0). Number of bins = maxt - 1 .
seed:: Number added to all y-values.
detectorIDseed:: detector IDs starting from this number.
isHist:: Whether to output histogram data or not
xStart:: The start value of the x-axis.
xEnd:: The end value of the x-axis.
Returns
Pointer to the workspace.

Definition at line 69 of file MuonWorkspaceCreationHelper.cpp.

References WorkspaceCreationHelper::create2DWorkspaceFromFunction(), and ComponentCreationHelper::createTestInstrumentCylindrical().

◆ createCountsWorkspace() [2/2]

MatrixWorkspace_sptr MuonWorkspaceCreationHelper::createCountsWorkspace ( size_t  nspec,
size_t  maxt,
double  seed,
size_t  detectorIDseed = 1 
)

Create a matrix workspace appropriate for Group Counts.

One detector per spectra, numbers starting from 1. The detector ID and spectrum number are equal. Y values increase from 0 in integer steps.

Definition at line 95 of file MuonWorkspaceCreationHelper.cpp.

References createCountsWorkspace().

Referenced by createCountsWorkspace(), createMultiPeriodWorkspaceGroup(), and createWorkspaceGroupConsecutiveDetectorIDs().

◆ createDeadTimeTable()

ITableWorkspace_sptr MuonWorkspaceCreationHelper::createDeadTimeTable ( const size_t &  nspec,
std::vector< double > &  deadTimes 
)

Create a simple dead time TableWorkspace with two columns (spectrum number and dead time).

Parameters
nspec:: The number of spectra (rows in table).
deadTimes:: The dead times for each spectra.
Returns
TableWorkspace with dead times appropriate for pairing algorithm.

Definition at line 166 of file MuonWorkspaceCreationHelper.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance().

◆ createMultiPeriodAsymmetryData()

Mantid::API::WorkspaceGroup_sptr MuonWorkspaceCreationHelper::createMultiPeriodAsymmetryData ( const int &  nPeriods,
size_t  nspec,
size_t  maxt,
const std::string &  wsGroupName 
)

◆ createMultiPeriodWorkspaceGroup()

WorkspaceGroup_sptr MuonWorkspaceCreationHelper::createMultiPeriodWorkspaceGroup ( const int &  nPeriods,
size_t  nspec,
size_t  maxt,
const std::string &  wsGroupName 
)

Create a WorkspaceGroup and add to the ADS, populate with MatrixWorkspaces simulating periods as used in muon analysis.

Workspace for period i has a name ending _i.

Workspace for period i has a name ending _i.

Parameters
nPeriods:: The number of periods (independent workspaces).
nspec:: The number of spectra in each workspace.
maxt:: The number of histogram bin edges (between 0.0 and 1.0). Number of bins = maxt - 1 .
wsGroupName:: Name of the workspace group containing the period workspaces.
Returns
Pointer to the workspace group.

Definition at line 111 of file MuonWorkspaceCreationHelper.cpp.

References createCountsWorkspace(), Mantid::Kernel::SingletonHolder< T >::Instance(), and std::to_string().

◆ createTimeZeroTable()

ITableWorkspace_sptr MuonWorkspaceCreationHelper::createTimeZeroTable ( const size_t &  numSpec,
const std::vector< double > &  timeZeros 
)

Create a simple time zero TableWorkspace with one column (time zero)

Parameters
numSpec:: The number of spectra (rows of the table)
timeZeros:: Vector of time zeros for each spectra
Returns
TableWorkspace with time zeros in each row for all spectra

Definition at line 193 of file MuonWorkspaceCreationHelper.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance().

◆ createWorkspaceGroupConsecutiveDetectorIDs()

WorkspaceGroup_sptr MuonWorkspaceCreationHelper::createWorkspaceGroupConsecutiveDetectorIDs ( const int &  nWorkspaces,
size_t  nspec,
size_t  maxt,
const std::string &  wsGroupName 
)

Creates a grouped workspace containing multiple workspaces with multiple spectra, the detector IDs are consecutive across the spectra, starting from 1.

Parameters
nWorkspaces:: The number of workspaces.
nspec:: The number of spectra per workspace.
maxt:: The number of histogram bin edges (between 0.0 and 1.0). Number of bins = maxt - 1 .
wsGroupName:: Name of the workspace group.

Definition at line 237 of file MuonWorkspaceCreationHelper.cpp.

References createCountsWorkspace(), Mantid::Kernel::SingletonHolder< T >::Instance(), and std::to_string().

◆ createWorkspaceWithInstrumentandRun()

MatrixWorkspace_sptr MuonWorkspaceCreationHelper::createWorkspaceWithInstrumentandRun ( const std::string &  instrName,
int  runNumber,
size_t  nSpectra 
)

Creates a single-point workspace with instrument and runNumber set.

Parameters
instrName:: Instrument name e.g. MUSR
runNumber:: e.g. 1000
nSpectra:: Number of spectra in the workspace, defaults to 1.
Returns
Pointer to the workspace.

Definition at line 219 of file MuonWorkspaceCreationHelper.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), and nSpectra.