src
CalibCalorimetry
HcalAlgos
src
ThirdOrderDelayODE.cc
Go to the documentation of this file.
1
#include <cmath>
2
#include <cassert>
3
#include "
FWCore/Utilities/interface/Exception.h
"
4
5
#include "
CalibCalorimetry/HcalAlgos/interface/ThirdOrderDelayODE.h
"
6
7
void
ThirdOrderDelayODE::calculate
(
const
double
tau
,
8
const
double
currentIn,
9
double
/* dIdt */
,
10
double
/* d2Id2t */
,
11
const
double
*
x
,
12
const
unsigned
lenX,
13
const
unsigned
firstNode,
14
double
*
derivative
)
const
{
15
// Check input sanity
16
if
(lenX < firstNode + 3
U
)
17
throw
cms::Exception
(
"In ThirdOrderDelayODE::calculate: insufficient number of variables"
);
18
if
(
tau
<= 0.0)
19
throw
cms::Exception
(
"In ThirdOrderDelayODE::calculate: delay time is not positive"
);
20
assert
(
x
);
21
assert
(
derivative
);
22
23
derivative
[firstNode] =
x
[firstNode + 1];
24
derivative
[firstNode + 1] =
x
[firstNode + 2];
25
derivative
[firstNode + 2] =
26
6.0 /
a_
* (currentIn -
x
[firstNode] -
c_
*
tau
*
x
[firstNode + 1] -
b_
/ 2.0 *
tau
*
tau
*
x
[firstNode + 2]) /
27
tau
/
tau
/
tau
;
28
}
29
30
void
ThirdOrderDelayODE::setParameters
(
const
double
* pars,
const
unsigned
nPars) {
31
assert
(nPars == 3
U
);
32
assert
(pars);
33
a_
=
exp
(pars[0]);
34
b_
=
exp
(pars[1]);
35
c_
=
exp
(pars[2]);
36
}
funct::derivative
Derivative< X, A >::type derivative(const A &_)
Definition:
Derivative.h:18
Exception
Definition:
hltDiff.cc:245
ThirdOrderDelayODE::c_
double c_
Definition:
ThirdOrderDelayODE.h:32
ThirdOrderDelayODE::calculate
void calculate(double tau, double inputCurrent, double dIdt, double d2Id2t, const double *x, unsigned lenX, unsigned firstNode, double *derivative) const
Definition:
ThirdOrderDelayODE.cc:7
cms::cuda::assert
assert(be >=bs)
mitigatedMETSequence_cff.U
U
Definition:
mitigatedMETSequence_cff.py:36
ThirdOrderDelayODE::a_
double a_
Definition:
ThirdOrderDelayODE.h:30
ThirdOrderDelayODE::b_
double b_
Definition:
ThirdOrderDelayODE.h:31
ThirdOrderDelayODE.h
Exception.h
tau
Definition:
TauWPThreshold.h:12
x
float x
Definition:
beamSpotDipStandalone.cc:55
JetChargeProducer_cfi.exp
exp
Definition:
JetChargeProducer_cfi.py:6
DDAxes::x
ThirdOrderDelayODE::setParameters
void setParameters(const double *pars, unsigned nPars)
Definition:
ThirdOrderDelayODE.cc:30
Generated for CMSSW Reference Manual by
1.8.14