#include <BaselineDetrend.h>
Definition at line 45 of file BaselineDetrend.h.
Definition at line 18 of file BaselineDetrend_tool.cc.
22 m_Pad(
ps.get<
unsigned>(
"Pad") ),
26 const string myname =
"BaselineDetrend::ctor: ";
29 cout<<myname<<
"Threshold to drop samples from average "<<
m_Thresh<<
endl;
30 cout<<myname<<
"Number of ticks to pad around signals above threshold "<<
m_Pad<<
endl;
31 cout<<myname<<
"Min fraction of pedestal samples for detrending "<<
m_MinFrac<<
endl;
32 cout<<myname<<
"LOWESS span parameter "<<
m_Span<<
endl;
35 m_GS =
new TGraphSmooth(
"smoother" );
static constexpr double ps
QTextStream & endl(QTextStream &s)
BaselineDetrend::~BaselineDetrend |
( |
| ) |
|
|
override |
Definition at line 74 of file BaselineDetrend_tool.cc.
77 const string myname =
"BaselineDetrend::Smoother: ";
81 if( !pedidx.empty() ){
86 for(
unsigned i = 0; i <
data.size(); ++i ){
90 while( !idx.empty() ){
91 if( count >=
m_Pad )
break;
93 if( (
int)idx.back() != ((
int)i - (
int)
count) )
break;
100 for(
unsigned j = i+1; j <
data.size(); ++j ){
102 if( count >=
m_Pad ) {
120 cout<<myname<<
"number of baseline samples is too low\n";
126 TGraph gin( idx.size() );
127 for(
unsigned i=0; i<idx.size(); ++i ){
128 gin.SetPoint(i, idx[i],
data[idx[i]] );
132 auto gout =
m_GS->SmoothLowess(&gin,
"",
m_Span);
135 gout->SetBit(TGraph::kIsSortedX);
138 unsigned nidx = idx.size();
139 for(
unsigned i = 0; i<nidx; ++i ){
140 unsigned ii = idx[i];
142 gout->GetPoint(i, x, y);
148 for(
unsigned j=0;j<ii;++j)
149 trend[j] = gout->Eval( j );
152 else if( i == nidx - 1 ) {
153 unsigned iii =
data.size() - 1;
155 for(
unsigned j=ii;j<=iii;++j)
156 trend[j] = gout->Eval( j );
160 unsigned iii = idx[i-1];
161 if( (ii - iii ) > 1 ){
162 for(
unsigned j=iii;j<ii;++j)
163 trend[j] = gout->Eval( j );
std::vector< AdcSignal > AdcSignalVector
Reimplemented from AdcChannelTool.
Definition at line 44 of file BaselineDetrend_tool.cc.
48 vector<unsigned> pedidx;
52 for(
unsigned i=0; i<data.size(); ++i ){
53 if( sig[i] )
continue;
54 pedidx.push_back( i );
59 auto trend =
Smoother( data, pedidx );
62 for(
size_t i=0;i<data.size();++i){
AdcSignalVector Smoother(const AdcSignalVector &data, const std::vector< unsigned > &pedidx) const
std::vector< AdcSignal > AdcSignalVector
TGraphSmooth* BaselineDetrend::m_GS |
|
private |
int BaselineDetrend::m_LogLevel |
|
private |
float BaselineDetrend::m_MinFrac |
|
private |
unsigned BaselineDetrend::m_Pad |
|
private |
float BaselineDetrend::m_Span |
|
private |
float BaselineDetrend::m_Thresh |
|
private |
bool BaselineDetrend::m_UseBasicROI |
|
private |
The documentation for this class was generated from the following files: