#include <SubtractBaseline.h>
Definition at line 21 of file SubtractBaseline.h.
Definition at line 17 of file SubtractBaseline_tool.cc.
21 const string myname =
"SubtractBaseline::ctor: ";
23 cout << myname <<
"Parameters:" <<
endl;
static constexpr double ps
QTextStream & endl(QTextStream &s)
SubtractBaseline::~SubtractBaseline |
( |
| ) |
|
|
overridedefault |
Reimplemented from AdcChannelTool.
Definition at line 32 of file SubtractBaseline_tool.cc.
33 const string myname =
"SubtractBaseline::view: ";
40 std::vector<float>
base(nBasePts, 0.);
44 unsigned short nfilld = 0;
45 for(
unsigned short ii = 0; ii < nBasePts; ++ii) {
50 for(
unsigned short bin = loBin;
bin < hiBin; ++
bin) {
52 sum += samples[
bin] * samples[
bin];
55 float var = (sum - fbins * ave * ave) / (fbins - 1.);
64 if(nfilld < nBasePts && nfilld > nBasePts / 2) {
68 unsigned short ii1 = 0;
69 for(
unsigned short ii = 1; ii < nBasePts; ++ii) {
75 unsigned short ii2 = 0;
76 for(
unsigned short ii = ii1 + 1; ii < nBasePts; ++ii) {
84 float slp = (
base[ii2] -
base[ii1]) / (
float)(ii2 - ii1);
91 if(baseOK &&
base[nBasePts] == 0) {
92 unsigned short ii2 = 0;
93 for(
unsigned short ii = nBasePts - 1; ii > 0; --ii) {
100 unsigned short ii1 = 0;
102 for(
unsigned short ii = ii2 - 1; ii > 0; --ii) {
111 float slp = (
base[ii2] -
base[ii1]) / (
float)(ii2 - ii1);
112 base[nBasePts] =
base[ii2] + slp * (nBasePts - ii2);
116 for(
unsigned short ii = 1; ii < nBasePts - 1; ++ii) {
119 for(
unsigned short jj = ii + 1; jj < nBasePts; ++jj) {
121 float slp = (
base[jj] -
base[ii - 1]) / (jj - ii + 1);
132 short bof = m_BaseSampleBins / 2;
133 short lastRegion = 0;
134 for(
unsigned short bin = 0;
bin < samples.size(); ++
bin) {
137 if(region > lastRegion) {
143 samples[
bin] -=
base[region] + (
bin - bof) * slp;
QTextStream & bin(QTextStream &s)
std::vector< AdcSignal > AdcSignalVector
int SubtractBaseline::m_BaseSampleBins |
|
private |
float SubtractBaseline::m_BaseVarCut |
|
private |
int SubtractBaseline::m_LogLevel |
|
private |
The documentation for this class was generated from the following files: