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

Info about a single neutron detection event, including a weight and error value: More...

#include <Events.h>

Inheritance diagram for Mantid::DataObjects::WeightedEvent:

Public Member Functions

bool equals (const WeightedEvent &rhs, const double tolTof, const double tolWeight, const int64_t tolPulse) const
 Compare two events within the specified tolerance. More...
 
double error () const
 
double errorSquared () const
 
bool operator== (const WeightedEvent &rhs) const
 Comparison operator. More...
 
double weight () const
 Return the weight of the neutron, as a double (it is saved as a float). More...
 
 WeightedEvent ()
 Empty constructor. More...
 
 WeightedEvent (const TofEvent &)
 Constructor, copy from another WeightedEvent object. More...
 
 WeightedEvent (const TofEvent &, double weight, double errorSquared)
 Constructor, copy from a TofEvent object but add weights. More...
 
 WeightedEvent (const TofEvent &, float weight, float errorSquared)
 Constructor, copy from a TofEvent object but add weights. More...
 
 WeightedEvent (double time_of_flight)
 Constructor, specifying only the time of flight. More...
 
 WeightedEvent (double tof, const Mantid::Types::Core::DateAndTime pulsetime, double weight, double errorSquared)
 Constructor, full. More...
 
 WeightedEvent (double tof, const Mantid::Types::Core::DateAndTime pulsetime, float weight, float errorSquared)
 Constructor, full: More...
 

Public Attributes

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

Friends

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

Detailed Description

Info about a single neutron detection event, including a weight and error value:

Definition at line 39 of file Events.h.

Constructor & Destructor Documentation

◆ WeightedEvent() [1/7]

Mantid::DataObjects::WeightedEvent::WeightedEvent ( double  time_of_flight)

Constructor, specifying only the time of flight.

------------------— WeightedEvent stuff ---------------------------—

Constructor, tof only:

Parameters
time_of_flighttof in microseconds.

Definition at line 29 of file Events.cpp.

◆ WeightedEvent() [2/7]

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

Constructor, full.

Constructor, full:

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

Definition at line 37 of file Events.cpp.

◆ WeightedEvent() [3/7]

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

Constructor, full:

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

Definition at line 48 of file Events.cpp.

◆ WeightedEvent() [4/7]

Mantid::DataObjects::WeightedEvent::WeightedEvent ( const 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 57 of file Events.cpp.

◆ WeightedEvent() [5/7]

Mantid::DataObjects::WeightedEvent::WeightedEvent ( const 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 66 of file Events.cpp.

◆ WeightedEvent() [6/7]

Mantid::DataObjects::WeightedEvent::WeightedEvent ( const TofEvent &  rhs)

Constructor, copy from another WeightedEvent object.

Parameters
rhssource TofEvent

Definition at line 72 of file Events.cpp.

◆ WeightedEvent() [7/7]

Mantid::DataObjects::WeightedEvent::WeightedEvent ( )

Empty constructor.

Definition at line 76 of file Events.cpp.

Member Function Documentation

◆ equals()

bool Mantid::DataObjects::WeightedEvent::equals ( const WeightedEvent rhs,
const double  tolTof,
const double  tolWeight,
const int64_t  tolPulse 
) 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.
tolPulsethe tolerance of a difference in m_pulsetime in nanoseconds.
Returns
True if the are the same within the specifed tolerances

Definition at line 99 of file Events.cpp.

References m_errorSquared, m_weight, and rhs.

◆ error()

double Mantid::DataObjects::WeightedEvent::error ( ) const
inline
Returns
the error of the neutron, as a double (it is saved as a float). Note: this returns the actual error; the value is saved internally as the SQUARED error, so this function calculates sqrt(). For more speed, use errorSquared().

Definition at line 169 of file Events.h.

References m_errorSquared.

◆ errorSquared()

double Mantid::DataObjects::WeightedEvent::errorSquared ( ) const
inline
Returns
the square of the error for this event. This is how the error is saved internally, so this is faster than error()

Definition at line 174 of file Events.h.

References m_errorSquared.

◆ operator==()

bool Mantid::DataObjects::WeightedEvent::operator== ( const WeightedEvent 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 82 of file Events.cpp.

References m_errorSquared, m_weight, and rhs.

◆ weight()

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

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

Definition at line 162 of file Events.h.

References m_weight.

Friends And Related Function Documentation

◆ EventList

friend class EventList
friend

EventList has the right to mess with WeightedEvent.

Definition at line 42 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 45 of file Events.h.

◆ tofGreaterOrEqual

friend class tofGreaterOrEqual
friend

Definition at line 44 of file Events.h.

◆ WeightedEventNoTime

friend class WeightedEventNoTime
friend

Definition at line 43 of file Events.h.

Member Data Documentation

◆ m_errorSquared

float Mantid::DataObjects::WeightedEvent::m_errorSquared

The SQUARE of the error that this neutron contributes.

Definition at line 52 of file Events.h.

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

◆ m_weight

float Mantid::DataObjects::WeightedEvent::m_weight

The weight of this neutron.

Definition at line 49 of file Events.h.

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


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