Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
runningMean.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file runningMean.h
1 #ifndef __RUNNINGMEAN_H__
2 #define __RUNNINGMEAN_H__
3 
4 
5 
25 class runningMean {
26 
27 public:
28  runningMean();
29  virtual ~runningMean();
30 
31 
33  virtual double getMean(const int /*ich*/) const = 0;
34  virtual double getReference(const int /*ich*/) const;
35  virtual int getNumberofChannels() const {return NumberofChannels;};
36 
38  virtual int Reset() = 0;
39 
44  virtual int Add (const int /*iarr*/[]) = 0;
45  virtual int Add (const float /*farr*/[]) = 0;
46  virtual int Add (const double /*darr*/[]) = 0;
47 
48  // provide an externAl, ready-made array of the means (e.g, from the
49  // database) to be used as a reference
50  int setRefArray(const double /*darr*/[]);
51 
52  // set the reference for individual channels
53  int setRefChannel(const int /*channel*/, const double /*refvalue*/);
54 
55  // establish thecurrent mean values as the reference
56  int setAsReference();
57 
58  double getPercentDeviation(const int /*channel*/) const;
59 
60  protected:
61 
63  double * refArray;
64 
65 
66 };
67 #endif
68 
69