Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:05

0001 #ifndef CalibCalorimetry_HcalAlgos_ThirdOrderDelayODE_h_
0002 #define CalibCalorimetry_HcalAlgos_ThirdOrderDelayODE_h_
0003 
0004 //
0005 // Equation a/6*tau^3*V_out''' + b/2*tau^2*V_out'' + c*tau*V_out' + V_out = V_in,
0006 // with parameters "a", "b", and "c". a = 1, b = 1, c = 1 corresponds to the
0007 // Pade table delay equation with row = 0 and column = 3.
0008 //
0009 class ThirdOrderDelayODE {
0010 public:
0011   inline ThirdOrderDelayODE(unsigned /* r */, unsigned /* c */) : a_(1.0) {}
0012 
0013   void calculate(double tau,
0014                  double inputCurrent,
0015                  double dIdt,
0016                  double d2Id2t,
0017                  const double* x,
0018                  unsigned lenX,
0019                  unsigned firstNode,
0020                  double* derivative) const;
0021 
0022   inline unsigned getPadeRow() const { return 0U; }
0023   inline unsigned getPadeColumn() const { return 3U; }
0024   inline unsigned nParameters() const { return 3U; }
0025 
0026   // The parameters should be set to the logs of their actual values
0027   void setParameters(const double* pars, unsigned nPars);
0028 
0029 private:
0030   double a_;
0031   double b_;
0032   double c_;
0033 };
0034 
0035 #endif  // CalibCalorimetry_HcalAlgos_ThirdOrderDelayODE_h_