10 using namespace sistrip;
24 <<
" NULL pointer to Analysis object!";
29 if (histos.size() != 1) {
34 if (!histos.empty()) {
39 std::vector<TH1*>::const_iterator ihis = histos.begin();
40 for (; ihis != histos.end(); ihis++) {
55 histo_.second = (*ihis)->GetName();
64 <<
" NULL pointer to base Analysis object!";
72 <<
" NULL pointer to derived Analysis object!";
78 std::vector<const TProfile*>
histos;
79 std::vector<unsigned short> monitorables;
84 histos.push_back(const_cast<const TProfile*>(dynamic_cast<TProfile*>(
histo_.first)));
96 if (histos.size() != 1) {
98 monitorables.push_back(0);
101 const TProfile*
histo = histos[0];
106 std::vector<unsigned short> binContent;
107 binContent.reserve((
unsigned short)histo->GetNbinsX());
108 binContent.resize((
unsigned short)histo->GetNbinsX(), 0);
110 for (
unsigned short k = 0;
k < (
unsigned short)histo->GetNbinsX();
k++) {
113 binContent.push_back((
unsigned int)(histo->GetBinContent(
k)));
118 sort(binContent.begin(), binContent.end());
122 float meanNoise = 0.;
123 float mean2Noise = 0.;
125 for (
unsigned short k = (
unsigned short)(binContent.size() * .1);
k < (
unsigned short)(binContent.size() * .9);
k++) {
126 meanNoise += binContent[
k];
127 mean2Noise += binContent[
k] * binContent[
k];
131 meanNoise = meanNoise * binContent.size() * 0.8;
132 mean2Noise = mean2Noise * binContent.size() * 0.8;
133 float sigmaNoise =
sqrt(fabs(meanNoise * meanNoise - mean2Noise));
136 unsigned short count = 0;
137 unsigned short maxlatency = 0;
138 unsigned int maxhits = 0;
140 for (
unsigned short k = 1;
k < ((
unsigned short)histo->GetNbinsX() + 1);
k++) {
141 if (histo->GetBinContent((Int_t)
k) > maxhits)
143 if ((
float)histo->GetBinContent((Int_t)k) > (meanNoise + 5 * sigmaNoise)) {
151 latency = maxlatency;
156 latency = maxlatency;
160 monitorables.clear();
161 monitorables.push_back(latency);
static const char unexpectedTask_[]
const uint32_t & fedKey() const
Utility class that holds histogram title.
const Histo & histo() const
static const char numberOfHistos_[]
uint32_t extractFedKey(const TH1 *const)
static const char mlCommissioning_[]
virtual void addErrorCode(const std::string &error)
Analysis for APV latency scan.
Abstract base for derived classes that provide analysis of commissioning histograms.
Log< level::Warning, false > LogWarning
void extract(const std::vector< TH1 * > &) override
CommissioningAnalysis *const anal() const
static const char nullPtr_[]