Peak.h 4.66 KB
Newer Older
1
2
#ifndef MANTID_DATAOBJECTS_PEAK_H_
#define MANTID_DATAOBJECTS_PEAK_H_
3
4

#include "MantidAPI/IPeak.h"
5
#include "MantidGeometry/IInstrument.h"
6
7
#include "MantidKernel/Matrix.h"
#include "MantidKernel/V3D.h"
8
#include "MantidKernel/PhysicalConstants.h"
9
#include "MantidKernel/System.h"
10
11
12
13
14
15
16
17
18
19
20
21


namespace Mantid
{
namespace DataObjects
{

  /** Structure describing a single-crystal peak
   * 
   * @author Janik Zikovsky
   * @date 2011-04-15 13:24:07.963491
   */
22
  class DLLExport Peak: public API::IPeak
23
24
  {
  public:
25
26
27
    /// Allow PeakColumn class to directly access members.
    friend class PeakColumn;

28
    Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0);
29
    Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QSampleFrame, Mantid::Kernel::Matrix<double> goniometer, double detectorDistance=1.0);
30
    Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength);
31
32
    Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL);
    Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL, Mantid::Kernel::Matrix<double> goniometer);
33
34

    // Copy constructor is compiler-provided.
Roman Tolchenov's avatar
Roman Tolchenov committed
35
    Peak(const Peak & other);
36
    Peak(const API::IPeak & ipeak);
37
    virtual ~Peak();
38

39
    void setInstrument(Mantid::Geometry::IInstrument_const_sptr inst);
40

41
    int getDetectorID() const;
42
    void setDetectorID(int m_DetectorID);
43
44
    Mantid::Geometry::IDetector_const_sptr getDetector() const;
    Mantid::Geometry::IInstrument_const_sptr getInstrument() const;
45

46
    bool findDetector();
47

48
49
    int getRunNumber() const;
    void setRunNumber(int m_RunNumber);
50

51
52
53
    double getH() const;
    double getK() const;
    double getL() const;
54
    Mantid::Kernel::V3D getHKL();
55
56
57
    void setH(double m_H);
    void setK(double m_K);
    void setL(double m_L);
58
    void setHKL(double H, double K, double L);
59
    void setHKL(Mantid::Kernel::V3D HKL);
60

61
62
    Mantid::Kernel::V3D getQLabFrame() const;
    Mantid::Kernel::V3D getQSampleFrame() const;
63

64
65
    void setQSampleFrame(Mantid::Kernel::V3D QSampleFrame, double detectorDistance=1.0);
    void setQLabFrame(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0);
66

67
68
69
70
71
72
73
    void setWavelength(double wavelength);
    double getWavelength() const;
    double getDSpacing() const;
    double getTOF() const;

    double getInitialEnergy() const;
    double getFinalEnergy() const;
74
75
76
    void setInitialEnergy(double m_InitialEnergy);
    void setFinalEnergy(double m_FinalEnergy);

77
78
79
    double getIntensity() const;
    double getSigmaIntensity() const;

80
    void setIntensity(double m_Intensity);
81
    void setSigmaIntensity(double m_SigmaIntensity);
82

83
84
85
    double getBinCount() const;
    void setBinCount(double m_BinCount);

86
87
    Mantid::Kernel::Matrix<double> getGoniometerMatrix() const;
    void setGoniometerMatrix(Mantid::Kernel::Matrix<double> m_GoniometerMatrix);
88

89
90
91
    std::string getBankName() const;
    int getRow() const;
    int getCol() const;
92

93
    Mantid::Kernel::V3D getDetPos() const;
94
    double getL1() const;
Janik Zikovsky's avatar
Janik Zikovsky committed
95
    double getL2() const;
96

97
  protected:
98
    /// Shared pointer to the instrument (for calculating some values )
99
    Mantid::Geometry::IInstrument_const_sptr m_inst;
100

101
    /// Detector pointed to
102
    Mantid::Geometry::IDetector_const_sptr m_det;
103

104
105
106
    /// Name of the parent bank
    std::string m_BankName;

107
108
109
110
111
112
113
114
115
116
117
118
    /// ID of the detector
    int m_DetectorID;

    /// H of the peak
    double m_H;

    /// K of the peak
    double m_K;

    /// L of the peak
    double m_L;

119
120
121
122
    /// Integrated peak intensity
    double m_Intensity;

    /// Error (sigma) on peak intensity
123
    double m_SigmaIntensity;
124

125
126
127
    /// Count in the bin at the peak
    double m_BinCount;

128
129
130
131
132
133
    /// Initial energy of neutrons at the peak
    double m_InitialEnergy;

    /// Final energy of the neutrons at peak (normally same as m_InitialEnergy)
    double m_FinalEnergy;

134
    /// Orientation matrix of the goniometer angles.
135
    Mantid::Kernel::Matrix<double> m_GoniometerMatrix;
136
137

    /// Inverse of the goniometer rotation matrix; used to go from Q in lab frame to Q in sample frame
138
    Mantid::Kernel::Matrix<double> m_InverseGoniometerMatrix;
139
140
141
142
143
144
145
146
147
148
149

    /// Originating run number for this peak
    int m_RunNumber;

    /// Cached row in the detector
    int m_Row;

    /// Cached column in the detector
    int m_Col;

    /// Cached source position
150
    Mantid::Kernel::V3D sourcePos;
151
    /// Cached sample position
152
    Mantid::Kernel::V3D samplePos;
153
    /// Cached detector position
154
    Mantid::Kernel::V3D detPos;
155

156
157
158
159
160
161
162
  };


} // namespace Mantid
} // namespace DataObjects

#endif  /* MANTID_DATAOBJECTS_PEAK_H_ */