![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
23 for (
int i = 1;
i <=
hist->GetNbinsX();
i++) {
24 if (
hist->GetBinContent(
i) > 0) {
31 log << MSG::WARNING <<
"estimate_background() - No hits in input histogram!" <<
endmsg;
35 double maxx = scale_min - 40;
38 if (
max - min < m_settings->MinBackgroundBins()) {
43 if (
max - min < m_settings->MinBackgroundBins()) {
45 log << MSG::WARNING <<
"estimate_background() - Rising edge is to glose to lower histogram range!" <<
endmsg;
51 double back_squared = 0.0;
53 double referece_chi2 = 0.0;
57 back_squared +=
hist->GetBinContent(
i) *
hist->GetBinContent(
i);
60 referece_chi2 = 2 * (back_squared / n_bins - bac * bac);
64 double chi2 = 2 * (back_squared / n_bins - bac * bac);
65 if (
chi2 > 5 * referece_chi2)
break;
74 (
new TLine(
hist->GetBinCenter(
min), 0,
hist->GetBinCenter(
min),
hist->GetMaximum()))->Write(
"t0_back_left");
75 (
new TLine(
hist->GetBinCenter(
max), 0,
hist->GetBinCenter(
max),
hist->GetMaximum()))->Write(
"t0_back_right");
105 double left(9e9), right(-9e9);
115 if (right - left > 50 &&
i > 20)
break;
121 (
new TLine(left, 0, left,
hist->GetMaximum()))->Write(
"t0_height_left");
122 (
new TLine(right, 0, right,
hist->GetMaximum()))->Write(
"t0_height_right");
125 int bleft(
hist->FindBin(left)), bright(
hist->FindBin(right));
128 for (
int i = bleft;
i <= bright;
i++) {
134 log << MSG::WARNING <<
"estimate_height() - top region is too small! left=" << left <<
" right=" << right <<
endmsg;
singleton-like access to IMessageSvc via open function and helper
const VariableBinwidthHistogramBin & GetSortedBin(unsigned int bin)
Get a bin sorted by content.
TGraph * DiffDensityGraph() const
Plot graph with differential density.
const T0MTSettingsT0 * m_settings
settings
double m_background
background level
TGraph * DenistyGraph() const
create density graph - density vs bin center
unsigned int GetNumberOfBins() const
Get the number of bins
IMessageSvc * getMessageSvc(bool quiet=false)
const int & MinBackgroundBins() const
The minimum width of the region for the background estimation.
TGraph * BinContentGraph() const
Plot bin content graph - bin content vs bin center.
double chi2(TH1 *h0, TH1 *h1)
bool Smooth(double width)
Removes steps that origin in a binning effekt.
double m_fit_min
fit range
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
double Left() const
Get left (lower) bin border.
TGraph * BinWidthGraph() const
Plot binwidth graph - binwidth versus bin center.
VariableBinwidthHistogram m_vbh
Variable binwidth histogram.
double Right() const
Get right (upper) bin border.
bool estimate_background(TH1F *hist, double scale_min)
estimates the background level
double estimate_height(TH1F *hist)
estimates the height of the spectrum.
double Width() const
Get width of the bin.
double m_t0_est
t0 estimate