#include <MTTmaxPatternRecognition.h>
Definition at line 36 of file MTTmaxPatternRecognition.h.
◆ MTTmaxPatternRecognition()
| MuonCalib::MTTmaxPatternRecognition::MTTmaxPatternRecognition |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 40 of file MTTmaxPatternRecognition.h.
40 :
double m_background
background level
const T0MTSettingsTMax * m_settings
settings
double m_tmax_est
t0 estimate
double m_a
parameters a, b in a*exp(b*x)
double m_fit_min
fit range
◆ estimate_background()
| bool MuonCalib::MTTmaxPatternRecognition::estimate_background |
( |
TH1F * | hist | ) |
|
|
private |
estimates the background level
- Parameters
-
Definition at line 39 of file MTTmaxPatternRecognition.cxx.
39 {
40
41 for (
double i = 1.0;
i <= 4.0;
i *= 2.0) {
42 for (int j = 0; j < 2; j++)
43 if (!
m_vbh.Smooth(
hist->GetBinWidth(1) / i)) {
45 return false;
46 }
47 }
49 m_vbh.DenistyGraph()->Write(
"tmax_density");
50 m_vbh.BinWidthGraph()->Write(
"tmax_binwidth");
51 m_vbh.DiffDensityGraph()->Write(
"tmax_diffdensity");
52 m_vbh.DiffBinwidthGraph()->Write(
"tmax_diffbinwidth");
53 }
54
55 double peak_falling(0.0), peak_falling_slope(-9e9);
56 for (
unsigned int i = 0;
i <
m_vbh.GetNumberOfBins() - 1;
i++) {
58
60 if (
bin2.Width() -
bin1.Width() > peak_falling_slope &&
bin2.Right() <
hist->GetBinLowEdge(
hist->GetNbinsX()) - 10) {
61 peak_falling =
bin1.Right();
62 peak_falling_slope =
bin2.Width() -
bin1.Width();
63 }
64 }
65
66 int firstbin =
hist->FindBin(peak_falling +
m_settings->DistBackground());
67 int lastbin =
hist->FindBin(
m_vbh.GetBin(
m_vbh.GetNumberOfBins() - 1).Right());
68 if (lastbin - firstbin < m_settings->MinBackgroundBins()) lastbin =
hist->GetNbinsX();
69 if (lastbin - firstbin < m_settings->MinBackgroundBins()) {
71 log << MSG::WARNING <<
"estimate_background() - Falling edge is to glose to upper histogram range!" <<
endmsg;
73 return false;
74 }
75
77 double n_bins = 0.0;
78 if (lastbin >
hist->GetNbinsX()) lastbin =
hist->GetNbinsX();
79 for (
int i = firstbin;
i <= lastbin;
i++) {
81 n_bins++;
82 }
83
85 (
new TLine(
hist->GetBinCenter(firstbin), 0,
hist->GetBinCenter(firstbin),
hist->GetMaximum()))->Write(
"tmax_back_left");
86 (
new TLine(
hist->GetBinCenter(lastbin), 0,
hist->GetBinCenter(lastbin),
hist->GetMaximum()))->Write(
"tmax_back_right");
87 }
88
92 return true;
93 }
VariableBinwidthHistogram m_vbh
Variable binwidth histogram.
IMessageSvc * getMessageSvc(bool quiet=false)
◆ estimate_height()
| bool MuonCalib::MTTmaxPatternRecognition::estimate_height |
( |
TH1F * | hist | ) |
|
|
private |
estimates the height of the spectrum.
The height is representet by an exponetial function a*exp(b*t). It returns the upper end of the height region.
- Parameters
-
Definition at line 99 of file MTTmaxPatternRecognition.cxx.
99 {
100
102
103 TF1*
fun =
new TF1(
"myexp",
myexp, left, right, 4);
106 hist->Fit(
"myexp",
"Q0+",
"", left, right);
107
108 m_a =
fun->GetParameter(0);
109 m_b =
fun->GetParameter(1);
111
113 (
new TLine(left, 0, left,
hist->GetMaximum()))->Write(
"tmax_height_left");
114 (
new TLine(right, 0, right,
hist->GetMaximum()))->Write(
"tmax_height_right");
115 }
116 return true;
117 }
Double_t myexp(Double_t *x, Double_t *p)
◆ GetA()
| double MuonCalib::MTTmaxPatternRecognition::GetA |
( |
| ) |
const |
|
inline |
◆ GetB()
| double MuonCalib::MTTmaxPatternRecognition::GetB |
( |
| ) |
const |
|
inline |
◆ GetBackground()
| double MuonCalib::MTTmaxPatternRecognition::GetBackground |
( |
| ) |
const |
|
inline |
◆ GetError()
| bool MuonCalib::MTTmaxPatternRecognition::GetError |
( |
| ) |
const |
|
inline |
◆ GetEstimatedTMax()
| double MuonCalib::MTTmaxPatternRecognition::GetEstimatedTMax |
( |
| ) |
const |
|
inline |
◆ GetFitRangeMax()
| double MuonCalib::MTTmaxPatternRecognition::GetFitRangeMax |
( |
| ) |
const |
|
inline |
◆ GetFitRangeMin()
| double MuonCalib::MTTmaxPatternRecognition::GetFitRangeMin |
( |
| ) |
const |
|
inline |
◆ Initialize()
| bool MuonCalib::MTTmaxPatternRecognition::Initialize |
( |
TH1F * | hist, |
|
|
double | t0, |
|
|
const T0MTSettings * | settings ) |
Initialize class.
- Parameters
-
| hist | Histogram which is to be fitted |
| t0 | comes from the t0 fit |
Definition at line 20 of file MTTmaxPatternRecognition.cxx.
20 {
28 log << MSG::WARNING <<
"Initialize() - Initialization of VBH failed!" <<
endmsg;
29 }
33 }
bool estimate_background(TH1F *hist)
estimates the background level
bool estimate_height(TH1F *hist)
estimates the height of the spectrum.
◆ m_a
| double MuonCalib::MTTmaxPatternRecognition::m_a |
|
private |
◆ m_b
| double MuonCalib::MTTmaxPatternRecognition::m_b |
|
private |
◆ m_background
| double MuonCalib::MTTmaxPatternRecognition::m_background |
|
private |
◆ m_draw_debug_graph
| bool MuonCalib::MTTmaxPatternRecognition::m_draw_debug_graph |
|
private |
◆ m_error
| bool MuonCalib::MTTmaxPatternRecognition::m_error |
|
private |
◆ m_fit_max
| double MuonCalib::MTTmaxPatternRecognition::m_fit_max |
|
private |
◆ m_fit_min
| double MuonCalib::MTTmaxPatternRecognition::m_fit_min |
|
private |
◆ m_settings
◆ m_t0
| double MuonCalib::MTTmaxPatternRecognition::m_t0 |
|
private |
◆ m_tmax_est
| double MuonCalib::MTTmaxPatternRecognition::m_tmax_est |
|
private |
◆ m_vbh
The documentation for this class was generated from the following files: