Mantid
|
A class for holding : More...
#include <EventList.h>
Public Member Functions | |
void | addEventQuickly (const Types::Event::TofEvent &event) |
Append an event to the histogram, without clearing the cache, to make it faster. More... | |
void | addEventQuickly (const WeightedEvent &event) |
Append an event to the histogram, without clearing the cache, to make it faster. More... | |
void | addEventQuickly (const WeightedEventNoTime &event) |
Append an event to the histogram, without clearing the cache, to make it faster. More... | |
void | addPulsetime (const double seconds) override |
Add an offset to the pulsetime (wall-clock time) of each event in the list. More... | |
void | addPulsetimes (const std::vector< double > &seconds) override |
Add an offset to the pulsetime (wall-clock time) of each event in the list. More... | |
void | addTof (const double offset) override |
Add an offset to the TOF of each event in the list. More... | |
void | clear (const bool removeDetIDs=true) override |
Clear the list of events and any associated detector ID's. More... | |
void | clearData () override |
Mask the spectrum to this value. Removes all events. More... | |
void | clearUnused () |
Clear any unused event lists (the ones that do not match the currently used type). More... | |
void | compressEvents (double tolerance, EventList *destination) |
Compress the event list by grouping events with the same TOF (within a given tolerance). More... | |
void | compressFatEvents (const double tolerance, const Types::Core::DateAndTime &timeStart, const double seconds, EventList *destination) |
template<class T > | |
void | compressFatEventsHelper (const std::vector< T > &events, std::vector< WeightedEvent > &out, const double tolerance, const Types::Core::DateAndTime &timeStart, const double seconds) |
void | convertTof (const double factor, const double offset=0.) override |
Convert the time of flight by tof'=tof*factor+offset. More... | |
void | convertTof (std::function< double(double)> func, const int sorting=0) override |
void | convertUnitsQuickly (const double &factor, const double &power) |
Convert the event's TOF (x) value according to a simple output = a * (input^b) relationship. More... | |
void | convertUnitsViaTof (Mantid::Kernel::Unit *fromUnit, Mantid::Kernel::Unit *toUnit) |
Converts the X units in each event by going through TOF. More... | |
void | copyDataFrom (const ISpectrum &source) override |
Copy data from another EventList, via ISpectrum reference. More... | |
HistogramData::Counts | counts () const override |
HistogramData::CountStandardDeviations | countStandardDeviations () const override |
HistogramData::CountVariances | countVariances () const override |
void | createFromHistogram (const ISpectrum *inSpec, bool GenerateZeros, bool GenerateMultipleEvents, int MaxEventsPerBin) |
Create an EventList from a histogram. More... | |
const MantidVec & | dataDx () const override |
Deprecated, use dx() instead. More... | |
MantidVec & | dataDx () override |
Deprecated, use mutableDx() instead. More... | |
const MantidVec & | dataE () const override |
Deprecated, use e() instead. More... | |
MantidVec & | dataE () override |
Deprecated, use mutableE() instead. More... | |
const MantidVec & | dataX () const override |
Deprecated, use x() instead. More... | |
MantidVec & | dataX () override |
Deprecated, use mutableX() instead. More... | |
const MantidVec & | dataY () const override |
Deprecated, use y() instead. More... | |
MantidVec & | dataY () override |
Deprecated, use mutableY() instead. More... | |
void | divide (const double value, const double error=0.0) override |
Divide the weights in this event list by a scalar with an (optional) error. More... | |
void | divide (const MantidVec &X, const MantidVec &Y, const MantidVec &E) override |
Divide the weights in this event list by a histogram. More... | |
const HistogramData::HistogramE & | e () const override |
bool | empty () const |
Much like stl containers, returns true if there is nothing in the event list. More... | |
bool | equals (const EventList &rhs, const double tolTof, const double tolWeight, const int64_t tolPulse) const |
EventList () | |
Constructor (empty) More... | |
EventList (const EventList &rhs) | |
Constructor copying from an existing event list. More... | |
EventList (const std::vector< Types::Event::TofEvent > &events) | |
EventList (const std::vector< WeightedEvent > &events) | |
Constructor, taking a vector of events. More... | |
EventList (const std::vector< WeightedEventNoTime > &events) | |
Constructor, taking a vector of events. More... | |
EventList (EventWorkspaceMRU *mru, specnum_t specNo) | |
Constructor with a MRU list. More... | |
void | filterByPulseTime (Types::Core::DateAndTime start, Types::Core::DateAndTime stop, EventList &output) const |
Filter this EventList into an output EventList, using keeping only events within the >= start and < end pulse times. More... | |
template<class T > | |
void | filterByPulseTimeHelper (std::vector< T > &events, DateAndTime start, DateAndTime stop, std::vector< T > &output) |
Filter a vector of events into another based on pulse time. More... | |
void | filterByTimeAtSample (Types::Core::DateAndTime start, Types::Core::DateAndTime stop, double tofFactor, double tofOffset, EventList &output) const |
template<class T > | |
void | filterByTimeAtSampleHelper (std::vector< T > &events, DateAndTime start, DateAndTime stop, double tofFactor, double tofOffset, std::vector< T > &output) |
Filter a vector of events into another based on time at sample. More... | |
void | filterInPlace (Kernel::TimeSplitterType &splitter) |
Use a TimeSplitterType to filter the event list in place. More... | |
HistogramData::Frequencies | frequencies () const override |
HistogramData::FrequencyStandardDeviations | frequencyStandardDeviations () const override |
HistogramData::FrequencyVariances | frequencyVariances () const override |
void | generateCountsHistogramPulseTime (const double &xMin, const double &xMax, MantidVec &Y, const double TofMin=std::numeric_limits< double >::lowest(), const double TofMax=std::numeric_limits< double >::max()) const |
With respect to PulseTime fill a histogram given equal histogram bins. More... | |
void | generateHistogram (const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const override |
Generates both the Y and E (error) histograms w.r.t TOF for an EventList with or without WeightedEvents. More... | |
void | generateHistogramPulseTime (const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const override |
Generates both the Y and E (error) histograms w.r.t Pulse Time for an EventList with or without WeightedEvents. More... | |
void | generateHistogramTimeAtSample (const MantidVec &X, MantidVec &Y, MantidVec &E, const double &tofFactor, const double &tofOffset, bool skipError=false) const override |
Generates both the Y and E (error) histograms w.r.t Time at sample position. More... | |
WeightedEvent | getEvent (size_t event_number) |
Return the given event in the list. More... | |
std::vector< Types::Event::TofEvent > & | getEvents () |
Return the list of TofEvents contained. More... | |
const std::vector< Types::Event::TofEvent > & | getEvents () const |
Return the const list of TofEvents contained. More... | |
Mantid::API::EventType | getEventType () const override |
Return the type of Event vector contained within. More... | |
size_t | getMemorySize () const override |
Memory used by this event list. More... | |
std::size_t | getNumberEvents () const override |
Return the number of events in the list. More... | |
Mantid::Types::Core::DateAndTime | getPulseTimeMax () const override |
Mantid::Types::Core::DateAndTime | getPulseTimeMin () const override |
void | getPulseTimeMinMax (Mantid::Types::Core::DateAndTime &tMin, Mantid::Types::Core::DateAndTime &tM) const |
std::vector< Mantid::Types::Core::DateAndTime > | getPulseTimes () const override |
Get the pulse times of each event in this EventList. More... | |
EventSortType | getSortType () const |
Return the type of sorting used in this event list. More... | |
Mantid::Types::Core::DateAndTime | getTimeAtSampleMax (const double &tofFactor, const double &tofOffset) const override |
Get the maximum time at sample. More... | |
Mantid::Types::Core::DateAndTime | getTimeAtSampleMin (const double &tofFactor, const double &tofOffset) const override |
Get the minimum time at sample. More... | |
double | getTofMax () const override |
double | getTofMin () const override |
std::vector< double > | getTofs () const override |
Get the times-of-flight of each event in this EventList. More... | |
void | getTofs (std::vector< double > &tofs) const override |
Fill a vector with the list of TOFs. More... | |
std::vector< WeightedEvent > & | getWeightedEvents () |
Return the list of WeightedEvent contained. More... | |
const std::vector< WeightedEvent > & | getWeightedEvents () const |
Return the list of WeightedEvent contained. More... | |
std::vector< WeightedEventNoTime > & | getWeightedEventsNoTime () |
Return the list of WeightedEvent contained. More... | |
const std::vector< WeightedEventNoTime > & | getWeightedEventsNoTime () const |
Return the list of WeightedEventNoTime contained. More... | |
std::vector< double > | getWeightErrors () const override |
Return the list of event weight error values. More... | |
void | getWeightErrors (std::vector< double > &weightErrors) const override |
Return the list of event weight error values. More... | |
std::vector< double > | getWeights () const override |
Return the list of event weight values. More... | |
void | getWeights (std::vector< double > &weights) const override |
Return the list of event weight values. More... | |
HistogramData::Histogram | histogram () const override |
Returns the Histogram associated with this spectrum. More... | |
virtual size_t | histogram_size () const |
Return the size of the histogram data. More... | |
double | integrate (const double minX, const double maxX, const bool entireRange) const override |
Integrate the events between a range of X values, or all events. More... | |
void | integrate (const double minX, const double maxX, const bool entireRange, double &sum, double &error) const |
Integrate the events between a range of X values, or all events. More... | |
bool | isSortedByTof () const override |
Return true if the event list is sorted by TOF. More... | |
MantidVec * | makeDataE () const |
Calculates and returns a pointer to the E histogrammed data. More... | |
MantidVec * | makeDataY () const |
Calculates and returns a pointer to the Y histogrammed data. More... | |
void | maskCondition (const std::vector< bool > &mask) override |
Mask out events by the condition vector. More... | |
void | maskTof (const double tofMin, const double tofMax) override |
Mask out events that have a tof between tofMin and tofMax (inclusively). More... | |
void | multiply (const double value, const double error=0.0) override |
Multiply the weights in this event list by a scalar variable with an error; though the error can be 0.0. More... | |
void | multiply (const MantidVec &X, const MantidVec &Y, const MantidVec &E) override |
Multiply the weights in this event list by a histogram. More... | |
bool | operator!= (const EventList &rhs) const |
Inequality comparator. More... | |
EventList & | operator*= (const double value) |
Operator to multiply the weights in this EventList by an error-less scalar. More... | |
EventList & | operator+= (const EventList &more_events) |
Append another EventList to this event list. More... | |
EventList & | operator+= (const std::vector< Types::Event::TofEvent > &more_events) |
EventList & | operator+= (const std::vector< WeightedEvent > &more_events) |
Append a list of events to the histogram. More... | |
EventList & | operator+= (const std::vector< WeightedEventNoTime > &more_events) |
Append a list of events to the histogram. More... | |
EventList & | operator+= (const Types::Event::TofEvent &event) |
EventList & | operator+= (const WeightedEvent &event) |
Append a WeightedEvent to the histogram. More... | |
EventList & | operator-= (const EventList &more_events) |
SUBTRACT another EventList from this event list. More... | |
EventList & | operator/= (const double value) |
Operator to divide the weights in this EventList by an error-less scalar. More... | |
EventList & | operator= (const EventList &) |
Copy into this event list from another. More... | |
bool | operator== (const EventList &rhs) const |
Equality operator between EventList's. More... | |
Kernel::cow_ptr< HistogramData::HistogramX > | ptrX () const override |
Deprecated, use sharedX() instead. Returns a pointer to the x data. More... | |
const MantidVec & | readDx () const override |
Deprecated, use dx() instead. More... | |
const MantidVec & | readX () const override |
Deprecated, use x() instead. Returns the x data const. More... | |
void | reserve (size_t num) override |
Reserve a certain number of entries in event list of the specified eventType. More... | |
void | reverse () |
Reverse the histogram boundaries and the associated events if they are sorted by time-of-flight. More... | |
void | scaleTof (const double factor) override |
Convert the units in the TofEvent's m_tof field to some other value, by scaling by a multiplier. More... | |
void | setMRU (EventWorkspaceMRU *newMRU) |
Sets the MRU list for this event list. More... | |
void | setSortOrder (const EventSortType order) const |
Manually set the event list sort order value. More... | |
void | setTofs (const MantidVec &tofs) override |
Set a list of TOFs to the current event list. More... | |
void | setX (const Kernel::cow_ptr< HistogramData::HistogramX > &X) override |
Deprecated, use setSharedX() instead. More... | |
Kernel::cow_ptr< HistogramData::HistogramE > | sharedE () const override |
Kernel::cow_ptr< HistogramData::HistogramY > | sharedY () const override |
void | sort (const EventSortType order) const |
Sort events by TOF or Frame. More... | |
void | sortPulseTime () const |
Sort events by Frame. More... | |
void | sortPulseTimeTOF () const |
void | sortTimeAtSample (const double &tofFactor, const double &tofShift, bool forceResort=false) const |
Sort events by time at sample. More... | |
void | sortTof () const |
Sort events by TOF in one thread. More... | |
void | splitByFullTime (Kernel::TimeSplitterType &splitter, std::map< int, EventList * > outputs, bool docorrection, double toffactor, double tofshift) const |
Split the event list into n outputs by event's full time (tof + pulse time) More... | |
std::string | splitByFullTimeMatrixSplitter (const std::vector< int64_t > &vec_splitters_time, const std::vector< int > &vecgroups, std::map< int, EventList * > vec_outputEventList, bool docorrection, double toffactor, double tofshift) const |
Split ... More... | |
void | splitByPulseTime (Kernel::TimeSplitterType &splitter, std::map< int, EventList * > outputs) const |
Split events by pulse time. More... | |
void | splitByPulseTimeWithMatrix (const std::vector< int64_t > &vec_times, const std::vector< int > &vec_target, std::map< int, EventList * > outputs) const |
Split events by pulse time with Matrix splitters. More... | |
void | splitByTime (Kernel::TimeSplitterType &splitter, std::vector< EventList * > outputs) const |
Split the event list into n outputs. More... | |
void | switchTo (Mantid::API::EventType newType) override |
Switch the EventList to use the given EventType (TOF, WEIGHTED, or WEIGHTED_NOTIME) More... | |
const HistogramData::HistogramY & | y () const override |
~EventList () override | |
Destructor. More... | |
Public Member Functions inherited from Mantid::API::IEventList | |
virtual void | addPulsetime (const double seconds)=0 |
Add a value to the pulse time values. More... | |
virtual void | addPulsetimes (const std::vector< double > &seconds)=0 |
Add a separate value to each of the pulse time values. More... | |
virtual void | addTof (const double offset)=0 |
Add a value to the TOF values. More... | |
virtual void | clear (const bool removeDetIDs)=0 |
Clear the event list. More... | |
virtual void | convertTof (const double factor, const double offset=0.)=0 |
Convert the TOF values. More... | |
virtual void | convertTof (std::function< double(double)> func, const int sorting=0)=0 |
Convert the TOF values. More... | |
virtual void | divide (const double value, const double error=0.0)=0 |
Divide event list by a constant with error. More... | |
virtual void | divide (const MantidVec &X, const MantidVec &Y, const MantidVec &E)=0 |
Divide event list by a histogram. More... | |
virtual void | generateHistogram (const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const =0 |
Get copy of counts and errors, rebinned using on the given X values. More... | |
virtual void | generateHistogramPulseTime (const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const =0 |
Get copy of counts and errors rebinned using the given X values w.r.t pulse time. More... | |
virtual void | generateHistogramTimeAtSample (const MantidVec &X, MantidVec &Y, MantidVec &E, const double &tofFactor, const double &tofOffset, bool skipError=false) const =0 |
Get copy of counts and errors rebinning using the given X values w.r.t absolute time at the sample. More... | |
virtual Mantid::API::EventType | getEventType () const =0 |
Return the current event type for the list. More... | |
size_t | getMemorySize () const override=0 |
Get memory size of event list. More... | |
virtual std::size_t | getNumberEvents () const =0 |
Get the number of events from the list. More... | |
virtual Mantid::Types::Core::DateAndTime | getPulseTimeMax () const =0 |
Get the maximum pulse time from the list. More... | |
virtual Mantid::Types::Core::DateAndTime | getPulseTimeMin () const =0 |
Get the minimum pulse time from the list. More... | |
virtual std::vector< Mantid::Types::Core::DateAndTime > | getPulseTimes () const =0 |
Return the list of pulse time values. More... | |
virtual Mantid::Types::Core::DateAndTime | getTimeAtSampleMax (const double &tofFactor, const double &tofOffset) const =0 |
Get the maximum time at sample. More... | |
virtual Mantid::Types::Core::DateAndTime | getTimeAtSampleMin (const double &tofFactor, const double &tofOffset) const =0 |
Get the minimum time at sample. More... | |
virtual double | getTofMax () const =0 |
Get the maximum TOF from the list. More... | |
virtual double | getTofMin () const =0 |
Get the minimum TOF from the list. More... | |
virtual std::vector< double > | getTofs () const =0 |
Return the list of TOF values. More... | |
virtual void | getTofs (std::vector< double > &tofs) const =0 |
Return the list of TOF values. More... | |
virtual std::vector< double > | getWeightErrors () const =0 |
Return the list of event weight error values. More... | |
virtual void | getWeightErrors (std::vector< double > &weightErrors) const =0 |
Return the list of event weight error values. More... | |
virtual std::vector< double > | getWeights () const =0 |
Return the list of event weight values. More... | |
virtual void | getWeights (std::vector< double > &weights) const =0 |
Return the list of event weight values. More... | |
IEventList () | |
Empty constructor. More... | |
IEventList (specnum_t specNo) | |
Constructor. More... | |
virtual double | integrate (const double minX, const double maxX, const bool entireRange) const =0 |
Integrate the event list. More... | |
virtual bool | isSortedByTof () const =0 |
IS the list sorted by TOF? More... | |
virtual void | maskCondition (const std::vector< bool > &mask)=0 |
Mask the events by the condition vector. More... | |
virtual void | maskTof (const double tofMin, const double tofMax)=0 |
Mask a given TOF range. More... | |
virtual void | multiply (const double value, const double error=0.0)=0 |
Multiply event list by a constant with error. More... | |
virtual void | multiply (const MantidVec &X, const MantidVec &Y, const MantidVec &E)=0 |
Multiply event list by a histogram. More... | |
virtual void | reserve (size_t num)=0 |
Reserve a fixed size for the list. More... | |
virtual void | scaleTof (const double factor)=0 |
Scale the TOF values by a constant. More... | |
virtual void | setTofs (const MantidVec &tofs)=0 |
Set the TOFs from the given list. More... | |
virtual void | switchTo (Mantid::API::EventType newType)=0 |
Switch to a new event type within the list. More... | |
Public Member Functions inherited from Mantid::API::ISpectrum | |
void | addDetectorID (const detid_t detID) |
Add a detector ID to the set of detector IDs. More... | |
void | addDetectorIDs (const std::set< detid_t > &detIDs) |
Add a set of detector IDs to the set of detector IDs. More... | |
void | addDetectorIDs (const std::vector< detid_t > &detIDs) |
Add a vector of detector IDs to the set of detector IDs. More... | |
HistogramData::BinEdges | binEdges () const |
virtual void | clearData ()=0 |
void | clearDetectorIDs () |
Clear the detector IDs set. More... | |
void | convertToCounts () |
void | convertToFrequencies () |
virtual void | copyDataFrom (const ISpectrum &source)=0 |
Copy data from another ISpectrum with double-dynamic dispatch. More... | |
virtual void | copyDataInto (DataObjects::EventList &) const |
Override in child classes for polymorphic copying of data. More... | |
virtual void | copyDataInto (DataObjects::Histogram1D &) const |
Override in child classes for polymorphic copying of data. More... | |
virtual void | copyDataInto (SpectrumTester &) const |
Override in child classes for polymorphic copying of data. More... | |
void | copyInfoFrom (const ISpectrum &other) |
Copy spectrum number and detector IDs, but not X vector, from another ISpectrum. More... | |
virtual HistogramData::Counts | counts () const |
virtual HistogramData::CountStandardDeviations | countStandardDeviations () const |
virtual HistogramData::CountVariances | countVariances () const |
virtual const MantidVec & | dataDx () const =0 |
virtual MantidVec & | dataDx ()=0 |
virtual const MantidVec & | dataE () const =0 |
virtual MantidVec & | dataE ()=0 |
virtual const MantidVec & | dataX () const =0 |
virtual MantidVec & | dataX ()=0 |
virtual const MantidVec & | dataY () const =0 |
virtual MantidVec & | dataY ()=0 |
const HistogramData::HistogramDx & | dx () const |
virtual const HistogramData::HistogramE & | e () const |
virtual HistogramData::Frequencies | frequencies () const |
virtual HistogramData::FrequencyStandardDeviations | frequencyStandardDeviations () const |
virtual HistogramData::FrequencyVariances | frequencyVariances () const |
const std::set< detid_t > & | getDetectorIDs () const |
Get a const reference to the detector IDs set. More... | |
virtual size_t | getMemorySize () const =0 |
specnum_t | getSpectrumNo () const |
virtual std::pair< double, double > | getXDataRange () const |
Return the min/max X values for this spectrum. More... | |
bool | hasDetectorID (const detid_t detID) const |
Return true if the given detector ID is in the list for this ISpectrum. More... | |
bool | hasDx () const |
Gets the value of the use flag. More... | |
virtual HistogramData::Histogram | histogram () const |
Returns the Histogram associated with this spectrum. More... | |
ISpectrum ()=default | |
ISpectrum (const specnum_t specNo) | |
Constructor with spectrum number. More... | |
HistogramData::HistogramDx & | mutableDx () & |
HistogramData::HistogramE & | mutableE () & |
HistogramData::HistogramX & | mutableX () & |
HistogramData::HistogramY & | mutableY () & |
HistogramData::Points | points () const |
HistogramData::PointStandardDeviations | pointStandardDeviations () const |
virtual Kernel::cow_ptr< HistogramData::HistogramX > | ptrX () const =0 |
virtual const MantidVec & | readDx () const =0 |
virtual const MantidVec & | readE () const |
Deprecated, use e() instead. Returns the y error data const. More... | |
virtual const MantidVec & | readX () const =0 |
virtual const MantidVec & | readY () const |
Deprecated, use y() instead. Returns the y data const. More... | |
void | resetHasDx () |
Resets the hasDx flag. More... | |
template<typename... T> | |
void | setBinEdges (T &&...data) & |
template<typename... T> | |
void | setCounts (T &&...data) & |
template<typename... T> | |
void | setCountStandardDeviations (T &&...data) & |
template<typename... T> | |
void | setCountVariances (T &&...data) & |
void | setDetectorID (const detid_t detID) |
Clear the list of detector IDs, then add one. More... | |
void | setDetectorIDs (const std::set< detid_t > &detIDs) |
Set the detector IDs to be the set given. More... | |
void | setDetectorIDs (std::set< detid_t > &&detIDs) |
Set the detector IDs to be the set given (move version). More... | |
template<typename... T> | |
void | setFrequencies (T &&...data) & |
template<typename... T> | |
void | setFrequencyStandardDeviations (T &&...data) & |
template<typename... T> | |
void | setFrequencyVariances (T &&...data) & |
template<typename... T> | |
void | setHistogram (T &&...data) |
Sets the Histogram associated with this spectrum. More... | |
void | setMatrixWorkspace (MatrixWorkspace *matrixWorkspace, const size_t index) |
Sets the MatrixWorkspace pointer (pointer to the owning workspace). More... | |
template<typename... T> | |
void | setPoints (T &&...data) & |
template<typename... T> | |
void | setPointStandardDeviations (T &&...data) & |
template<typename... T> | |
void | setPointVariances (T &&...data) & |
void | setSharedDx (const Kernel::cow_ptr< HistogramData::HistogramDx > &dx) & |
void | setSharedE (const Kernel::cow_ptr< HistogramData::HistogramE > &e) & |
void | setSharedX (const Kernel::cow_ptr< HistogramData::HistogramX > &x) & |
void | setSharedY (const Kernel::cow_ptr< HistogramData::HistogramY > &y) & |
void | setSpectrumNo (specnum_t num) |
Sets the the spectrum number of this spectrum. More... | |
virtual void | setX (const Kernel::cow_ptr< HistogramData::HistogramX > &X)=0 |
void | setYMode (HistogramData::Histogram::YMode ymode) |
Kernel::cow_ptr< HistogramData::HistogramDx > | sharedDx () const |
virtual Kernel::cow_ptr< HistogramData::HistogramE > | sharedE () const |
Kernel::cow_ptr< HistogramData::HistogramX > | sharedX () const |
virtual Kernel::cow_ptr< HistogramData::HistogramY > | sharedY () const |
const HistogramData::HistogramX & | x () const |
virtual const HistogramData::HistogramY & | y () const |
HistogramData::Histogram::YMode | yMode () const |
virtual | ~ISpectrum ()=default |
Protected Member Functions | |
void | checkAndSanitizeHistogram (HistogramData::Histogram &histogram) override |
void | checkIsYAndEWritable () const override |
void | checkWorksWithPoints () const override |
Protected Member Functions inherited from Mantid::API::ISpectrum | |
virtual void | checkAndSanitizeHistogram (HistogramData::Histogram &) |
virtual void | checkIsYAndEWritable () const |
virtual void | checkWorksWithPoints () const |
ISpectrum (const ISpectrum &other) | |
Copy constructor. More... | |
ISpectrum (ISpectrum &&other) | |
Move constructor. More... | |
ISpectrum & | operator= (const ISpectrum &other) |
Copy assignment. More... | |
ISpectrum & | operator= (ISpectrum &&other) |
Move assignment. More... | |
Private Member Functions | |
template<class T > | |
void | addPulsetimeHelper (std::vector< T > &events, const double seconds) |
Add an offset to the pulsetime (wall-clock time) of each event in the list. More... | |
template<class T > | |
void | addPulsetimesHelper (std::vector< T > &events, const std::vector< double > &seconds) |
Add an offset per event to the pulsetime (wall-clock time) of each event in the list. More... | |
template<class T > | |
void | compressEventsParallelHelper (const std::vector< T > &events, std::vector< WeightedEventNoTime > &out, double tolerance) |
Compress the event list by grouping events with the same TOF. More... | |
template<class T > | |
void | convertTofHelper (std::vector< T > &events, const double factor, const double offset) |
Function to do the conversion factor work on either the TofEvent list or the WeightedEvent list. More... | |
template<class T > | |
void | convertTofHelper (std::vector< T > &events, const std::function< double(double)> &func) |
template<class T > | |
void | convertUnitsQuicklyHelper (typename std::vector< T > &events, const double &factor, const double &power) |
Convert the event's TOF (x) value according to a simple output = a * (input^b) relationship. More... | |
template<class T > | |
void | convertUnitsViaTofHelper (typename std::vector< T > &events, Mantid::Kernel::Unit *fromUnit, Mantid::Kernel::Unit *toUnit) |
Helper function for the conversion to TOF. More... | |
virtual void | copyDataInto (DataObjects::EventList &) const |
Override in child classes for polymorphic copying of data. More... | |
virtual void | copyDataInto (DataObjects::Histogram1D &) const |
Override in child classes for polymorphic copying of data. More... | |
void | copyDataInto (EventList &sink) const override |
Used by copyDataFrom for dynamic dispatch for its source . More... | |
void | copyDataInto (Histogram1D &sink) const override |
Used by Histogram1D::copyDataFrom for dynamic dispatch for other . More... | |
virtual void | copyDataInto (SpectrumTester &) const |
Override in child classes for polymorphic copying of data. More... | |
template<class T > | |
void | filterInPlaceHelper (Kernel::TimeSplitterType &splitter, typename std::vector< T > &events) |
Perform an in-place filtering on a vector of either TofEvent's or WeightedEvent's. More... | |
template<class T > | |
std::vector< T >::const_iterator | findFirstTimeAtSampleEvent (const std::vector< T > &events, const double seek_time, const double &tofFactor, const double &tofOffset) const |
Utility function: Returns the iterator into events of the first TofEvent with time at sample > seek_time Will return events.end() if nothing is found! More... | |
void | generateCountsHistogram (const MantidVec &X, MantidVec &Y) const |
Fill a histogram given specified histogram bounds. More... | |
void | generateCountsHistogramPulseTime (const MantidVec &X, MantidVec &Y) const |
With respect to PulseTime Fill a histogram given specified histogram bounds. More... | |
void | generateCountsHistogramTimeAtSample (const MantidVec &X, MantidVec &Y, const double &tofFactor, const double &tofOffset) const |
With respect to Time at Sample, fill a histogram given specified histogram bounds. More... | |
void | generateErrorsHistogram (const MantidVec &Y, MantidVec &E) const |
Generate the Error histogram for the provided counts histogram. More... | |
const HistogramData::Histogram & | histogramRef () const override |
HistogramData::Histogram & | mutableHistogramRef () override |
void | sortPulseTimeTOFDelta (const Types::Core::DateAndTime &start, const double seconds) const |
Sort by the pulse time with a tolerance. More... | |
template<class T > | |
void | splitByFullTimeHelper (Kernel::TimeSplitterType &splitter, std::map< int, EventList * > outputs, typename std::vector< T > &events, bool docorrection, double toffactor, double tofshift) const |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus. More... | |
template<class T > | |
std::string | splitByFullTimeSparseVectorSplitterHelper (const std::vector< int64_t > &vectimes, const std::vector< int > &vecgroups, std::map< int, EventList * > outputs, typename std::vector< T > &vecEvents, bool docorrection, double toffactor, double tofshift) const |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus. More... | |
template<class T > | |
std::string | splitByFullTimeVectorSplitterHelper (const std::vector< int64_t > &vectimes, const std::vector< int > &vecgroups, std::map< int, EventList * > outputs, typename std::vector< T > &vecEvents, bool docorrection, double toffactor, double tofshift) const |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus. More... | |
template<class T > | |
void | splitByPulseTimeHelper (Kernel::TimeSplitterType &splitter, std::map< int, EventList * > outputs, typename std::vector< T > &events) const |
Split events by pulse time. More... | |
template<class T > | |
void | splitByPulseTimeWithMatrixHelper (const std::vector< int64_t > &vec_split_times, const std::vector< int > &vec_split_target, std::map< int, EventList * > outputs, typename std::vector< T > &events) const |
Split events (template) by pulse time with matrix splitters. More... | |
template<class T > | |
void | splitByTimeHelper (Kernel::TimeSplitterType &splitter, std::vector< EventList * > outputs, typename std::vector< T > &events) const |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's Only event's pulse time is used to compare with splitters. More... | |
void | switchToWeightedEvents () |
Switch the EventList to use WeightedEvents instead of TofEvent. More... | |
void | switchToWeightedEventsNoTime () |
Switch the EventList to use WeightedEventNoTime's instead of TofEvent. More... | |
Static Private Member Functions | |
template<class T > | |
static void | compressEventsHelper (const std::vector< T > &events, std::vector< WeightedEventNoTime > &out, double tolerance) |
Compress the event list by grouping events with the same TOF. More... | |
template<class T > | |
static void | compressFatEventsHelper (const std::vector< T > &events, std::vector< WeightedEvent > &out, const double tolerance, const Mantid::Types::Core::DateAndTime &timeStart, const double seconds) |
template<class T > | |
static void | divideHistogramHelper (std::vector< T > &events, const MantidVec &X, const MantidVec &Y, const MantidVec &E) |
Helper method for dividing an event list by a histogram with error. More... | |
template<class T > | |
static void | filterByPulseTimeHelper (std::vector< T > &events, Types::Core::DateAndTime start, Types::Core::DateAndTime stop, std::vector< T > &output) |
template<class T > | |
static void | filterByTimeAtSampleHelper (std::vector< T > &events, Types::Core::DateAndTime start, Types::Core::DateAndTime stop, double tofFactor, double tofOffset, std::vector< T > &output) |
template<class T > | |
static std::vector< T >::const_iterator | findFirstPulseEvent (const std::vector< T > &events, const double seek_pulsetime) |
Utility function: Returns the iterator into events of the first TofEvent with pulsetime() > seek_pulsetime Will return events.end() if nothing is found! More... | |
template<class T > | |
static void | getPulseTimesHelper (const std::vector< T > &events, std::vector< Mantid::Types::Core::DateAndTime > ×) |
Get the pulsetimes of all events in a list. More... | |
template<class T > | |
static void | getTofsHelper (const std::vector< T > &events, std::vector< double > &tofs) |
Get the m_tof member of all events in a list. More... | |
template<class T > | |
static void | getWeightErrorsHelper (const std::vector< T > &events, std::vector< double > &weightErrors) |
Get the weight error member of all events in a list. More... | |
template<class T > | |
static void | getWeightsHelper (const std::vector< T > &events, std::vector< double > &weights) |
Get the weight member of all events in a list. More... | |
template<class T > | |
static void | histogramForWeightsHelper (const std::vector< T > &events, const MantidVec &X, MantidVec &Y, MantidVec &E) |
Generates both the Y and E (error) histograms for an EventList with WeightedEvents. More... | |
template<class T > | |
static double | integrateHelper (std::vector< T > &events, const double minX, const double maxX, const bool entireRange) |
Integrate the events between a range of X values, or all events. More... | |
template<class T > | |
static void | integrateHelper (std::vector< T > &events, const double minX, const double maxX, const bool entireRange, double &sum, double &error) |
Integrate the events between a range of X values, or all events. More... | |
template<class T > | |
static std::size_t | maskConditionHelper (std::vector< T > &events, const std::vector< bool > &mask) |
Mask out events by the condition vector. More... | |
template<class T > | |
static std::size_t | maskTofHelper (std::vector< T > &events, const double tofMin, const double tofMax) |
Mask out events that have a tof between tofMin and tofMax (inclusively). More... | |
template<class T1 , class T2 > | |
static void | minusHelper (std::vector< T1 > &events, const std::vector< T2 > &more_events) |
SUBTRACT another EventList from this event list. More... | |
template<class T > | |
static void | multiplyHelper (std::vector< T > &events, const double value, const double error=0.0) |
Helper method for multiplying an event list by a scalar value with/without error. More... | |
template<class T > | |
static void | multiplyHistogramHelper (std::vector< T > &events, const MantidVec &X, const MantidVec &Y, const MantidVec &E) |
Helper method for multiplying an event list by a histogram with error. More... | |
template<class T > | |
static void | setTofsHelper (std::vector< T > &events, const std::vector< double > &tofs) |
Set a list of TOFs to the current event list. More... | |
Private Attributes | |
std::vector< Types::Event::TofEvent > | events |
List of TofEvent (no weights). More... | |
Mantid::API::EventType | eventType |
What type of event is in our list. More... | |
HistogramData::Histogram | m_histogram |
Histogram object holding the histogram data. Currently only X. More... | |
std::mutex | m_sortMutex |
Mutex that is locked while sorting an event list. More... | |
EventWorkspaceMRU * | mru |
MRU lists of the parent EventWorkspace. More... | |
EventSortType | order |
Last sorting order. More... | |
std::vector< WeightedEvent > | weightedEvents |
List of WeightedEvent's. More... | |
std::vector< WeightedEventNoTime > | weightedEventsNoTime |
List of WeightedEvent's. More... | |
A class for holding :
This class can switch from holding regular TofEvent's (implied weight of 1.0) or WeightedEvent (where each neutron can have a non-1 weight). This is done transparently.
Definition at line 56 of file EventList.h.
Mantid::DataObjects::EventList::EventList | ( | ) |
Constructor (empty)
Definition at line 140 of file EventList.cpp.
Mantid::DataObjects::EventList::EventList | ( | EventWorkspaceMRU * | mru, |
specnum_t | specNo | ||
) |
Constructor with a MRU list.
mru | :: pointer to the MRU of the parent EventWorkspace |
specNo | :: the spectrum number for the event list |
Definition at line 148 of file EventList.cpp.
Mantid::DataObjects::EventList::EventList | ( | const EventList & | rhs | ) |
Constructor copying from an existing event list.
rhs | :: EventList object to copy |
Definition at line 155 of file EventList.cpp.
References operator=().
Mantid::DataObjects::EventList::EventList | ( | const std::vector< Types::Event::TofEvent > & | events | ) |
Mantid::DataObjects::EventList::EventList | ( | const std::vector< WeightedEvent > & | events | ) |
Constructor, taking a vector of events.
events | :: Vector of WeightedEvent's |
Definition at line 173 of file EventList.cpp.
References events, eventType, order, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, and weightedEvents.
Mantid::DataObjects::EventList::EventList | ( | const std::vector< WeightedEventNoTime > & | events | ) |
Constructor, taking a vector of events.
events | :: Vector of WeightedEventNoTime's |
Definition at line 182 of file EventList.cpp.
References events, eventType, order, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
|
override |
|
inline |
Append an event to the histogram, without clearing the cache, to make it faster.
NOTE: Only call this on a un-weighted event list!
event | :: TofEvent to add at the end of the list. |
Definition at line 104 of file EventList.h.
References Mantid::DataObjects::UNSORTED.
Referenced by Mantid::DataHandling::LoadSwans::loadDataIntoTheWorkspace(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadNexusMonitors2::readEventMonitorEntry(), Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace(), splitByFullTimeHelper(), splitByFullTimeSparseVectorSplitterHelper(), splitByFullTimeVectorSplitterHelper(), splitByPulseTimeHelper(), splitByPulseTimeWithMatrixHelper(), and splitByTimeHelper().
|
inline |
Append an event to the histogram, without clearing the cache, to make it faster.
event | :: WeightedEvent to add at the end of the list. |
Definition at line 114 of file EventList.h.
References Mantid::DataObjects::UNSORTED.
|
inline |
Append an event to the histogram, without clearing the cache, to make it faster.
event | :: WeightedEventNoTime to add at the end of the list. |
Definition at line 124 of file EventList.h.
References Mantid::DataObjects::UNSORTED.
|
overridevirtual |
Add an offset to the pulsetime (wall-clock time) of each event in the list.
seconds | :: The value to shift the pulsetime by, in seconds |
Implements Mantid::API::IEventList.
Definition at line 2525 of file EventList.cpp.
References addPulsetimeHelper(), eventType, getNumberEvents(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
|
private |
Add an offset to the pulsetime (wall-clock time) of each event in the list.
events | :: reference to a vector of events to change. |
seconds | :: The value to shift the pulsetime by, in seconds |
Definition at line 2499 of file EventList.cpp.
References events.
Referenced by addPulsetime().
|
overridevirtual |
Add an offset to the pulsetime (wall-clock time) of each event in the list.
seconds | :: A set of values to shift the pulsetime by, in seconds |
Implements Mantid::API::IEventList.
Definition at line 2550 of file EventList.cpp.
References addPulsetimesHelper(), eventType, getNumberEvents(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
|
private |
Add an offset per event to the pulsetime (wall-clock time) of each event in the list.
It is assumed that the vector sizes match.
events | :: reference to a vector of events to change. |
seconds | :: The set of values to shift the pulsetime by, in seconds |
Definition at line 2512 of file EventList.cpp.
References events.
Referenced by addPulsetimes().
|
overridevirtual |
Add an offset to the TOF of each event in the list.
offset | :: The value to shift the time-of-flight by |
Implements Mantid::API::IEventList.
Definition at line 2491 of file EventList.cpp.
References convertTof().
Referenced by Mantid::Algorithms::ChangeBinOffset::exec().
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4690 of file EventList.cpp.
References histogram(), and m_histogram.
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4710 of file EventList.cpp.
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4705 of file EventList.cpp.
|
overridevirtual |
Clear the list of events and any associated detector ID's.
Implements Mantid::API::IEventList.
Definition at line 847 of file EventList.cpp.
References Mantid::API::ISpectrum::clearDetectorIDs(), Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), mru, weightedEvents, and weightedEventsNoTime.
Referenced by clearData(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), createFromHistogram(), filterByPulseTime(), filterByTimeAtSample(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::filterEvents(), maskCondition(), maskTof(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::procEvents(), Mantid::DataHandling::LoadEventPreNexus2::procEvents(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), splitByPulseTimeWithMatrix(), and ~EventList().
|
overridevirtual |
Mask the spectrum to this value. Removes all events.
Implements Mantid::API::ISpectrum.
Definition at line 880 of file EventList.cpp.
References clear().
Referenced by Mantid::Algorithms::WorkspaceJoiners::execEvent(), and operator-=().
void Mantid::DataObjects::EventList::clearUnused | ( | ) |
Clear any unused event lists (the ones that do not match the currently used type).
Memory is freed.
Definition at line 864 of file EventList.cpp.
References eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by compressEvents(), compressFatEvents(), and switchTo().
void Mantid::DataObjects::EventList::compressEvents | ( | double | tolerance, |
EventList * | destination | ||
) |
Compress the event list by grouping events with the same TOF (within a given tolerance).
PulseTime is ignored. The event list will be switched to WeightedEventNoTime.
tolerance | :: how close do two event's TOF have to be to be considered the same. |
destination | :: EventList that will receive the compressed events. Can be == this. |
Definition at line 1676 of file EventList.cpp.
References clearUnused(), compressEventsHelper(), empty(), eventType, order, sortTof(), Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, tolerance, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS().
|
inlinestaticprivate |
Compress the event list by grouping events with the same TOF.
events | :: input event list. |
out | :: output WeightedEventNoTime vector. |
tolerance | :: how close do two event's TOF have to be to be considered the same. |
Definition at line 1410 of file EventList.cpp.
References events, and tolerance.
Referenced by compressEvents().
|
private |
Compress the event list by grouping events with the same TOF.
Performs the compression in parallel.
events | :: input event list. |
out | :: output WeightedEventNoTime vector. |
tolerance | :: how close do two event's TOF have to be to be considered the same. |
Definition at line 1485 of file EventList.cpp.
References events, Mantid::DataHandling::numEvents(), PARALLEL_FOR_NO_WSP_CHECK, PARALLEL_GET_MAX_THREADS, and tolerance.
void Mantid::DataObjects::EventList::compressFatEvents | ( | const double | tolerance, |
const Types::Core::DateAndTime & | timeStart, | ||
const double | seconds, | ||
EventList * | destination | ||
) |
Definition at line 1727 of file EventList.cpp.
References clearUnused(), compressFatEventsHelper(), empty(), eventType, order, Mantid::DataObjects::PULSETIMETOF_SORT, sortPulseTimeTOFDelta(), Mantid::API::TOF, tolerance, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
|
staticprivate |
Referenced by compressFatEvents().
|
inline |
Definition at line 1566 of file EventList.cpp.
References Mantid::Kernel::DateAndTimeHelpers::averageSorted(), events, and tolerance.
|
overridevirtual |
Convert the time of flight by tof'=tof*factor+offset.
factor | :: The value to scale the time-of-flight by |
offset | :: The value to shift the time-of-flight by |
Implements Mantid::API::IEventList.
Definition at line 2435 of file EventList.cpp.
References convertTofHelper(), eventType, getNumberEvents(), getSortType(), Mantid::API::ISpectrum::mutableX(), reverse(), Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::x.
|
overridevirtual |
func | Function to do the conversion. |
sorting | How the events are sorted after the operation. 0 = unsorted (default), positive = unchanged, negative = reverse. |
Implements Mantid::API::IEventList.
Definition at line 2390 of file EventList.cpp.
References convertTofHelper(), dataX(), eventType, getNumberEvents(), getSortType(), reverse(), setSortOrder(), Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::x.
Referenced by addTof(), Mantid::Algorithms::EQSANSCorrectFrame::exec(), and scaleTof().
|
private |
Function to do the conversion factor work on either the TofEvent list or the WeightedEvent list.
Does NOT reverse the event list if the factor < 0
events | :: reference to a vector of events to change. |
factor | :: multiply by this |
offset | :: add this |
Definition at line 2470 of file EventList.cpp.
References events.
|
private |
events | |
func |
Definition at line 2423 of file EventList.cpp.
References events.
Referenced by convertTof().
void Mantid::DataObjects::EventList::convertUnitsQuickly | ( | const double & | factor, |
const double & | power | ||
) |
Convert the event's TOF (x) value according to a simple output = a * (input^b) relationship.
factor | :: the conversion factor a to apply |
power | :: the Power b to apply to the conversion |
Definition at line 4670 of file EventList.cpp.
References convertUnitsQuicklyHelper(), eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
private |
Convert the event's TOF (x) value according to a simple output = a * (input^b) relationship.
events | :: templated class for the list of events |
factor | :: the conversion factor a to apply |
power | :: the Power b to apply to the conversion |
Definition at line 4657 of file EventList.cpp.
References events.
Referenced by convertUnitsQuickly().
void Mantid::DataObjects::EventList::convertUnitsViaTof | ( | Mantid::Kernel::Unit * | fromUnit, |
Mantid::Kernel::Unit * | toUnit | ||
) |
Converts the X units in each event by going through TOF.
Note: if the unit conversion reverses the order, use "reverse()" to flip it back.
fromUnit | :: the Unit describing the input unit. Must be initialized. |
toUnit | :: the Unit describing the output unit. Must be initialized. |
Definition at line 4627 of file EventList.cpp.
References convertUnitsViaTofHelper(), eventType, Mantid::Kernel::Unit::isInitialized(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
private |
Helper function for the conversion to TOF.
This handles the different event types.
events | the list of events |
fromUnit | the unit to convert from |
toUnit | the unit to convert to |
Definition at line 4607 of file EventList.cpp.
References events, Mantid::Kernel::Unit::singleFromTOF(), and Mantid::Kernel::Unit::singleToTOF().
Referenced by convertUnitsViaTof().
|
overridevirtual |
Copy data from another EventList, via ISpectrum reference.
Implements Mantid::API::ISpectrum.
Definition at line 202 of file EventList.cpp.
References Mantid::API::ISpectrum::copyDataInto().
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 203 of file ISpectrum.cpp.
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 204 of file ISpectrum.cpp.
|
overrideprivatevirtual |
Used by copyDataFrom for dynamic dispatch for its source
.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 205 of file EventList.cpp.
References events, eventType, m_histogram, order, weightedEvents, and weightedEventsNoTime.
|
overrideprivatevirtual |
Used by Histogram1D::copyDataFrom for dynamic dispatch for other
.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 215 of file EventList.cpp.
References histogram(), and Mantid::API::ISpectrum::setHistogram().
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 205 of file ISpectrum.cpp.
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1278 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1282 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1280 of file EventList.cpp.
References histogram().
void Mantid::DataObjects::EventList::createFromHistogram | ( | const ISpectrum * | inSpec, |
bool | GenerateZeros, | ||
bool | GenerateMultipleEvents, | ||
int | MaxEventsPerBin | ||
) |
Create an EventList from a histogram.
This converts bins to weighted events. Any existing events are cleared.
inSpec | :: ISpectrum ptr to histogram data. |
GenerateZeros | :: if true, generate event(s) for empty bins |
GenerateMultipleEvents | :: if true, create several evenly-spaced fake events inside the bin |
MaxEventsPerBin | :: max number of events to generate in one bin, if GenerateMultipleEvents |
Definition at line 229 of file EventList.cpp.
References clear(), Mantid::API::ISpectrum::copyInfoFrom(), error, Mantid::DataHandling::numEvents(), Mantid::API::ISpectrum::ptrX(), Mantid::API::ISpectrum::readE(), Mantid::API::ISpectrum::readX(), Mantid::API::ISpectrum::readY(), setSortOrder(), setX(), switchTo(), Mantid::DataObjects::TOF_SORT, Mantid::API::WEIGHTED_NOTIME, weightedEventsNoTime, Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertSpectrum(), and Mantid::Algorithms::ConvertToEventWorkspace::exec().
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1237 of file EventList.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use mutableDx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1235 of file EventList.cpp.
References m_histogram.
Referenced by Mantid::DataObjects::EventWorkspace::dataDx().
|
overridevirtual |
Deprecated, use e() instead.
Look in the MRU to see if the E histogram has been generated before.
Return a read-only E histogram view of an event list
If so, return that. If not, calculate, cache and return it.
Implements Mantid::API::ISpectrum.
Definition at line 1380 of file EventList.cpp.
|
inlineoverridevirtual |
Deprecated, use mutableE() instead.
Disallowed data accessors - can't modify Y/E on a EventList
Implements Mantid::API::ISpectrum.
Definition at line 183 of file EventList.h.
|
overridevirtual |
Deprecated, use x() instead.
Returns a const reference to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 1226 of file EventList.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use mutableX() instead.
Returns a reference to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 1218 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), m_histogram, and mru.
Referenced by convertTof(), Mantid::DataObjects::EventWorkspace::dataX(), and reverse().
|
overridevirtual |
Deprecated, use y() instead.
Look in the MRU to see if the Y histogram has been generated before.
Return a read-only Y histogram view of an event list
If so, return that. If not, calculate, cache and return it.
Implements Mantid::API::ISpectrum.
Definition at line 1366 of file EventList.cpp.
|
inlineoverridevirtual |
Deprecated, use mutableY() instead.
Disallowed data accessors - can't modify Y/E on a EventList
Implements Mantid::API::ISpectrum.
Definition at line 180 of file EventList.h.
|
overridevirtual |
Divide the weights in this event list by a scalar with an (optional) error.
The event list switches to WeightedEvent's if needed. This simply calls the equivalent function: multiply(1.0/value, error/(value*value)).
value | divide all weights by this amount. |
error | error on 'value'. Can be 0. |
std::invalid_argument | if value == 0; cannot divide by zero. |
Implements Mantid::API::IEventList.
Definition at line 3633 of file EventList.cpp.
References error, multiply(), and value.
Referenced by Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin(), and Mantid::Algorithms::Divide::performEventBinaryOperation().
|
overridevirtual |
Divide the weights in this event list by a histogram.
The event list switches to WeightedEvent's if needed. NOTE: no unit checks are made (or possible to make) to compare the units of X and tof() in the EventList.
The formula used for calculating the error on the neutron weight is:
\[ \sigma_{f}^2 = (A / B)^2 * (\sigma_A^2 / A^2 + \sigma_B^2 / B^2) \]
where:
X | bins of the multiplying histogram. |
Y | value to multiply the weights. |
E | error on the value to multiply. |
invalid_argument | if the sizes of X, Y, E are not consistent. |
Implements Mantid::API::IEventList.
Definition at line 3586 of file EventList.cpp.
References divideHistogramHelper(), eventType, sortTof(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::Y.
|
staticprivate |
Helper method for dividing an event list by a histogram with error.
events | vector of events (with weights) |
X | bins of the dividing histogram. |
Y | value to dividing the weights. |
E | error on the value to dividing. |
invalid_argument | if the sizes of X, Y, E are not consistent. |
Definition at line 3480 of file EventList.cpp.
References error, events, Mantid::DataObjects::findFirstEvent(), value, Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by divide().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1300 of file EventList.cpp.
bool Mantid::DataObjects::EventList::empty | ( | ) | const |
Much like stl containers, returns true if there is nothing in the event list.
Definition at line 1158 of file EventList.cpp.
References eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by compressEvents(), compressFatEvents(), Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::Algorithms::SumSpectra::execEvent(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), Mantid::Algorithms::CalculateCountRate::histogramEvents(), Mantid::DataHandling::makeTimeOfFlightDataFuzzy(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS().
bool Mantid::DataObjects::EventList::equals | ( | const EventList & | rhs, |
const double | tolTof, | ||
const double | tolWeight, | ||
const int64_t | tolPulse | ||
) | const |
Definition at line 602 of file EventList.cpp.
References equals(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), rhs, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), and equals().
void Mantid::DataObjects::EventList::filterByPulseTime | ( | Types::Core::DateAndTime | start, |
Types::Core::DateAndTime | stop, | ||
EventList & | output | ||
) | const |
Filter this EventList into an output EventList, using keeping only events within the >= start and < end pulse times.
Detector IDs and the X axis are copied as well.
start | :: start time (absolute) |
stop | :: end time (absolute) |
output | :: reference to an event list that will be output. |
std::invalid_argument | If output is a reference to this EventList |
Definition at line 3709 of file EventList.cpp.
References clear(), events, eventType, filterByPulseTimeHelper(), Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, order, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), setSortOrder(), sortPulseTime(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterByTime::exec().
void Mantid::DataObjects::EventList::filterByPulseTimeHelper | ( | std::vector< T > & | events, |
DateAndTime | start, | ||
DateAndTime | stop, | ||
std::vector< T > & | output | ||
) |
Filter a vector of events into another based on pulse time.
TODO: Make this more efficient using STL-fu.
events | :: input events |
start | :: start time (absolute) |
stop | :: end time (absolute) |
output | :: reference to an event list that will be output. |
Definition at line 3659 of file EventList.cpp.
References events.
|
staticprivate |
Referenced by filterByPulseTime().
void Mantid::DataObjects::EventList::filterByTimeAtSample | ( | Types::Core::DateAndTime | start, |
Types::Core::DateAndTime | stop, | ||
double | tofFactor, | ||
double | tofOffset, | ||
EventList & | output | ||
) | const |
Definition at line 3739 of file EventList.cpp.
References clear(), events, eventType, filterByTimeAtSampleHelper(), Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, order, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), setSortOrder(), sortTimeAtSample(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
void Mantid::DataObjects::EventList::filterByTimeAtSampleHelper | ( | std::vector< T > & | events, |
DateAndTime | start, | ||
DateAndTime | stop, | ||
double | tofFactor, | ||
double | tofOffset, | ||
std::vector< T > & | output | ||
) |
Filter a vector of events into another based on time at sample.
TODO: Make this more efficient using STL-fu.
events | :: input events |
start | :: start time (absolute) |
stop | :: end time (absolute) |
tofFactor | :: scaling factor for tof |
tofOffset | :: offset for tof |
output | :: reference to an event list that will be output. |
Definition at line 3684 of file EventList.cpp.
References events.
|
staticprivate |
Referenced by filterByTimeAtSample().
void Mantid::DataObjects::EventList::filterInPlace | ( | Kernel::TimeSplitterType & | splitter | ) |
Use a TimeSplitterType to filter the event list in place.
splitter | :: a TimeSplitterType where all the entries (start/end time) indicate events that will be kept. Any other events will be deleted. |
Definition at line 3852 of file EventList.cpp.
References eventType, filterInPlaceHelper(), sortPulseTime(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterByLogValue::exec().
|
private |
Perform an in-place filtering on a vector of either TofEvent's or WeightedEvent's.
splitter | :: a TimeSplitterType where all the entries (start/end time) indicate events that will be kept. Any other events will be deleted. |
events | :: either this->events or this->weightedEvents. |
Definition at line 3781 of file EventList.cpp.
Referenced by filterInPlace().
|
staticprivate |
Utility function: Returns the iterator into events of the first TofEvent with pulsetime() > seek_pulsetime Will return events.end() if nothing is found!
events | :: event vector in which to look. |
seek_pulsetime | :: pulse time to find (typically the first bin X[0]) |
Definition at line 1787 of file EventList.cpp.
References events.
Referenced by generateCountsHistogramPulseTime().
|
private |
Utility function: Returns the iterator into events of the first TofEvent with time at sample > seek_time Will return events.end() if nothing is found!
events | :: event vector in which to look. |
seek_time | :: seek time to find (typically the first bin X[0]). Seek time in nanoseconds. |
tofFactor | :: Time of flight factor |
tofOffset | :: Time of flight offset |
Definition at line 1815 of file EventList.cpp.
References events.
Referenced by generateCountsHistogramTimeAtSample().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1286 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1290 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1288 of file EventList.cpp.
References histogram().
|
private |
Fill a histogram given specified histogram bounds.
Does not modify the eventlist (const method).
X | :: The x bins |
Y | :: The generated counts histogram |
Definition at line 2213 of file EventList.cpp.
References events, Mantid::DataObjects::findFirstEvent(), sortTof(), Mantid::Geometry::X, Mantid::Geometry::x, and Mantid::Geometry::Y.
Referenced by generateHistogram().
void Mantid::DataObjects::EventList::generateCountsHistogramPulseTime | ( | const double & | xMin, |
const double & | xMax, | ||
MantidVec & | Y, | ||
const double | TOF_min = std::numeric_limits<double>::lowest() , |
||
const double | TOF_max = std::numeric_limits<double>::max() |
||
) | const |
With respect to PulseTime fill a histogram given equal histogram bins.
Number of bins is equal to number of elements in vector Y. Appends values to existing Y values.
xMin | :: Minimal Pulse time (in nanoseconds, i.e. DateTime->totalNanoseconds()) value to include in binning. |
xMax | :: Maximal Pulse time value to constrain binning by (include the times smaller than right boundary, excluding equal) |
Y | :: The generated counts histogram |
TOF_min | – min TOF to include in histogram. |
TOF_max | – max TOF to constrain values included in histogram. |
Definition at line 2114 of file EventList.cpp.
References Mantid::Geometry::Y.
Referenced by Mantid::Algorithms::CalculateCountRate::calcRateLog(), and generateHistogramPulseTime().
|
private |
With respect to PulseTime Fill a histogram given specified histogram bounds.
Does not modify the eventlist (const method).
X | :: The x bins |
Y | :: The generated counts histogram |
Definition at line 2040 of file EventList.cpp.
References events, findFirstPulseEvent(), sortPulseTime(), Mantid::Geometry::X, and Mantid::Geometry::Y.
|
private |
With respect to Time at Sample, fill a histogram given specified histogram bounds.
Does not modify the eventlist (const method).
X | :: The x bins |
Y | :: The generated counts histogram |
tofFactor | :: time of flight factor |
tofOffset | :: time of flight offset |
Definition at line 2148 of file EventList.cpp.
References events, findFirstTimeAtSampleEvent(), sortTimeAtSample(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by generateHistogramTimeAtSample().
|
private |
Generate the Error histogram for the provided counts histogram.
It simply returns the sqrt of the number of counts for each bin.
Y | :: The counts histogram |
E | :: The generated error histogram |
Definition at line 2257 of file EventList.cpp.
References Mantid::Geometry::Y.
Referenced by generateHistogram(), generateHistogramPulseTime(), and generateHistogramTimeAtSample().
|
overridevirtual |
Generates both the Y and E (error) histograms w.r.t TOF for an EventList with or without WeightedEvents.
X | x-bins supplied |
Y | counts returned |
E | errors returned |
skipError | skip calculating the error. This has no effect for weighted events; you can just ignore the returned E vector. |
Implements Mantid::API::IEventList.
Definition at line 2010 of file EventList.cpp.
References eventType, generateCountsHistogram(), generateErrorsHistogram(), histogramForWeightsHelper(), sortTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::Y.
Referenced by Mantid::Algorithms::ResampleX::exec(), makeDataE(), makeDataY(), sharedE(), and sharedY().
|
overridevirtual |
Generates both the Y and E (error) histograms w.r.t Pulse Time for an EventList with or without WeightedEvents.
X | x-bins supplied |
Y | counts returned |
E | errors returned |
skipError | skip calculating the error. This has no effect for weighted events; you can just ignore the returned E vector. |
Implements Mantid::API::IEventList.
Definition at line 1946 of file EventList.cpp.
References eventType, generateCountsHistogramPulseTime(), generateErrorsHistogram(), sortPulseTime(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and Mantid::Geometry::Y.
|
overridevirtual |
Generates both the Y and E (error) histograms w.r.t Time at sample position.
X | X - axis supplied as reference |
Y | counts to fill |
E | errors to fill |
tofFactor | : Time of flight factor. Usually L1/(L1 + L2) |
tofOffset | : Time of flight offset. |
skipError | : skip calculating the error. This has no effect for weighted events; you can just ignore the returned E vector. |
Implements Mantid::API::IEventList.
Definition at line 1978 of file EventList.cpp.
References eventType, generateCountsHistogramTimeAtSample(), generateErrorsHistogram(), sortTimeAtSample(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and Mantid::Geometry::Y.
WeightedEvent Mantid::DataObjects::EventList::getEvent | ( | size_t | event_number | ) |
Return the given event in the list.
Handles the different types of events by converting to WeightedEvent (the most general type).
event_number | :: the index of the event to retrieve |
Definition at line 740 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
std::vector< TofEvent > & Mantid::DataObjects::EventList::getEvents | ( | ) |
Return the list of TofEvents contained.
NOTE! This should be used for testing purposes only, as much as possible. The EventList may contain weighted events, requiring use of getWeightedEvents() instead.
Definition at line 780 of file EventList.cpp.
References events, eventType, and Mantid::API::TOF.
Referenced by Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::filterEvents(), Mantid::DataObjects::getEventsFrom(), Mantid::Algorithms::CalculateCountRate::histogramEvents(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::procEvents(), Mantid::DataHandling::LoadEventPreNexus2::procEvents(), and Mantid::NeXus::NexusFileIO::writeEventList().
const std::vector< TofEvent > & Mantid::DataObjects::EventList::getEvents | ( | ) | const |
Return the const list of TofEvents contained.
NOTE! This should be used for testing purposes only, as much as possible. The EventList may contain weighted events, requiring use of getWeightedEvents() instead.
Definition at line 765 of file EventList.cpp.
References events, eventType, and Mantid::API::TOF.
|
overridevirtual |
Return the type of Event vector contained within.
Implements Mantid::API::IEventList.
Definition at line 643 of file EventList.cpp.
References eventType.
Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventsListInDetails(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertSpectrum(), Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), operator+=(), operator-=(), and Mantid::NeXus::NexusFileIO::writeEventList().
|
overridevirtual |
Memory used by this event list.
Note: It reports the CAPACITY of the vectors, rather than their size, since that is a more accurate representation of the size used.
Implements Mantid::API::IEventList.
Definition at line 1177 of file EventList.cpp.
References eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
overridevirtual |
Return the number of events in the list.
NOTE: If the events have weights, this returns the NUMBER of WeightedEvent's in the list, and NOT the sum of their weights (which may be two different numbers).
Implements Mantid::API::IEventList.
Definition at line 1143 of file EventList.cpp.
References eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by addPulsetime(), addPulsetimes(), Mantid::Algorithms::CompareWorkspaces::compareEventsListInDetails(), Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), Mantid::MDAlgorithms::ConvToMDEventsWS::convertEventList(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::convertEventList(), Mantid::MDAlgorithms::ConvToMDEventsWSIndexing::convertEvents(), convertTof(), equals(), Mantid::Algorithms::FilterEvents::examineAndSortEventWS(), Mantid::Algorithms::EQSANSCorrectFrame::exec(), Mantid::Algorithms::ModeratorTzero::execEvent(), Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), Mantid::MDAlgorithms::IntegrateFlux::getMaxNumberOfPoints(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getPulseTimes(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightErrors(), getWeights(), maskCondition(), maskTof(), operator==(), splitByFullTimeMatrixSplitter(), and Mantid::NeXus::NexusFileIO::writeEventList().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 3029 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::DataObjects::PULSETIME_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), and Mantid::DataObjects::EventWorkspace::getPulseTimeMax().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 2985 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::DataObjects::PULSETIME_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getPulseTimeMin().
void Mantid::DataObjects::EventList::getPulseTimeMinMax | ( | Mantid::Types::Core::DateAndTime & | tMin, |
Mantid::Types::Core::DateAndTime & | tM | ||
) | const |
Definition at line 3070 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::DataObjects::PULSETIME_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getPulseTimeMinMax().
|
overridevirtual |
Get the pulse times of each event in this EventList.
Implements Mantid::API::IEventList.
Definition at line 2872 of file EventList.cpp.
References eventType, getNumberEvents(), getPulseTimesHelper(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
staticprivate |
Get the pulsetimes of all events in a list.
events | :: source vector of events |
times | :: vector to fill |
Definition at line 2860 of file EventList.cpp.
References events.
Referenced by getPulseTimes().
EventSortType Mantid::DataObjects::EventList::getSortType | ( | ) | const |
Return the type of sorting used in this event list.
Definition at line 1104 of file EventList.cpp.
References order.
Referenced by convertTof(), and Mantid::NeXus::NexusFileIO::writeEventList().
|
overridevirtual |
Get the maximum time at sample.
Implements Mantid::API::IEventList.
Definition at line 3120 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::DataObjects::TIMEATSAMPLE_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getTimeAtSampleMax().
|
overridevirtual |
Get the minimum time at sample.
Implements Mantid::API::IEventList.
Definition at line 3161 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::DataObjects::TIMEATSAMPLE_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getTimeAtSampleMin().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 2940 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getEventXMax(), and Mantid::DataObjects::EventWorkspace::getEventXMinMax().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 2896 of file EventList.cpp.
References empty(), eventType, getNumberEvents(), Mantid::DataHandling::numEvents(), order, Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getEventXMin(), and Mantid::DataObjects::EventWorkspace::getEventXMinMax().
|
overridevirtual |
Get the times-of-flight of each event in this EventList.
Implements Mantid::API::IEventList.
Definition at line 2756 of file EventList.cpp.
References getTofs().
Referenced by getTofs().
|
overridevirtual |
Fill a vector with the list of TOFs.
tofs | :: A reference to the vector to be filled |
Implements Mantid::API::IEventList.
Definition at line 2734 of file EventList.cpp.
References eventType, getNumberEvents(), getTofsHelper(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::Algorithms::ModeratorTzero::execEvent(), and Mantid::DataHandling::makeTimeOfFlightDataFuzzy().
|
staticprivate |
Get the m_tof member of all events in a list.
events | :: source vector of events |
tofs | :: vector to fill |
Definition at line 2725 of file EventList.cpp.
References events.
Referenced by getTofs().
std::vector< WeightedEvent > & Mantid::DataObjects::EventList::getWeightedEvents | ( | ) |
Return the list of WeightedEvent contained.
NOTE! This should be used for testing purposes only, as much as possible. The EventList may contain un-weighted events, requiring use of getEvents() instead.
Definition at line 795 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED, and weightedEvents.
Referenced by Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::DataObjects::getEventsFrom(), and Mantid::NeXus::NexusFileIO::writeEventList().
const std::vector< WeightedEvent > & Mantid::DataObjects::EventList::getWeightedEvents | ( | ) | const |
Return the list of WeightedEvent contained.
NOTE! This should be used for testing purposes only, as much as possible. The EventList may contain un-weighted events, requiring use of getEvents() instead.
Definition at line 810 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED, and weightedEvents.
std::vector< WeightedEventNoTime > & Mantid::DataObjects::EventList::getWeightedEventsNoTime | ( | ) |
Return the list of WeightedEvent contained.
NOTE! This should be used for testing purposes only, as much as possible.
Definition at line 823 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
Referenced by Mantid::Crystal::AnvredCorrection::execEvent(), Mantid::DataObjects::getEventsFrom(), Mantid::Crystal::CentroidPeaks::integrateEvent(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace(), and Mantid::NeXus::NexusFileIO::writeEventList().
const std::vector< WeightedEventNoTime > & Mantid::DataObjects::EventList::getWeightedEventsNoTime | ( | ) | const |
Return the list of WeightedEventNoTime contained.
NOTE! This should be used for testing purposes only, as much as possible.
Definition at line 836 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
|
overridevirtual |
Return the list of event weight error values.
Get the weight error of each event in this EventList.
Implements Mantid::API::IEventList.
Definition at line 2847 of file EventList.cpp.
References getWeightErrors().
Referenced by getWeightErrors().
|
overridevirtual |
Return the list of event weight error values.
Fill a vector with the list of Weight Errors.
weightErrors | :: A reference to the vector to be filled |
Implements Mantid::API::IEventList.
Definition at line 2824 of file EventList.cpp.
References eventType, getNumberEvents(), getWeightErrorsHelper(), Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
staticprivate |
Get the weight error member of all events in a list.
events | :: source vector of events |
weightErrors | :: vector to fill |
Definition at line 2814 of file EventList.cpp.
References events.
Referenced by getWeightErrors().
|
overridevirtual |
Return the list of event weight values.
Get the weight of each event in this EventList.
Implements Mantid::API::IEventList.
Definition at line 2801 of file EventList.cpp.
References getWeights().
Referenced by getWeights().
|
overridevirtual |
Return the list of event weight values.
Fill a vector with the list of Weights.
weights | :: A reference to the vector to be filled |
Implements Mantid::API::IEventList.
Definition at line 2778 of file EventList.cpp.
References eventType, getNumberEvents(), getWeightsHelper(), Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
staticprivate |
Get the weight member of all events in a list.
events | :: source vector of events |
weights | :: vector to fill |
Definition at line 2768 of file EventList.cpp.
References events.
Referenced by getWeights().
|
overridevirtual |
Returns the Histogram associated with this spectrum.
Y and E data is computed from the event list.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1271 of file EventList.cpp.
References m_histogram, sharedE(), and sharedY().
Referenced by checkAndSanitizeHistogram(), copyDataInto(), counts(), countStandardDeviations(), countVariances(), frequencies(), frequencyStandardDeviations(), and frequencyVariances().
|
virtual |
Return the size of the histogram data.
Definition at line 1192 of file EventList.cpp.
References readX().
|
staticprivate |
Generates both the Y and E (error) histograms for an EventList with WeightedEvents.
events | vector of events (with weights) |
X | X-bins supplied |
Y | counts returned |
E | errors returned |
runtime_error | if the EventList does not have weighted events |
Definition at line 1854 of file EventList.cpp.
References events, Mantid::DataObjects::findFirstEvent(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by generateHistogram().
|
inlineoverrideprivatevirtual |
Implements Mantid::API::ISpectrum.
Definition at line 326 of file EventList.h.
|
overridevirtual |
Integrate the events between a range of X values, or all events.
minX | :: minimum X bin to use in integrating. |
maxX | :: maximum X bin to use in integrating. |
entireRange | :: set to true to use the entire range. minX and maxX are then ignored! |
Implements Mantid::API::IEventList.
Definition at line 2338 of file EventList.cpp.
References error, and integrate().
void Mantid::DataObjects::EventList::integrate | ( | const double | minX, |
const double | maxX, | ||
const bool | entireRange, | ||
double & | sum, | ||
double & | error | ||
) | const |
Integrate the events between a range of X values, or all events.
minX | :: minimum X bin to use in integrating. |
maxX | :: maximum X bin to use in integrating. |
entireRange | :: set to true to use the entire range. minX and maxX are then ignored! |
sum | :: place holder for the resulting sum |
error | :: place holder for the resulting sum of errors |
Definition at line 2354 of file EventList.cpp.
References error, eventType, integrateHelper(), sortTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getIntegratedSpectra(), and integrate().
|
staticprivate |
Integrate the events between a range of X values, or all events.
events | :: reference to a vector of events to change. |
minX | :: minimum X bin to use in integrating. |
maxX | :: maximum X bin to use in integrating. |
entireRange | :: set to true to use the entire range. minX and maxX are then ignored! |
Definition at line 2275 of file EventList.cpp.
References error, events, and integrateHelper().
|
staticprivate |
Integrate the events between a range of X values, or all events.
events | :: reference to a vector of events to change. |
minX | :: minimum X bin to use in integrating. |
maxX | :: maximum X bin to use in integrating. |
entireRange | :: set to true to use the entire range. minX and maxX are then ignored! |
sum | :: reference to a double to put the sum in. |
error | :: reference to a double to put the error in. |
Definition at line 2293 of file EventList.cpp.
Referenced by integrate(), and integrateHelper().
|
overridevirtual |
Return true if the event list is sorted by TOF.
Implements Mantid::API::IEventList.
Definition at line 1100 of file EventList.cpp.
References order, and Mantid::DataObjects::TOF_SORT.
Referenced by reverse().
MantidVec * Mantid::DataObjects::EventList::makeDataE | ( | ) | const |
Calculates and returns a pointer to the E histogrammed data.
Remember to delete your pointer after use!
Definition at line 1263 of file EventList.cpp.
References generateHistogram(), readX(), and Mantid::Geometry::Y.
MantidVec * Mantid::DataObjects::EventList::makeDataY | ( | ) | const |
Calculates and returns a pointer to the Y histogrammed data.
Remember to delete your pointer after use!
Definition at line 1250 of file EventList.cpp.
References generateHistogram(), readX(), and Mantid::Geometry::Y.
|
overridevirtual |
Mask out events by the condition vector.
Events are removed from the list.
mask | :: condition vector |
Implements Mantid::API::IEventList.
Definition at line 2687 of file EventList.cpp.
References clear(), eventType, getNumberEvents(), maskConditionHelper(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
staticprivate |
Mask out events by the condition vector.
Events are removed from the list.
events | :: reference to a vector of events to change. |
mask | :: condition vector |
Definition at line 2659 of file EventList.cpp.
Referenced by maskCondition().
|
overridevirtual |
Mask out events that have a tof between tofMin and tofMax (inclusively).
Events are removed from the list.
tofMin | :: lower bound of TOF to filter out |
tofMax | :: upper bound of TOF to filter out |
Implements Mantid::API::IEventList.
Definition at line 2619 of file EventList.cpp.
References clear(), eventType, getNumberEvents(), maskTofHelper(), sortTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
staticprivate |
Mask out events that have a tof between tofMin and tofMax (inclusively).
Events are removed from the list.
events | :: reference to a vector of events to change. |
tofMin | :: lower bound of TOF to filter out |
tofMax | :: upper bound of TOF to filter out |
Definition at line 2582 of file EventList.cpp.
Referenced by maskTof().
|
staticprivate |
SUBTRACT another EventList from this event list.
The event lists are concatenated, but the weights of the incoming list are multiplied by -1.0.
T1,T2 | :: TofEvent, WeightedEvent or WeightedEventNoTime |
events | :: The event vector being changed. |
more_events | :: Another event vector being subtracted from this. |
Definition at line 502 of file EventList.cpp.
References events.
Referenced by operator-=().
|
overridevirtual |
Multiply the weights in this event list by a scalar variable with an error; though the error can be 0.0.
The event list switches to WeightedEvent's if needed. Note that if the multiplier is exactly 1.0 and the error is exactly 0.0, the list is NOT switched to WeightedEvents - nothing happens.
Given:
The error propagation formula used is:
\[ \left(\frac{\sigma_f}{f}\right)^2 = \left(\frac{\sigma_A}{A}\right)^2 + *\left(\frac{\sigma_B}{B}\right)^2 + 2\frac{\sigma_A\sigma_B}{AB}\rho_{AB} \]
\( \rho_{AB} \) is the covariance between A and B, which we take to be 0 (uncorrelated variables). Therefore, this reduces to:
\[ \sigma_{AB}^2 = B^2 \sigma_A^2 + A^2 \sigma_B ^ 2 \]
In the case of no error:
value | multiply all weights by this amount. |
error | error on 'value'. Can be 0. |
Implements Mantid::API::IEventList.
Definition at line 3324 of file EventList.cpp.
References error, eventType, multiplyHelper(), switchTo(), Mantid::API::TOF, value, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by divide(), operator*=(), operator/=(), and Mantid::Algorithms::Multiply::performEventBinaryOperation().
|
overridevirtual |
Multiply the weights in this event list by a histogram.
The event list switches to WeightedEvent's if needed. NOTE: no unit checks are made (or possible to make) to compare the units of X and tof() in the EventList.
The formula used for calculating the error on the neutron weight is:
\[ \sigma_{f}^2 = B^2 \sigma_A^2 + A^2 \sigma_B ^ 2 \]
where:
X | bins of the multiplying histogram. |
Y | value to multiply the weights. |
E | error on the value to multiply. |
invalid_argument | if the sizes of X, Y, E are not consistent. |
Implements Mantid::API::IEventList.
Definition at line 3449 of file EventList.cpp.
References eventType, multiplyHistogramHelper(), sortTof(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::Y.
|
staticprivate |
Helper method for multiplying an event list by a scalar value with/without error.
events | vector of events (with weights) |
value | multiply all weights by this amount. |
error | error on 'value'. Can be 0. |
Definition at line 3255 of file EventList.cpp.
References error, events, and value.
Referenced by multiply().
|
staticprivate |
Helper method for multiplying an event list by a histogram with error.
events | vector of events (with weights) |
X | bins of the multiplying histogram. |
Y | value to multiply the weights. |
E | error on the value to multiply. |
invalid_argument | if the sizes of X, Y, E are not consistent. |
Definition at line 3355 of file EventList.cpp.
References error, events, Mantid::DataObjects::findFirstEvent(), value, Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by multiply().
|
overrideprivatevirtual |
Implements Mantid::API::ISpectrum.
Definition at line 4684 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), m_histogram, and mru.
bool Mantid::DataObjects::EventList::operator!= | ( | const EventList & | rhs | ) | const |
Inequality comparator.
rhs | :: other EventList to compare |
Definition at line 600 of file EventList.cpp.
EventList & Mantid::DataObjects::EventList::operator*= | ( | const double | value | ) |
Operator to multiply the weights in this EventList by an error-less scalar.
Use multiply(value,error) if you wish to multiply by a real variable with an error!
The event list switches to WeightedEvent's if needed. Note that if the multiplier is exactly 1.0, the list is NOT switched to WeightedEvents - nothing happens.
value | :: multiply by this |
Definition at line 3290 of file EventList.cpp.
References multiply().
Append another EventList to this event list.
The event lists are concatenated, and a union of the sets of detector ID's is done. Switching of event types may occur if the two are different.
more_events | :: Another EventList. |
Definition at line 468 of file EventList.cpp.
References Mantid::API::ISpectrum::addDetectorIDs(), events, Mantid::API::ISpectrum::getDetectorIDs(), getEventType(), operator+=(), order, Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
EventList & Mantid::DataObjects::EventList::operator+= | ( | const std::vector< Types::Event::TofEvent > & | more_events | ) |
EventList & Mantid::DataObjects::EventList::operator+= | ( | const std::vector< WeightedEvent > & | more_events | ) |
Append a list of events to the histogram.
Note: The whole list will switch to weights (a possibly lengthy operation) if it did not have weights before.
more_events | :: A vector of events to append. |
Definition at line 407 of file EventList.cpp.
References eventType, order, switchTo(), Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
EventList & Mantid::DataObjects::EventList::operator+= | ( | const std::vector< WeightedEventNoTime > & | more_events | ) |
Append a list of events to the histogram.
Note: The whole list will switch to weights (a possibly lengthy operation) if it did not have weights before.
more_events | :: A vector of events to append. |
Definition at line 441 of file EventList.cpp.
References eventType, order, switchTo(), Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
EventList & Mantid::DataObjects::EventList::operator+= | ( | const Types::Event::TofEvent & | event | ) |
Referenced by operator+=().
EventList & Mantid::DataObjects::EventList::operator+= | ( | const WeightedEvent & | event | ) |
Append a WeightedEvent to the histogram.
Note: The whole list will switch to weights (a possibly lengthy operation) if it did not have weights before.
event | :: WeightedEvent to add at the end of the list. |
Definition at line 392 of file EventList.cpp.
References order, switchTo(), Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, and weightedEvents.
SUBTRACT another EventList from this event list.
The event lists are concatenated, but the weights of the incoming list are multiplied by -1.0.
more_events | :: Another EventList. |
Definition at line 524 of file EventList.cpp.
References clearData(), events, getEventType(), minusHelper(), order, switchTo(), Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
EventList & Mantid::DataObjects::EventList::operator/= | ( | const double | value | ) |
Operator to divide the weights in this EventList by an error-less scalar.
Use divide(value,error) if your scalar has an error! This simply calls the equivalent function: multiply(1.0/value).
value | :: divide by this |
std::invalid_argument | if value == 0; cannot divide by zero. |
Definition at line 3616 of file EventList.cpp.
References multiply(), and value.
Copy into this event list from another.
rhs | :: We will copy all the events from that into this object. |
Definition at line 309 of file EventList.cpp.
References events, eventType, m_histogram, order, rhs, weightedEvents, and weightedEventsNoTime.
Referenced by EventList().
bool Mantid::DataObjects::EventList::operator== | ( | const EventList & | rhs | ) | const |
Equality operator between EventList's.
rhs | :: other EventList to compare |
Definition at line 581 of file EventList.cpp.
References events, eventType, getNumberEvents(), rhs, weightedEvents, and weightedEventsNoTime.
|
overridevirtual |
Deprecated, use sharedX() instead. Returns a pointer to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 1232 of file EventList.cpp.
References m_histogram.
Referenced by Mantid::DataObjects::EventWorkspace::refX().
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1239 of file EventList.cpp.
References m_histogram.
Referenced by Mantid::DataObjects::EventWorkspace::dataDx().
|
overridevirtual |
Deprecated, use x() instead. Returns the x data const.
Implements Mantid::API::ISpectrum.
Definition at line 1229 of file EventList.cpp.
References m_histogram.
Referenced by Mantid::DataObjects::EventWorkspace::dataX(), histogram_size(), makeDataE(), makeDataY(), sharedE(), and sharedY().
|
overridevirtual |
Reserve a certain number of entries in event list of the specified eventType.
Calls std::vector<>::reserve() in order to pre-allocate the length of the event list vector.
num | :: number of events that will be in this EventList |
Implements Mantid::API::IEventList.
Definition at line 895 of file EventList.cpp.
References eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataHandling::LoadBBY::exec(), Mantid::Algorithms::DiffractionFocussing2::execEvent(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::filterEvents(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadEMU< FD >::prepareEventStorage(), Mantid::DataHandling::LoadPLN::prepareEventStorage(), Mantid::DataHandling::FilterEventsByLogValuePreNexus::procEvents(), Mantid::DataHandling::LoadEventPreNexus2::procEvents(), and Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace().
void Mantid::DataObjects::EventList::reverse | ( | ) |
Reverse the histogram boundaries and the associated events if they are sorted by time-of-flight.
Does nothing if sorted otherwise or unsorted.
Definition at line 1112 of file EventList.cpp.
References dataX(), eventType, isSortedByTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::x.
Referenced by convertTof().
|
overridevirtual |
Convert the units in the TofEvent's m_tof field to some other value, by scaling by a multiplier.
factor | :: conversion factor (e.g. multiply TOF by this to get d-spacing) |
Implements Mantid::API::IEventList.
Definition at line 2484 of file EventList.cpp.
References convertTof().
void Mantid::DataObjects::EventList::setMRU | ( | EventWorkspaceMRU * | newMRU | ) |
Sets the MRU list for this event list.
newMRU | :: new MRU for the workspace containing this EventList |
Definition at line 886 of file EventList.cpp.
References mru.
void Mantid::DataObjects::EventList::setSortOrder | ( | const EventSortType | order | ) | const |
Manually set the event list sort order value.
No actual sorting takes place. SHOULD ONLY BE USED IN TESTS or if you know what you are doing.
order | :: sort order to set. |
Definition at line 943 of file EventList.cpp.
References order.
Referenced by convertTof(), createFromHistogram(), Mantid::DataHandling::LoadBBY::exec(), Mantid::Algorithms::ModeratorTzero::execEvent(), filterByPulseTime(), filterByTimeAtSample(), Mantid::DataHandling::LoadEMU< FD >::prepareEventStorage(), Mantid::DataHandling::LoadPLN::prepareEventStorage(), and Mantid::DataHandling::LoadNexusMonitors2::readEventMonitorEntry().
|
overridevirtual |
Set a list of TOFs to the current event list.
Modify the units if necessary.
tofs | :: The vector of doubles to set the tofs to. |
Implements Mantid::API::IEventList.
Definition at line 3226 of file EventList.cpp.
References eventType, order, setTofsHelper(), Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::Algorithms::ModeratorTzero::execEvent(), and Mantid::DataHandling::makeTimeOfFlightDataFuzzy().
|
staticprivate |
Set a list of TOFs to the current event list.
events | :: source vector of events |
tofs | :: The vector of doubles to set the tofs to. |
Definition at line 3208 of file EventList.cpp.
References events.
Referenced by setTofs().
|
overridevirtual |
Deprecated, use setSharedX() instead.
Set the x-component for the histogram view. This will NOT cause the histogram to be calculated.
X | :: The vector of doubles to set as the histogram limits. |
Implements Mantid::API::ISpectrum.
Definition at line 1209 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), m_histogram, mru, and Mantid::Geometry::X.
Referenced by createFromHistogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1336 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::ensureEnoughBuffersE(), Mantid::DataObjects::EventWorkspaceMRU::findE(), generateHistogram(), Mantid::DataObjects::EventWorkspaceMRU::insertE(), mru, PARALLEL_THREAD_NUMBER, and readX().
Referenced by dataE(), e(), and histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1306 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::ensureEnoughBuffersE(), Mantid::DataObjects::EventWorkspaceMRU::ensureEnoughBuffersY(), Mantid::DataObjects::EventWorkspaceMRU::findY(), generateHistogram(), Mantid::DataObjects::EventWorkspaceMRU::insertE(), Mantid::DataObjects::EventWorkspaceMRU::insertY(), mru, PARALLEL_THREAD_NUMBER, readX(), and Mantid::Geometry::Y.
Referenced by dataY(), histogram(), and y().
void Mantid::DataObjects::EventList::sort | ( | const EventSortType | order | ) | const |
Sort events by TOF or Frame.
order | :: Order by which to sort. |
Definition at line 917 of file EventList.cpp.
References order, Mantid::DataObjects::PULSETIME_SORT, Mantid::DataObjects::PULSETIMETOF_DELTA_SORT, Mantid::DataObjects::PULSETIMETOF_SORT, sortPulseTime(), sortPulseTimeTOF(), sortTof(), Mantid::DataObjects::TIMEATSAMPLE_SORT, Mantid::DataObjects::TOF_SORT, and Mantid::DataObjects::UNSORTED.
Referenced by Mantid::DataObjects::EventSortingTask::operator()().
void Mantid::DataObjects::EventList::sortPulseTime | ( | ) | const |
Sort events by Frame.
Definition at line 1014 of file EventList.cpp.
References Mantid::DataObjects::compareEventPulseTime(), events, eventType, m_sortMutex, order, Mantid::DataObjects::PULSETIME_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by filterByPulseTime(), filterInPlace(), generateCountsHistogramPulseTime(), generateHistogramPulseTime(), sort(), and splitByTime().
void Mantid::DataObjects::EventList::sortPulseTimeTOF | ( | ) | const |
Definition at line 1044 of file EventList.cpp.
References Mantid::DataObjects::compareEventPulseTimeTOF(), events, eventType, m_sortMutex, order, Mantid::DataObjects::PULSETIMETOF_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by sort(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), and splitByPulseTimeWithMatrix().
|
private |
Sort by the pulse time with a tolerance.
The pulsetime to compare is a constant binning of seconds from start. This will set the sort order to UNSORTED upon completion rather than storing the call parameters.
start | The absolute start time |
seconds | The tolerance of pulse time in seconds. |
Definition at line 1077 of file EventList.cpp.
References events, eventType, m_sortMutex, order, Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by compressFatEvents().
void Mantid::DataObjects::EventList::sortTimeAtSample | ( | const double & | tofFactor, |
const double & | tofShift, | ||
bool | forceResort = false |
||
) | const |
Sort events by time at sample.
tofFactor | : For the elastic case, L1 / (L1 + L2) |
tofShift | : Tof offset in Seconds |
forceResort | : If the tofFactor, or tofShift are different from a previous run of the same sort type, you need to trigger a full resort using forceResort = true. False by default. |
Definition at line 982 of file EventList.cpp.
References events, eventType, m_sortMutex, order, Mantid::DataObjects::TIMEATSAMPLE_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by filterByTimeAtSample(), generateCountsHistogramTimeAtSample(), and generateHistogramTimeAtSample().
void Mantid::DataObjects::EventList::sortTof | ( | ) | const |
Sort events by TOF in one thread.
Definition at line 947 of file EventList.cpp.
References events, eventType, m_sortMutex, order, Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by compressEvents(), divide(), Mantid::Algorithms::FilterByXValue::exec(), generateCountsHistogram(), generateHistogram(), integrate(), Mantid::DataHandling::makeTimeOfFlightDataFuzzy(), maskTof(), multiply(), and sort().
void Mantid::DataObjects::EventList::splitByFullTime | ( | Kernel::TimeSplitterType & | splitter, |
std::map< int, EventList * > | outputs, | ||
bool | docorrection, | ||
double | toffactor, | ||
double | tofshift | ||
) | const |
Split the event list into n outputs by event's full time (tof + pulse time)
splitter | :: a TimeSplitterType giving where to split |
outputs | :: a map of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
docorrection | :: a boolean to indiciate whether it is need to do correction |
toffactor | a correction factor for each TOF to multiply with |
tofshift | a correction shift for each TOF to add with |
Definition at line 4070 of file EventList.cpp.
References clear(), eventType, Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), sortPulseTimeTOF(), splitByFullTimeHelper(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterEvents::filterEventsBySplitters().
|
private |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus.
splitter | :: a TimeSplitterType giving where to split |
outputs | :: a vector of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
events | :: either this->events or this->weightedEvents. |
docorrection | :: flag to determine whether or not to apply correction |
toffactor | :: factor to correct TOF in formula toffactor*tof+tofshift |
tofshift | :: amount to shift (in SECOND) to correct TOF in formula: toffactor*tof+tofshift |
Definition at line 3992 of file EventList.cpp.
References addEventQuickly(), events, and index.
Referenced by splitByFullTime().
std::string Mantid::DataObjects::EventList::splitByFullTimeMatrixSplitter | ( | const std::vector< int64_t > & | vec_splitters_time, |
const std::vector< int > & | vecgroups, | ||
std::map< int, EventList * > | vec_outputEventList, | ||
bool | docorrection, | ||
double | toffactor, | ||
double | tofshift | ||
) | const |
Split ...
EventList::splitByFullTimeMatrixSplitter.
vec_splitters_time | :: vector of splitting times |
vecgroups | :: vector of index group for splitters |
vec_outputEventList | :: vector of groups of splitted events |
docorrection | :: flag to do TOF correction from detector to sample |
toffactor | :: factor multiplied to TOF for correction |
tofshift | :: shift to TOF in unit of SECOND for correction |
Definition at line 4290 of file EventList.cpp.
References clear(), eventType, Mantid::API::ISpectrum::getDetectorIDs(), getNumberEvents(), m_histogram, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), sortPulseTimeTOF(), splitByFullTimeSparseVectorSplitterHelper(), splitByFullTimeVectorSplitterHelper(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterEvents::filterEventsByVectorSplitters().
|
private |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus.
vectimes | :: a vector of absolute time in nanoseconds serving as boundaries of splitters |
vecgroups | :: a vector of integer serving as the target workspace group for splitters |
outputs | :: a vector of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
vecEvents | :: either this->events or this->weightedEvents. |
docorrection | :: flag to determine whether or not to apply correction |
toffactor | :: factor multiplied to TOF for correcting event time from detector to sample |
tofshift | :: shift in SECOND to TOF for correcting event time from detector to sample |
Definition at line 4199 of file EventList.cpp.
References addEventQuickly().
Referenced by splitByFullTimeMatrixSplitter().
|
private |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's The comparison between neutron event and splitter is based on neutron event's pulse time plus.
vectimes | :: a vector of absolute time in nanoseconds serving as boundaries of splitters |
vecgroups | :: a vector of integer serving as the target workspace group for splitters |
outputs | :: a vector of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
vecEvents | :: either this->events or this->weightedEvents. |
docorrection | :: flag to determine whether or not to apply correction |
toffactor | :: factor multiplied to TOF for correcting event time from detector to sample |
tofshift | :: shift in SECOND to TOF for correcting event time from detector to sample |
Definition at line 4132 of file EventList.cpp.
References addEventQuickly(), and index.
Referenced by splitByFullTimeMatrixSplitter().
void Mantid::DataObjects::EventList::splitByPulseTime | ( | Kernel::TimeSplitterType & | splitter, |
std::map< int, EventList * > | outputs | ||
) | const |
Split events by pulse time.
Split the event list by pulse time.
Definition at line 4420 of file EventList.cpp.
References clear(), eventType, Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), sortPulseTimeTOF(), splitByPulseTimeHelper(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterEvents::filterEventsBySplitters().
|
private |
Split events by pulse time.
Split the event list into n outputs by each event's pulse time only.
Definition at line 4360 of file EventList.cpp.
References addEventQuickly(), events, and index.
Referenced by splitByPulseTime().
void Mantid::DataObjects::EventList::splitByPulseTimeWithMatrix | ( | const std::vector< int64_t > & | vec_times, |
const std::vector< int > & | vec_target, | ||
std::map< int, EventList * > | outputs | ||
) | const |
Split events by pulse time with Matrix splitters.
Split the event list by pulse time.
Definition at line 4463 of file EventList.cpp.
References clear(), eventType, Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), sortPulseTimeTOF(), splitByPulseTimeWithMatrixHelper(), switchTo(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
|
private |
Split events (template) by pulse time with matrix splitters.
Definition at line 4504 of file EventList.cpp.
References addEventQuickly(), events, and index.
Referenced by splitByPulseTimeWithMatrix().
void Mantid::DataObjects::EventList::splitByTime | ( | Kernel::TimeSplitterType & | splitter, |
std::vector< EventList * > | outputs | ||
) | const |
Split the event list into n outputs.
splitter | :: a TimeSplitterType giving where to split |
outputs | :: a vector of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
Definition at line 3941 of file EventList.cpp.
References eventType, Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, sortPulseTime(), splitByTimeHelper(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::Algorithms::FilterByLogValue::exec().
|
private |
Split the event list into n outputs, operating on a vector of either TofEvent's or WeightedEvent's Only event's pulse time is used to compare with splitters.
It is a faster and simple version of splitByFullTimeHelper
splitter | :: a TimeSplitterType giving where to split |
outputs | :: a vector of where the split events will end up. The # of entries in there should be big enough to accommodate the indices. |
events | :: either this->events or this->weightedEvents. |
Definition at line 3884 of file EventList.cpp.
References addEventQuickly(), events, and index.
Referenced by splitByTime().
|
overridevirtual |
Switch the EventList to use the given EventType (TOF, WEIGHTED, or WEIGHTED_NOTIME)
Implements Mantid::API::IEventList.
Definition at line 649 of file EventList.cpp.
References clearUnused(), eventType, switchToWeightedEvents(), switchToWeightedEventsNoTime(), Mantid::API::TOF, Mantid::API::WEIGHTED, and Mantid::API::WEIGHTED_NOTIME.
Referenced by createFromHistogram(), Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::DataHandling::DefaultEventLoader::DefaultEventLoader(), divide(), Mantid::Algorithms::DiffractionFocussing2::execEvent(), Mantid::Crystal::AnvredCorrection::execEvent(), filterByPulseTime(), filterByTimeAtSample(), Mantid::Crystal::CentroidPeaks::integrateEvent(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), multiply(), operator+=(), operator-=(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), and splitByPulseTimeWithMatrix().
|
private |
Switch the EventList to use WeightedEvents instead of TofEvent.
Definition at line 675 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by switchTo().
|
private |
Switch the EventList to use WeightedEventNoTime's instead of TofEvent.
Definition at line 703 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by switchTo().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1294 of file EventList.cpp.
|
mutableprivate |
List of TofEvent (no weights).
Definition at line 333 of file EventList.h.
Referenced by addPulsetimeHelper(), addPulsetimesHelper(), compressEventsHelper(), compressEventsParallelHelper(), compressFatEventsHelper(), convertTofHelper(), convertUnitsQuicklyHelper(), convertUnitsViaTofHelper(), copyDataInto(), divideHistogramHelper(), EventList(), filterByPulseTime(), filterByPulseTimeHelper(), filterByTimeAtSample(), filterByTimeAtSampleHelper(), filterInPlaceHelper(), findFirstPulseEvent(), findFirstTimeAtSampleEvent(), generateCountsHistogram(), generateCountsHistogramPulseTime(), generateCountsHistogramTimeAtSample(), getEvent(), getEvents(), getPulseTimesHelper(), getTofsHelper(), getWeightErrorsHelper(), getWeightsHelper(), histogramForWeightsHelper(), integrateHelper(), maskConditionHelper(), maskTofHelper(), minusHelper(), multiplyHelper(), multiplyHistogramHelper(), operator+=(), operator-=(), operator=(), operator==(), setTofsHelper(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), splitByFullTimeHelper(), splitByPulseTimeHelper(), splitByPulseTimeWithMatrixHelper(), splitByTimeHelper(), switchToWeightedEvents(), and switchToWeightedEventsNoTime().
|
private |
What type of event is in our list.
Definition at line 342 of file EventList.h.
Referenced by addPulsetime(), addPulsetimes(), clearUnused(), compressEvents(), compressFatEvents(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), divide(), empty(), equals(), EventList(), filterByPulseTime(), filterByTimeAtSample(), filterInPlace(), generateHistogram(), generateHistogramPulseTime(), generateHistogramTimeAtSample(), getEvent(), getEvents(), getEventType(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getPulseTimes(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEvents(), getWeightedEventsNoTime(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), operator+=(), operator=(), operator==(), reserve(), reverse(), setTofs(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), splitByPulseTimeWithMatrix(), splitByTime(), switchTo(), switchToWeightedEvents(), and switchToWeightedEventsNoTime().
|
private |
Histogram object holding the histogram data. Currently only X.
Definition at line 330 of file EventList.h.
Referenced by checkAndSanitizeHistogram(), copyDataInto(), dataDx(), dataX(), filterByPulseTime(), filterByTimeAtSample(), histogram(), mutableHistogramRef(), operator=(), ptrX(), readDx(), readX(), setX(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), splitByPulseTimeWithMatrix(), and splitByTime().
|
mutableprivate |
Mutex that is locked while sorting an event list.
Definition at line 351 of file EventList.h.
Referenced by sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), and sortTof().
|
mutableprivate |
MRU lists of the parent EventWorkspace.
Definition at line 348 of file EventList.h.
Referenced by clear(), dataE(), dataX(), dataY(), e(), mutableHistogramRef(), setMRU(), setX(), sharedE(), sharedY(), and y().
|
mutableprivate |
Last sorting order.
Definition at line 345 of file EventList.h.
Referenced by compressEvents(), compressFatEvents(), copyDataInto(), EventList(), filterByPulseTime(), filterByTimeAtSample(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getSortType(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), isSortedByTof(), operator+=(), operator-=(), operator=(), setSortOrder(), setTofs(), sort(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), and sortTof().
|
mutableprivate |
List of WeightedEvent's.
Definition at line 336 of file EventList.h.
Referenced by addPulsetime(), addPulsetimes(), clear(), clearUnused(), compressEvents(), compressFatEvents(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), divide(), empty(), equals(), EventList(), filterByPulseTime(), filterByTimeAtSample(), filterInPlace(), generateHistogram(), getEvent(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getPulseTimes(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEvents(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), operator+=(), operator-=(), operator=(), operator==(), reserve(), reverse(), setTofs(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), splitByFullTime(), splitByFullTimeMatrixSplitter(), splitByPulseTime(), splitByPulseTimeWithMatrix(), splitByTime(), switchToWeightedEvents(), and switchToWeightedEventsNoTime().
|
mutableprivate |
List of WeightedEvent's.
Definition at line 339 of file EventList.h.
Referenced by clear(), clearUnused(), compressEvents(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), createFromHistogram(), divide(), empty(), equals(), EventList(), generateHistogram(), getEvent(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getPulseTimes(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEventsNoTime(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), operator+=(), operator-=(), operator=(), operator==(), reserve(), reverse(), setTofs(), sortTimeAtSample(), sortTof(), switchToWeightedEvents(), and switchToWeightedEventsNoTime().