|
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. | |
| void | addEventQuickly (const WeightedEvent &event) |
| Append an event to the histogram, without clearing the cache, to make it faster. | |
| void | addEventQuickly (const WeightedEventNoTime &event) |
| Append an event to the histogram, without clearing the cache, to make it faster. | |
| void | addPulsetime (const double seconds) override |
| Add an offset to the pulsetime (wall-clock time) of each event in the list. | |
| void | addPulsetimes (const std::vector< double > &seconds) override |
| Add an offset to the pulsetime (wall-clock time) of each event in the list. | |
| void | addTof (const double offset) override |
| Add an offset to the TOF of each event in the list. | |
| void | clear (const bool removeDetIDs=true) override |
| Clear the list of events and any associated detector ID's. | |
| void | clearData () override |
| Mask the spectrum to this value. Removes all events. | |
| void | clearUnused () |
| Clear any unused event lists (the ones that do not match the currently used type). | |
| void | compressEvents (double tolerance, EventList *destination) |
| Compress the event list by grouping events with the same TOF (within a given tolerance). | |
| void | compressEvents (double tolerance, EventList *destination, const std::shared_ptr< std::vector< double > > histogram_bin_edges) |
| 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. | |
| 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. | |
| void | convertUnitsViaTof (Mantid::Kernel::Unit const *fromUnit, Mantid::Kernel::Unit const *toUnit) |
| Converts the X units in each event by going through TOF. | |
| void | copyDataFrom (const ISpectrum &source) override |
| Copy data from another EventList, via ISpectrum reference. | |
| 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. | |
| const MantidVec & | dataDx () const override |
| Deprecated, use dx() instead. | |
| MantidVec & | dataDx () override |
| Deprecated, use mutableDx() instead. | |
| const MantidVec & | dataE () const override |
| Deprecated, use e() instead. | |
| MantidVec & | dataE () override |
| Deprecated, use mutableE() instead. | |
| const MantidVec & | dataX () const override |
| Deprecated, use x() instead. | |
| MantidVec & | dataX () override |
| Deprecated, use mutableX() instead. | |
| const MantidVec & | dataY () const override |
| Deprecated, use y() instead. | |
| MantidVec & | dataY () override |
| Deprecated, use mutableY() instead. | |
| 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. | |
| void | divide (const MantidVec &X, const MantidVec &Y, const MantidVec &E) override |
| Divide the weights in this event list by a histogram. | |
| const HistogramData::HistogramE & | e () const override |
| bool | empty () const |
| Much like stl containers, returns true if there is nothing in the event list. | |
| bool | equals (const EventList &rhs, const double tolTof, const double tolWeight, const int64_t tolPulse) const |
| EventList (const EventList &rhs) | |
| Constructor copying from an existing event list. | |
| EventList (const Mantid::API::EventType event_type=Mantid::API::EventType::TOF) | |
| Constructor (empty) | |
| EventList (const std::vector< Types::Event::TofEvent > &events) | |
| Constructor, taking a vector of events. | |
| EventList (const std::vector< WeightedEvent > &events) | |
| Constructor, taking a vector of events. | |
| EventList (const std::vector< WeightedEventNoTime > &events) | |
| Constructor, taking a vector of events. | |
| EventList (EventWorkspaceMRU *mru, specnum_t specNo) | |
| Constructor with a MRU list. | |
| template<typename UnaryOperation > | |
| std::vector< DateAndTime > | eventTimesCalculator (const UnaryOperation ×Calc) const |
| Compute a time (for instance, pulse-time plus TOF) associated to each event in the list. | |
| void | filterByPulseTime (Kernel::TimeROI const *timeRoi, EventList *output) const |
| Filter this EventList into an output EventList, using TimeROI keeping only events within the >= start and < end pulse times. | |
| 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. | |
| 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. | |
| void | filterInPlace (const Kernel::TimeROI *timeRoi) |
| Use a SplittingIntervalVec to filter the event list in place. | |
| 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. | |
| void | generateHistogram (const double step, const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const |
| Generates both the Y and E (error) histograms w.r.t TOF for an EventList with or without WeightedEvents. | |
| 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. | |
| 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. | |
| 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. | |
| WeightedEvent | getEvent (size_t event_number) |
| Return the given event in the list. | |
| std::vector< Types::Event::TofEvent > & | getEvents () |
| Return the list of TofEvents contained. | |
| const std::vector< Types::Event::TofEvent > & | getEvents () const |
| Return the const list of TofEvents contained. | |
| Mantid::API::EventType | getEventType () const override |
| Return the type of Event vector contained within. | |
| HistogramData::Histogram | getHistogram () const |
| Returns a copy of the Histogram associated with this spectrum. | |
| size_t | getMemorySize () const override |
| Memory used by this event list. | |
| std::size_t | getNumberEvents () const override |
| Return the number of events in the list. | |
| 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< Types::Core::DateAndTime > | getPulseTimes () const override |
| Get the pulse times of each event in this EventList. | |
| std::vector< Types::Core::DateAndTime > | getPulseTOFTimes () const |
| Get the Pulse-time + TOF for each event in this EventList. | |
| std::vector< Types::Core::DateAndTime > | getPulseTOFTimesAtSample (const double &factor, const double &shift) const |
| Get the Pulse-time + time-of-flight of the neutron up to the sample, for each event in this EventList. | |
| EventSortType | getSortType () const |
| Return the type of sorting used in this event list. | |
| Mantid::Types::Core::DateAndTime | getTimeAtSampleMax (const double &tofFactor, const double &tofOffset) const override |
| Get the maximum time at sample. | |
| Mantid::Types::Core::DateAndTime | getTimeAtSampleMin (const double &tofFactor, const double &tofOffset) const override |
| Get the minimum time at sample. | |
| 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. | |
| void | getTofs (std::vector< double > &tofs) const override |
| Fill a vector with the list of TOFs. | |
| std::vector< WeightedEvent > & | getWeightedEvents () |
| Return the list of WeightedEvent contained. | |
| const std::vector< WeightedEvent > & | getWeightedEvents () const |
| Return the list of WeightedEvent contained. | |
| std::vector< WeightedEventNoTime > & | getWeightedEventsNoTime () |
| Return the list of WeightedEvent contained. | |
| const std::vector< WeightedEventNoTime > & | getWeightedEventsNoTime () const |
| Return the list of WeightedEventNoTime contained. | |
| std::vector< double > | getWeightErrors () const override |
| Return the list of event weight error values. | |
| void | getWeightErrors (std::vector< double > &weightErrors) const override |
| Return the list of event weight error values. | |
| std::vector< double > | getWeights () const override |
| Return the list of event weight values. | |
| void | getWeights (std::vector< double > &weights) const override |
| Return the list of event weight values. | |
| HistogramData::Histogram | histogram () const override |
| Returns the Histogram associated with this spectrum. | |
| virtual size_t | histogram_size () const |
| Return the size of the histogram data. | |
| void | initializePartials (std::map< int, EventList * > partials) const |
| Initialize the detector ID's and event type of the destination event lists when splitting this list. | |
| 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. | |
| 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. | |
| bool | isSortedByTof () const override |
| Return true if the event list is sorted by TOF. | |
| MantidVec * | makeDataE () const |
| Calculates and returns a pointer to the E histogrammed data. | |
| MantidVec * | makeDataY () const |
| Calculates and returns a pointer to the Y histogrammed data. | |
| void | maskCondition (const std::vector< bool > &mask) override |
| Mask out events by the condition vector. | |
| void | maskTof (const double tofMin, const double tofMax) override |
| Mask out events that have a tof between tofMin and tofMax (inclusively). | |
| 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. | |
| void | multiply (const MantidVec &X, const MantidVec &Y, const MantidVec &E) override |
| Multiply the weights in this event list by a histogram. | |
| bool | operator!= (const EventList &rhs) const |
| Inequality comparator. | |
| EventList & | operator*= (const double value) |
| Operator to multiply the weights in this EventList by an error-less scalar. | |
| EventList & | operator+= (const EventList &more_events) |
| Append another EventList to this event list. | |
| EventList & | operator+= (const std::vector< Types::Event::TofEvent > &more_events) |
| Append a list of events to the histogram. | |
| EventList & | operator+= (const std::vector< WeightedEvent > &more_events) |
| Append a list of events to the histogram. | |
| EventList & | operator+= (const std::vector< WeightedEventNoTime > &more_events) |
| Append a list of events to the histogram. | |
| EventList & | operator+= (const Types::Event::TofEvent &event) |
| Append an event to the histogram. | |
| EventList & | operator+= (const WeightedEvent &event) |
| Append a WeightedEvent to the histogram. | |
| EventList & | operator-= (const EventList &more_events) |
| SUBTRACT another EventList from this event list. | |
| EventList & | operator/= (const double value) |
| Operator to divide the weights in this EventList by an error-less scalar. | |
| EventList & | operator= (const EventList &) |
| Copy into this event list from another. | |
| bool | operator== (const EventList &rhs) const |
| Equality operator between EventList's. | |
| Kernel::cow_ptr< HistogramData::HistogramX > | ptrX () const override |
| Deprecated, use sharedX() instead. Returns a pointer to the x data. | |
| const MantidVec & | readDx () const override |
| Deprecated, use dx() instead. | |
| const MantidVec & | readX () const override |
| Deprecated, use x() instead. Returns the x data const. | |
| void | reserve (size_t num) override |
| Reserve a certain number of entries in event list of the specified eventType. | |
| void | reverse () |
| Reverse the histogram boundaries and the associated events if they are sorted by time-of-flight. | |
| 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. | |
| void | setMRU (EventWorkspaceMRU *newMRU) |
| Sets the MRU list for this event list. | |
| void | setSortOrder (const EventSortType order) const |
| Manually set the event list sort order value. | |
| void | setTofs (const MantidVec &tofs) override |
| Set a list of TOFs to the current event list. | |
| void | setX (const Kernel::cow_ptr< HistogramData::HistogramX > &X) override |
| Deprecated, use setSharedX() instead. | |
| 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. | |
| void | sortPulseTime () const |
| Sort events by Frame. | |
| void | sortPulseTimeTOF () const |
| void | sortTimeAtSample (const double &tofFactor, const double &tofShift, bool forceResort=false) const |
| Sort events by time at sample. | |
| void | sortTof () const |
| Sort events by TOF in one thread. | |
| void | switchTo (Mantid::API::EventType newType) override |
| Switch the EventList to use the given EventType (TOF, WEIGHTED, or WEIGHTED_NOTIME) | |
| const HistogramData::HistogramY & | y () const override |
| ~EventList () override | |
| Destructor. | |
Public Member Functions inherited from Mantid::API::IEventList | |
| IEventList () | |
| Empty constructor. | |
| IEventList (specnum_t specNo) | |
| Constructor. | |
Public Member Functions inherited from Mantid::API::ISpectrum | |
| void | addDetectorID (const detid_t detID) |
| Add a detector ID to the set of detector IDs. | |
| void | addDetectorIDs (const std::set< detid_t > &detIDs) |
| Add a set of detector IDs to the set of detector IDs. | |
| void | addDetectorIDs (const std::vector< detid_t > &detIDs) |
| Add a vector of detector IDs to the set of detector IDs. | |
| HistogramData::BinEdges | binEdges () const |
| void | clearDetectorIDs () |
| Clear the detector IDs set. | |
| void | convertToCounts () |
| void | convertToFrequencies () |
| void | copyInfoFrom (const ISpectrum &other) |
| Copy spectrum number and detector IDs, but not X vector, from another ISpectrum. | |
| const HistogramData::HistogramDx & | dx () const |
| const std::set< detid_t > & | getDetectorIDs () const |
| Get a const reference to the detector IDs set. | |
| specnum_t | getSpectrumNo () const |
| virtual std::pair< double, double > | getXDataRange () const |
| Return the min/max X values for this spectrum. | |
| bool | hasDetectorID (const detid_t detID) const |
| Return true if the given detector ID is in the list for this ISpectrum. | |
| bool | hasDx () const |
| Gets the value of the use flag. | |
| ISpectrum ()=default | |
| ISpectrum (const specnum_t specNo) | |
| Constructor with spectrum number. | |
| HistogramData::HistogramDx & | mutableDx () & |
| HistogramData::HistogramE & | mutableE () & |
| HistogramData::HistogramX & | mutableX () & |
| HistogramData::HistogramY & | mutableY () & |
| HistogramData::Points | points () const |
| HistogramData::PointStandardDeviations | pointStandardDeviations () const |
| virtual const MantidVec & | readE () const |
| Deprecated, use e() instead. Returns the y error data const. | |
| virtual const MantidVec & | readY () const |
| Deprecated, use y() instead. Returns the y data const. | |
| void | resetHasDx () |
| Resets the hasDx flag. | |
| void | resize (size_t n) |
| 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. | |
| void | setDetectorIDs (const std::set< detid_t > &detIDs) |
| Set the detector IDs to be the set given. | |
| void | setDetectorIDs (std::set< detid_t > &&detIDs) |
| Set the detector IDs to be the set given (move version). | |
| 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. | |
| void | setMatrixWorkspace (MatrixWorkspace *matrixWorkspace, const size_t index) |
| Sets the MatrixWorkspace pointer (pointer to the owning workspace). | |
| 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 spectrum number of this spectrum. | |
| void | setYMode (HistogramData::Histogram::YMode ymode) |
| Kernel::cow_ptr< HistogramData::HistogramDx > | sharedDx () const |
| Kernel::cow_ptr< HistogramData::HistogramX > | sharedX () const |
| size_t | size () const |
| const HistogramData::HistogramX & | x () const |
| HistogramData::Histogram::YMode | yMode () const |
| virtual | ~ISpectrum ()=default |
Static Public Member Functions | |
| static std::optional< size_t > | findLinearBin (const MantidVec &X, const double tof, const double divisor, const double offset, const bool findExact=true) |
| Find the bin which this TOF value falls in with linear binning, assumes TOF is in range of X. | |
| static std::optional< size_t > | findLogBin (const MantidVec &X, const double tof, const double divisor, const double offset, const bool findExact=true) |
| Find the bin which this TOF value falls in with log binning, assumes TOF is in range of X. | |
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 | |
| ISpectrum (const ISpectrum &other) | |
| Copy constructor. | |
| ISpectrum (ISpectrum &&other) | |
| Move constructor. | |
| ISpectrum & | operator= (const ISpectrum &other) |
| Copy assignment. | |
| ISpectrum & | operator= (ISpectrum &&other) |
| Move assignment. | |
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. | |
| 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. | |
| 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. | |
| 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. | |
| template<class T > | |
| void | convertUnitsViaTofHelper (typename std::vector< T > &events, Mantid::Kernel::Unit const *fromUnit, Mantid::Kernel::Unit const *toUnit) |
| Helper function for the conversion to TOF. | |
| virtual void | copyDataInto (DataObjects::EventList &) const |
| Override in child classes for polymorphic copying of data. | |
| virtual void | copyDataInto (DataObjects::Histogram1D &) const |
| Override in child classes for polymorphic copying of data. | |
| void | copyDataInto (EventList &sink) const override |
Used by copyDataFrom for dynamic dispatch for its source. | |
| void | copyDataInto (Histogram1D &sink) const override |
Used by Histogram1D::copyDataFrom for dynamic dispatch for other. | |
| virtual void | copyDataInto (SpectrumTester &) const |
| Override in child classes for polymorphic copying of data. | |
| template<typename UnaryOperation > | |
| std::vector< Types::Core::DateAndTime > | eventTimesCalculator (const UnaryOperation ×Calc) const |
| Compute a time (for instance, pulse-time plus TOF) associated to each event in the list. | |
| template<class T > | |
| void | filterInPlaceHelper (Kernel::TimeROI const *timeRoi, typename std::vector< T > &events) |
| Perform an in-place filtering on a vector of either TofEvent's or WeightedEvent's. | |
| 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! | |
| void | generateCountsHistogram (const double step, const MantidVec &X, MantidVec &Y) const |
| Fill a histogram given specified histogram bounds. | |
| void | generateCountsHistogram (const MantidVec &X, MantidVec &Y) const |
| Fill a histogram given specified histogram bounds. | |
| void | generateCountsHistogramPulseTime (const MantidVec &X, MantidVec &Y) const |
| With respect to PulseTime Fill a histogram given specified histogram bounds. | |
| 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. | |
| void | generateErrorsHistogram (const MantidVec &Y, MantidVec &E) const |
| Generate the Error histogram for the provided counts histogram. | |
| 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. | |
| void | switchToWeightedEvents () |
| Switch the EventList to use WeightedEvents instead of TofEvent. | |
| void | switchToWeightedEventsNoTime () |
| Switch the EventList to use WeightedEventNoTime's instead of TofEvent. | |
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. | |
| 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 | createWeightedEvents (std::vector< WeightedEventNoTime > &out, const std::vector< double > &tof, const std::vector< T > &weight, const std::vector< T > &error) |
| 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. | |
| 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 | filterByTimeROIHelper (std::vector< T > &events, const std::vector< Kernel::TimeInterval > &intervals, EventList *output) |
| Filter a vector of events into another based on TimeROI. | |
| static size_t | findExactBin (const MantidVec &X, const double tof, const size_t n_bin) |
| Find the exact bin which a TOF falls in starting from the provided estimated one. | |
| 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! | |
| 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. | |
| 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. | |
| 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. | |
| template<class T > | |
| static void | histogramForWeightsHelper (const std::vector< T > &events, const double step, const MantidVec &X, MantidVec &Y, MantidVec &E) |
| Generates both the Y and E (error) histograms for an EventList with WeightedEvents. | |
| 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. | |
| 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. | |
| template<class T > | |
| static std::size_t | maskConditionHelper (std::vector< T > &events, const std::vector< bool > &mask) |
| Mask out events by the condition vector. | |
| 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). | |
| 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. | |
| 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. | |
| 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. | |
| template<class T > | |
| static void | processWeightedEvents (const std::vector< T > &events, std::vector< WeightedEventNoTime > &out, const std::shared_ptr< std::vector< double > > histogram_bin_edges, struct FindBin findBin) |
| 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. | |
Private Attributes | |
| std::unique_ptr< std::vector< Types::Event::TofEvent > > | events |
| List of TofEvent (no weights). | |
| Mantid::API::EventType | eventType |
| What type of event is in our list. | |
| HistogramData::Histogram | m_histogram |
| Histogram object holding the histogram data. Currently only X. | |
| std::mutex | m_sortMutex |
| Mutex that is locked while sorting an event list. | |
| EventWorkspaceMRU * | mru |
| MRU lists of the parent EventWorkspace. | |
| EventSortType | order |
| Last sorting order. | |
| std::unique_ptr< std::vector< WeightedEvent > > | weightedEvents |
| List of WeightedEvent's. | |
| std::unique_ptr< std::vector< WeightedEventNoTime > > | weightedEventsNoTime |
| List of WeightedEvent's. | |
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 57 of file EventList.h.
| Mantid::DataObjects::EventList::EventList | ( | const Mantid::API::EventType | event_type = Mantid::API::EventType::TOF | ) |
Constructor (empty)
Definition at line 165 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
| 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 193 of file EventList.cpp.
References events.
| Mantid::DataObjects::EventList::EventList | ( | const EventList & | rhs | ) |
Constructor copying from an existing event list.
| rhs | :: EventList object to copy |
Definition at line 202 of file EventList.cpp.
References operator=().
| Mantid::DataObjects::EventList::EventList | ( | const std::vector< Types::Event::TofEvent > & | events | ) |
Constructor, taking a vector of events.
| events | :: Vector of TofEvent's |
Definition at line 210 of file EventList.cpp.
References events, eventType, order, Mantid::API::TOF, and Mantid::DataObjects::UNSORTED.
| Mantid::DataObjects::EventList::EventList | ( | const std::vector< WeightedEvent > & | events | ) |
Constructor, taking a vector of events.
| events | :: Vector of WeightedEvent's |
Definition at line 220 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 230 of file EventList.cpp.
References events, eventType, order, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
|
override |
Destructor.
Definition at line 239 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), events, mru, weightedEvents, and weightedEventsNoTime.
|
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 105 of file EventList.h.
References Mantid::DataObjects::UNSORTED.
Referenced by Mantid::Algorithms::GenerateGoniometerIndependentBackground::filterAndAddEvents(), filterByTimeROIHelper(), Mantid::DataHandling::LoadSwans::loadDataIntoTheWorkspace(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadNexusMonitors2::readEventMonitorEntry(), and Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace().
|
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 116 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 127 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 2991 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 2965 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 3016 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 2978 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 2957 of file EventList.cpp.
References convertTof().
Referenced by Mantid::Algorithms::ChangeBinOffset::exec().
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4541 of file EventList.cpp.
References histogram(), and m_histogram.
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4561 of file EventList.cpp.
|
overrideprotectedvirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 4556 of file EventList.cpp.
|
overridevirtual |
Clear the list of events and any associated detector ID's.
Implements Mantid::API::IEventList.
Definition at line 967 of file EventList.cpp.
References Mantid::API::ISpectrum::clearDetectorIDs(), clearUnused(), Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), empty(), events, eventType, mru, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by clearData(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), createFromHistogram(), Mantid::Algorithms::DiffractionFocussing2::execEvent(), filterByPulseTime(), filterByPulseTime(), maskCondition(), maskTof(), and Mantid::DataHandling::LoadEventPreNexus2::procEvents().
|
overridevirtual |
Mask the spectrum to this value. Removes all events.
Implements Mantid::API::ISpectrum.
Definition at line 1015 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 1002 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by clear(), compressEvents(), 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 1830 of file EventList.cpp.
References clearUnused(), compressEventsHelper(), empty(), events, eventType, order, sortTof(), Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, tolerance, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataHandling::CompressEvents::exec(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS().
| void Mantid::DataObjects::EventList::compressEvents | ( | double | tolerance, |
| EventList * | destination, | ||
| const std::shared_ptr< std::vector< double > > | histogram_bin_edges | ||
| ) |
Definition at line 1926 of file EventList.cpp.
References clearUnused(), count, createWeightedEvents(), empty(), events, eventType, order, processWeightedEvents(), Mantid::API::TOF, Mantid::DataObjects::TOF_SORT, tolerance, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
|
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. Negative implies log grouping. |
Definition at line 1580 of file EventList.cpp.
References events, fabs, rhs, and tolerance.
Referenced by compressEvents().
| void Mantid::DataObjects::EventList::compressFatEvents | ( | const double | tolerance, |
| const Types::Core::DateAndTime & | timeStart, | ||
| const double | seconds, | ||
| EventList * | destination | ||
| ) |
Definition at line 1988 of file EventList.cpp.
References clearUnused(), compressFatEventsHelper(), empty(), events, eventType, order, Mantid::DataObjects::PULSETIMETOF_SORT, sortPulseTimeTOFDelta(), Mantid::API::TOF, tolerance, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by Mantid::DataHandling::CompressEvents::exec().
|
staticprivate |
Referenced by compressFatEvents().
|
inline |
Definition at line 1675 of file EventList.cpp.
References Mantid::Kernel::DateAndTimeHelpers::averageSorted(), events, fabs, left, rhs, right, 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 2901 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 2856 of file EventList.cpp.
References convertTofHelper(), dataX(), events, 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 2936 of file EventList.cpp.
References events.
|
private |
| events | |
| func |
Definition at line 2889 of file EventList.cpp.
References events.
Referenced by convertTof(), and 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 4521 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 4508 of file EventList.cpp.
References events.
Referenced by convertUnitsQuickly().
| void Mantid::DataObjects::EventList::convertUnitsViaTof | ( | Mantid::Kernel::Unit const * | fromUnit, |
| Mantid::Kernel::Unit const * | 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 4478 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 4460 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 256 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 205 of file ISpectrum.cpp.
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 206 of file ISpectrum.cpp.
|
overrideprivatevirtual |
Used by copyDataFrom for dynamic dispatch for its source.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 259 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 281 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 207 of file ISpectrum.cpp.
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1448 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1452 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1450 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 295 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().
|
inlinestaticprivate |
Definition at line 1889 of file EventList.cpp.
References error.
Referenced by compressEvents(), and processWeightedEvents().
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1404 of file EventList.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use mutableDx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1402 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 1550 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 187 of file EventList.h.
|
overridevirtual |
Deprecated, use x() instead.
Returns a const reference to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 1393 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 1385 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 1536 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 184 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 4114 of file EventList.cpp.
References error, multiply(), and value.
Referenced by Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin(), Mantid::Algorithms::Divide::performEventBinaryOperation(), Mantid::Algorithms::Divide::performEventBinaryOperation(), 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 4067 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 3961 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 1470 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 1316 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by clear(), compressEvents(), compressEvents(), compressFatEvents(), equals(), Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::Algorithms::SumSpectra::execEvent(), Mantid::Algorithms::FilterEvents::filterEvents(), generateHistogram(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), Mantid::Algorithms::CalculateCountRate::histogramEvents(), Mantid::DataHandling::makeTimeOfFlightDataFuzzy(), operator+=(), operator==(), 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 684 of file EventList.cpp.
References empty(), events, eventType, getNumberEvents(), rhs, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces().
|
private |
Compute a time (for instance, pulse-time plus TOF) associated to each event in the list.
Referenced by getPulseTimes(), getPulseTOFTimes(), and getPulseTOFTimesAtSample().
| std::vector< DateAndTime > Mantid::DataObjects::EventList::eventTimesCalculator | ( | const UnaryOperation & | timesCalc | ) | const |
Compute a time (for instance, pulse-time plus TOF) associated to each event in the list.
| timesCalc | : anonymous function that computes a time from an input event |
Definition at line 3324 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
| void Mantid::DataObjects::EventList::filterByPulseTime | ( | Kernel::TimeROI const * | timeRoi, |
| EventList * | output | ||
| ) | const |
Filter this EventList into an output EventList, using TimeROI keeping only events within the >= start and < end pulse times.
Since a TimeROI object may contain more than one time interval, the function is keeping events with pulse times within any of the ROI time intervals and discarding events within any of the masked time intervals. Detector IDs and the X axis are copied as well.
| timeRoi | :: reference to TimeROI to be used for filtering |
| output | :: reference to an event list that will be output. |
| std::invalid_argument | If output is a reference to this EventList |
Definition at line 4185 of file EventList.cpp.
References clear(), eventType, filterByTimeROIHelper(), Mantid::API::ISpectrum::getDetectorIDs(), m_histogram, Mantid::API::ISpectrum::setDetectorIDs(), Mantid::API::ISpectrum::setHistogram(), sortPulseTime(), switchTo(), Mantid::API::TOF, Mantid::Kernel::TimeROI::toTimeIntervals(), Mantid::Kernel::TimeROI::useAll(), Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
| 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 4142 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::FilterByLogValue::exec(), and 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 4225 of file EventList.cpp.
References events.
|
staticprivate |
Referenced by filterByPulseTime().
|
staticprivate |
Filter a vector of events into another based on TimeROI.
TODO: Make this more efficient using STL-fu.
| events | :: input events |
| intervals | :: Interval vec of start and stop times |
| output | :: reference to an event list that will be output. |
Definition at line 4238 of file EventList.cpp.
References addEventQuickly(), and events.
Referenced by filterByPulseTime().
| void Mantid::DataObjects::EventList::filterInPlace | ( | const Kernel::TimeROI * | timeRoi | ) |
Use a SplittingIntervalVec to filter the event list in place.
| timeRoi | :: a TimeROI that will be used to filter events |
Definition at line 4281 of file EventList.cpp.
References eventType, filterInPlaceHelper(), sortPulseTime(), Mantid::API::TOF, Mantid::Kernel::TimeROI::useAll(), 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.
| timeRoi | :: a TimeROI that will be used filter events |
| events | :: either this->events or this->weightedEvents. |
This helper function uses a two pointer technique where
If itev->m_pulsetime is within the interval, the event, *itev, will be copied to the location pointed by itOut, and itOut will be incremented. When either splitter intervals or events are exhausted, truncate the events list to the current location of itOut.
This linear scanning ensures that
The splitter intervals must be sorted by start time, which is not enforced in this helper function and is expected to be implicitly followed by the caller.
Definition at line 4333 of file EventList.cpp.
References events, and Mantid::Kernel::TimeROI::toTimeIntervals().
Referenced by filterInPlace().
|
staticprivate |
Find the exact bin which a TOF falls in starting from the provided estimated one.
Estimated bin is expected to be within 1 of the correct bin
| X | :: The x bins |
| tof | :: TOF of the event we are trying to bin |
| n_bin | :: starting estiamted bin number |
Definition at line 2669 of file EventList.cpp.
References Mantid::Geometry::X.
Referenced by findLinearBin(), and findLogBin().
|
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 2052 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 2080 of file EventList.cpp.
References events.
Referenced by generateCountsHistogramTimeAtSample().
|
static |
Find the bin which this TOF value falls in with linear binning, assumes TOF is in range of X.
bin_number = (tof - xmin) / step
| X | :: The x bins |
| tof | :: TOF of the event we are trying to bin |
| divisor | :: pre-calculated divisor |
| offset | :: pre-calculated offset |
| findExact | :: do extra check of supplied time-of-flight compared to bin boundaries and move the bin if needed |
Definition at line 2622 of file EventList.cpp.
References findExactBin(), and Mantid::Geometry::X.
Referenced by Mantid::DataHandling::CompressEventAccumulator::CompressEventAccumulator(), and Mantid::DataObjects::FindBin::FindBin().
|
static |
Find the bin which this TOF value falls in with log binning, assumes TOF is in range of X.
formula to get bin_number from TOF
bin_number = log_{abs(step) + 1}(tof/xmin) (that is log base abs(step)+1)
rewritten as
bin_number = log(tof)/log(abs(step)+1) - log(xmin)/log(abs(step)+1)
or bin_number = log(tof)/divisor - offset, where divisor and offset are precalulated
| X | :: The x bins |
| tof | :: TOF of the event we are trying to bin |
| divisor | :: pre-calculated divisor |
| offset | :: pre-calculated offset |
| findExact | :: do extra check of supplied time-of-flight compared to bin boundaries and move the bin if needed |
Definition at line 2651 of file EventList.cpp.
References findExactBin(), and Mantid::Geometry::X.
Referenced by Mantid::DataHandling::CompressEventAccumulator::CompressEventAccumulator(), and Mantid::DataObjects::FindBin::FindBin().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1456 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1460 of file EventList.cpp.
References histogram().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1458 of file EventList.cpp.
References histogram().
|
private |
Fill a histogram given specified histogram bounds.
Does not modify the eventlist (const method).
This histogram without sorting the events by using the step size to estimate the bin number. This only works for logarithmic or linear binning.
| step | :: bin step size |
| X | :: The x bins |
| Y | :: The generated counts histogram |
Definition at line 2695 of file EventList.cpp.
References events, Mantid::Geometry::X, and Mantid::Geometry::Y.
|
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 2575 of file EventList.cpp.
References events, Mantid::DataObjects::findFirstEvent(), sortTof(), Mantid::Geometry::X, Mantid::Geometry::x, and Mantid::Geometry::Y.
Referenced by generateHistogram(), and 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 2476 of file EventList.cpp.
References events, and 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 2402 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 2510 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 2741 of file EventList.cpp.
References Mantid::Geometry::Y.
Referenced by generateHistogram(), generateHistogram(), generateHistogramPulseTime(), and generateHistogramTimeAtSample().
| void Mantid::DataObjects::EventList::generateHistogram | ( | const double | step, |
| const MantidVec & | X, | ||
| MantidVec & | Y, | ||
| MantidVec & | E, | ||
| bool | skipError = false |
||
| ) | const |
Generates both the Y and E (error) histograms w.r.t TOF for an EventList with or without WeightedEvents.
This will zero out the Y array as part of the process.
This calculates histogram without sorting the events by using the step size to estimate the bin number. This has been made to only work for logarithmic or linear binning. This falls back to using the sorted histogram method if the events are already sorted, as that will be faster.
| step | bin step size |
| 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. |
Definition at line 2372 of file EventList.cpp.
References empty(), eventType, generateCountsHistogram(), generateErrorsHistogram(), generateHistogram(), histogramForWeightsHelper(), isSortedByTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, Mantid::Geometry::X, and Mantid::Geometry::Y.
|
overridevirtual |
Generates both the Y and E (error) histograms w.r.t TOF for an EventList with or without WeightedEvents.
This will zero out the Y array as part of the process.
| 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 2334 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::DiffractionFocussing2::exec(), Mantid::Algorithms::RebinRagged::exec(), Mantid::Algorithms::ResampleX::exec(), generateHistogram(), 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 2270 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 2302 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 848 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 890 of file EventList.cpp.
References events, eventType, and Mantid::API::TOF.
Referenced by Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::DataObjects::getEventsFrom(), Mantid::DataObjects::getEventsFrom(), Mantid::Algorithms::CalculateCountRate::histogramEvents(), Mantid::DataHandling::LoadEventPreNexus2::procEvents(), and Mantid::DataObjects::TimeSplitter::splitEventList().
| 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 874 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 744 of file EventList.cpp.
References eventType.
Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventsListInDetails(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertSpectrum(), Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), initializePartials(), operator+=(), operator-=(), and Mantid::DataObjects::TimeSplitter::splitEventList().
| HistogramData::Histogram Mantid::DataObjects::EventList::getHistogram | ( | ) | const |
Returns a copy of the Histogram associated with this spectrum.
Definition at line 1439 of file EventList.cpp.
References m_histogram.
Referenced by initializePartials().
|
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 1344 of file EventList.cpp.
References events, 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 1301 of file EventList.cpp.
References events, 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(), convertTof(), equals(), Mantid::Algorithms::FilterEvents::examineEventWS(), Mantid::Algorithms::EQSANSCorrectFrame::exec(), Mantid::DataHandling::CompressEvents::exec(), Mantid::Algorithms::ModeratorTzero::execEvent(), Mantid::MDAlgorithms::IntegrateFlux::getMaxNumberOfPoints(), Mantid::DataHandling::EventWorkspaceCollection::getNumberEvents(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofs(), getWeightErrors(), getWeights(), maskCondition(), maskTof(), and operator==().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 3520 of file EventList.cpp.
References empty(), eventType, order, Mantid::DataObjects::PULSETIME_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::DataObjects::EventWorkspace::getPulseTimeMax().
|
overridevirtual |
Implements Mantid::API::IEventList.
Definition at line 3487 of file EventList.cpp.
References empty(), eventType, 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 3550 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 3347 of file EventList.cpp.
References eventTimesCalculator().
| std::vector< DateAndTime > Mantid::DataObjects::EventList::getPulseTOFTimes | ( | ) | const |
Get the Pulse-time + TOF for each event in this EventList.
Definition at line 3353 of file EventList.cpp.
References eventTimesCalculator().
| std::vector< DateAndTime > Mantid::DataObjects::EventList::getPulseTOFTimesAtSample | ( | const double & | factor, |
| const double & | shift | ||
| ) | const |
Get the Pulse-time + time-of-flight of the neutron up to the sample, for each event in this EventList.
| factor | : rescale the TOF by this dimensionless quantity |
| shift | : shift the TOF (after rescaling) by this time, in microseconds |
Definition at line 3362 of file EventList.cpp.
References eventTimesCalculator().
| EventSortType Mantid::DataObjects::EventList::getSortType | ( | ) | const |
Return the type of sorting used in this event list.
Definition at line 1262 of file EventList.cpp.
References order.
Referenced by convertTof(), and convertTof().
|
overridevirtual |
Get the maximum time at sample.
Implements Mantid::API::IEventList.
Definition at line 3601 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 3642 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 3428 of file EventList.cpp.
References empty(), eventType, 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 3386 of file EventList.cpp.
References empty(), eventType, 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 3221 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 3199 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 3190 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 907 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED, and weightedEvents.
Referenced by Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::DataObjects::getEventsFrom(), Mantid::DataObjects::getEventsFrom(), and Mantid::DataObjects::TimeSplitter::splitEventList().
| 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 924 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 939 of file EventList.cpp.
References eventType, Mantid::API::WEIGHTED_NOTIME, and weightedEventsNoTime.
Referenced by Mantid::Crystal::AnvredCorrection::execEvent(), Mantid::DataObjects::getEventsFrom(), Mantid::DataObjects::getEventsFrom(), Mantid::Crystal::CentroidPeaks::integrateEvent(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), and Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace().
| 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 954 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 3312 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 3289 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 3279 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 3266 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 3243 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 3233 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 1441 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 1359 of file EventList.cpp.
References readX().
|
staticprivate |
Generates both the Y and E (error) histograms for an EventList with WeightedEvents.
This histograms without sorting the events first by using the bin step size to estimate the bin number. This only works for logarithmic or linear binning.
| events | vector of events (with weights) |
| step | bin step size |
| X | X-bins supplied |
| Y | counts returned |
| E | errors returned |
| runtime_error | if the EventList does not have weighted events |
Definition at line 2215 of file EventList.cpp.
References events, Mantid::Geometry::X, and Mantid::Geometry::Y.
|
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 2119 of file EventList.cpp.
References events, Mantid::DataObjects::findFirstEvent(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by generateHistogram(), and generateHistogram().
|
inlineoverrideprivatevirtual |
Implements Mantid::API::ISpectrum.
Definition at line 326 of file EventList.h.
| void Mantid::DataObjects::EventList::initializePartials | ( | std::map< int, EventList * > | partials | ) | const |
Initialize the detector ID's and event type of the destination event lists when splitting this list.
| partials | : resulting partial lists of events after splitting's done |
Definition at line 4394 of file EventList.cpp.
References getEventType(), and getHistogram().
|
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 2805 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 2820 of file EventList.cpp.
References error, events, 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! |
| sum | :: reference to a double to put the sum in. |
| error | :: reference to a double to put the error in. |
Definition at line 2761 of file EventList.cpp.
Referenced by integrate().
|
overridevirtual |
Return true if the event list is sorted by TOF.
Implements Mantid::API::IEventList.
Definition at line 1258 of file EventList.cpp.
References order, and Mantid::DataObjects::TOF_SORT.
Referenced by Mantid::DataHandling::CompressEvents::exec(), generateHistogram(), and 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 1430 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 1417 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 3152 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 3124 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 3084 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 3048 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 565 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 3805 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/=(), Mantid::Algorithms::Multiply::performEventBinaryOperation(), Mantid::Algorithms::Multiply::performEventBinaryOperation(), 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 3930 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 3736 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 3836 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 4535 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 682 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 3771 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 525 of file EventList.cpp.
References Mantid::API::ISpectrum::addDetectorIDs(), empty(), 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 | ) |
Append a list of events to the histogram.
The internal event list will switch to the required type.
| more_events | :: A vector of events to append. |
Definition at line 417 of file EventList.cpp.
References events, eventType, order, reserve(), Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
| 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 466 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 498 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 | ) |
Append an event to the histogram.
| event | :: TofEvent to add at the end of the list. |
Definition at line 389 of file EventList.cpp.
References events, eventType, order, Mantid::API::TOF, Mantid::DataObjects::UNSORTED, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
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 451 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 586 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 4097 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 375 of file EventList.cpp.
References m_histogram, and rhs.
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 659 of file EventList.cpp.
References empty(), events, eventType, getNumberEvents(), rhs, weightedEvents, and weightedEventsNoTime.
|
inlinestaticprivate |
Definition at line 1900 of file EventList.cpp.
References createWeightedEvents(), error, and events.
Referenced by compressEvents().
|
overridevirtual |
Deprecated, use sharedX() instead. Returns a pointer to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 1399 of file EventList.cpp.
References m_histogram.
Referenced by Mantid::DataHandling::CompressEvents::exec(), and Mantid::DataObjects::EventWorkspace::refX().
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 1406 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 1396 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 1030 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, and weightedEventsNoTime.
Referenced by Mantid::MDAlgorithms::ConvertToDetectorFaceMD::convertEventList(), Mantid::DataHandling::LoadBBY::exec(), Mantid::Algorithms::DiffractionFocussing2::execEvent(), Mantid::Algorithms::SumSpectra::execEvent(), Mantid::Algorithms::SmoothNeighbours::execEvent(), Mantid::DataHandling::LoadBBY2::execLoader(), Mantid::DataHandling::GroupDetectors2::formGroupsEvent(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), operator+=(), Mantid::DataHandling::LoadEMU< FD >::prepareEventStorage(), Mantid::DataHandling::LoadPLN::prepareEventStorage(), 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 1270 of file EventList.cpp.
References dataX(), events, eventType, isSortedByTof(), Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, weightedEvents, weightedEventsNoTime, and Mantid::Geometry::x.
Referenced by convertTof(), and 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 2950 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 1021 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 1078 of file EventList.cpp.
References order.
Referenced by convertTof(), createFromHistogram(), Mantid::DataHandling::LoadBBY::exec(), Mantid::Algorithms::ModeratorTzero::execEvent(), Mantid::DataHandling::LoadBBY2::execLoader(), filterByPulseTime(), Mantid::DataObjects::EventSortingTask::operator()(), 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 3707 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 3689 of file EventList.cpp.
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 1376 of file EventList.cpp.
References Mantid::DataObjects::EventWorkspaceMRU::deleteIndex(), m_histogram, mru, and Mantid::Geometry::X.
Referenced by createFromHistogram(), and Mantid::DataHandling::CompressEvents::exec().
|
overridevirtual |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 1506 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 1476 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 1052 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.
| void Mantid::DataObjects::EventList::sortPulseTime | ( | ) | const |
Sort events by Frame.
Definition at line 1172 of file EventList.cpp.
References Mantid::DataObjects::compareEventPulseTime(), events, eventType, m_sortMutex, order, Mantid::DataObjects::PULSETIME_SORT, Mantid::DataObjects::PULSETIMETOF_SORT, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by filterByPulseTime(), filterByPulseTime(), filterInPlace(), generateCountsHistogramPulseTime(), generateHistogramPulseTime(), sort(), and Mantid::DataObjects::TimeSplitter::splitEventList().
| void Mantid::DataObjects::EventList::sortPulseTimeTOF | ( | ) | const |
Definition at line 1202 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(), and Mantid::DataObjects::TimeSplitter::splitEventList().
|
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 1235 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 1140 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 generateCountsHistogramTimeAtSample(), and generateHistogramTimeAtSample().
| void Mantid::DataObjects::EventList::sortTof | ( | ) | const |
Sort events by TOF in one thread.
Definition at line 1105 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().
|
overridevirtual |
Switch the EventList to use the given EventType (TOF, WEIGHTED, or WEIGHTED_NOTIME)
Implements Mantid::API::IEventList.
Definition at line 750 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(), Mantid::Algorithms::SumSpectra::execEvent(), Mantid::Algorithms::GenerateGoniometerIndependentBackground::filterAndAddEvents(), filterByPulseTime(), filterByPulseTime(), Mantid::DataHandling::GroupDetectors2::formGroupsEvent(), Mantid::Crystal::CentroidPeaks::integrateEvent(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), multiply(), multiply(), operator+=(), operator+=(), operator+=(), operator-=(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), and Mantid::Algorithms::ExportTimeSeriesLog::setupEventWorkspace().
|
private |
Switch the EventList to use WeightedEvents instead of TofEvent.
Definition at line 774 of file EventList.cpp.
References events, eventType, Mantid::API::TOF, Mantid::API::WEIGHTED, Mantid::API::WEIGHTED_NOTIME, and weightedEvents.
Referenced by switchTo().
|
private |
Switch the EventList to use WeightedEventNoTime's instead of TofEvent.
Definition at line 803 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 1464 of file EventList.cpp.
|
mutableprivate |
List of TofEvent (no weights).
Definition at line 333 of file EventList.h.
Referenced by addPulsetimeHelper(), addPulsetimesHelper(), clear(), clearUnused(), compressEvents(), compressEvents(), compressEventsHelper(), compressFatEvents(), compressFatEventsHelper(), convertTof(), convertTofHelper(), convertTofHelper(), convertUnitsQuicklyHelper(), convertUnitsViaTofHelper(), copyDataInto(), divideHistogramHelper(), empty(), equals(), EventList(), EventList(), EventList(), EventList(), EventList(), eventTimesCalculator(), filterByPulseTime(), filterByPulseTimeHelper(), filterByTimeROIHelper(), filterInPlaceHelper(), findFirstPulseEvent(), findFirstTimeAtSampleEvent(), generateCountsHistogram(), generateCountsHistogram(), generateCountsHistogramPulseTime(), generateCountsHistogramPulseTime(), generateCountsHistogramTimeAtSample(), getEvent(), getEvents(), getEvents(), getMemorySize(), getNumberEvents(), getTofsHelper(), getWeightErrorsHelper(), getWeightsHelper(), histogramForWeightsHelper(), histogramForWeightsHelper(), integrate(), integrateHelper(), maskConditionHelper(), maskTofHelper(), minusHelper(), multiplyHelper(), multiplyHistogramHelper(), operator+=(), operator+=(), operator+=(), operator-=(), operator==(), processWeightedEvents(), reserve(), reverse(), setTofsHelper(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), switchToWeightedEvents(), switchToWeightedEventsNoTime(), and ~EventList().
|
private |
What type of event is in our list.
Definition at line 342 of file EventList.h.
Referenced by addPulsetime(), addPulsetimes(), clear(), clearUnused(), compressEvents(), compressEvents(), compressFatEvents(), convertTof(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), divide(), empty(), equals(), EventList(), EventList(), EventList(), EventList(), eventTimesCalculator(), filterByPulseTime(), filterByPulseTime(), filterInPlace(), generateHistogram(), generateHistogram(), generateHistogramPulseTime(), generateHistogramTimeAtSample(), getEvent(), getEvents(), getEvents(), getEventType(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEvents(), getWeightedEvents(), getWeightedEventsNoTime(), getWeightedEventsNoTime(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), multiply(), operator+=(), operator+=(), operator+=(), operator+=(), operator==(), reserve(), reverse(), setTofs(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), 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(), dataDx(), dataX(), dataX(), filterByPulseTime(), filterByPulseTime(), getHistogram(), histogram(), mutableHistogramRef(), operator=(), ptrX(), readDx(), readX(), and setX().
|
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(), y(), and ~EventList().
|
mutableprivate |
Last sorting order.
Definition at line 345 of file EventList.h.
Referenced by compressEvents(), compressEvents(), compressFatEvents(), copyDataInto(), EventList(), EventList(), EventList(), filterByPulseTime(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getSortType(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), isSortedByTof(), operator+=(), operator+=(), operator+=(), operator+=(), 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(), compressEvents(), compressFatEvents(), convertTof(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), divide(), empty(), equals(), EventList(), EventList(), eventTimesCalculator(), filterByPulseTime(), filterByPulseTime(), filterInPlace(), generateHistogram(), generateHistogram(), getEvent(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEvents(), getWeightedEvents(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), multiply(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator-=(), operator==(), reserve(), reverse(), setTofs(), sortPulseTime(), sortPulseTimeTOF(), sortPulseTimeTOFDelta(), sortTimeAtSample(), sortTof(), switchToWeightedEvents(), switchToWeightedEventsNoTime(), and ~EventList().
|
mutableprivate |
List of WeightedEvent's.
Definition at line 339 of file EventList.h.
Referenced by clear(), clearUnused(), compressEvents(), compressEvents(), convertTof(), convertTof(), convertUnitsQuickly(), convertUnitsViaTof(), copyDataInto(), createFromHistogram(), divide(), empty(), equals(), EventList(), EventList(), eventTimesCalculator(), generateHistogram(), generateHistogram(), getEvent(), getMemorySize(), getNumberEvents(), getPulseTimeMax(), getPulseTimeMin(), getPulseTimeMinMax(), getTimeAtSampleMax(), getTimeAtSampleMin(), getTofMax(), getTofMin(), getTofs(), getWeightedEventsNoTime(), getWeightedEventsNoTime(), getWeightErrors(), getWeights(), integrate(), maskCondition(), maskTof(), multiply(), multiply(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator-=(), operator==(), reserve(), reverse(), setTofs(), sortTimeAtSample(), sortTof(), switchToWeightedEventsNoTime(), and ~EventList().