PulseFitWithShape

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
//-----------------------------------------------------------------------
//----------------------------------------------------------------------
// File PulseFitWithShape.h

#ifndef PulseFitWithShape_H
#define PulseFitWithShape_H
#include "TObject.h"
#include <vector>

class PulseFitWithShape : public TObject {
public:
  // Default Constructor, mainly for Root
  PulseFitWithShape();

  // Destructor: Does nothing
  ~PulseFitWithShape() override;

  // Initialize
  virtual void init(int, int, int, int, int, const std::vector<double> &, double);

  // Compute amplitude of a channel

  virtual double doFit(double *, double *cova = nullptr);

  double fAmp_fitted_max;  // amplitude maximum fitted
  double fTim_fitted_max;  // time of amplitude maximum fitted

  double getAmpl() { return fAmp_fitted_max; }
  double getTime() { return fTim_fitted_max; }

private:
  int fNsamples;       // maximum number of samples into framelegth
  int fNsamplesShape;  // maximum number of samples into framelegth
  double fNoise;

  std::vector<double> pshape;
  std::vector<double> dshape;

  int fNb_iter;             // maximum number of iterations
  int fNum_samp_bef_max;    // number of samples before maximum sample
  int fNum_samp_after_max;  // number of samples after  maximum sample

  ClassDefOverride(PulseFitWithShape, 0)  //!< The processed part of the class is persistant
};

#endif

//-----------------------------------------------------------------------
//----------------------------------------------------------------------