31 return static_cast<double>(
m_count);
45 double e = exp(-t /
tau);
46 double factor = (
static_cast<double>(spec) + 1.0) * 0.5;
47 double phase_offset = 4 * M_PI / 180;
49 0.0, (10. * factor * (1.0 +
m_amp * cos(
m_omega * t +
m_phi +
static_cast<double>(spec) * phase_offset)) * e));
70 double xStart,
double xEnd) {
73 yDataCounts(),
static_cast<int>(nspec), xStart, xEnd, (1.0 /
static_cast<double>(maxt)), isHist,
eData());
77 for (
int g = 0; g < static_cast<int>(nspec); g++) {
78 auto &spec = ws->getSpectrum(g);
79 spec.addDetectorID(g +
static_cast<int>(detectorIDseed));
80 spec.setSpectrumNo(g + 1);
81 ws->mutableY(g) += seed;
85 ws->mutableRun().addProperty(
"goodfrm", 10);
87 std::shared_ptr<Geometry::Instrument> inst1 = std::make_shared<Geometry::Instrument>();
88 inst1->setName(
"EMU");
89 ws->setInstrument(inst1);
90 ws->mutableRun().addProperty(
"run_number", 12345);
112 const std::string &wsGroupName) {
117 std::string wsNameStem =
"MuonDataPeriod_";
120 std::shared_ptr<Geometry::Instrument> inst1 = std::make_shared<Geometry::Instrument>();
121 inst1->setName(
"EMU");
123 for (
int period = 1; period < nPeriods + 1; period++) {
128 wsGroup->addWorkspace(ws);
137 const std::string &wsGroupName) {
141 std::string wsNameStem =
"MuonDataPeriod_";
144 std::shared_ptr<Mantid::Geometry::Instrument> inst1 = std::make_shared<Mantid::Geometry::Instrument>();
145 inst1->setName(
"EMU");
147 for (
int period = 1; period < nPeriods + 1; period++) {
151 wsGroup->addWorkspace(ws);
171 deadTimeTable->addColumn(
"int",
"Spectrum Number");
172 deadTimeTable->addColumn(
"double",
"Dead Time");
174 if (deadTimes.size() != nspec) {
175 return deadTimeTable;
178 for (
size_t spec = 0; spec < deadTimes.size(); spec++) {
179 TableRow newRow = deadTimeTable->appendRow();
180 newRow << static_cast<int>(spec) + 1;
181 newRow << deadTimes[spec];
184 return deadTimeTable;
198 timeZeroTable->addColumn(
"double",
"time zero");
200 if (timeZeros.size() != numSpec) {
201 return timeZeroTable;
204 for (
size_t specNum = 0; specNum < numSpec; ++specNum) {
205 TableRow row = timeZeroTable->appendRow();
206 row << timeZeros[specNum];
209 return timeZeroTable;
223 ws->setInstrument(instr);
224 ws->mutableRun().addProperty(
"run_number", runNumber);
238 const std::string &wsGroupName) {
243 std::string wsNameStem =
"MuonDataPeriod_";
246 for (
int period = 1; period < nWorkspaces + 1; period++) {
249 size_t detIDstart = (period - 1) * nspec + 1;
251 wsGroup->addWorkspace(ws);
TableRow represents a row in a TableWorkspace.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Mantid::Geometry::Instrument_sptr createTestInstrumentCylindrical(int num_banks, const Mantid::Kernel::V3D &sourcePos=Mantid::Kernel::V3D(0.0, 0.0, -10.), const Mantid::Kernel::V3D &samplePos=Mantid::Kernel::V3D(), const double cylRadius=0.004, const double cylHeight=0.0002)
Create an test instrument with n panels of 9 cylindrical detectors, a source and a sample position.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
Helper class which provides the Collimation Length for SANS instruments.
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 ar...
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)
Mantid::API::WorkspaceGroup_sptr createMultiPeriodAsymmetryData(const int &nPeriods, size_t nspec, size_t maxt, const std::string &wsGroupName)
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.
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...
Mantid::API::MatrixWorkspace_sptr createAsymmetryWorkspace(std::size_t nspec, std::size_t maxt, Function dataGenerator=yDataAsymmetry())
Create a matrix workspace appropriate for Group Asymmetry.
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).
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithInstrumentandRun(const std::string &instrName, int runNumber, size_t nSpectra=1)
Creates a single-point workspace with instrument and runNumber set.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceFromFunction(fT yFunc, int nSpec, double x0, double x1, double dx, bool isHist=false, gT eFunc=ReturnOne())
Creates a 2D workspace from taking the function values from the input function.
std::string to_string(const wide_integer< Bits, Signed > &n)
double operator()(const double, size_t)
double operator()(const double t, size_t spec)
double operator()(const double t, size_t spec)