Peak.h 4.04 KB
Newer Older
1
2
3
4
#ifndef MANTID_DATAOBJECTS_PEAK_H_
#define MANTID_DATAOBJECTS_PEAK_H_
    
#include "MantidKernel/System.h"
5
#include "MantidGeometry/V3D.h"
6
#include "MantidGeometry/Math/Matrix.h"
7
#include "MantidGeometry/IInstrument.h"
8
#include "MantidKernel/PhysicalConstants.h"
9
10
11
12
13
14
15
16
17
18
19
20


namespace Mantid
{
namespace DataObjects
{

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

Janik Zikovsky's avatar
Janik Zikovsky committed
27
    Peak(Mantid::Geometry::IInstrument_sptr m_inst, int m_DetectorID, double m_Wavelength);
28
    Peak(Mantid::Geometry::IInstrument_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL);
29
    Peak(Mantid::Geometry::IInstrument_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL,Mantid::Geometry::Matrix<double> goniometer);
30
31
32
33

    // Copy constructor is compiler-provided.
    //    Peak(const Peak & other);
    virtual ~Peak();
34

35
    int getDetectorID() const;
36
37
38
39
40
41
    void setDetectorID(int m_DetectorID);
    Mantid::Geometry::IDetector_sptr getDetector() const;
    Mantid::Geometry::IInstrument_sptr getInstrument() const;

    int getRunNumber() const;
    void setRunNumber(int m_RunNumber);
42

43
44
45
    double getH() const;
    double getK() const;
    double getL() const;
46
    Mantid::Geometry::V3D getHKL();
47
48
49
    void setH(double m_H);
    void setK(double m_K);
    void setL(double m_L);
50
    void setHKL(double H, double K, double L);
51
    void setHKL(Mantid::Geometry::V3D HKL);
52

53
54
55
56
57
58
59
60
61
62
    Mantid::Geometry::V3D getQLabFrame() const;
    Mantid::Geometry::V3D getQSampleFrame() const;

    void setWavelength(double wavelength);
    double getWavelength() const;
    double getDSpacing() const;
    double getTOF() const;

    double getInitialEnergy() const;
    double getFinalEnergy() const;
63
64
65
    void setInitialEnergy(double m_InitialEnergy);
    void setFinalEnergy(double m_FinalEnergy);

66
67
68
    double getIntensity() const;
    double getSigmaIntensity() const;

69
    void setIntensity(double m_Intensity);
70
    void setSigmaIntensity(double m_SigmaIntensity);
71

72
73
74
    double getBinCount() const;
    void setBinCount(double m_BinCount);

75
76
    Mantid::Geometry::Matrix<double> getGoniometerMatrix() const;
    void setGoniometerMatrix(Mantid::Geometry::Matrix<double> m_GoniometerMatrix);
77

78
79
80
    std::string getBankName() const;
    int getRow() const;
    int getCol() const;
81

82
83
    Mantid::Geometry::V3D getDetPos() const;
    double getL1() const;
Janik Zikovsky's avatar
Janik Zikovsky committed
84
    double getL2() const;
85

86
  protected:
87
88
    /// Shared pointer to the instrument (for calculating some values )
    Mantid::Geometry::IInstrument_sptr m_inst;
89

90
91
    /// Detector pointed to
    Mantid::Geometry::IDetector_sptr m_det;
92

93
94
95
    /// Name of the parent bank
    std::string m_BankName;

96
97
98
99
100
101
102
103
104
105
106
107
    /// 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;

108
109
110
111
    /// Integrated peak intensity
    double m_Intensity;

    /// Error (sigma) on peak intensity
112
    double m_SigmaIntensity;
113

114
115
116
    /// Count in the bin at the peak
    double m_BinCount;

117
118
119
120
121
122
    /// 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;

123
    /// Orientation matrix of the goniometer angles.
124
125
126
127
    Mantid::Geometry::Matrix<double> m_GoniometerMatrix;

    /// Inverse of the goniometer rotation matrix; used to go from Q in lab frame to Q in sample frame
    Mantid::Geometry::Matrix<double> m_InverseGoniometerMatrix;
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

    /// 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
    Mantid::Geometry::V3D sourcePos;
    /// Cached sample position
    Mantid::Geometry::V3D samplePos;
    /// Cached detector position
    Mantid::Geometry::V3D detPos;

145
146
147
148
149
150
151
  };


} // namespace Mantid
} // namespace DataObjects

#endif  /* MANTID_DATAOBJECTS_PEAK_H_ */