Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Mantid::DataObjects::MDEvent< nd > Class Template Reference

Templated class holding data about a neutron detection event in N-dimensions (for example, Qx, Qy, Qz, E). More...

#include <MDEvent.h>

Inheritance diagram for Mantid::DataObjects::MDEvent< nd >:
Mantid::DataObjects::MDLeanEvent< nd >

Public Types

enum  { is_full_mdevent = true }
 
- Public Types inherited from Mantid::DataObjects::MDLeanEvent< nd >
enum  { is_full_mdevent = false }
 
using IntT = typename morton_index::IndexTypes< nd, coord_t >::IntType
 Additional index type defenitions. More...
 
using MortonT = typename morton_index::IndexTypes< nd, coord_t >::MortonType
 

Public Member Functions

int32_t getDetectorID () const
 
uint16_t getExpInfoIndex () const
 
uint16_t getGoniometerIndex () const
 
 MDEvent ()
 Empty constructor. More...
 
 MDEvent (const double signal, const double errorSquared)
 Constructor with signal and error. More...
 
 MDEvent (const double signal, const double errorSquared, const coord_t *centers)
 Constructor with signal and error and an array of centers. More...
 
 MDEvent (const double signal, const double errorSquared, const uint16_t expInfoIndex, const uint16_t goniometerIndex, const int32_t detectorId)
 Constructor with signal, error, expInfoIndex and detectorId. More...
 
 MDEvent (const double signal, const double errorSquared, const uint16_t expInfoIndex, const uint16_t goniometerIndex, const int32_t detectorId, const coord_t *centers)
 
 MDEvent (const float signal, const float errorSquared)
 Constructor with signal and error. More...
 
 MDEvent (const float signal, const float errorSquared, const coord_t *centers)
 Constructor with signal and error and an array of centers. More...
 
 MDEvent (const float signal, const float errorSquared, const uint16_t expInfoIndex, const uint16_t goniometerIndex, const int32_t detectorId)
 Constructor with signal, error, expInfoIndex and detectorId. More...
 
 MDEvent (const float signal, const float errorSquared, const uint16_t expInfoIndex, const uint16_t goniometerIndex, const int32_t detectorId, const coord_t *centers)
 Constructor with signal and error and an array of centers, and the expInfoIndex and detectorID. More...
 
void setDetectorId (int32_t id)
 Sets the detectorId of this event. More...
 
void setExpInfoIndex (uint16_t index)
 Sets the expInfoIndex of this event. More...
 
void setGoniometerIndex (uint16_t index)
 Sets the expInfoIndex of this event. More...
 
- Public Member Functions inherited from Mantid::DataObjects::MDLeanEvent< nd >
const coord_tgetCenter () const
 Returns the array of coordinates. More...
 
coord_t getCenter (const size_t n) const
 
coord_tgetCenterNonConst ()
 Returns the array of coordinates, as a pointer to a non-const array. More...
 
int32_t getDetectorID () const
 
float getError () const
 Returns the error (not squared) of this event. More...
 
float getErrorSquared () const
 Returns the error (squared) of this event. More...
 
uint16_t getExpInfoIndex () const
 
uint16_t getGoniometerIndex () const
 
size_t getNumDims () const
 Returns the number of dimensions in the event. More...
 
float getSignal () const
 Returns the signal (weight) of this event. More...
 
 MDLeanEvent ()
 Empty constructor. More...
 
 MDLeanEvent (const double signal, const double errorSquared)
 Constructor with signal and error. More...
 
 MDLeanEvent (const double signal, const double errorSquared, const coord_t *centers)
 Constructor with signal and error and an array of centers. More...
 
 MDLeanEvent (const float signal, const float errorSquared)
 Constructor with signal and error. More...
 
 MDLeanEvent (const float signal, const float errorSquared, const coord_t *centers)
 Constructor with signal and error and an array of centers. More...
 
 MDLeanEvent (const MDLeanEvent &rhs)
 Copy constructor. More...
 
MDLeanEventoperator= (MDLeanEvent other)
 
void setCenter (const size_t n, const coord_t value)
 Sets the n-th coordinate axis value. More...
 
void setCoords (const coord_t *centers)
 Sets all the coordinates. More...
 
void setErrorSquared (const float newerrorSquared)
 Set the squared error of the event. More...
 
void setSignal (const float newSignal)
 Set the signal of the event. More...
 

Static Public Member Functions

static void dataToEvents (const std::vector< coord_t > &data, std::vector< MDEvent< nd > > &events, bool reserveMemory=true)
 
static void eventsToData (const std::vector< MDEvent< nd > > &events, std::vector< coord_t > &data, size_t &ncols, double &totalSignal, double &totalErrSq)
 
static std::string getTypeName ()
 
- Static Public Member Functions inherited from Mantid::DataObjects::MDLeanEvent< nd >
static void dataToEvents (const std::vector< coord_t > &coord, std::vector< MDLeanEvent< nd > > &events, bool reserveMemory=true)
 
static void eventsToData (const std::vector< MDLeanEvent< nd > > &mdLeanEvents, std::vector< coord_t > &data, size_t &ncols, double &totalSignal, double &totalErrSq)
 
static std::string getTypeName ()
 

Protected Attributes

int32_t detectorId
 Detector ID of the pixel that measured this event. More...
 
uint16_t expInfoIndex
 0-based index of which run this event belongs to. More...
 
uint16_t goniometerIndex
 0-based index determines the goniometer settings when this event occurred More...
 
- Protected Attributes inherited from Mantid::DataObjects::MDLeanEvent< nd >
union {
   coord_t   center [nd]
 
   MortonT   index = 0
 
}; 
 The N-dimensional coordinates of the center of the event. More...
 
float errorSquared
 The square of the error carried in this event. More...
 
float signal
 The signal (aka weight) from the neutron event. More...
 

Detailed Description

template<size_t nd>
class Mantid::DataObjects::MDEvent< nd >

Templated class holding data about a neutron detection event in N-dimensions (for example, Qx, Qy, Qz, E).

This is an extension to MDLeanEvent which adds:

Template Parameters
nd:: the number of dimensions that each MDEvent will be tracking. an int > 0.
Author
Janik Zikovsky, SNS
Date
Dec 3, 2010

Definition at line 36 of file MDEvent.h.

Member Enumeration Documentation

◆ anonymous enum

template<size_t nd>
anonymous enum
Enumerator
is_full_mdevent 

Definition at line 52 of file MDEvent.h.

Constructor & Destructor Documentation

◆ MDEvent() [1/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( )
inline

Empty constructor.

Definition at line 56 of file MDEvent.h.

◆ MDEvent() [2/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const float  signal,
const float  errorSquared 
)
inline

Constructor with signal and error.

Parameters
signal:: signal
errorSquared:: square of the error on the weight

Definition at line 64 of file MDEvent.h.

◆ MDEvent() [3/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const double  signal,
const double  errorSquared 
)
inline

Constructor with signal and error.

Parameters
signal:: signal
errorSquared:: square of the error on the weight

Definition at line 73 of file MDEvent.h.

◆ MDEvent() [4/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const double  signal,
const double  errorSquared,
const uint16_t  expInfoIndex,
const uint16_t  goniometerIndex,
const int32_t  detectorId 
)
inline

Constructor with signal, error, expInfoIndex and detectorId.

Parameters
signal:: signal (aka weight)
errorSquared:: square of the error on the weight
expInfoIndex:: 0-based index of which run in the containing MDEventWorkspace
goniometerIndex:: 0-based index determines the goniometer settings when this event occurred
detectorId:: ID of the detector that measured this event.

Definition at line 87 of file MDEvent.h.

◆ MDEvent() [5/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const float  signal,
const float  errorSquared,
const uint16_t  expInfoIndex,
const uint16_t  goniometerIndex,
const int32_t  detectorId 
)
inline

Constructor with signal, error, expInfoIndex and detectorId.

Parameters
signal:: signal (aka weight)
errorSquared:: square of the error on the weight
expInfoIndex:: 0-based index of which run in the containing MDEventWorkspace
goniometerIndex:: 0-based index determines the goniometer settings when this event occurred
detectorId:: ID of the detector that measured this event.

Definition at line 103 of file MDEvent.h.

◆ MDEvent() [6/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const float  signal,
const float  errorSquared,
const coord_t centers 
)
inline

Constructor with signal and error and an array of centers.

Parameters
signal:: signal (aka weight)
errorSquared:: square of the error on the weight
centers:: pointer to a nd-sized array of values to set for all coordinates.

Definition at line 116 of file MDEvent.h.

◆ MDEvent() [7/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const double  signal,
const double  errorSquared,
const coord_t centers 
)
inline

Constructor with signal and error and an array of centers.

Parameters
signal:: signal (aka weight)
errorSquared:: square of the error on the weight
centers:: pointer to a nd-sized array of values to set for all coordinates.

Definition at line 126 of file MDEvent.h.

◆ MDEvent() [8/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const float  signal,
const float  errorSquared,
const uint16_t  expInfoIndex,
const uint16_t  goniometerIndex,
const int32_t  detectorId,
const coord_t centers 
)
inline

Constructor with signal and error and an array of centers, and the expInfoIndex and detectorID.

Parameters
signal:: signal (aka weight)
errorSquared:: square of the error on the weight
expInfoIndex:: 0-based index of which run in the containing MDEventWorkspace
goniometerIndex:: 0-based index determines the goniometer settings when this event occurred
detectorId:: ID of the detector that measured this event.
centers:: pointer to a nd-sized array of values to set for all coordinates.

Definition at line 142 of file MDEvent.h.

◆ MDEvent() [9/9]

template<size_t nd>
Mantid::DataObjects::MDEvent< nd >::MDEvent ( const double  signal,
const double  errorSquared,
const uint16_t  expInfoIndex,
const uint16_t  goniometerIndex,
const int32_t  detectorId,
const coord_t centers 
)
inline

Definition at line 147 of file MDEvent.h.

Member Function Documentation

◆ dataToEvents()

template<size_t nd>
static void Mantid::DataObjects::MDEvent< nd >::dataToEvents ( const std::vector< coord_t > &  data,
std::vector< MDEvent< nd > > &  events,
bool  reserveMemory = true 
)
inlinestatic

Definition at line 244 of file MDEvent.h.

References Mantid::DataHandling::numEvents().

◆ eventsToData()

template<size_t nd>
static void Mantid::DataObjects::MDEvent< nd >::eventsToData ( const std::vector< MDEvent< nd > > &  events,
std::vector< coord_t > &  data,
size_t &  ncols,
double &  totalSignal,
double &  totalErrSq 
)
inlinestatic

Definition at line 211 of file MDEvent.h.

References Mantid::Geometry::d, index, and ncols.

◆ getDetectorID()

template<size_t nd>
int32_t Mantid::DataObjects::MDEvent< nd >::getDetectorID ( ) const
inline
Returns
the detectorId of this event.

Definition at line 191 of file MDEvent.h.

Referenced by Mantid::MDAlgorithms::copyEvent().

◆ getExpInfoIndex()

template<size_t nd>
uint16_t Mantid::DataObjects::MDEvent< nd >::getExpInfoIndex ( ) const
inline
Returns
the associated experiment-info index of this event in the containing MDEventWorkspace

Definition at line 175 of file MDEvent.h.

Referenced by Mantid::MDAlgorithms::copyEvent().

◆ getGoniometerIndex()

template<size_t nd>
uint16_t Mantid::DataObjects::MDEvent< nd >::getGoniometerIndex ( ) const
inline
Returns
the goniometer index of this event

Definition at line 183 of file MDEvent.h.

◆ getTypeName()

template<size_t nd>
static std::string Mantid::DataObjects::MDEvent< nd >::getTypeName ( )
inlinestatic
Returns
a string identifying the type of event this is.

Definition at line 199 of file MDEvent.h.

Referenced by Mantid::DataObjects::BoxControllerNeXusIO::BoxControllerNeXusIO().

◆ setDetectorId()

template<size_t nd>
void Mantid::DataObjects::MDEvent< nd >::setDetectorId ( int32_t  id)
inline

Sets the detectorId of this event.

Parameters
id:: new detector ID value.

Definition at line 195 of file MDEvent.h.

Referenced by Mantid::MDAlgorithms::copyEvent().

◆ setExpInfoIndex()

template<size_t nd>
void Mantid::DataObjects::MDEvent< nd >::setExpInfoIndex ( uint16_t  index)
inline

Sets the expInfoIndex of this event.

Parameters
index:: new expInfoIndex value.

Definition at line 179 of file MDEvent.h.

References index.

Referenced by Mantid::MDAlgorithms::copyEvent().

◆ setGoniometerIndex()

template<size_t nd>
void Mantid::DataObjects::MDEvent< nd >::setGoniometerIndex ( uint16_t  index)
inline

Sets the expInfoIndex of this event.

Parameters
index:: new goniometerIndex value.

Definition at line 187 of file MDEvent.h.

References index.

Member Data Documentation

◆ detectorId

template<size_t nd>
int32_t Mantid::DataObjects::MDEvent< nd >::detectorId
protected

Detector ID of the pixel that measured this event.

Definition at line 48 of file MDEvent.h.

◆ expInfoIndex

template<size_t nd>
uint16_t Mantid::DataObjects::MDEvent< nd >::expInfoIndex
protected

0-based index of which run this event belongs to.

This refers to the particular ExperimentInfo that is stored in the MDEventWorkspace

Definition at line 42 of file MDEvent.h.

◆ goniometerIndex

template<size_t nd>
uint16_t Mantid::DataObjects::MDEvent< nd >::goniometerIndex
protected

0-based index determines the goniometer settings when this event occurred

Definition at line 45 of file MDEvent.h.


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