You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix AHDC pulse indexing and estimate the pedestal of the AHDC waveform using the first five samples (#480)
* Recover more data from AHDC pulse
* caotjava for mon12/ahdc (fix merging conflicts)
* Don't change HipoExtractor but Override ModeAHDC
* Declare `protected` some methods of HipoExtractor
* Estimate the pedestal using the first five samples
* Fix AHDC pulse indexing
---------
Co-authored-by: Felix Touchte Codjo <touchte@ifarm2402.jlab.org>
Co-authored-by: Felix Touchte Codjo <touchte@ifarm2401.jlab.org>
Copy file name to clipboardExpand all lines: common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ public List<Pulse> extract(NamedEntry pars, int id, short... samples){
58
58
floatleadingEdgeTime = 0; // moment when the signal reaches a Constant Fraction of its Amplitude uphill (fitted)
59
59
floattrailingEdgeTime = 0; // moment when the signal reaches a Constant Fraction of its Amplitude downhill (fitted)
60
60
floattimeOverThreshold = 0; // is equal to (timeFallCFA - timeRiseCFA)
61
-
floatconstantFractionTime ; // time extracted using the Constant Fraction Discriminator (CFD) algorithm (fitted)
61
+
floatconstantFractionTime= 0; // time extracted using the Constant Fraction Discriminator (CFD) algorithm (fitted)
62
62
/// /////////////////////////
63
63
// Begin waveform correction
64
64
/// ////////////////////////
@@ -75,11 +75,14 @@ public List<Pulse> extract(NamedEntry pars, int id, short... samples){
75
75
//private void waveformCorrection(short[] samples, short adcOffset, float samplingTime, int sparseSample, int binMax, int adcMax, int integral, short samplesCorr[], int binOffset, int timeMax){
76
76
binNumber = samples.length;
77
77
binMax = 0;
78
+
if (binNumber >= 5) {
79
+
adcOffset = (short) ((samples[0] + samples[1] + samples[2] + samples[3] + samples[4])/5); // try to estimate the baseline (pedestal) using the first five samples
0 commit comments