CFEL - ASG Software Suite
2.5.0
CASS
|
cfd analysis of waveform More...
#include <waveform.h>
Public Member Functions | |
pp112 (const name_t &name) | |
constructor More... | |
virtual void | process (const CASSEvent &, result_t &) |
copy the last waveform from the channel More... | |
virtual void | loadSettings (size_t) |
load the settings of this pp More... | |
![]() | |
Processor (const name_t &name) | |
constructor More... | |
virtual | ~Processor () |
virtual destructor More... | |
virtual void | processEvent (const CASSEvent &event) |
process the event More... | |
virtual const result_t & | result (const CASSEvent::id_t eventid=0) |
retrieve a result for a given id. More... | |
virtual void | releaseEvent (const CASSEvent &event) |
tell the list that the result for event can be overwritten More... | |
result_t::shared_pointer | resultCopy (const uint64_t eventid) |
retrieve histogram for id More... | |
virtual void | load () |
load the general settings More... | |
virtual void | aboutToQuit () |
function that will be called when the processor is about to be deleted More... | |
const names_t & | dependencies () |
Define all processors keys a processor depends on. More... | |
void | clearDependencies () |
clear the dependenies More... | |
void | clearHistograms () |
clear the histograms More... | |
virtual void | processCommand (std::string command) |
process command in pp More... | |
const name_t | name () const |
retrieve the name of this processor More... | |
bool | hide () const |
retrieve the hide flag of this processor More... | |
const std::string & | comment () const |
retrieve the comment of this processor More... | |
Protected Types | |
enum | ColumnNames { position = 0, height = 1, maxpos = 2, fwhm = 3, startpos = 4, endpos = 5, integral = 6, width = 7, polarity = 8, CoM = 9, nbrOf } |
enum describing the contents of the resulting table More... | |
typedef result_t::storage_t | table_t |
definition of the table More... | |
typedef std::pair< float, float > | fitparam_t |
define the fitparameters More... | |
typedef std::pair< float, float > | point_t |
define a point More... | |
typedef std::vector< point_t > | points_t |
define points More... | |
Protected Member Functions | |
fitparam_t | linearRegression (points_t::const_iterator first, points_t::const_iterator last) |
make a linear regression through points More... | |
void | createNewtonPolynomial (const float *x, const float *y, float *coeff) |
create Newton Polynomial More... | |
float | evalNewtonPolynomial (const float *x, const float *coeff, float X) |
evaluate Newton Polynomial More... | |
float | findXForGivenY (const float *x, const float *coeff, const float Y, const float Start) |
Achims Numerical Approximation. More... | |
![]() | |
virtual void | createHistList (result_t::shared_pointer result) |
create result list. More... | |
void | setupGeneral () |
general setup of the processor More... | |
bool | setupCondition (bool defaultConditionType=true) |
setup the condition. More... | |
shared_pointer | setupDependency (const std::string &depVarName, const name_t &name="") |
setup the dependecy. More... | |
Protected Attributes | |
shared_pointer | _waveform |
the Processor that contains the waveform to convert More... | |
size_t | _delay |
the delay in bins More... | |
float | _fraction |
the fraction More... | |
float | _walk |
the walk in volts More... | |
float | _threshold |
the threshold More... | |
float | _baseline |
the baseline More... | |
![]() | |
const name_t | _name |
the processors name More... | |
bool | _hide |
flag to tell whether this pp should be hidden in the dropdown list More... | |
std::string | _comment |
optional comment that one can add to a processor. More... | |
CachedList | _resultList |
the list of results More... | |
names_t | _dependencies |
the list of dependencies More... | |
shared_pointer | _condition |
pointer to the processor that will contain the condition More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< Processor > | shared_pointer |
a shared pointer of this More... | |
typedef std::string | name_t |
define the name type More... | |
typedef std::list< name_t > | names_t |
define the list of names More... | |
typedef CachedList::item_type | result_t |
define the results More... | |
typedef CachedList::item_sp | resultsp_t |
define the shared pointer to the result More... | |
cfd analysis of waveform
Processor/%name%/{Waveform}
The name of the Processor containing the waveform that should be converted. Default is 'Unknown'
Processor/%name%/{Delay}
Delay in units of the input x-axis is used. Default is 5.
Processor/%name%/{Fraction}
Fraction used. Default is 0.6
Processor/%name%/{Threshold}
threshold in units of the y-axis. Default is 0.1
Processor/%name%/{Walk}
walk in units of the y-axis. Default is 0.
Definition at line 138 of file waveform.h.
|
protected |
define the fitparameters
Definition at line 172 of file waveform.h.
|
protected |
define a point
Definition at line 175 of file waveform.h.
|
protected |
define points
Definition at line 178 of file waveform.h.
|
protected |
definition of the table
Definition at line 152 of file waveform.h.
|
protected |
enum describing the contents of the resulting table
Enumerator | |
---|---|
position | |
height | |
maxpos | |
fwhm | |
startpos | |
endpos | |
integral | |
width | |
polarity | |
CoM | |
nbrOf |
Definition at line 155 of file waveform.h.
pp112::pp112 | ( | const name_t & | name | ) |
|
protected |
create Newton Polynomial
This function creates the coefficients for Newton interpolating Polynomials. Newton Polynomials are created from n Points and have the form given that you have n Points
Here we do it for 4 Points.
[in] | x | the x-values of the points |
[in] | y | the y-values of the points |
[out] | coeff | the coefficients of the newton polynomial |
Definition at line 257 of file waveform.cpp.
Referenced by process().
|
protected |
evaluate Newton Polynomial
this function evaluates the Newton Polynomial that was created from n Points using Horner's Rule. This is done for an polynomial with 4 entries
[in] | x | array of x values |
[in] | coeff | array of coefficients |
[in] | X |
Definition at line 274 of file waveform.cpp.
Referenced by findXForGivenY().
|
protected |
Achims Numerical Approximation.
this function should find x value corrosponding to a given y value in a newton polynomial. It does it the following way:
[in] | x | two points describing upper and lower boundaries |
[in] | coeff | the newton polynomial coefficents |
[in] | Y | the requested y-values to find the x-value for |
[in] | Start | the x-value we start the search with |
initialize the boundaries
intialize the starting value
right value? then return the correspoinding x value
find the type of crossing
if its a negative crossing, and the y-value is bigger than the requested then point is the new lower boundary. If the y-value is smaller than the requested value, then the value is the new upper boundary. If we hit the spot, return the corresponding x-value
if its a positive crossing, and the y-value is bigger than the requested then point is the new upper boundary. If the y-value is smaller than the requested value, then the value is the new lower boundary. If we hit the spot, return the corresponding x-value
find new boundaries until the difference between the x-values of the boundaries is samller than 0.005
the new x value is the arithmetic mean between the two boundaries and determines the new x-values to be checked (with the corresponding y-value)
if its a negative crossing, and the y-value is bigger than the requested then point is the new lower boundary. If the y-value is smaller than the requested value, then the value is the new upper boundary. If we hit the spot, return the corresponding x-value
if its a positive crossing, and the y-value is bigger than the requested then point is the new upper boundary. If the y-value is smaller than the requested value, then the value is the new lower boundary. If we hit the spot, return the corresponding x-value
return the arithmentic mean between the two boundaries
Definition at line 284 of file waveform.cpp.
References evalNewtonPolynomial().
Referenced by process().
|
protected |
make a linear regression through points
points | vector containing the x,y coordintas of the points |
Definition at line 238 of file waveform.cpp.
Referenced by process().
|
virtual |
load the settings of this pp
Create the result output
Reimplemented from cass::Processor.
Definition at line 204 of file waveform.cpp.
References cass::Processor::_condition, _delay, _fraction, _threshold, _walk, _waveform, cass::Log::add(), QSettings::beginGroup(), cass::Processor::createHistList(), QString::fromStdString(), cass::Log::INFO, cass::Processor::name(), nbrOf, cass::Processor::setupCondition(), cass::Processor::setupDependency(), cass::Processor::setupGeneral(), cass::toString(), QSettings::value(), and cass::Result< float >::xAxis.
Referenced by pp112().
copy the last waveform from the channel
clear the resulting table to fill it with the values of this image
get a table row that we can later add to the table
calculate the constant fraction at i
calculate the constant fraction at i+1
check wether the criteria for a Peak are fullfilled: one point above one below the walk original point above the threshold
it could be that the first criteria is 0 because one of the Constant Fraction Signal Points or both are exactly where the walk is
both points are on the walk: go to next loop until at least one is over or under the walk
only first is on walk: this is what we want, so do nothing
only second is on walk: we want that the first point will be on the walk so in the next loop iteration this point will be the first
check the polarity
if two pulses are close together then the cfsignal goes through the walk three times, where only two crossings are good. So we need to check for the one where it is not good
negative polarity, but positive Puls -> skip
positive polarity, but negative Puls -> skip
to find the position of the crossing more precisely we need two more points, so create them here
calculate the constant fraction at i+1
calculate the constant fraction at i+2
find x with a linear interpolation between the two points
make a linear regression to find the slope of the leading edge
Find x with a cubic polynomial interpolation between four points do this with the Newtons interpolation Polynomial. Numericaly solve the Newton Polynomial, give the linear approach for x as Start Value
add info of the peak
go left from center until either i == 0, or the datapoint is inside the noise or we go from the previous one (i+1) to the actual one (i) through the baseline
go right form center until either i < pulslength, or the datapoint is inside the noise or we go from the previous one (i-1) to the actual one (i) through the baseline
go through whole peak and determine the integral and center of mass, while finding the maximum.
determine the fwhm of the peak with linear regression
go from maxpos to left until last point that is above 0.5*height
go from maxpos to right until last point that is above 0.5*height
make linear regression through 4 points
add peak to table
Reimplemented from cass::Processor.
Definition at line 374 of file waveform.cpp.
References _baseline, _delay, _fraction, _threshold, _walk, _waveform, cass::Result< T >::appendRows(), cass::Result< T >::axis(), CoM, createNewtonPolynomial(), endpos, findXForGivenY(), cass::fuzzycompare(), fwhm, height, cass::CASSEvent::id(), integral, linearRegression(), cass::Result< T >::lock, maxpos, nbrOf, polarity, position, cass::Result< T >::resetTable(), cass::Result< T >::shape(), startpos, width, cass::ACQIRIS::x, cass::Result< float >::xAxis, and cass::ACQIRIS::y.
|
protected |
|
protected |
the delay in bins
Definition at line 241 of file waveform.h.
Referenced by loadSettings(), and process().
|
protected |
the fraction
Definition at line 244 of file waveform.h.
Referenced by loadSettings(), and process().
|
protected |
the threshold
Definition at line 250 of file waveform.h.
Referenced by loadSettings(), and process().
|
protected |
the walk in volts
Definition at line 247 of file waveform.h.
Referenced by loadSettings(), and process().
|
protected |
the Processor that contains the waveform to convert
Definition at line 238 of file waveform.h.
Referenced by loadSettings(), and process().