11 using namespace sistrip;
26 <<
"[DaqScopeModeAlgorithm::" << __func__ <<
"]"
27 <<
" NULL pointer to base Analysis object!";
32 if ( histos.size() != 1 ) {
40 std::vector<TH1*>::const_iterator ihis = histos.begin();
41 for ( ; ihis != histos.end(); ihis++ ) {
44 if ( !(*ihis) ) {
continue; }
55 histo_.second = (*ihis)->GetName();
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 ); }
static const char unexpectedTask_[]
const uint32_t & fedKey() const
const float & median() const
Utility class that holds histogram title.
static const char numberOfHistos_[]
static const char mlCommissioning_[]
uint32_t extractFedKey(const TH1 *const )
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.
void extract(const std::vector< TH1 * > &)
CommissioningAnalysis *const anal() const
static const char nullPtr_[]
Analysis for scope mode data.