This set of macros calculates Least Count parameters i.e.
offset and TOF slope in ns/(1000*chan).
This macro fits dependence on delay for each module
by linear function and saves the offset and Slope parameters. Then it
calculates offsets and slopes distributions, fits them with Gaus and
extracts means and sigmas. Using mean and deviation, we estimate good/bad modules.
We find that the best results are obtained if we assume that good modules are
insude the range (mean-4*sigma)<LeastCount<(mean+6*sigma)
Once module's parameters are
outsude this range, we repare it: If there are 12 subsequent mudules (whole 1/2 of ASIC),
we assume, that it was really dead and put mean parameters for offset
and slope. If this is not full 1/2 ASIC, we calculate average offset and slope in
this 1/2 ASIC and put into this (or these) module(s). For reference, we create a
figure with fit of delay dependence for each bad channel and put it into dir Figs.
Finally, we write resulting parameters into the dir Data.
Code repository
/home/phnxpbgl/work/RawData/calib/timing
Instruction
Make sure that HV is on.
Force anyone using DAQ to leave it for 15 minutes
Load Calibration trigger configuration
Make sure that PPG signal reach LEDs.
Take an LED run (one have to use partition including GL1)
Insert a 8 ns cable delay to extend PPG cable
Repeat stages 5 and 6 three-four times. Four runs is enough to
calculate least counts. Taking more runs is senseless as
our TAC range is less than 40 ns.
Write run names (pathes) and delays (in ns) in file DelayRuns.list like: