Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AdcChannelMetric::MetricSummary Class Reference

Public Member Functions

void add (double val, double weight)
 
double neff () const
 
double mean () const
 
double dmean () const
 
double meansq () const
 
double rms () const
 
double drms () const
 
double sdev () const
 
double center () const
 
double range () const
 
double getValue (Name vnam) const
 

Static Public Member Functions

static bool isValueName (Name vnam)
 

Public Attributes

Index weightFlag = 0
 
Index eventCount = 0
 
Index weightedEventCount = 0
 
double weightSum
 
double sum = 0.0
 
double sumsq = 0.0
 
double minval = 0.0
 
double maxval = 0.0
 

Detailed Description

Definition at line 223 of file AdcChannelMetric.h.

Member Function Documentation

void AdcChannelMetric::MetricSummary::add ( double  val,
double  weight 
)
inline
double AdcChannelMetric::MetricSummary::center ( ) const
inline

Definition at line 262 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::dmean ( ) const
inline

Definition at line 246 of file AdcChannelMetric.h.

246 { return weightSum > 0.0 ? sdev()/sqrt(neff()) : 0.0; }
double AdcChannelMetric::MetricSummary::drms ( ) const
inline

Definition at line 251 of file AdcChannelMetric.h.

251  {
252  if ( weightSum <= 0.0 ) return 0.0;
253  double rmsVal = rms();
254  double rmsVar = meansq() + rmsVal*(rmsVal - 2.0*mean());
255  return rmsVar > 0.0 ? sqrt(rmsVar/neff()) : 0.0;
256  }
double AdcChannelMetric::MetricSummary::getValue ( Name  vnam) const
inline

Definition at line 273 of file AdcChannelMetric.h.

273  {
274  if ( vnam == "weightFlag" ) return weightFlag;
275  if ( vnam == "weightedEventCount" ) return weightedEventCount;
276  if ( vnam == "eventCount" ) return eventCount;
277  if ( vnam == "weightSum" ) return weightSum;
278  if ( vnam == "mean" ) return mean();
279  if ( vnam == "rms" ) return rms();
280  if ( vnam == "sdev" ) return sdev();
281  if ( vnam == "min" ) return minval;
282  if ( vnam == "max" ) return maxval;
283  if ( vnam == "center" ) return center();
284  if ( vnam == "range" ) return range();
285  if ( vnam == "halfRange" ) return 0.5*range();
286  if ( vnam == "dmean" ) return dmean();
287  if ( vnam == "drms" ) return drms();
288  return 0.0;
289  }
static bool AdcChannelMetric::MetricSummary::isValueName ( Name  vnam)
inlinestatic

Definition at line 265 of file AdcChannelMetric.h.

265  {
266  const std::set<Name> sumVals =
267  {"weightFlag", "eventCount", "weightedEventCount", "weightSum",
268  "mean", "rms", "sdev", "min", "max", "dmean", "drms",
269  "center", "range", "halfRange"};
270  return sumVals.find(vnam) != sumVals.end();
271  }
double AdcChannelMetric::MetricSummary::mean ( ) const
inline

Definition at line 245 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::meansq ( ) const
inline

Definition at line 247 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::neff ( ) const
inline
double AdcChannelMetric::MetricSummary::range ( ) const
inline
double AdcChannelMetric::MetricSummary::rms ( ) const
inline

Definition at line 248 of file AdcChannelMetric.h.

248  {
249  return sqrt(meansq());
250  }
double AdcChannelMetric::MetricSummary::sdev ( ) const
inline

Definition at line 257 of file AdcChannelMetric.h.

257  {
258  double valm = mean();
259  double arg = meansq() - valm*valm;
260  return arg > 0 ? sqrt(arg) : 0.0;
261  }

Member Data Documentation

Index AdcChannelMetric::MetricSummary::eventCount = 0

Definition at line 226 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::maxval = 0.0

Definition at line 232 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::minval = 0.0

Definition at line 231 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::sum = 0.0

Definition at line 229 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::sumsq = 0.0

Definition at line 230 of file AdcChannelMetric.h.

Index AdcChannelMetric::MetricSummary::weightedEventCount = 0

Definition at line 227 of file AdcChannelMetric.h.

Index AdcChannelMetric::MetricSummary::weightFlag = 0

Definition at line 225 of file AdcChannelMetric.h.

double AdcChannelMetric::MetricSummary::weightSum

Definition at line 228 of file AdcChannelMetric.h.


The documentation for this class was generated from the following file: