|
|
Go to the documentation of this file.
7 : preampOutputCut_(-1.0e100),
12 integrateToGetCharge_(
false),
16 const unsigned chargeNode,
17 const bool interpolateCubic,
18 const double preampOutputCut,
19 const double inputGain,
20 const double outputGain)
22 preampOutputCut_(preampOutputCut),
23 inputGain_(inputGain),
24 outputGain_(outputGain),
26 chargeNode_(chargeNode),
27 useCubic_(interpolateCubic) {
29 throw cms::Exception(
"In QIE8Simulator constructor: invalid charge collection node");
36 const double dt,
const double tstop,
const double tDigitize,
double* TS,
const unsigned lenTS) {
38 throw cms::Exception(
"In QIE8Simulator::run: preamp model is not set");
45 throw cms::Exception(
"In QIE8Simulator::run: invalid stopping time");
47 if (lenTS && tDigitize < 0.0)
48 throw cms::Exception(
"In QIE8Simulator::run: can't digitize at t < 0");
51 const double dsteps = tstop /
dt;
53 if (dsteps != static_cast<double>(
n))
70 "In QIE8Simulator::run: "
71 "invalid mode of operation");
72 const unsigned runLen =
n + 1
U;
76 for (
unsigned istep = 0; istep < runLen; ++istep, ++hbuf)
77 rhs.
calc(istep *
dt,
nullptr, 0
U, hbuf);
92 for (
unsigned its = 0; its < lenTS; ++its) {
93 const double t0 = tDigitize + its * tsWidth;
95 double t1 =
t0 + tsWidth;
113 throw cms::Exception(
"In QIE8Simulator::preampOutput: please run the simulation first");
123 throw cms::Exception(
"In QIE8Simulator::controlOutput: please run the simulation first");
133 throw cms::Exception(
"In QIE8Simulator::preampPeakTime: please run the simulation first");
136 throw cms::Exception(
"In QIE8Simulator::preampPeakTime: no preamp node in the circuit");
144 "In QIE8Simulator::setInitialConditions: unexpected number "
145 "of initial conditions");
149 for (
unsigned i = 0;
i < sz; ++
i)
155 const unsigned chargeNode,
156 const bool useCubicInterpolation) {
158 throw cms::Exception(
"In QIE8Simulator::setRHS invalid charge collection node");
172 for (
unsigned i = 0;
i < sz; ++
i)
179 throw cms::Exception(
"In QIE8Simulator::validateGain: invalid input gain");
184 throw cms::Exception(
"In QIE8Simulator::lastStopTime: please run the simulation first");
191 "In QIE8Simulator::totalIntegratedCharge: "
192 "please run the simulation first");
virtual void calc(double t, const double *x, unsigned lenX, double *derivative)=0
void truncateCoordinate(unsigned which, double minValue, double maxValue)
double getCharge(const double t) const
virtual unsigned controlNode() const
std::vector< double > initialConditions_
static const unsigned maxlen
void zeroInitialConditions()
double interpolateCoordinate(unsigned which, double t, bool cubic=false) const
double controlOutput(double t) const
virtual unsigned outputNode() const =0
void setRHS(const AbsODERHS &rhs)
double lastStopTime() const
std::vector< double > historyBuffer_
double getPeakTime(unsigned which) const
void setHistory(double dt, const double *data, unsigned dim, unsigned runLen)
void validateGain() const
static double adcTSWidth()
virtual unsigned numberOfNodes() const =0
unsigned run(double dt, double tstop, double tDigitize, double *TS, unsigned lenTS)
double preampOutput(double t) const
const AbsElectronicODERHS & getRHS() const
double totalIntegratedCharge(double t) const
void setRHS(const AbsElectronicODERHS &rhs, unsigned chargeNode, bool interpolateCubic=false)
void run(const double *initialConditions, unsigned lenConditions, double dt, unsigned nSteps)
double preampPeakTime() const
bool integrateToGetCharge_
void setInitialConditions(const double *values, const unsigned len)
AbsElectronicODERHS & modifiableRHS()
static const unsigned invalidNode