ATLAS Offline Software
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"
18 class TH1F;
19 
20 // root
21 #include "TH1.h"
22 
23 // this
24 #include "T0MTSettings.h"
26 
27 namespace 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();
55  m_draw_debug_graph = settings->DrawDebugGraphs();
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 
88  double m_background;
89 
91  double m_height;
92 
95 
97  double m_t0_est;
98 
101 
103  bool m_error;
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
MuonCalib::MTT0PatternRecognition::m_draw_debug_graph
bool m_draw_debug_graph
Definition: MTT0PatternRecognition.h:85
MuonCalib::VariableBinwidthHistogram
Definition: VariableBinwidthHistogram.h:40
MuonCalib::MTT0PatternRecognition::MTT0PatternRecognition
MTT0PatternRecognition()
Default constructor.
Definition: MTT0PatternRecognition.h:39
T0MTSettings.h
plotmaker.hist
hist
Definition: plotmaker.py:148
MuonCalib::T0MTSettingsT0::VBHBinContent
double VBHBinContent() const
Number of hits per histogram bin for the VariableBinwidthHistogram The number is given relative to th...
Definition: T0MTSettingsT0.h:39
MuonCalib::MTT0PatternRecognition::GetEstimatedT0
double GetEstimatedT0() const
get estimated t0
Definition: MTT0PatternRecognition.h:70
MuonCalib::MTT0PatternRecognition::m_settings
const T0MTSettingsT0 * m_settings
settings
Definition: MTT0PatternRecognition.h:84
MuonCalib::MTT0PatternRecognition::m_background
double m_background
background level
Definition: MTT0PatternRecognition.h:88
MuonCalib::T0MTSettings::T0Settings
const T0MTSettingsT0 * T0Settings() const
get settings for the t0-fit
Definition: T0MTSettings.h:78
MuonCalib::MTT0PatternRecognition::GetHeight
double GetHeight() const
get height
Definition: MTT0PatternRecognition.h:67
VariableBinwidthHistogram.h
MuonCalib::MTT0PatternRecognition::m_height
double m_height
height
Definition: MTT0PatternRecognition.h:91
MuonCalib::MTT0PatternRecognition::GetBackground
double GetBackground() const
get the background level
Definition: MTT0PatternRecognition.h:64
MuonCalib::MTT0PatternRecognition::GetFitRangeMin
double GetFitRangeMin() const
get fit range
Definition: MTT0PatternRecognition.h:73
MuonCalib::T0MTSettingsT0::MaxBinWidth
double MaxBinWidth() const
Maximum bin width for the VariableBinwidthHistogram The bins will not be wider than this even if it m...
Definition: T0MTSettingsT0.h:43
MuonCalib::MTT0PatternRecognition::m_fit_min
double m_fit_min
fit range
Definition: MTT0PatternRecognition.h:94
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MTT0PatternRecognition::GetFitRangeMax
double GetFitRangeMax() const
get fit range
Definition: MTT0PatternRecognition.h:76
MuonCalib::MTT0PatternRecognition::GetError
bool GetError() const
return error flag
Definition: MTT0PatternRecognition.h:79
MuonCalib::VariableBinwidthHistogram::Initialize
bool Initialize(TH1F *hist, double binc_r, double max_bin_width, double min_x=-9e9, double max_x=9e9)
Initialize with new input histogram Returns on error false.
Definition: VariableBinwidthHistogram.cxx:22
MuonCalib::MTT0PatternRecognition::Initialize
bool Initialize(TH1F *hist, const T0MTSettings *settings)
Initialize class - returns true if pattern recognition was successfull.
Definition: MTT0PatternRecognition.h:53
MuonCalib::MTT0PatternRecognition::m_error
bool m_error
error flag
Definition: MTT0PatternRecognition.h:103
MuonCalib::MTT0PatternRecognition::m_fit_max
double m_fit_max
Definition: MTT0PatternRecognition.h:94
MuonCalib::MTT0PatternRecognition
Definition: MTT0PatternRecognition.h:35
MuonCalib::MTT0PatternRecognition::m_vbh
VariableBinwidthHistogram m_vbh
Variable binwidth histogram.
Definition: MTT0PatternRecognition.h:100
MuonCalib::MTT0PatternRecognition::estimate_background
bool estimate_background(TH1F *hist, double scale_min)
estimates the background level
Definition: MTT0PatternRecognition.cxx:19
MuonCalib::MTT0PatternRecognition::estimate_height
double estimate_height(TH1F *hist)
estimates the height of the spectrum.
Definition: MTT0PatternRecognition.cxx:85
MuonCalib::T0MTSettings::DrawDebugGraphs
const bool & DrawDebugGraphs() const
If set to true for every tube a TDirectory will be created.
Definition: T0MTSettings.h:60
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
MuonCalib::T0MTSettingsT0
Definition: T0MTSettingsT0.h:24
MuonCalib::T0MTSettings
Definition: T0MTSettings.h:28
MuonCalib::MTT0PatternRecognition::m_t0_est
double m_t0_est
t0 estimate
Definition: MTT0PatternRecognition.h:97