32 for (
unsigned int i = 0; i < shape.
nPoints(); i++) {
44 for (
unsigned int i = 0; i < shapeInfo.
nPoints(); i++) {
45 if (samplingTimeOnly && shapeInfo.
phase(i) != 0)
continue;
65 for (
unsigned int i = 0; i <
nPoints(); i++) {
76 std::vector<double>
values, errors;
77 for (
unsigned int k = 0; k <
nPoints(); ++k) {
79 int pb = other.interpolate(
time(k) - shift, val, err);
80 if (pb != 0) val = err = 0;
83 errors.push_back(TMath::Sqrt(TMath::Power(this->
error(k),2) + TMath::Power(scale*err, 2)));
108 TH1D*
h =
new TH1D(name, title,
nPoints() + 2, xMin, xMax);
109 h->GetXaxis()->SetTitle(timeInUnitOfSamples ?
"Sample Index" :
"Time (ns)");
110 h->GetYaxis()->SetTitle(
"ADC counts");
111 h->GetYaxis()->SetTitleOffset(1.1);
112 h->SetMarkerStyle(20);
115 for (
unsigned int i = 0; i <
nPoints(); i++) {
116 h->SetBinContent(i + 2,
value(i));
131 if (!sum)
return false;
139 if (!s1)
return false;
virtual unsigned int nPoints() const =0
virtual double time(unsigned int i) const =0
TVectorD values(int lwb, int upb) const
virtual double error(unsigned int i) const
virtual double value(unsigned int i) const =0
int interpolateDiff(double time, double &diff) const
unsigned char phase(unsigned int i) const
double value(unsigned int i) const
unsigned int nPoints() const
unsigned int nIntervals() const
bool add(unsigned int k, double value, double error)
TH1D * histogram(const char *name="shape", const char *title="", bool timeInUnitOfSamples=false) const
unsigned int nPoints() const
SimpleShape(const std::vector< double > &values, const std::vector< double > &errors, double timeInterval=25, double startTime=0)
Constructor.
double timeInterval() const
SimpleShape * diff() const
std::vector< double > m_errors
static bool scaleAndShift(std::unique_ptr< SimpleShape > &s1, double scale, double shift=0)
SimpleShape * createEmpty() const
double time(unsigned int i) const
std::vector< double > m_values
double value(unsigned int i) const
static const unsigned int samplingInterval