Algorithm for scope mode data.
- Author
- R.Bainbridge
Definition at line 16 of file DaqScopeModeAlgorithm.h.
void DaqScopeModeAlgorithm::analyse |
( |
| ) |
|
|
privatevirtual |
Performs histogram anaylsis.
Implements CommissioningAlgorithm.
Definition at line 63 of file DaqScopeModeAlgorithm.cc.
References CommissioningAnalysis::addErrorCode(), CommissioningAlgorithm::anal(), relmon_rootfiles_spy::contents, DaqScopeModeAnalysis::entries_, histo_, sistrip::invalid_, DaqScopeModeAnalysis::max_, hcaldqm::quantity::max_value, sistrip::maximum_, DaqScopeModeAnalysis::mean_, median(), DaqScopeModeAnalysis::median_, DaqScopeModeAnalysis::min_, sistrip::mlCommissioning_, DaqScopeModeAnalysis::mode_, pileupCalc::nbins, sistrip::nullPtr_, DaqScopeModeAnalysis::rms_, mathSSE::sqrt(), combinedConstraintHelpers::sum2(), tmp, and relativeConstraints::value.
Referenced by DaqScopeModeAlgorithm().
67 <<
"[DaqScopeModeAlgorithm::" << __func__ <<
"]" 68 <<
" NULL pointer to base Analysis object!";
76 <<
"[DaqScopeModeAlgorithm::" << __func__ <<
"]" 77 <<
" NULL pointer to derived Analysis object!";
94 uint16_t
nbins =
static_cast<uint16_t
>(
histo_.first->GetNbinsX() );
95 for ( uint16_t ibin = 0; ibin <
nbins; ibin++ ) {
96 float value =
histo_.first->GetBinLowEdge(ibin+1) +
histo_.first->GetBinWidth(ibin+1) / 2.;
101 if ( value > max_value ) { max_value =
value; }
102 if ( value < anal->min_ ) { anal->
min_ =
value; }
104 sum2 += value * contents* value *
contents;
105 median.insert( median.end(),
static_cast<uint32_t
>(
contents), value );
114 sort( median.begin(), median.end() );
115 if ( !median.empty() ) { anal->
median_ = median[ median.size()%2 ? median.size()/2 : median.size()/2 ]; }
119 sum /=
static_cast<float>(anal->
entries_);
120 sum2 /=
static_cast<float>(anal->
entries_);
122 if ( sum2 > sum*sum ) { anal->
rms_ =
sqrt( sum2 - sum*sum ); }
const float & median() const
static const char mlCommissioning_[]
double const max_value[nValueQuantityType]
static const uint16_t maximum_
virtual void addErrorCode(const std::string &error)
static const uint16_t invalid_
std::vector< std::vector< double > > tmp
Abstract base for derived classes that provide analysis of commissioning histograms.
CommissioningAnalysis *const anal() const
static const char nullPtr_[]
Analysis for scope mode data.