ATLAS Offline Software
Loading...
Searching...
No Matches
MTT0PatternRecognition.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// MTT0PattternRecognition.h
6// Header file for class VariableBinwidthHistogram
8// (c) ATLAS Detector software
10//
12
13#ifndef MTT0PATTTERNRECOGNITION_H
14#define MTT0PATTTERNRECOGNITION_H
15
16// c - c++
17//#include "iostream"
18class TH1F;
19
20// root
21#include "TH1.h"
22
23// this
24#include "T0MTSettings.h"
26
27namespace MuonCalib {
28
36 public:
37 //-------------------------constructors-----------------------------------------
40 m_settings(NULL),
41 m_draw_debug_graph(false),
42 m_background(0.),
43 m_height(0.),
44 m_fit_min(0.),
45 m_fit_max(0.),
46 m_t0_est(0.),
47 m_error(false) {}
48
49 //-------------------------public member functions------------------------------
53 inline bool Initialize(TH1F *hist, const T0MTSettings *settings) {
54 m_settings = settings->T0Settings();
56 m_error = !m_vbh.Initialize(hist, m_settings->VBHBinContent(), m_settings->MaxBinWidth());
57 double scale_min = 0.;
58 if (!m_error) scale_min = estimate_height(hist);
59 if (!m_error) estimate_background(hist, scale_min);
60 return !m_error;
61 }
62
64 inline double GetBackground() const { return m_background; }
65
67 inline double GetHeight() const { return m_height; }
68
70 inline double GetEstimatedT0() const { return m_t0_est; }
71
73 inline double GetFitRangeMin() const { return m_fit_min; }
74
76 inline double GetFitRangeMax() const { return m_fit_max; }
77
79 inline bool GetError() const { return m_error; }
80
81 private:
82 //------------------------private data members----------------------------------
86
89
91 double m_height;
92
95
97 double m_t0_est;
98
101
104
105 //-----------------------private member functions-------------------------------
106
111 bool estimate_background(TH1F *hist, double scale_min);
112
116 double estimate_height(TH1F *hist);
117 };
118
119} // namespace MuonCalib
120#endif
double GetEstimatedT0() const
get estimated t0
bool Initialize(TH1F *hist, const T0MTSettings *settings)
Initialize class - returns true if pattern recognition was successfull.
double GetBackground() const
get the background level
double GetFitRangeMax() const
get fit range
double GetFitRangeMin() const
get fit range
double estimate_height(TH1F *hist)
estimates the height of the spectrum.
bool GetError() const
return error flag
VariableBinwidthHistogram m_vbh
Variable binwidth histogram.
bool estimate_background(TH1F *hist, double scale_min)
estimates the background level
const T0MTSettingsT0 * m_settings
settings
Settings for the T0 calibration (histogram booking and fitting parameters) Parameters for pattern rec...
const T0MTSettingsT0 * T0Settings() const
get settings for the t0-fit
const bool & DrawDebugGraphs() const
If set to true for every tube a TDirectory will be created.
A histogram where every bin has the same number of entries.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)