Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Static Private Attributes | Friends | List of all members
Mantid::DataObjects::WeightedEventNoTime Class Reference

Info about a single neutron detection event, including a weight and error value, but excluding the pulsetime to save memory: More...

#include <Events.h>

Public Member Functions

bool equals (const WeightedEventNoTime &rhs, const double tolTof, const double tolWeight) const
 Compare two events within the specified tolerance.
 
double error () const
 Return the error of the neutron, as a double (it is saved as a float).
 
double errorSquared () const
 Return the squared error of the neutron, as a double.
 
double operator() () const
 
bool operator< (const double rhs_tof) const
 < comparison operator, using the TOF to do the comparison.
 
bool operator< (const WeightedEventNoTime &rhs) const
 < comparison operator, using the TOF to do the comparison.
 
bool operator== (const WeightedEventNoTime &rhs) const
 Comparison operator.
 
const Mantid::Types::Core::DateAndTime & pulseTime () const
 Return the pulse time; this returns 0 since this type of Event has no time associated.
 
Mantid::Types::Core::DateAndTime pulseTOFTime () const
 Return the pulse time; this returns 0 since this type of Event has no time associated.
 
Mantid::Types::Core::DateAndTime pulseTOFTimeAtSample (const double &factor, const double &shift) const
 Return the pulse time; this returns 0 since this type of Event has no time associated.
 
double tof () const
 Return the time-of-flight of the neutron, as a double.
 
double weight () const
 Return the weight of the neutron, as a double (it is saved as a float).
 
 WeightedEventNoTime ()
 Empty constructor.
 
 WeightedEventNoTime (const Types::Event::TofEvent &rhs)
 Constructor, copy from another TofEvent object.
 
 WeightedEventNoTime (const Types::Event::TofEvent &rhs, double weight, double errorSquared)
 Constructor, copy from a TofEvent object but add weights.
 
 WeightedEventNoTime (const Types::Event::TofEvent &rhs, float weight, float errorSquared)
 Constructor, copy from a TofEvent object but add weights.
 
 WeightedEventNoTime (const WeightedEvent &rhs)
 Constructor, copy from a WeightedEvent object.
 
 WeightedEventNoTime (double time_of_flight)
 Constructor, specifying only the time of flight.
 
 WeightedEventNoTime (double tof, const Mantid::Types::Core::DateAndTime pulsetime, double weight, double errorSquared)
 Constructor that ignores a time:
 
 WeightedEventNoTime (double tof, const Mantid::Types::Core::DateAndTime pulsetime, float weight, float errorSquared)
 Constructor that ignores a time:
 
 WeightedEventNoTime (double tof, double weight, double errorSquared)
 Constructor, full.
 
 WeightedEventNoTime (double tof, float weight, float errorSquared)
 Constructor, full:
 

Public Attributes

float m_errorSquared
 The SQUARE of the error that this neutron contributes.
 
float m_weight
 The weight of this neutron.
 

Protected Attributes

double m_tof
 The 'x value' (e.g. time-of-flight) of this neutron.
 

Static Private Attributes

static const Mantid::Types::Core::DateAndTime UNSET_DATEANDTIME = Mantid::Types::Core::DateAndTime(0)
 

Friends

class EventList
 EventList has the right to mess with this.
 
std::ostream & operator<< (std::ostream &os, const WeightedEvent &event)
 Output a string representation of the event to a stream.
 
class tofGreater
 
class tofGreaterOrEqual
 

Detailed Description

Info about a single neutron detection event, including a weight and error value, but excluding the pulsetime to save memory:

Definition at line 91 of file Events.h.

Constructor & Destructor Documentation

◆ WeightedEventNoTime() [1/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( double  time_of_flight)

Constructor, specifying only the time of flight.

------------------— WeightedEventNoTime stuff ---------------------—

Constructor, tof only:

Parameters
time_of_flighttof in microseconds.

Definition at line 128 of file Events.cpp.

◆ WeightedEventNoTime() [2/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( double  tof,
double  weight,
double  errorSquared 
)

Constructor, full.

Constructor, full:

Parameters
toftof in microseconds.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 136 of file Events.cpp.

◆ WeightedEventNoTime() [3/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( double  tof,
float  weight,
float  errorSquared 
)

Constructor, full:

Parameters
toftof in microseconds.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 144 of file Events.cpp.

◆ WeightedEventNoTime() [4/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( double  tof,
const Mantid::Types::Core::DateAndTime  pulsetime,
double  weight,
double  errorSquared 
)

Constructor that ignores a time:

Parameters
toftof in microseconds.
pulsetimean ignored pulse time.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 153 of file Events.cpp.

◆ WeightedEventNoTime() [5/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( double  tof,
const Mantid::Types::Core::DateAndTime  pulsetime,
float  weight,
float  errorSquared 
)

Constructor that ignores a time:

Parameters
toftof in microseconds.
pulsetimean ignored pulse time.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 163 of file Events.cpp.

◆ WeightedEventNoTime() [6/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( const Types::Event::TofEvent &  rhs,
double  weight,
double  errorSquared 
)

Constructor, copy from a TofEvent object but add weights.

Parameters
rhsTofEvent to copy into this.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 172 of file Events.cpp.

◆ WeightedEventNoTime() [7/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( const Types::Event::TofEvent &  rhs,
float  weight,
float  errorSquared 
)

Constructor, copy from a TofEvent object but add weights.

Parameters
rhsTofEvent to copy into this.
weightweight of this neutron event.
errorSquaredthe square of the error on the event

Definition at line 180 of file Events.cpp.

◆ WeightedEventNoTime() [8/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( const WeightedEvent rhs)

Constructor, copy from a WeightedEvent object.

Parameters
rhssource WeightedEvent

Definition at line 186 of file Events.cpp.

◆ WeightedEventNoTime() [9/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( const Types::Event::TofEvent &  rhs)

Constructor, copy from another TofEvent object.

Parameters
rhssource TofEvent

Definition at line 192 of file Events.cpp.

◆ WeightedEventNoTime() [10/10]

Mantid::DataObjects::WeightedEventNoTime::WeightedEventNoTime ( )

Empty constructor.

Definition at line 196 of file Events.cpp.

Member Function Documentation

◆ equals()

bool Mantid::DataObjects::WeightedEventNoTime::equals ( const WeightedEventNoTime rhs,
const double  tolTof,
const double  tolWeight 
) const

Compare two events within the specified tolerance.

Parameters
rhsthe other TofEvent to compare
tolTofthe tolerance of a difference in m_tof.
tolWeightthe tolerance of a difference in m_weight and m_errorSquared.
Returns
True if the are the same within the specifed tolerances

Definition at line 216 of file Events.cpp.

References m_errorSquared, m_tof, and m_weight.

◆ error()

double Mantid::DataObjects::WeightedEventNoTime::error ( ) const
inline

Return the error of the neutron, as a double (it is saved as a float).

Definition at line 206 of file Events.h.

References m_errorSquared.

◆ errorSquared()

double Mantid::DataObjects::WeightedEventNoTime::errorSquared ( ) const
inline

Return the squared error of the neutron, as a double.

Definition at line 209 of file Events.h.

References m_errorSquared.

◆ operator()()

double Mantid::DataObjects::WeightedEventNoTime::operator() ( ) const
inline

Definition at line 185 of file Events.h.

References m_tof.

◆ operator<() [1/2]

bool Mantid::DataObjects::WeightedEventNoTime::operator< ( const double  rhs_tof) const
inline

< comparison operator, using the TOF to do the comparison.

Parameters
rhs_tofthe other time of flight to compare.
Returns
true if this->m_tof < rhs.m_tof

Definition at line 141 of file Events.h.

◆ operator<() [2/2]

bool Mantid::DataObjects::WeightedEventNoTime::operator< ( const WeightedEventNoTime rhs) const
inline

< comparison operator, using the TOF to do the comparison.

Parameters
rhsthe other WeightedEventNoTime to compare.
Returns
true if this->m_tof < rhs.m_tof

Definition at line 135 of file Events.h.

References rhs.

◆ operator==()

bool Mantid::DataObjects::WeightedEventNoTime::operator== ( const WeightedEventNoTime rhs) const

Comparison operator.

Parameters
rhs:: event to which we are comparing.
Returns
true if all elements of this event are identical

Definition at line 202 of file Events.cpp.

References m_errorSquared, m_tof, and m_weight.

◆ pulseTime()

const Types::Core::DateAndTime & Mantid::DataObjects::WeightedEventNoTime::pulseTime ( ) const
inline

Return the pulse time; this returns 0 since this type of Event has no time associated.

Definition at line 191 of file Events.h.

References UNSET_DATEANDTIME.

◆ pulseTOFTime()

Types::Core::DateAndTime Mantid::DataObjects::WeightedEventNoTime::pulseTOFTime ( ) const
inline

Return the pulse time; this returns 0 since this type of Event has no time associated.

Definition at line 193 of file Events.h.

References UNSET_DATEANDTIME.

◆ pulseTOFTimeAtSample()

Types::Core::DateAndTime Mantid::DataObjects::WeightedEventNoTime::pulseTOFTimeAtSample ( const double &  factor,
const double &  shift 
) const
inline

Return the pulse time; this returns 0 since this type of Event has no time associated.

Definition at line 195 of file Events.h.

References UNUSED_ARG.

◆ tof()

double Mantid::DataObjects::WeightedEventNoTime::tof ( ) const
inline

Return the time-of-flight of the neutron, as a double.

Definition at line 188 of file Events.h.

References m_tof.

◆ weight()

double Mantid::DataObjects::WeightedEventNoTime::weight ( ) const
inline

Return the weight of the neutron, as a double (it is saved as a float).

Definition at line 203 of file Events.h.

References m_weight.

Friends And Related Symbol Documentation

◆ EventList

friend class EventList
friend

EventList has the right to mess with this.

Definition at line 94 of file Events.h.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const WeightedEvent event 
)
friend

Output a string representation of the event to a stream.

Parameters
os:: Stream
event:: WeightedEvent to output to the stream

Definition at line 115 of file Events.cpp.

◆ tofGreater

friend class tofGreater
friend

Definition at line 96 of file Events.h.

◆ tofGreaterOrEqual

friend class tofGreaterOrEqual
friend

Definition at line 95 of file Events.h.

Member Data Documentation

◆ m_errorSquared

float Mantid::DataObjects::WeightedEventNoTime::m_errorSquared

The SQUARE of the error that this neutron contributes.

Definition at line 107 of file Events.h.

Referenced by equals(), error(), errorSquared(), and operator==().

◆ m_tof

double Mantid::DataObjects::WeightedEventNoTime::m_tof
protected

The 'x value' (e.g. time-of-flight) of this neutron.

Definition at line 100 of file Events.h.

Referenced by equals(), operator()(), operator==(), and tof().

◆ m_weight

float Mantid::DataObjects::WeightedEventNoTime::m_weight

The weight of this neutron.

Definition at line 104 of file Events.h.

Referenced by equals(), operator==(), and weight().

◆ UNSET_DATEANDTIME

const Mantid::Types::Core::DateAndTime Mantid::DataObjects::WeightedEventNoTime::UNSET_DATEANDTIME = Mantid::Types::Core::DateAndTime(0)
inlinestaticprivate

Definition at line 158 of file Events.h.

Referenced by pulseTime(), and pulseTOFTime().


The documentation for this class was generated from the following files: