CFEL - ASG Software Suite  2.5.0
CASS
waveform.cpp
Go to the documentation of this file.
1 //Copyright (C) 2010-2011 Lutz Foucar
2 
3 /**
4  * @file waveform.cpp file contains acqiris data retrieval processor
5  * definition
6  *
7  * @author Lutz Foucar
8  */
9 
10 #include <stdexcept>
11 #include <cmath>
12 #include <algorithm>
13 #include <string>
14 #include <tr1/functional>
15 #include <utility>
16 
17 #include "waveform.h"
18 #include "result.hpp"
19 #include "cass_event.h"
20 #include "cass.h"
21 #include "acqiris_device.hpp"
22 #include "convenience_functions.h"
23 #include "cass_settings.h"
24 #include "log.h"
25 #include "cass_exceptions.hpp"
26 
27 using namespace cass;
28 using namespace ACQIRIS;
29 using std::runtime_error;
30 using std::logic_error;
31 using std::minus;
32 using std::multiplies;
33 using std::cout;
34 using std::endl;
35 using std::invalid_argument;
36 using std::tr1::shared_ptr;
37 using std::tr1::bind;
38 using std::tr1::placeholders::_1;
39 using std::make_pair;
40 
41 //the last wavefrom processor
42 pp110::pp110(const name_t &name)
43  :Processor(name)
44 {
45  loadSettings(0);
46 }
47 
48 void pp110::loadSettings(size_t)
49 {
50  CASSSettings s;
51  s.beginGroup("Processor");
53  _instrument = s.value("InstrumentId",8).toUInt();
54  _channel = s.value("ChannelNbr",0).toUInt();
55  int wsize(s.value("NbrSamples",40000).toInt());
56  _sampleInterval = s.value("SampleInterval",1e-9).toDouble();
57  setupGeneral();
58  if (!setupCondition())
59  return;
62  (new result_t
63  (result_t::axe_t(wsize,0,wsize*_sampleInterval,"Time [s]"))));
64  Log::add(Log::INFO,"Processor '" + name() + "' is showing channel '" +
65  toString(_channel) + "' of acqiris '" + toString(_instrument) +
66  "'. Condition is '" + _condition->name() + "'");
67 }
68 
69 void pp110::process(const CASSEvent &evt, result_t &result)
70 {
71  CASSEvent::devices_t::const_iterator devIt(evt.devices().find(CASSEvent::Acqiris));
72  if (devIt == evt.devices().end())
73  throw logic_error("pp110::process() '" + name() +
74  "': Device 'Acqiris' doesn't exist in CASSEvent'");
75  const Device &dev
76  (dynamic_cast<const Device&>(*(devIt->second)));
77  Device::instruments_t::const_iterator instrIt (dev.instruments().find(_instrument));
78  if (dev.instruments().end() == instrIt)
79  throw InvalidData("pp110::process() '" + name() +
80  "': Data doesn't contain Instrument '"+toString(_instrument)
81  + "'");
82  const Instrument &instr(instrIt->second);
83  if (instr.id() != evt.id())
84  throw InvalidData("pp110::process() '" + name() + "': The dataId '" +
85  toString(instr.id()) + "' of Acqiris Instrument '" +
87  "' is inconsistent with the eventId '" +
88  toString(evt.id()) + "'");
89  if (instr.channels().size() <= _channel)
90  throw runtime_error("pp110::process() '" + name() + "': Instrument '"+
91  toString(_instrument) + "' doesn't contain channel '" +
92  toString(_channel)+ "'");
93  const Channel &channel (instr.channels()[_channel]);
94  const Channel::waveform_t &waveform (channel.waveform());
95  if (result.shape().first != waveform.size())
96  {
97  throw invalid_argument("processor '" + name() +
98  "' incoming waveforms NbrSamples '" + toString(waveform.size()) +
99  "'. User set NbrSamples '" +
100  toString(result.shape().first) +
101  "'");
102  }
103  if (!std::isfinite(channel.gain()))
104  {
105  throw InvalidData("pp110::process(): Processor '" + name() +
106  "': The provided gain '" + toString(channel.gain()) +
107  "' is not a number");
108  }
109  if (!std::isfinite(channel.sampleInterval()))
110  {
111  throw InvalidData("pp110::process(): Processor '" + name() +
112  "': The provided sampleInterval '" +
113  toString(channel.sampleInterval()) + "' is not a number");
114  }
115  if (!std::isfinite(channel.offset()))
116  {
117  throw InvalidData("pp110::process(): Processor '" + name() +
118  "': The provided vertical offset '" +
119  toString(channel.offset()) + "' is not a number");
120  }
121  if (!(fuzzycompare(channel.sampleInterval(),_sampleInterval)))
122  {
123  throw invalid_argument("processor '" + name() +
124  "' incoming waveforms SampleInterval '" + toString(channel.sampleInterval()) +
125  "'. User set SampleInterval '" + toString(_sampleInterval) + "'");
126  }
127  transform(waveform.begin(), waveform.end(), result.begin(),
128  std::tr1::bind(minus<float>(),
129  std::tr1::bind(multiplies<float>(),channel.gain(),_1),channel.offset()));
130 }
131 
132 
133 
134 
135 // ***cfd trace from waveform
136 
137 pp111::pp111(const name_t &name)
138  :Processor(name)
139 {
140  loadSettings(0);
141 }
142 
144 {
145  CASSSettings s;
146  s.beginGroup("Processor");
148  _waveform = setupDependency("Waveform");
149  setupGeneral();
150  if (!setupCondition())
151  return;
152  if (_waveform->result().dim() != 1)
153  throw invalid_argument("pp111 '" + name() + "' histogram '" + _waveform->name() +
154  "' is not a 1D histogram");
155 
156  _fraction = s.value("Fraction",0.6).toFloat();
157  _walk = s.value("Walk_V",0).toFloat();
158  const float delay(s.value("Delay_ns",5).toFloat());
159  const size_t nBins(_waveform->result().axis(result_t::xAxis).nBins);
160  const float Up(_waveform->result().axis(result_t::xAxis).up);
161  const float samplInter(Up/nBins);
162  _delay = static_cast<size_t>(delay/samplInter);
163 
164  createHistList(_waveform->result().clone());
165 
166  Log::add(Log::INFO,"Processor '" + name() + "' is converting waveform '" +
167  _waveform->name() + "' to a CFD Trace using delay '" + toString(delay) +
168  "', Fraction '" + toString(_fraction) + "', Walk '" + toString(_walk) +
169  "'. Condition is '" + _condition->name() + "'");
170 }
171 
172 void pp111::process(const CASSEvent &evt, result_t &result)
173 {
174  const result_t& waveform(_waveform->result(evt.id()));
175  QReadLocker lock(&waveform.lock);
176 
177  const size_t wLength(waveform.shape().first);
178  /** set all points before the delay to 0 */
179  fill(result.begin(),result.begin()+_delay,0);
180  for (size_t i=_delay; i<wLength; ++i)
181  {
182  /** get the original value at i */
183  const float fx = waveform[i];
184  /** get the delayed value at i-delay */
185  const float fxd = waveform[i-_delay];
186  /** the constant fraction value at i is \f fx*fraction + fx_{delayed}\f */
187  const float fsx = -fx*_fraction + fxd;
188  /** now remove the walk from the constant fraction to get the real cfd value */
189  result[i] = fsx - _walk;
190  }
191 }
192 
193 
194 
195 
196 // ***cfd analysis of waveform
197 
198 pp112::pp112(const name_t &name)
199  :Processor(name)
200 {
201  loadSettings(0);
202 }
203 
205 {
206  CASSSettings s;
207  s.beginGroup("Processor");
209  _waveform = setupDependency("Waveform");
210  setupGeneral();
211  if (!setupCondition())
212  return;
213  if (_waveform->result().dim() != 1)
214  throw invalid_argument("pp111 '" + name() + "' histogram '" + _waveform->name() +
215  "' is not a 1D histogram");
216 
217  _threshold = s.value("Threshold",0.2).toFloat();
218  _fraction = s.value("Fraction",0.6).toFloat();
219  _walk = s.value("Walk",0).toFloat();
220  const float delay(s.value("Delay",5).toFloat());
221  const size_t nBins(_waveform->result().axis(result_t::xAxis).nBins);
222  const float Up(_waveform->result().axis(result_t::xAxis).up);
223  const float samplInter(Up/nBins);
224  _delay = static_cast<size_t>(delay/samplInter);
225 
226  /** Create the result output */
228 
229  Log::add(Log::INFO,"Processor '" + name() + "' is finding signals in input '" +
230  _waveform->name() + "' using a CFD algorithm with user set delay '" +
231  toString(delay) + "' which corresponds to '" + toString(_delay) +
232  "' points of the input, Fraction '" + toString(_fraction) +
233  "', Walk '" + toString(_walk) +
234  "', Threshold '" + toString(_threshold) +
235  "'. Condition is '" + _condition->name() + "'");
236 }
237 
238 pp112::fitparam_t pp112::linearRegression(points_t::const_iterator first,
239  points_t::const_iterator last)
240 {
241  float SumXsq(0.f),SumX(0.f),SumY(0.f),SumXY(0.f);
242  size_t nPoints(0);
243  while (first != last)
244  {
245  SumX += first->first;
246  SumY += first->second;
247  SumXY += (first->first*first->second);
248  SumXsq += (first->first*first->first);
249  ++nPoints;
250  ++first;
251  }
252  const float a1 = ((SumX*SumX) - (nPoints*SumXsq));
253  return make_pair(((SumX*SumXY) - (SumY*SumXsq)) / a1,
254  ((SumX*SumY) - (nPoints*SumXY)) / a1);
255 }
256 
257 void pp112::createNewtonPolynomial(const float *x, const float *y, float *coeff)
258 {
259  double f_x0_x1 = (y[1]-y[0]) / (x[1]-x[0]);
260  double f_x1_x2 = (y[2]-y[1]) / (x[2]-x[1]);
261  double f_x2_x3 = (y[3]-y[2]) / (x[3]-x[2]);
262 
263  double f_x0_x1_x2 = (f_x1_x2 - f_x0_x1) / (x[2]-x[0]);
264  double f_x1_x2_x3 = (f_x2_x3 - f_x1_x2) / (x[3]-x[1]);
265 
266  double f_x0_x1_x2_x3 = (f_x1_x2_x3 - f_x0_x1_x2) / (x[3]-x[0]);
267 
268  coeff[0] = y[0];
269  coeff[1] = f_x0_x1;
270  coeff[2] = f_x0_x1_x2;
271  coeff[3] = f_x0_x1_x2_x3;
272 }
273 
274 float pp112::evalNewtonPolynomial(const float *x, const float *coeff, float X)
275 {
276  double returnValue = coeff[3];
277  returnValue = returnValue * (X - x[2]) + coeff[2];
278  returnValue = returnValue * (X - x[1]) + coeff[1];
279  returnValue = returnValue * (X - x[0]) + coeff[0];
280 
281  return returnValue;
282 }
283 
284 float pp112::findXForGivenY(const float *x, const float *coeff, const float Y, const float Start)
285 {
286  typedef std::pair<double,double> punkt_t;
287  /** initialize the boundaries */
288  punkt_t Low(x[1], evalNewtonPolynomial(x,coeff,x[1]));
289  punkt_t Up (x[2], evalNewtonPolynomial(x,coeff,x[2]));
290 
291  /** intialize the starting value */
292  punkt_t p (Start, evalNewtonPolynomial(x,coeff,Start));
293 
294  /** right value? then return the correspoinding x value */
295  if (p.second == Y)
296  return p.first;
297 
298  /** find the type of crossing */
299  bool Neg = (Low.second > Up.second)?true:false;
300 
301  /** if its a negative crossing, and the y-value is bigger than the requested
302  * then point is the new lower boundary. If the y-value is smaller than the
303  * requested value, then the value is the new upper boundary. If we hit the
304  * spot, return the corresponding x-value
305  */
306  if (Neg)
307  {
308  if (p.second > Y)
309  Low = p;
310  else if (p.second < Y)
311  Up = p;
312  else
313  return p.first;
314  }
315  /** if its a positive crossing, and the y-value is bigger than the requested
316  * then point is the new upper boundary. If the y-value is smaller than the
317  * requested value, then the value is the new lower boundary. If we hit the
318  * spot, return the corresponding x-value
319  */
320  else
321  {
322  if (p.second > Y)
323  Up = p;
324  else if (p.second < Y)
325  Low = p;
326  else
327  return p.first;
328  }
329 
330  /** find new boundaries until the difference between the x-values of the
331  * boundaries is samller than 0.005
332  */
333  while((Up.first-Low.first) > 0.005)
334  {
335  /** the new x value is the arithmetic mean between the two boundaries and
336  * determines the new x-values to be checked (with the corresponding y-value)
337  */
338  p.first = 0.5 * (Up.first+Low.first);
339  p.second = evalNewtonPolynomial(x,coeff,p.first);
340 
341  /** if its a negative crossing, and the y-value is bigger than the requested
342  * then point is the new lower boundary. If the y-value is smaller than the
343  * requested value, then the value is the new upper boundary. If we hit the
344  * spot, return the corresponding x-value
345  */
346  if (Neg)
347  {
348  if (p.second > Y)
349  Low = p;
350  else if (p.second < Y)
351  Up = p;
352  else
353  return p.first;
354  }
355  /** if its a positive crossing, and the y-value is bigger than the requested
356  * then point is the new upper boundary. If the y-value is smaller than the
357  * requested value, then the value is the new lower boundary. If we hit the
358  * spot, return the corresponding x-value
359  */
360  else
361  {
362  if (p.second > Y)
363  Up = p;
364  else if (p.second < Y)
365  Low = p;
366  else
367  return p.first;
368  }
369  }
370  /** return the arithmentic mean between the two boundaries */
371  return ((Up.first + Low.first)*0.5);
372 }
373 
374 void pp112::process(const CASSEvent &evt, result_t &result)
375 {
376  const result_t& waveform(_waveform->result(evt.id()));
377  QReadLocker lock(&waveform.lock);
378 
379  /** clear the resulting table to fill it with the values of this image */
380  result.resetTable();
381 
382  /** get a table row that we can later add to the table */
383  table_t peak(nbrOf,0);
384 
385  const size_t wLength(waveform.shape().first);
386  for (size_t i=_delay+1; i<wLength-2; ++i)
387  {
388  /** calculate the constant fraction at i */
389  const float fx(waveform[i]);
390  const float fxd(waveform[i-_delay]);
391  const float fsx(-fx*_fraction + fxd);
392 
393  /** calculate the constant fraction at i+1 */
394  const float fx_1(waveform[i+1]);
395  const float fxd_1(waveform[i+1-_delay]);
396  const float fsx_1(-fx_1*_fraction + fxd_1);
397 
398  /** check wether the criteria for a Peak are fullfilled:
399  * one point above one below the walk
400  * original point above the threshold
401  */
402  if ((((fsx-_walk) * (fsx_1-_walk)) <= 0) && (fabs(fx) > _threshold))
403  {
404  /** it could be that the first criteria is 0 because one of the
405  * Constant Fraction Signal Points or both are exactly where the walk is
406  */
407  /** both points are on the walk:
408  * go to next loop until at least one is over or under the walk
409  */
410  if (fuzzycompare(fsx,fsx_1))
411  continue;
412  /** only first is on walk:
413  * this is what we want, so do nothing
414  */
415  else if ((fsx-_walk) == 0);
416  /** only second is on walk:
417  * we want that the first point will be on the walk so in the next loop
418  * iteration this point will be the first
419  */
420  else if ((fsx_1-_walk) == 0)
421  continue;
422 
423  /** check the polarity */
424  /** if two pulses are close together then the cfsignal goes through the
425  * walk three times, where only two crossings are good. So we need to
426  * check for the one where it is not good
427  */
428  /** negative polarity, but positive Puls -> skip */
429  if ((fsx > fsx_1) && (waveform[i] > _baseline))
430  continue;
431  /** positive polarity, but negative Puls -> skip */
432  if ((fsx < fsx_1) && (waveform[i] < _baseline))
433  continue;
434 
435  /** to find the position of the crossing more precisely we need two more
436  * points, so create them here
437  */
438  /** calculate the constant fraction at i+1 */
439  const float fx_m1(waveform[i-1] - _baseline);
440  const float fxd_m1(waveform[i-1-_delay] -_baseline);
441  const float fsx_m1(-fx_m1*_fraction + fxd_m1);
442 
443  /** calculate the constant fraction at i+2 */
444  const float fx_2(waveform[i+2] - _baseline);
445  const float fxd_2(waveform[i+2-_delay] - _baseline);
446  const float fsx_2(-fx_2*_fraction + fxd_2);
447 
448  /** find x with a linear interpolation between the two points */
449  const float m(fsx_1-fsx); //(fsx-fsx_1)/(i-(i+1));
450  const float xLin(i + (_walk - fsx)/m); //PSF fx = (x - i)*m + cfs[i]
451 
452 // /** make a linear regression to find the slope of the leading edge */
453 // const float SumX((i-_delay) + (i+1-_delay) + (i+2-_delay));
454 // const float SumY(fxd + fxd_1 + fxd_2);
455 // const float SumXY((i-_delay)*fxd + (i+1-_delay)*fxd_1 + (i+2-_delay)*fxd_2);
456 // const float SumXsq((i-_delay)*(i-_delay) +
457 // (i+1-_delay)*(i+1-_delay) +
458 // (i+2-_delay)*(i+2-_delay));
459 // const float a1((SumX*SumX) - (3*SumXsq));
460 // const float m(((SumX*SumY) - (3*SumXY)) / a1);
461 // const float c(((SumX*SumXY) - (SumY*SumXsq)) / a1);
462 
463  /** Find x with a cubic polynomial interpolation between four points
464  * do this with the Newtons interpolation Polynomial.
465  * Numericaly solve the Newton Polynomial, give the linear approach for
466  * x as Start Value
467  */
468  const float x[4] = {static_cast<float>(i-1), static_cast<float>(i),
469  static_cast<float>(i+1), static_cast<float>(i+2)};
470  const float y[4] = {fsx_m1,fsx,fsx_1,fsx_2};
471  float coeff[4] = {0.f,0.f,0.f,0.f};
472  createNewtonPolynomial(x,y,coeff);
473  const float xPoly(findXForGivenY(x,coeff,_walk,xLin));
474 
475  /** add info of the peak */
476  const float low(waveform.axis(result_t::xAxis).low);
477  const float up(waveform.axis(result_t::xAxis).up);
478  const float nBins(waveform.axis(result_t::xAxis).nBins);
479  peak[position] = low +(xPoly*(up-low)/nBins);
480  if (fsx > fsx_1)
481  peak[polarity] = 0;
482  if (fsx < fsx_1)
483  peak[polarity] = 1;
484  if (fuzzycompare(fsx,fsx_1))
485  peak[polarity] = 2;
486  /** go left from center until either i == 0, or the datapoint is inside
487  * the noise or we go from the previous one (i+1) to the actual one (i)
488  * through the baseline
489  */
490  int start(i);
491  for (; start>=0; --start)
492  if ((fabs(waveform[start]-_baseline) < _threshold))
493  break;
494  peak[startpos] = start;
495  /** go right form center until either i < pulslength, or the datapoint
496  * is inside the noise or we go from the previous one (i-1) to the
497  * actual one (i) through the baseline
498  */
499  size_t stop(i);
500  for (; stop < wLength; ++stop)
501  if ((fabs(waveform[stop]-_baseline) < _threshold))
502  break;
503  peak[endpos] = stop;
504  peak[width] = stop - start;
505 
506  /** go through whole peak and determine the integral and center of mass,
507  * while finding the maximum.
508  */
509  peak[height] = 0;
510  float weight(0);
511  peak[integral] = 0;
512  for (size_t j(start); j<=stop;++j)
513  {
514  const float y(fabs(waveform[j] - _baseline));
515  peak[integral] += y;
516  weight += y * j;
517  if (y > peak[height])
518  {
519  peak[height] = y;
520  peak[maxpos] = j;
521  }
522  }
523  peak[CoM] = weight / peak[integral];
524 
525  /** determine the fwhm of the peak with linear regression */
526  const float halfmax(peak[height]*0.5);
527  /** go from maxpos to left until last point that is above 0.5*height */
528  size_t fwhm_l(peak[maxpos]);
529  while (fabs(waveform[fwhm_l]-_baseline) > halfmax)
530  --fwhm_l;
531  /** go from maxpos to right until last point that is above 0.5*height */
532  size_t fwhm_r(peak[maxpos]);
533  while (fabs(waveform[fwhm_r]-_baseline) > halfmax)
534  ++fwhm_r;
535  /** make linear regression through 4 points */
536  points_t points(4,make_pair(0,0));
537  points[0].first = fwhm_l-2; points[0].second = fabs(waveform[fwhm_l-2]-_baseline);
538  points[1].first = fwhm_l-1; points[1].second = fabs(waveform[fwhm_l-1]-_baseline);
539  points[2].first = fwhm_l-0; points[2].second = fabs(waveform[fwhm_l-0]-_baseline);
540  points[3].first = fwhm_l+1; points[3].second = fabs(waveform[fwhm_l+1]-_baseline);
541  fitparam_t left_fitparam(linearRegression(points.begin(),points.end()));
542  points[0].first = fwhm_r-1; points[0].second = fabs(waveform[fwhm_r-1]-_baseline);
543  points[1].first = fwhm_r-0; points[1].second = fabs(waveform[fwhm_r-0]-_baseline);
544  points[2].first = fwhm_r+1; points[2].second = fabs(waveform[fwhm_r+1]-_baseline);
545  points[3].first = fwhm_r+2; points[3].second = fabs(waveform[fwhm_r+2]-_baseline);
546  fitparam_t right_fitparam(linearRegression(points.begin(),points.end()));
547 
548  //y = m*x+c => x = (y-c)/m;
549  const float fwhm_L((halfmax-left_fitparam.first)/left_fitparam.second);
550  const float fwhm_R((halfmax-right_fitparam.first)/right_fitparam.second);
551  peak[fwhm] = fwhm_R-fwhm_L;
552 
553  /** add peak to table */
554  result.appendRows(peak);
555  }
556  }
557 }
CachedList::item_type result_t
define the results
Definition: processor.h:52
float _baseline
the baseline
Definition: waveform.h:253
float _fraction
the fraction
Definition: waveform.h:109
size_t _channel
the Acqiris channel number of this processor
Definition: waveform.h:62
void appendRows(const storage_t &rows)
add row(s) to the result
Definition: result.hpp:724
Event to store all LCLS Data.
Definition: cass_event.h:32
virtual void createHistList(result_t::shared_pointer result)
create result list.
Definition: processor.cpp:79
float _threshold
the threshold
Definition: waveform.h:250
float _fraction
the fraction
Definition: waveform.h:244
uint32_t _instrument
the instrument that contains the channel this processor will work on
Definition: waveform.h:59
bool fuzzycompare(const T &first, const T &second)
fuzzy compare two floating point variables
pos_t minus(const pos_t &minuent, const pos_t &subtrahend)
functor to substract one position from the other
Definition: geom_parser.cpp:45
float findXForGivenY(const float *x, const float *coeff, const float Y, const float Start)
Achims Numerical Approximation.
Definition: waveform.cpp:284
virtual void loadSettings(size_t)
load the settings of this pp
Definition: waveform.cpp:48
const name_t name() const
retrieve the name of this processor
Definition: processor.h:167
virtual void process(const CASSEvent &, result_t &)
copy the last waveform from the channel
Definition: waveform.cpp:69
file contains declaration of the CASSEvent
Settings for CASS.
Definition: cass_settings.h:30
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
Definition: result.hpp:323
size_t _delay
the delay in bins
Definition: waveform.h:241
an axis of a more than 0 dimensional container
Definition: result.hpp:29
void resetTable()
reset the table like result
Definition: result.hpp:740
result classes
virtual void loadSettings(size_t)
load the settings of this pp
Definition: waveform.cpp:143
shared_pointer _waveform
the Processor that contains the waveform to convert
Definition: waveform.h:103
file contains custom exceptions used in cass
fitparam_t linearRegression(points_t::const_iterator first, points_t::const_iterator last)
make a linear regression through points
Definition: waveform.cpp:238
Exception thrown when there is a problem with the data.
static void add(Level level, const std::string &line)
add a string to the log
Definition: log.cpp:31
const_iterator begin() const
retrieve a iterator for read access to beginning
Definition: result.hpp:608
fromStdString(const std::string &str)
std::vector< point_t > points_t
define points
Definition: waveform.h:178
size_t _delay
the delay in bins
Definition: waveform.h:106
base class for processors.
Definition: processor.h:39
shared_pointer setupDependency(const std::string &depVarName, const name_t &name="")
setup the dependecy.
Definition: processor.cpp:114
const axis_t & axis() const
read access to the axis
Definition: result.hpp:449
file contains acqiris data retrieval processor declaration
void createNewtonPolynomial(const float *x, const float *y, float *coeff)
create Newton Polynomial
Definition: waveform.cpp:257
pp112(const name_t &name)
constructor
Definition: waveform.cpp:198
devices_t & devices()
setters
Definition: cass_event.h:66
virtual void process(const CASSEvent &, result_t &)
copy the last waveform from the channel
Definition: waveform.cpp:172
file contains declaration of classes and functions that help other processors to do their job...
std::pair< float, float > fitparam_t
define the fitparameters
Definition: waveform.h:172
result_t::storage_t table_t
definition of the table
Definition: waveform.h:152
QReadWriteLock lock
lock for locking operations on the data of the container
Definition: result.hpp:954
file contains the declaration of the acqiris part of the CASSEvent
file contains global definitions for project cass
id_t & id()
setters
Definition: cass_event.h:64
float _walk
the walk in volts
Definition: waveform.h:247
std::string toString(const Type &t)
convert any type to a string
Definition: cass.h:63
float _walk
the walk in volts
Definition: waveform.h:112
value(const QString &key, const QVariant &defaultValue=QVariant()
shared_pointer _waveform
the Processor that contains the waveform to convert
Definition: waveform.h:238
pp111(const name_t &name)
constructor
Definition: waveform.cpp:137
void setupGeneral()
general setup of the processor
Definition: processor.cpp:85
virtual void loadSettings(size_t)
load the settings of this pp
Definition: waveform.cpp:204
file contains specialized class that do the settings for cass
float evalNewtonPolynomial(const float *x, const float *coeff, float X)
evaluate Newton Polynomial
Definition: waveform.cpp:274
pp110(const name_t &name)
constructor
Definition: waveform.cpp:42
shared_pointer _condition
pointer to the processor that will contain the condition
Definition: processor.h:277
double _sampleInterval
the sample interval
Definition: waveform.h:65
virtual void process(const CASSEvent &, result_t &)
copy the last waveform from the channel
Definition: waveform.cpp:374
shape_t shape() const
return the shape of the result
Definition: result.hpp:811
bool setupCondition(bool defaultConditionType=true)
setup the condition.
Definition: processor.cpp:94
std::string name_t
define the name type
Definition: processor.h:46
contains a logger for cass
beginGroup(const QString &prefix)