You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/crpropa/module/Observer.h
+105-6Lines changed: 105 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -240,8 +240,24 @@ class ObserverParticleIdVeto: public ObserverFeature {
240
240
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.
241
241
*/
242
242
class ObserverTimeEvolution: public ObserverFeature {
243
-
private:
243
+
protected:
244
+
int nIntervals; // number of time invervals
245
+
bool isLogarithmicScaling = false; // enables or disables logarithmic scaling for the intervals
246
+
bool doDetListConstruction = true; // enables the construction of detList in the relevant functions (addTime, addTimeRange)
247
+
double minimum; // the minimum time
248
+
double maximum; // the maximum time
249
+
/** Vector containing all used times.
250
+
It is only constructed by the user manually.
251
+
If it is not empty, the vector will be used instead of the getTime function.
252
+
(leave empty if you want to rather use functions)
253
+
*/
244
254
std::vector<double> detList;
255
+
/**
256
+
A temporary storage for detList, this enables the return of a List in getTimes
257
+
without risking to modify detList
258
+
*/
259
+
mutable std::vector<double> tempDetList;
260
+
245
261
public:
246
262
/** Default constructor
247
263
*/
@@ -250,22 +266,105 @@ class ObserverTimeEvolution: public ObserverFeature {
250
266
@param min minimum time
251
267
@param dist time interval for detection
252
268
@param numb number of time intervals
269
+
270
+
This constructor calculates the maximum from max = min + (numb - 1) * dist
0 commit comments