Mantid
Loading...
Searching...
No Matches
MSVesuvioHelpers.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include <random>
11#include <vector>
12
13namespace Mantid {
14namespace CurveFitting {
15namespace MSVesuvioHelper {
16// Absorption energy for double-difference gold foil
17double finalEnergyAuDD(const double randv);
18// Absorption energy for gold foil YAP
19double finalEnergyAuYap(const double randv);
20// Absorption energy for uranium
21double finalEnergyUranium(const double randv);
22
23// Ties together random numbers with various probability distributions
25public:
26 RandomVariateGenerator(const int seed);
28 double flat();
30 double gaussian(const double mean, const double sigma);
31
32private:
34 std::mt19937 m_engine;
35};
36
37// Stores counts for each scatter order
38// for a "run" of a given number of events
39struct Simulation {
40 Simulation(const size_t order, const size_t ntimes);
41
42 std::vector<std::vector<double>> counts;
43 size_t maxorder;
44};
45// Stores counts for each scatter order with errors
47 SimulationWithErrors(const size_t order, const size_t ntimes)
48 : sim(order, ntimes), errors(order, std::vector<double>(ntimes)) {}
49
50 void normalise();
52 std::vector<std::vector<double>> errors;
53};
54
55// Accumulates and averages the results of a set of simulations
57 SimulationAggregator(const size_t nruns);
58
59 // Creates a placeholder for a new simulation
60 Simulation &newSimulation(const size_t order, const size_t ntimes);
62
63 std::vector<Simulation> results;
64};
65} // namespace MSVesuvioHelper
66} // namespace CurveFitting
67} // namespace Mantid
double sigma
Definition: GetAllEi.cpp:156
double flat()
Returns a flat random number between 0.0 & 1.0.
double gaussian(const double mean, const double sigma)
Returns a random number distributed by a normal distribution.
double finalEnergyUranium(const double randv)
Generate the final energy of a neutron for uranium foil analyser at 293K with number density of 1....
double finalEnergyAuYap(const double randv)
Generate the final energy of a neutron for gold foil analyser at 293K with number density of 7....
double finalEnergyAuDD(const double randv)
Generate the final energy of a neutron for gold foil analyser at 293K in double-difference mode:
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.
Simulation & newSimulation(const size_t order, const size_t ntimes)
SimulationWithErrors(const size_t order, const size_t ntimes)
void normalise()
Normalise the counts so that the integral over the single-scatter events is 1.
std::vector< std::vector< double > > counts