 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/HistoModule.h>
14 #include <top/modules/TOPGainEfficiencyMonitor/TOPLaserHitSelectorModule.h>
37 class TOPGainEfficiencyCalculatorModule :
public HistoModule {
44 enum { c_NParameterGainFit = 6 };
49 enum { c_NPlotsPerChannel = 3, c_NChannelPerPage = 4 };
54 enum EHistogramType { c_LoadForFitHeight = 1, c_LoadHitRateHeight = 2,
55 c_LoadForFitIntegral = 3, c_LoadHitRateIntegral = 4
84 virtual void event()
override;
89 virtual void endRun()
override;
130 static double TOPGainFunc(
double* var,
double* par);
float m_p2
fit result of p2
TH1D * m_chargeHistogram[c_NChannelPerPMT]
pulse charge distribution, extracted from m_timeChargeHistogram as a projection along its y-axis with...
TF1 * m_funcForLaser[c_NChannelPerPMT]
array of TF1 pointer to store fit function for hit timing distribution
float m_threshold
pulse charge threshold, which defines lower limit of fit region and efficiency calculation
float m_funcFullRangeIntegral
integral of fit function for its full range
void DrawResult(const std::string &histotype, EHistogramType LoadHisto)
Draw results of gain/efficiency calculation for each channel to a given output file.
short m_targetPmtChId
PMT channel ID.
float m_hitTimingSigma
Gaussian fit sigma for a peak of laser direct photons in hit timing distribution.
float m_thresholdForIntegral
pulse integral threshold, which defines lower limit of fit region and efficiency calculation
float m_hitTiming
timing of laser direct photon hits, given by Gaussian fit mean
short m_targetPmtId
PMT ID.
TH1F * m_nCalPulseHistogram
histogram to store the number of events with calibration pulse(s) identified for each asic (1,...
float m_initialP1
initial value of the fit parameter p1
float m_meanPulseHeight
histogram mean of pulse height distribution
std::string m_outputPDFFile
output PDF file to store plots of 2D histogram, timing, and charge distribution for each channel
float m_fitHalfWidth
half fit width for direct laser hit peak in [ns] unit
float m_fracFit
fraction of events which are covered by an area [0,m_fitMax]
virtual void event() override
This will be empty as the all the processes are done in beginRun() function thus input file can be a ...
virtual void terminate() override
Termination action.
float m_p1Error
fit error of p1
int m_nEntries
entries of pulse charge distribution
float m_p1
fit result of p1
float m_histoMeanAboveThre
mean of histogram above threshold, ignore overflow bin
float m_p1HeightIntegral
Parameter from p0 + x*p1 function that fits height-integral distribution.
virtual void beginRun() override
The main processes, fitting charge distribution and calculating gain/efficiency, are done in this fun...
TTree * m_tree
ntuple to store summary
int m_nCalPulse
the number of events with calibration pulse(s) identified
float m_efficiency
calculated efficiency from fitting of pulse charge distribution
std::vector< TBranch * > m_branch[4]
ntuple to store summary of gain using height distribution.
std::string m_inputFile
input file containing timing vs charge 2D histograms (output of TOPLaserHitSelector)
int m_nOverflowEvents
the number of events outside histogram range
float m_initialX0
initial value of the fit parameter x0
void FitHistograms(EHistogramType LoadHisto)
Fit charge (or integrated charged) distribution to calculate gain and efficiency for each channel.
float m_p0HeightIntegral
Parameter from p0 + x*p1 function that fits height-integral distribution.
virtual void endRun() override
Draw plots to show fitting results for each channel and save them into a given PDF file (outputPDFFil...
TOPGainEfficiencyCalculatorModule()
Constructor.
float m_histoFitRangeIntegral
integral of histogram for a range [threshold, fitMax]
float m_x0
fit result of x0
Abstract base class for different kinds of events.
short m_pmtChId
PMT channel ID.
void LoadHistograms(const std::string &histotype)
Load 2D histograms from a given input file (output of TOPLaserHitSelector) and create timing and char...
float m_p2Error
fit error of p2
float m_pedestalSigma
sigma of pedestal
float m_meanPulseHeightError
histogram mean error of pulse height distribution
static double TOPGainFunc(double *var, double *par)
Fit function of pulse charge (or charnge) distribution for channel(pixel)-by-channel gain extraction,...
float m_initialP0
initial value of the fit parameter p0
static double FindPeakForSmallerXThan(TH1 *histo, double xmax=0)
Find peak and return its position for a limited range of x (x smaller than the given value (xmax))
float m_initialP2
initial value of the fit parameter p2
float m_x0Error
fit error of x0
short m_hvDiff
HV difference from nominal HV value.
TH1D * m_timeHistogram[c_NChannelPerPMT]
hit timing distribution, extracted from m_timeChargeHistogram as a projection along its x-axis.
void DummyFillBranch(EHistogramType LoadHisto)
Fill Dummy for Branch.
float m_p0Error
fit error of p0
EHistogramType
enum for LoadHistograms switch.
virtual void initialize() override
Load time vs charge 2D histogram from a given input file (paramter "inputFile") and prepare hit timin...
short m_pixelId
pixel ID, calculated from PMT ID and PMT channel ID
float m_funcFitRangeIntegral
integral of fit function for a range [threshold, fitMax]
virtual void defineHisto() override
Define TTree branches to store fit results for each channel This TTree is saved in an output file giv...
float m_gain
calculated gain from fitting of pulse charge distribution
float m_p0
fit result of p0
float m_fitMax
upper limit of fit region for pulse charge distribution, determined based on m_fracFit value
float m_chisquare
chi2 of fitting
std::string m_fitoption
charge histograms fitting option.
TF1 * m_funcForFitRange[c_NChannelPerPMT]
array of TF1 pointer to store fit function for pulse charge distribution, defined only for fit region
short m_targetSlotId
slot ID
virtual ~TOPGainEfficiencyCalculatorModule()
Destructor.
TF1 * m_funcForFullRange[c_NChannelPerPMT]
array of TF1 pointer to store fit function for pulse charge distribution, defined only for full range...
TH2F * m_timeChargeHistogram[c_NChannelPerPMT]
2D histogram of hit timing and pulse charge (or charge), taken from an output file of TOPLaserHitSele...