ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::ADCMTHistos Class Reference

Histogram and fitter class for drift time and pulsehight spectra The rising slope is fitted by a fermi-function: \(f(t)=r_{u,0} + \frac{A}{1+exp((t_0 - t)/T_0}\). More...

#include <ADCMTHistos.h>

Collaboration diagram for MuonCalib::ADCMTHistos:

Public Member Functions

 ADCMTHistos ()
 Default Constructor.
 ADCMTHistos (int id, const T0MTSettings *settings, const char *hname=NULL)
 Initializing constructor.
void Initialize (int id, const T0MTSettings *settings, const char *hname=NULL)
 Initialize class.
TH1F * GetADCSpec ()
 get adc spectrum
void FillA (double a)
 fill adc value
int Id () const
 return tube id
bool FitAdc ()
 fit adc
TF1 * GetAdcFunction () const
 returnd function fitted to adc-spectrum
bool AdcOk () const

Private Attributes

TH1F * m_adc
 pulse height spectrum
int m_id
 tube id;
std::unique_ptr< TF1 > m_adc_fit
 function which is fitted to the adc-spectrum
bool m_adc_ok
 is true if the adc-fit is ok;
const T0MTSettingsm_settings
 Pointer to settings class.

Detailed Description

Histogram and fitter class for drift time and pulsehight spectra The rising slope is fitted by a fermi-function: \(f(t)=r_{u,0} + \frac{A}{1+exp((t_0 - t)/T_0}\).

The falling slope is fitted by \(g(t)=r_{u,max} + \frac{e(t,a,b)}{1+exp((t_{max} - t)/T_{max}}\) where \(e(t, a, b) = a e^{bt}\). A pattern recognition determines the fit ranges and the parameters \(r_u\), \(A\), \(a\) and \(b\).

Author
Felix.nosp@m..Rau.nosp@m.scher.nosp@m.@Phy.nosp@m.sik.U.nosp@m.ni-M.nosp@m.uench.nosp@m.en.D.nosp@m.e
Date
June 2006

}

Definition at line 44 of file ADCMTHistos.h.

Constructor & Destructor Documentation

◆ ADCMTHistos() [1/2]

MuonCalib::ADCMTHistos::ADCMTHistos ( )
inline

Default Constructor.

Definition at line 48 of file ADCMTHistos.h.

48: m_adc(NULL), m_id(-1), m_adc_ok(false), m_settings(nullptr) {}
bool m_adc_ok
is true if the adc-fit is ok;
Definition ADCMTHistos.h:96
TH1F * m_adc
pulse height spectrum
Definition ADCMTHistos.h:90
const T0MTSettings * m_settings
Pointer to settings class.
Definition ADCMTHistos.h:98

◆ ADCMTHistos() [2/2]

MuonCalib::ADCMTHistos::ADCMTHistos ( int id,
const T0MTSettings * settings,
const char * hname = NULL )
inline

Initializing constructor.

Parameters
idtube id
settingst0-fit settings: settings will be asked about histogram binning

Definition at line 54 of file ADCMTHistos.h.

54 :
55 m_adc(NULL), m_id(-1), m_adc_ok(false), m_settings(nullptr) {
56 Initialize(id, settings, hname);
57 }
void Initialize(int id, const T0MTSettings *settings, const char *hname=NULL)
Initialize class.

Member Function Documentation

◆ AdcOk()

bool MuonCalib::ADCMTHistos::AdcOk ( ) const
inline

Definition at line 85 of file ADCMTHistos.h.

85{ return m_adc_ok; }

◆ FillA()

void MuonCalib::ADCMTHistos::FillA ( double a)

fill adc value

Parameters
aadc value

Definition at line 42 of file ADCMTHistos.cxx.

42{ m_adc->Fill(static_cast<Axis_t>(a)); }
static Double_t a

◆ FitAdc()

bool MuonCalib::ADCMTHistos::FitAdc ( )

fit adc

Definition at line 60 of file ADCMTHistos.cxx.

60 {
61 m_adc_fit = std::make_unique<TF1>("adc_fun", adcfitf_skewnormal, 50, 320, 4);
62 Double_t average = m_adc->GetMean();
63 Double_t max = m_adc->GetMaximum();
64 m_adc_fit->SetParameters(max, average, 40, 1); // initialize value
65 m_adc_fit->SetLineColor(kRed);
66 m_adc_fit->SetParNames("Max", "Mean", "Sigma", "Skew_factor");
67 m_adc_fit->SetParLimits(0, 0, 1000000);
68 m_adc_fit->SetParLimits(1, 100, 200);
69 m_adc_fit->SetParLimits(2, 0, 200);
70 m_adc->Fit("adc_fun", "Q+", "", 50, 320);
71 m_adc_ok = true;
72 return true;
73 }
#define max(a, b)
Definition cfImp.cxx:41
std::unique_ptr< TF1 > m_adc_fit
function which is fitted to the adc-spectrum
Definition ADCMTHistos.h:94
Double_t adcfitf_skewnormal(Double_t *x, Double_t *par)
skew normal ADC fitting

◆ GetAdcFunction()

TF1 * MuonCalib::ADCMTHistos::GetAdcFunction ( ) const
inline

returnd function fitted to adc-spectrum

Definition at line 84 of file ADCMTHistos.h.

84{ return m_adc->GetFunction("adc_fun"); }

◆ GetADCSpec()

TH1F * MuonCalib::ADCMTHistos::GetADCSpec ( )
inline

get adc spectrum

Definition at line 67 of file ADCMTHistos.h.

67{ return m_adc; }

◆ Id()

int MuonCalib::ADCMTHistos::Id ( ) const
inline

return tube id

Definition at line 78 of file ADCMTHistos.h.

78{ return m_id; }

◆ Initialize()

void MuonCalib::ADCMTHistos::Initialize ( int id,
const T0MTSettings * settings,
const char * hname = NULL )

Initialize class.

Parameters
idtube id
settingst0-fit settings: settings will be asked about histogram binning

Definition at line 48 of file ADCMTHistos.cxx.

48 {
49 m_settings = settings;
50 char buf[100];
51 if (hname == nullptr)
52 snprintf(buf, 100, "adc_spec_%d", id);
53 else
54 snprintf(buf, 100, "adc_spec_%s", hname);
55 m_adc = new TH1F(buf, "", settings->NBinsADC(), settings->ADCMin(), settings->ADCMax());
56 m_id = id;
57 m_adc_ok = false;
58 }
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

Member Data Documentation

◆ m_adc

TH1F* MuonCalib::ADCMTHistos::m_adc
private

pulse height spectrum

Definition at line 90 of file ADCMTHistos.h.

◆ m_adc_fit

std::unique_ptr<TF1> MuonCalib::ADCMTHistos::m_adc_fit
private

function which is fitted to the adc-spectrum

Definition at line 94 of file ADCMTHistos.h.

◆ m_adc_ok

bool MuonCalib::ADCMTHistos::m_adc_ok
private

is true if the adc-fit is ok;

Definition at line 96 of file ADCMTHistos.h.

◆ m_id

int MuonCalib::ADCMTHistos::m_id
private

tube id;

Definition at line 92 of file ADCMTHistos.h.

◆ m_settings

const T0MTSettings* MuonCalib::ADCMTHistos::m_settings
private

Pointer to settings class.

Definition at line 98 of file ADCMTHistos.h.


The documentation for this class was generated from the following files: