28 <<
"[FastFedCablingAlgorithm::" << __func__ <<
"]" 29 <<
" NULL pointer to Analysis object!";
34 if ( histos.size() != 1 ) {
42 std::vector<TH1*>::const_iterator ihis = histos.begin();
43 for ( ; ihis != histos.end(); ihis++ ) {
46 if ( !(*ihis) ) {
continue; }
57 histo_.second = (*ihis)->GetName();
69 <<
"[FastFedCablingAlgorithm::" << __func__ <<
"]" 70 <<
" NULL pointer to base Analysis object!";
78 <<
"[FastFedCablingAlgorithm::" << __func__ <<
"]" 79 <<
" NULL pointer to derived Analysis object!";
88 TProfile*
histo =
dynamic_cast<TProfile*
>(
histo_.first);
95 uint16_t zero_entries = 0;
96 uint16_t
nbins =
static_cast<uint16_t
>( histo->GetNbinsX() );
99 std::vector<float> entries;
100 contents.reserve( nbins );
101 errors.reserve( nbins );
102 entries.reserve( nbins );
106 for ( uint16_t ibin = 0; ibin <
nbins; ibin++ ) {
107 contents.push_back( histo->GetBinContent(ibin+1) );
108 errors.push_back( histo->GetBinError(ibin+1) );
109 entries.push_back( histo->GetBinEntries(ibin+1) );
110 if ( entries[ibin] ) {
111 if ( contents[ibin] > anal->
max_ ) { anal->
max_ = contents[ibin]; }
112 if ( contents[ibin] < anal->
min_ ) { anal->
min_ = contents[ibin]; }
113 }
else { zero_entries++; }
124 if ( zero_entries ) {
146 std::vector<float> high;
147 std::vector<float> low;
148 for ( uint16_t ibin = 0; ibin <
nbins; ibin++ ) {
149 if ( entries[ibin] ) {
150 if ( contents[ibin] < anal->
midRange_ ) {
151 low.push_back( contents[ibin] );
153 high.push_back( contents[ibin] );
159 sort( high.begin(), high.end() );
160 sort( low.begin(), low.end() );
161 if ( !high.empty() ) { anal->
highMedian_ = high[ high.size()%2 ? high.size()/2 : high.size()/2 ]; }
162 if ( !low.empty() ) { anal->
lowMedian_ = low[ low.size()%2 ? low.size()/2 : low.size()/2 ]; }
171 for ( uint16_t ibin = 0; ibin < low.size(); ibin++ ) {
173 anal->
lowRms_ += low[ibin] * low[ibin];
175 if ( !low.empty() ) {
192 for ( uint16_t ibin = 0; ibin < high.size(); ibin++ ) {
194 anal->
highRms_ += high[ibin] * high[ibin];
196 if ( !high.empty() ) {
234 if ( entries[ibin] ) {
235 if ( contents[ibin] > anal->
midRange_ ) {
245 if ( entries[FastFedCablingAnalysis::nBitsForDcuId_+ibin] ) {
246 if ( contents[FastFedCablingAnalysis::nBitsForDcuId_+ibin] > anal->
midRange_ ) {
247 anal->
lldCh_ += ( 0x3 & (1<<ibin) );
static const char unexpectedTask_[]
const uint32_t & fedKey() const
Utility class that holds histogram title.
static const uint32_t invalid32_
const Histo & histo() const
static const char numberOfHistos_[]
static const uint16_t nBitsForDcuId_
static const uint16_t valid_
static const char numberOfBins_[]
Histogram-based analysis for connection loop.
static const char mlCommissioning_[]
uint32_t extractFedKey(const TH1 *const )
void extract(const std::vector< TH1 * > &) override
virtual void addErrorCode(const std::string &error)
static const char noEntries_[]
static const uint16_t invalid_
FastFedCablingAlgorithm()
static const char smallDataRange_[]
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_[]
static const float threshold_
static const uint16_t nBitsForLldCh_