source: sasview/DataLoader/extensions/smearer.hh @ b341b16

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since b341b16 was a3f8d58, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

dataloader: converted smearing to C and allowed for partial Q range

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[a3f8d58]1/**
2        This software was developed by the University of Tennessee as part of the
3        Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
4        project funded by the US National Science Foundation.
5
6        If you use DANSE applications to do scientific research that leads to
7        publication, we ask that you acknowledge the use of the software with the
8        following sentence:
9
10        "This work benefited from DANSE software developed under NSF award DMR-0520547."
11
12        copyright 2009, University of Tennessee
13 */
14#ifndef SMEARER_CLASS_H
15#define SMEARER_CLASS_H
16
17#include <vector>
18
19using namespace std;
20
21/**
22 * Base smearer class, implementing the matrix multiplication only
23 */
24class BaseSmearer {
25protected:
26        bool has_matrix;
27    // Smearing matrix
28    vector<double>* weights;
29    // Q_min (Min Q-value for I(q))
30    double qmin;
31    // Q_max (Max Q_value for I(q))
32    double qmax;
33    // Number of Q bins
34    int nbins;
35
36public:
37    // Constructor
38    BaseSmearer(double qmin, double qmax, int nbins);
39        // Smear function
40        virtual void smear(double *, double *, int, int);
41        // Compute the smearing matrix
42        virtual void compute_matrix(){};
43        // Utility function to check the number of bins
44        int get_nbins() { return nbins; }
45};
46
47
48/**
49 * Slit smearer class
50 */
51class SlitSmearer : public BaseSmearer {
52
53protected:
54    // Number of points used in the smearing computation
55    static const int npts   = 10000;
56
57public:
58    // Slit width in Q units
59    double width;
60    // Slit height in Q units
61    double height;
62
63    // Constructor
64        SlitSmearer(double width, double height, double qmin, double qmax, int nbins);
65        // Compute the smearing matrix
66        virtual void compute_matrix();
67};
68
69
70/**
71 * Point smearer class
72 */
73class QSmearer : public BaseSmearer {
74
75protected:
76    // Standard deviation in Q [A-1]
77    double* width;
78
79public:
80
81    // Constructor
82    QSmearer(double* width,double qmin, double qmax, int nbins);
83        // Compute the smearing matrix
84        virtual void compute_matrix();
85};
86
87#endif
Note: See TracBrowser for help on using the repository browser.