Class ObserverTimeEvolution

Inheritance Relationships

Base Type

Class Documentation

class ObserverTimeEvolution : public ObserverFeature

Observes the time evolution of the candidates (phase-space elements) This observer is very useful if the time evolution of the particle density is needed. It detects all candidates in lin-spaced, log-spaced, or user-defined time intervals and limits the nextStep of candidates to prevent overshooting of detection intervals.

Public Functions

ObserverTimeEvolution()

Default constructor

ObserverTimeEvolution(double min, double dist, double numb)

Constructor

This constructor calculates the maximum from max = min + (numb - 1) * dist

Parameters:
  • min – minimum time

  • dist – time interval for detection

  • numb – number of time intervals

ObserverTimeEvolution(double min, double max, double numb, bool log)

Constructor

This constructor sets the maximum directly and gets numb automatically. You need to set the log parameter, since an overload for the first three doubles exist.

Parameters:
  • min – minimum time

  • max – maximum time

  • numb – number of time intervals

  • log – log (input: true) or lin (input: false) scaling between min and max with numb steps

ObserverTimeEvolution(const std::vector<double> &detList)

Constructor

This constructor uses a predefined vector containing the times that should be observed. The so created detList can then be modified via addTime, addTimeRange and setTimes.

Parameters:

detList – user defined vector<double> with times to check

inline ~ObserverTimeEvolution()

Destructor

void constructDetListIfEmpty()

Function Generates the detList if it is empty when for example the ObserverTimeEvolution(const std::vector<double> &detList) constructor was not used. Use this function to create a detList with can then be modified. When detList is not empty its entries are used instead of a runtime calculation of the times.

virtual DetectionState checkDetection(Candidate *candidate) const

Function

Checks whether to make a detection at the current step of candidate or not. This function is called in Observer.process with the simulated

Candidate.

Parameters:

candidateCandidate usally given by a module list

void clear()

Function

Parameters:

enableConstruction – if true, constructs detList from range of min, max, numb when calling addTime Clears the content of detList

inline bool empty()

Function Checks if detList is empty

void addTime(const double &time)

Function

Makes a push_back on detList with the given time.

Parameters:

time – Time that should be appended to detList

void addTimeRange(double min, double max, double numb, bool log = false)

Function

Appends a linear or logarithmic time range to detList via repeatedly calling addTime

Parameters:
  • min – minimum time

  • max – maximum time

  • numb – number of time intervals

  • log – log (input: true) or lin (input: false) scaling between min and max with numb steps

void setTimes(const std::vector<double> &detList)

Function

Sets this->detList to detList, with this it is possible to fully modify detList

Parameters:

detList – vector<double> containing times when to observe

void setMinimum(double min)
inline void setMaximum(double max)
inline void setNIntervals(int numb)
inline void setIsLogarithmicScaling(bool log)
virtual double getTime(std::size_t index) const

Function

Replaces the previous preconstructed detList and return the time for a specific index

Parameters:

index – index of the required time

inline double getMinimum() const
inline double getMaximum() const
inline int getNIntervals() const
inline bool getIsLogarithmicScaling() const
const std::vector<double> &getTimes() const

Function Returns a vector<double> containing all times between min and max generated by getTime. This function does not return detList directly, it rather appends a new vector with getTime numb times.

virtual std::string getDescription() const

Function Returns a string containing a representation of all times. This function does not create a detList.

virtual void onDetection(Candidate *candidate) const
inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

int nIntervals
bool isLogarithmicScaling = false
bool doDetListConstruction = true
double minimum
double maximum
std::vector<double> detList

Vector containing all used times. It is only constructed by the user manually. If it is not empty, the vector will be used instead of the getTime function. (leave empty if you want to rather use functions)

mutable std::vector<double> tempDetList

A temporary storage for detList, this enables the return of a List in getTimes without risking to modify detList

std::string description
mutable size_t _referenceCount