Skip to content
Snippets Groups Projects
Commit 8096cbe5 authored by Simon Heybrock's avatar Simon Heybrock
Browse files

Re #20887. Inline key methods of TofEvent for event loading speed.

parent 6dab89a0
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,6 @@ class LoadEventNexus;
}
namespace Types {
namespace Event {
//==========================================================================================
/** Info about a single neutron detection event:
*
* - the time of flight of the neutron (can be converted to other units)
......@@ -82,9 +81,20 @@ public:
};
#pragma pack(pop)
//==========================================================================================
// TofEvent inlined member function definitions
//==========================================================================================
/** Constructor, specifying the time of flight only
* @param tof :: time of flight, in microseconds
*/
inline TofEvent::TofEvent(const double tof) : m_tof(tof), m_pulsetime(0) {}
/** Constructor, specifying the time of flight and the frame id
* @param tof :: time of flight, in microseconds
* @param pulsetime :: absolute pulse time of the neutron.
*/
inline TofEvent::TofEvent(const double tof, const Core::DateAndTime pulsetime)
: m_tof(tof), m_pulsetime(pulsetime) {}
/// Empty constructor
inline TofEvent::TofEvent() : m_tof(0), m_pulsetime(0) {}
/** () operator: return the tof (X value) of the event.
* This is useful for std operations like comparisons and std::lower_bound
......@@ -112,4 +122,4 @@ inline double TofEvent::errorSquared() const { return 1.0; }
} // namespace Event
} // namespace Types
} // namespace Mantid
#endif // MANTID_TYPES_TOFEVENT_H
\ No newline at end of file
#endif // MANTID_TYPES_TOFEVENT_H
......@@ -6,24 +6,6 @@ namespace Mantid {
namespace Types {
using Core::DateAndTime;
namespace Event {
//==========================================================================
/// --------------------- TofEvent stuff ----------------------------------
//==========================================================================
/** Constructor, specifying the time of flight only
* @param tof :: time of flight, in microseconds
*/
TofEvent::TofEvent(const double tof) : m_tof(tof), m_pulsetime(0) {}
/** Constructor, specifying the time of flight and the frame id
* @param tof :: time of flight, in microseconds
* @param pulsetime :: absolute pulse time of the neutron.
*/
TofEvent::TofEvent(const double tof, const DateAndTime pulsetime)
: m_tof(tof), m_pulsetime(pulsetime) {}
/// Empty constructor
TofEvent::TofEvent() : m_tof(0), m_pulsetime(0) {}
/** Comparison operator.
* @param rhs: the other TofEvent to compare.
* @return true if the TofEvent's are identical.*/
......@@ -81,4 +63,4 @@ ostream &operator<<(ostream &os, const TofEvent &event) {
}
} // namespace Event
} // namespace Types
} // namespace Mantid
\ No newline at end of file
} // namespace Mantid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment