ALERT
Loading...
Searching...
No Matches
ahdcExtractor.h
1#ifndef AHDC_EXTRACTOR_H
2#define AHDC_EXTRACTOR_H
3
4#include <vector>
5#include <map>
6#include <string>
7
14 public :
16 int sparseSample = 0;
17 short adcOffset = 0;
18 long timeStamp = 0;
20 static const short ADC_LIMIT = 4095;
24
25 public :
26 int binMax;
28 float adcMax;
29 float timeMax;
30 float integral;
31
32 std::vector<short> samplesCorr;
34
38 float timeCFD;
39
41 ahdcExtractor() = default;
42
44 ahdcExtractor(float _samplingTime,float _amplitudeFractionCFA, int _binDelayCFD, float _fractionCFD) :
45 samplingTime(_samplingTime), amplitudeFractionCFA(_amplitudeFractionCFA), binDelayCFD(_binDelayCFD), fractionCFD(_fractionCFD) {}
46
49
56 std::map<std::string,double> extract(const std::vector<short> samples);
57
58 private :
64 void waveformCorrection();
65
72 void fitAverage();
73
77 void fitParabolic();
78
87 void fineTimeStampCorrection();
88
97 void computeTimeAtConstantFractionAmplitude();
98
108 void computeTimeUsingConstantFractionDiscriminator();
109 public:
110 std::vector<float> samplesCFD;
111
116 void Show(const char * filename);
117
122 void ShowCFD(const char * filename);
123};
124
125#endif
Definition ahdcExtractor.h:13
int sparseSample
used to defined binOffset
Definition ahdcExtractor.h:16
std::vector< float > samplesCFD
samples corresponding to the CFD signal
Definition ahdcExtractor.h:110
float integral
Sum of ADCs over the pulse (not fitted)
Definition ahdcExtractor.h:30
float adcMax
Max value of ADC over the pulse (fitted)
Definition ahdcExtractor.h:28
float timeCFD
time extracted using the Constant Fraction Discriminator (CFD) algorithm (fitted)
Definition ahdcExtractor.h:38
float timeOverThresholdCFA
is equal to (timeFallCFA - timeRiseCFA)
Definition ahdcExtractor.h:37
static const short ADC_LIMIT
Maximum value of ADC : 2^12-1.
Definition ahdcExtractor.h:20
float timeMax
Time of the max ADC over the pulse (fitted)
Definition ahdcExtractor.h:29
int binOffset
Offset due to sparse sample.
Definition ahdcExtractor.h:27
int binDelayCFD
CFD delay parameter.
Definition ahdcExtractor.h:22
std::vector< short > samplesCorr
Waveform after offset (pedestal) correction.
Definition ahdcExtractor.h:32
ahdcExtractor(float _samplingTime, float _amplitudeFractionCFA, int _binDelayCFD, float _fractionCFD)
Constructor.
Definition ahdcExtractor.h:44
std::map< std::string, double > extract(const std::vector< short > samples)
Definition ahdcExtractor.cpp:19
short adcOffset
pedestal or noise level
Definition ahdcExtractor.h:17
void Show(const char *filename)
Show the extracted data in a figure.
Definition ahdcExtractor.cpp:161
float timeFallCFA
moment when the signal reaches a Constant Fraction of its Amplitude downhill (fitted)
Definition ahdcExtractor.h:36
void ShowCFD(const char *filename)
Show the CFD signal.
Definition ahdcExtractor.cpp:236
~ahdcExtractor()
Destructor.
Definition ahdcExtractor.h:48
float fineTimeStampResolution
precision of dream clock (usually 8)
Definition ahdcExtractor.h:19
int binNumber
Number of bins in one waveform.
Definition ahdcExtractor.h:33
ahdcExtractor()=default
Default constructor.
long timeStamp
timeStamp timing informations (used to make fine corrections)
Definition ahdcExtractor.h:18
float amplitudeFractionCFA
amplitude fraction between 0 and 1
Definition ahdcExtractor.h:21
float timeRiseCFA
moment when the signal reaches a Constant Fraction of its Amplitude uphill (fitted)
Definition ahdcExtractor.h:35
float samplingTime
time between two ADC bins
Definition ahdcExtractor.h:15
float fractionCFD
CFD fraction parameter between 0 and 1.
Definition ahdcExtractor.h:23
int binMax
Bin of the max ADC over the pulse.
Definition ahdcExtractor.h:26