TraceAlgorithm.h
Go to the documentation of this file.
1 #ifndef _utl_TraceAlgorithm_h_
2 #define _utl_TraceAlgorithm_h_
3 
4 #include <utl/Trace-fwd.h>
5 #include <utl/AugerException.h>
6 #include <vector>
7 
8 
9 namespace utl {
10 
15  public:
17  InvalidTraceBoundException(const std::string& message = std::string())
18  : AugerException(message) { }
19 
21  virtual std::string GetExceptionName() const
22  { return "Invalid Trace Bound"; }
23  };
24 
25 
39  public:
41  template<typename T>
42  static double Min(const Trace<T>& trace,
43  const unsigned int bin1, const unsigned int bin2);
44 
46  template<typename T>
47  static double Max(const Trace<T>& trace,
48  const unsigned int bin1, const unsigned int bin2);
49 
51  template<typename T>
52  static double Mean(const Trace<T>& trace,
53  const unsigned int bin1, const unsigned int bin2);
54 
56  template<typename T>
57  static double Median(const Trace<T>& trace,
58  const unsigned int bin1, const unsigned int bin2,
59  const unsigned int sortAlgorithmLimit = 40);
60 
62 
63  template<typename T>
64  static double ShapeParameter(const Trace<T>& trace,
65  const unsigned int bin1, const unsigned int bin2);
66 
69  template<typename T>
70  static double RMS(const Trace<T>& trace,
71  const unsigned int bin1, const unsigned int bin2);
72 
74  template<typename T>
75  static double RootMeanSquare(const Trace<T>& trace,
76  const unsigned int bin1, const unsigned int bin2);
77 
79  template<typename T>
80  static double StandardDeviation(const Trace<T>& trace,
81  const unsigned int bin1, const unsigned int bin2);
82 
83 
86  template<typename T>
87  static double TimeAtRelativeSignalX(const Trace<T>& trace,
88  const unsigned int bin1, const unsigned int bin2,
89  const double percent);
90 
93  template<typename T>
94  static double RiseTime(const Trace<T>& trace,
95  const unsigned int bin1, const unsigned int bin2);
96 
97  template<typename T>
98  static double FallTime(const Trace<T>& trace,
99  unsigned int bin1, unsigned int bin2);
100 
102  template<typename T>
103  static double Sum(const Trace<T>& trace,
104  const unsigned int bin1, const unsigned int bin2);
105 
111  template<typename T>
112  static double Centroid(const Trace<T>& trace,
113  const unsigned int bin1, const unsigned int bin2);
114 
115  private:
116  template<typename T>
117  static bool BoundsOk(const Trace<T>& trace,
118  const unsigned int bin1, const unsigned int bin2);
119 
120  template<typename T>
121  static inline double Mean(const std::vector<T>& v);
122  };
123 
124 
125 }
126 
127 
128 #endif
static double Max(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the maximum of trace between bin1 and bin2.
Base class for all exceptions used in the auger offline code.
static double ShapeParameter(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the shape parameter between bin1 and bin2.
static double Mean(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the mean of trace between bin1 and bin2.
static double FallTime(const Trace< T > &trace, unsigned int bin1, unsigned int bin2)
constexpr double percent
Definition: AugerUnits.h:283
static double Median(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2, const unsigned int sortAlgorithmLimit=40)
Evaluate the median of trace between bin1 and bin2.
static bool BoundsOk(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
algorithms to manipulate traces
static double RMS(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
static double RootMeanSquare(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the RootMeanSquare of trace between bin1 and bin2.
static double Centroid(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
static double StandardDeviation(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the StandardDeviation of trace between bin1 and bin2.
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
Exception thrown when trying to access invalid bounds in Trace.
static double RiseTime(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
static double Min(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the minimum of trace between bin1 and bin2.
static double Sum(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the sum of bins bin1 thru bin2.
static double TimeAtRelativeSignalX(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2, const double percent)

, generated on Tue Sep 26 2023.