#include <DuneDPhaseRoiBuildingService.h>
Definition at line 23 of file DuneDPhaseRoiBuildingService_service.cc.
25 m_FltCoeffs( pset.get<std::vector<float>>(
"FltCoeffs") ),
28 const string myname =
"DuneDPhaseRoiBuildingService::ctor: ";
29 pset.get_if_present<
int>(
"LogLevel",
m_LogLevel);
std::vector< float > m_FltCoeffs
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
int DuneDPhaseRoiBuildingService::build |
( |
AdcChannelData & |
data | ) |
const |
|
virtual |
Implements AdcRoiBuildingService.
Definition at line 40 of file DuneDPhaseRoiBuildingService_service.cc.
41 const string myname =
"DuneDPhaseRoiBuildingService:build: ";
42 if (
m_LogLevel >= 2 ) cout << myname <<
"Building ROIs for channel " 58 signal.resize(sigs.size(),
false);
65 <<
" has no samples." <<
endl;
68 for (
AdcIndex isig=0; isig<sigs.size(); ++isig ) {
77 if ( sig > sighigh ) {
87 cout << myname <<
" ROIs before merge (size = " << rois.size() <<
"):" <<
endl;
88 for (
const AdcRoi& roi : rois ) {
89 cout << myname <<
setw(8) << roi.first <<
" " <<
setw(8) << roi.second <<
endl;
92 cout << myname <<
" ROI count before merge: " << data.
rois.size() <<
endl;
94 if ( rois.size() == 0 )
return 0;
96 unsigned int isig1 = 0;
97 unsigned int isig2 = 0;
98 for (
AdcRoi roi : rois ) {
101 for (
unsigned int isig=isig1; isig<isig2; ++isig ) signal[isig] =
true;
102 isig1 = roi.second + 1;
104 if ( isig2 > nsig ) isig2 = nsig;
105 for (
unsigned int isig=isig1; isig<isig2; ++isig ) signal[isig] =
true;
111 cout << myname <<
" ROIs after merge (size = " << rois.size() <<
"):" <<
endl;
112 for (
const AdcRoi& roi : rois ) {
113 cout << myname <<
setw(8) << roi.first <<
" " <<
setw(8) << roi.second <<
endl;
116 cout << myname <<
" ROI count after merge: " << data.
rois.size() <<
endl;
AdcSignalVector getLowFreqFiltered(const AdcSignalVector &adc) const
std::pair< AdcIndex, AdcIndex > AdcRoi
double GetDeconNoise(Channel channel) const override
Q_EXPORT QTSManip setw(int w)
std::vector< AdcRoi > AdcRoiVector
std::vector< bool > AdcFilterVector
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)
Definition at line 123 of file DuneDPhaseRoiBuildingService_service.cc.
126 std::vector< TComplex > ch_spectrum(fft->
FFTSize() / 2 + 1);
127 std::vector< float > ch_waveform(fft->
FFTSize(), 0);
129 size_t n_samples =
adc.size();
132 for (
size_t s = n_samples;
s < ch_waveform.
size(); ++
s)
134 ch_waveform[
s] = ch_waveform[
s-1];
136 fft->
DoFFT(ch_waveform, ch_spectrum);
141 fft->
DoInvFFT(ch_spectrum, ch_waveform);
144 std::copy(ch_waveform.begin(), ch_waveform.begin()+n_samples, flt_out.begin());
std::vector< float > m_FltCoeffs
void DoFFT(std::vector< T > &input, std::vector< TComplex > &output)
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
std::vector< AdcSignal > AdcSignalVector
ostream & DuneDPhaseRoiBuildingService::print |
( |
std::ostream & |
out = std::cout , |
|
|
std::string |
prefix = "" |
|
) |
| const |
|
virtual |
std::vector< float > DuneDPhaseRoiBuildingService::m_FltCoeffs |
|
private |
int DuneDPhaseRoiBuildingService::m_LogLevel |
|
private |
AdcSignal DuneDPhaseRoiBuildingService::m_NSigmaEnd |
|
private |
AdcSignal DuneDPhaseRoiBuildingService::m_NSigmaStart |
|
private |
AdcIndex DuneDPhaseRoiBuildingService::m_PadHigh |
|
private |
AdcIndex DuneDPhaseRoiBuildingService::m_PadLow |
|
private |
bool DuneDPhaseRoiBuildingService::m_UseFilter |
|
private |
The documentation for this class was generated from the following files: