DmxRMSStat Class Reference

#include <DmxRMSStat.h>

Inheritance diagram for DmxRMSStat:

DmxStatistic List of all members.

Public Member Functions

 DmxRMSStat ()
 DmxRMSStat (Float_t *SignalW, Float_t *SignalE, Float_t CoG)
virtual ~DmxRMSStat ()
Float_t GetGoodness () const
Float_t GetTieBreaker () const

Private Attributes

Float_t fRms

Detailed Description

Definition at line 17 of file DmxRMSStat.h.


Constructor & Destructor Documentation

DmxRMSStat::DmxRMSStat (  ) 

Definition at line 22 of file DmxRMSStat.cxx.

00023 {
00024 }

DmxRMSStat::DmxRMSStat ( Float_t *  SignalW,
Float_t *  SignalE,
Float_t  CoG 
)

Definition at line 27 of file DmxRMSStat.cxx.

References fRms.

00027                                                                       :
00028   fRms(0.)
00029 {
00030   Float_t numerator = 0.;
00031   Float_t denominator = 0.;
00032   Float_t totalHits = 0.;
00033 
00034   for(Int_t i = 0; i < 192; i++){
00035     if( SignalW[i] > 0.){ 
00036       totalHits += 1.; 
00037       numerator += SignalW[i] * ((1. * i) - CoG) * ((1. * i) - CoG);
00038       denominator += SignalW[i];
00039     }
00040     if( SignalE[i] > 0.){ 
00041       totalHits += 1.; 
00042       numerator += SignalE[i] * ((1. * i) - CoG) * ((1. * i) - CoG);
00043       denominator += SignalE[i];
00044     }
00045   }
00046     
00047   //find the RMS and return it
00048 
00049   if(denominator != 0. && totalHits > 1.){
00050     Float_t rmssqr = (numerator / denominator) * (totalHits/(totalHits - 1.));
00051     fRms = TMath::Sqrt(rmssqr);
00052     //MSG("Dmx", Msg::kVerbose)  << "rms = " << rms << endl;
00053   }
00054   
00055   return;
00056 }

DmxRMSStat::~DmxRMSStat (  )  [virtual]

Definition at line 59 of file DmxRMSStat.cxx.

00060 {
00061   //  MSG("Dmx", Msg::kVerbose) << "deleting DmxRMSStat object" << endl;
00062 }


Member Function Documentation

Float_t DmxRMSStat::GetGoodness (  )  const [virtual]

Implements DmxStatistic.

Definition at line 72 of file DmxRMSStat.cxx.

References fRms.

Referenced by DmxChiSqrStat::DmxChiSqrStat().

00073 {
00074   
00075   return fRms;
00076 }

Float_t DmxRMSStat::GetTieBreaker (  )  const [inline, virtual]

Implements DmxStatistic.

Definition at line 27 of file DmxRMSStat.h.

00027 {return 0.;}  


Member Data Documentation

Float_t DmxRMSStat::fRms [private]

Definition at line 33 of file DmxRMSStat.h.

Referenced by DmxRMSStat(), and GetGoodness().


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 00:55:26 2014 for loon by  doxygen 1.4.7