13 using namespace sistrip;
27 <<
" NULL pointer to Analysis object!";
32 if (histos.size() != 1) {
37 if (!histos.empty()) {
42 std::vector<TH1*>::const_iterator ihis = histos.begin();
43 for (; ihis != histos.end(); ihis++) {
58 histo_.second = (*ihis)->GetName();
67 <<
" NULL pointer to base Analysis object!";
75 <<
" NULL pointer to derived Analysis object!";
84 TProfile*
histo =
dynamic_cast<TProfile*
>(
histo_.first);
91 uint16_t zero_entries = 0;
92 uint16_t
nbins =
static_cast<uint16_t
>(histo->GetNbinsX());
94 std::vector<float> errors;
95 std::vector<float> entries;
96 contents.reserve(nbins);
97 errors.reserve(nbins);
98 entries.reserve(nbins);
102 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
103 contents.push_back(histo->GetBinContent(ibin + 1));
104 errors.push_back(histo->GetBinError(ibin + 1));
105 entries.push_back(histo->GetBinEntries(ibin + 1));
107 if (contents[ibin] > anal->
max_) {
108 anal->
max_ = contents[ibin];
110 if (contents[ibin] < anal->
min_) {
111 anal->
min_ = contents[ibin];
149 std::vector<float> high;
150 std::vector<float> low;
151 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
154 low.push_back(contents[ibin]);
156 high.push_back(contents[ibin]);
162 sort(high.begin(), high.end());
163 sort(low.begin(), low.end());
165 anal->
highMedian_ = high[high.size() % 2 ? high.size() / 2 : high.size() / 2];
168 anal->
lowMedian_ = low[low.size() % 2 ? low.size() / 2 : low.size() / 2];
178 for (uint16_t ibin = 0; ibin < low.size(); ibin++) {
180 anal->
lowRms_ += low[ibin] * low[ibin];
199 for (uint16_t ibin = 0; ibin < high.size(); ibin++) {
201 anal->
highRms_ += high[ibin] * high[ibin];
252 if (entries[FastFedCablingAnalysis::nBitsForDcuId_ + ibin]) {
253 if (contents[FastFedCablingAnalysis::nBitsForDcuId_ + ibin] > anal->
midRange_) {
254 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_[]
uint32_t extractFedKey(const TH1 *const)
Histogram-based analysis for connection loop.
static const char mlCommissioning_[]
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_[]
Abstract base for derived classes that provide analysis of commissioning histograms.
Log< level::Warning, false > LogWarning
CommissioningAnalysis *const anal() const
static const char nullPtr_[]
static const float threshold_
static const uint16_t nBitsForLldCh_