 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <top/dataobjects/TOPDigit.h>
19 #include <TMatrixDSym.h>
41 Hit(
double t,
double et,
int height,
double width)
62 TwoTimes(
double time1,
double time2,
double sig)
79 class TOPTimeBaseCalibratorModule :
public Module {
108 virtual void event()
override;
114 virtual void endRun()
override;
145 unsigned scrodID,
unsigned scrodChannel,
146 TH1F& Hchi2, TH1F& Hndf, TH1F& HDeltaT);
160 unsigned scrodID,
unsigned scrodChannel,
161 double meanTimeDifference,
162 TH1F& Hchi2, TH1F& Hndf, TH1F& HDeltaT);
177 unsigned scrodID,
unsigned scrodChannel,
178 double meanTimeDifference,
179 TH1F& Hchi2, TH1F& Hndf, TH1F& HDeltaT);
187 void Iteration(
const std::vector<TwoTimes>& ntuple, std::vector<double>& xval);
194 double Chisq(
const std::vector<TwoTimes>& ntuple,
const std::vector<double>& xxval);
205 const std::string& name,
206 const std::string& title,
207 const std::string& xTitle =
"",
208 const std::string& yTitle =
"")
const;
220 const std::vector<double>& err,
221 const std::string& name,
222 const std::string& title,
223 const std::string& xTitle =
"",
224 const std::string& yTitle =
"")
const;
233 const std::string& name,
234 const std::string& title)
const;
TH2F m_calPulseFirst
pulse height versus width of the first calibration pulse
double m_dchi2dxv
rms of 255 dchi2/dxval values
void Iteration(const std::vector< TwoTimes > &ntuple, std::vector< double > &xval)
Iteration function called by iterativeTBC()
TH2F m_calPulseSecond
pulse height versus width of the second calibration pulse
double Chisq(const std::vector< TwoTimes > &ntuple, const std::vector< double > &xxval)
Return the chisqure of one set of TBC constants (xval) in iTBC calculaton.
@ c_WindowSize
samples per window
double timeErr
raw time uncertainty [samples]
@ c_TimeAxisSize
number of samples to calibrate
double m_maxTimeDiff
upper bound for time difference [samples]
virtual void event() override
Event processor.
int pulseHeight
pulse height [ADC counts]
bool iterativeTBC(const std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, double meanTimeDifference, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
Method by iteration of chi2 minimization.
virtual void terminate() override
Termination action.
@ c_NumBoardstacks
number of boardstacks per module
double m_max_binwidth
maximum time interval of one sample
double m_dchi2_min
quit if chisq increase in iteratons is larger than this value.
double time
raw time [samples]
TH2F m_goodHits
pulse height versus width of all good hits
virtual void beginRun() override
Called when entering a new run.
@ c_NumChannels
number of channels per module
Hit(double t, double et, int height, double width)
Full constructor.
double m_min_binwidth
minimum time interval of one sample
double m_change_xstep
update m_xstep if m_dchi2dxv < m_change_step
double m_sigm2_exp
(sigma_0(dT))**2 for nomarlization of chisq = sum{dT^2/sigma^2}
virtual ~TOPTimeBaseCalibratorModule()
Destructor.
virtual void endRun() override
End-of-run action.
unsigned m_minHits
minimal required hits per channel
Structure to hold calpulse raw times expressed in samples since sample 0 of window 0.
Abstract base class for different kinds of events.
std::vector< TwoTimes > m_ntuples[c_NumChannels]
channel wise data
double m_dev_step
a step size to calculate the value of d(chisq)/dxval
void saveAsHistogram(const std::vector< double > &vec, const std::string &name, const std::string &title, const std::string &xTitle="", const std::string &yTitle="") const
Save vector to histogram and write it out.
float sigma
uncertainty of time difference (r.m.s.)
bool m_useFallingEdge
if true, use falling edge instead of rising
bool matrixInversion(const std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, double meanTimeDifference, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
Method by matrix inversion.
double m_DtSigma
a reference resolution of sigma_0(dT)=42.4 ps from Run3524
double m_minTimeDiff
lower bound for time difference [samples]
float t2
time of the second pulse [samples]
double m_new_xstep
m_xstep = m_new_xstep if m_dchi2dxv < m_change_step
float t1
time of the first pulse [samples]
double m_dt_max
maximum Delta T of raw calpulse
int m_good
good events used for chisq cal.
double m_syncTimeBase
synchronization time (two ASIC windows)
unsigned m_conv_iter
Number of iteration with chisq changes less than deltamin.
virtual void initialize() override
Initialize the Module.
bool calibrateChannel(std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
calibrate single channel
double m_xstep
unit for an interation of delta(X_s)
StoreArray< TOPDigit > m_digits
collection of digits
TOPTimeBaseCalibratorModule()
Constructor.
std::string m_directoryName
directory name for the output root files
double m_dt_min
minimum Delta T of raw calpulse
unsigned m_method
method to use
Accessor to arrays stored in the data store.
unsigned m_numIterations
Number of Iterations of iTBC.
double pulseWidth
pulse width [ns]
TwoTimes(double time1, double time2, double sig)
Full constructor.
double m_deltamin
minumum chisq change in an iteration.