#include <InterpolatingAdcMitigationService.h>
Definition at line 15 of file InterpolatingAdcMitigationService_service.cc.
17 const string myname =
"InterpolatingAdcMitigationService::ctor: ";
18 pset.get_if_present<
int>(
"LogLevel",
m_LogLevel);
int m_MaxConsecutiveSamples
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
std::ostream & InterpolatingAdcMitigationService::print |
( |
std::ostream & |
out = std::cout , |
|
|
std::string |
prefix = "" |
|
) |
| const |
|
virtual |
int InterpolatingAdcMitigationService::update |
( |
AdcChannelData & |
data | ) |
const |
|
virtual |
Implements AdcMitigationService.
Definition at line 29 of file InterpolatingAdcMitigationService_service.cc.
30 const string myname =
"InterpolatingAdcMitigationService:update: ";
32 cout << myname <<
"Entering..." <<
endl;
33 cout << myname <<
" Channel: " << data.
channel() <<
endl;
34 cout << myname <<
"Input vector size: " << data.
samples.size() <<
endl;
38 unsigned int isigFirst = sigs.size();
41 unsigned int nupdated = 0;
43 for (
unsigned int isig=0; isig<sigs.size(); ++isig ) {
45 unsigned int isLast = isig == sigs.size()-1;
54 if ( isBad && isigFirst > isig ) isigFirst = isig;
58 bool endBadSequence =
false;
59 unsigned int isigLast = 0;
60 if ( !isBad && isigFirst < isig ) {
61 endBadSequence =
true;
64 if ( isLast && isBad ) {
65 endBadSequence =
true;
69 if ( endBadSequence ) {
70 unsigned int nsig = isigLast - isigFirst + 1;
71 bool tooMany = useMax && nsig > maxsig;
73 cout << myname <<
" Updating at sample " << isig <<
":" 74 <<
" range=[" << isigFirst <<
"," << isigLast <<
"]," 75 <<
" tooMany=" << tooMany <<
", isLast=" << isLast <<
endl;
78 if ( tooMany || isigFirst == 0 || isLast ) {
80 for (
unsigned isig=isigFirst; isig<=isigLast; ++isig ) {
88 unsigned int isig1 = isigFirst - 1;
89 unsigned int isig2 = isigLast + 1;
90 double sig1 = sigs[isig1];
91 double sig2 = sigs[isigLast+1];
92 double fac = 1.0/(isig2 - isig1);
93 double a = fac*(sig2 - sig1);
94 double b = fac*(isig2*sig1 - isig1*sig2);
95 for (
unsigned isig=isigFirst; isig<=isigLast; ++isig ) {
96 sigs[isig] = a*isig +
b;
101 isigFirst = sigs.size();
105 <<
": # updated/total = " << nupdated <<
"/" << sigs.size() <<
endl;
std::vector< AdcFlag > AdcFlagVector
const AdcFlag AdcUnderflow
const AdcFlag AdcSetFixed
const AdcFlag AdcOverflow
int m_MaxConsecutiveSamples
const AdcFlag AdcInterpolated
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)
int InterpolatingAdcMitigationService::m_LogLevel |
|
private |
int InterpolatingAdcMitigationService::m_MaxConsecutiveFlag |
|
private |
int InterpolatingAdcMitigationService::m_MaxConsecutiveSamples |
|
private |
bool InterpolatingAdcMitigationService::m_SkipOverflows |
|
private |
bool InterpolatingAdcMitigationService::m_SkipUnderflows |
|
private |
The documentation for this class was generated from the following files: