7 : preampOutputCut_(-1.0e100), inputGain_(1.0),
8 outputGain_(1.0), runCount_(0),
10 integrateToGetCharge_(
false),
16 const unsigned chargeNode,
17 const bool interpolateCubic,
18 const double preampOutputCut,
19 const double inputGain,
20 const double outputGain)
31 "In QIE8Simulator constructor: invalid charge collection node");
38 const double tDigitize,
39 double* TS,
const unsigned lenTS)
43 "In QIE8Simulator::run: preamp model is not set");
47 "In QIE8Simulator::run: invalid time step");
50 "In QIE8Simulator::run: invalid stopping time");
53 "In QIE8Simulator::run: can't digitize at t < 0");
56 const double dsteps = tstop/
dt;
58 if (dsteps != static_cast<double>(n))
78 "invalid mode of operation");
79 const unsigned runLen = n + 1
U;
83 for (
unsigned istep=0; istep<runLen; ++istep, ++hbuf)
84 rhs.
calc(istep*dt, 0, 0U, hbuf);
100 for (
unsigned its=0; its<lenTS; ++its)
102 const double t0 = tDigitize + its*tsWidth;
105 double t1 = t0 + tsWidth;
125 "In QIE8Simulator::preampOutput: please run the simulation first");
137 "In QIE8Simulator::controlOutput: please run the simulation first");
148 "In QIE8Simulator::preampPeakTime: please run the simulation first");
151 "In QIE8Simulator::preampPeakTime: no preamp node in the circuit");
156 const double*
values,
const unsigned sz)
160 "In QIE8Simulator::setInitialConditions: unexpected number " 161 "of initial conditions");
166 for (
unsigned i=0;
i<sz; ++
i)
172 const unsigned chargeNode,
173 const bool useCubicInterpolation)
177 "In QIE8Simulator::setRHS invalid charge collection node");
193 for (
unsigned i=0;
i<sz; ++
i)
201 "In QIE8Simulator::validateGain: invalid input gain");
207 "In QIE8Simulator::lastStopTime: please run the simulation first");
214 "In QIE8Simulator::totalIntegratedCharge: " 215 "please run the simulation first");
double preampPeakTime() const
virtual unsigned numberOfNodes() const =0
static const unsigned invalidNode
std::vector< double > initialConditions_
double totalIntegratedCharge(double t) const
bool integrateToGetCharge_
double lastStopTime() const
virtual unsigned outputNode() const =0
static double adcTSWidth()
std::vector< double > historyBuffer_
void setInitialConditions(const double *values, const unsigned len)
double getPeakTime(unsigned which) const
virtual unsigned controlNode() const
const AbsElectronicODERHS & getRHS() const
void validateGain() const
void setRHS(const AbsODERHS &rhs)
virtual void calc(double t, const double *x, unsigned lenX, double *derivative)=0
void setRHS(const AbsElectronicODERHS &rhs, unsigned chargeNode, bool interpolateCubic=false)
AbsElectronicODERHS & modifiableRHS()
double getCharge(const double t) const
double interpolateCoordinate(unsigned which, double t, bool cubic=false) const
void run(const double *initialConditions, unsigned lenConditions, double dt, unsigned nSteps)
double preampOutput(double t) const
void truncateCoordinate(unsigned which, double minValue, double maxValue)
unsigned run(double dt, double tstop, double tDigitize, double *TS, unsigned lenTS)
void zeroInitialConditions()
void setHistory(double dt, const double *data, unsigned dim, unsigned runLen)
static const unsigned maxlen
double controlOutput(double t) const