12#include "TGraphErrors.h"
33 for (
unsigned int i = 0; i <
nPoints(); i++) {
34 double val =
value(i) + (withErrors ?
error(i) : 0);
44 for (
unsigned int i = 0; i <
nPoints(); i++) {
45 double val =
value(i) - (withErrors ?
error(i) : 0);
56 for (
unsigned int i = 0; i <
nPoints(); i++)
65 for (
unsigned int i = 0; i <
nPoints(); i++)
73 if (t <
time(0))
return -1;
76 for (
unsigned int i = 0; i <
nPoints() - 1; i++)
77 if (
time(i) <= t && t <
time(i+1))
return i;
120 if (i1 > 1 && i1 <
int(
nPoints()) - 2)
137 if (lwb < 0) lwb = 0;
138 if (upb < 0) upb = (int)
nPoints() - 1;
140 TVectorD vals(lwb, upb);
141 for (
int i = lwb; i <= upb; i++)
149 if (lwb < 0) lwb = 0;
150 if (upb < 0) upb = other.nPoints() - 1;
151 values.ResizeTo(lwb, upb);
152 errors.ResizeTo(lwb, upb, lwb, upb);
153 int actualLwb = -1, actualUpb = upb;
154 for (
int i = lwb; i <= upb; i++) {
157 if (stat == 0 && actualLwb < 0) actualLwb = i;
158 if (stat == +1) { actualUpb = i - 1;
break; }
160 errors(i, i) = err*err;
162 values.ResizeTo(actualLwb, actualUpb);
163 errors.ResizeTo(actualLwb, actualUpb, actualLwb, actualUpb);
164 return (actualLwb >= 0);
170 if (lwb < 0) lwb = 0;
171 if (upb < 0) upb = other.nPoints() - 1;
172 diffs.ResizeTo(lwb, upb);
173 int actualLwb = -1, actualUpb = upb;
174 for (
int i = lwb; i <= upb; i++) {
177 if (stat == 0 && actualLwb < 0) actualLwb = i;
178 if (stat == +1) { actualUpb = i - 1;
break; }
181 diffs.ResizeTo(actualLwb, actualUpb);
182 return (actualLwb >= 0);
190 for (
unsigned int i = 0; i <
nPoints(); i++) {
200 bool withCorrs)
const
202 if (lwb < 0 || upb < 0) { lwb = 0; upb =
nPoints() - 1; }
204 for (
int i = lwb; i <= upb; i++) {
205 for (
int j = lwb; j <= upb; j++) {
206 double cov = (withCorrs || i == j ?
covariance(i, j) : 0);
207 if (refErr.GetNrows() > 0) cov += refErr(i, j);
217 bool withCorrs)
const
224 bool withCorrs)
const
231 bool withCorrs)
const
239 std::vector<double>
values, errors;
242 double dT = (t1 -
t0)/nPts;
244 for (
unsigned int i = 0; i < nPts; i++, t += dT) {
247 if (
inRange != 0)
return nullptr;
249 errors.push_back(err);
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
int findTimeInterval(double time) const
virtual unsigned int nPoints() const =0
virtual double time(unsigned int i) const =0
TVectorD values(int lwb, int upb) const
CovMatrix invCovarianceMatrix(int lwb=-1, int upb=-1, const CovMatrix &refErr=CovMatrix(), bool withCorrs=true) const
virtual double error(unsigned int i) const
virtual double value(unsigned int i) const =0
TGraphErrors * graph(bool timeInUnitOfSamples=false) const
SimpleShape * resample(unsigned int nPts) const
double minValue(bool withErrors=false) const
double maxValue(bool withErrors=false) const
CovMatrix covarianceMatrix(int lwb=-1, int upb=-1, const CovMatrix &refErr=CovMatrix(), bool withCorrs=true) const
virtual double covariance(unsigned int i, unsigned int j) const =0
int interpolate(double time, double &value, double &error) const
int interpolateDiff(double time, double &diff) const
TMatrixTSym< double > CovMatrix
static const unsigned int samplingInterval