|
| PDSNoiseFilter (Parameters const &config) |
|
void | produce (art::Event &) |
|
| EDProducer (fhicl::ParameterSet const &pset) |
|
template<typename Config > |
| EDProducer (Table< Config > const &config) |
|
std::string | workerType () const |
|
virtual | ~Producer () noexcept |
|
| Producer (fhicl::ParameterSet const &) |
|
| Producer (Producer const &)=delete |
|
| Producer (Producer &&)=delete |
|
Producer & | operator= (Producer const &)=delete |
|
Producer & | operator= (Producer &&)=delete |
|
void | doBeginJob (SharedResources const &resources) |
|
void | doEndJob () |
|
void | doRespondToOpenInputFile (FileBlock const &fb) |
|
void | doRespondToCloseInputFile (FileBlock const &fb) |
|
void | doRespondToOpenOutputFiles (FileBlock const &fb) |
|
void | doRespondToCloseOutputFiles (FileBlock const &fb) |
|
bool | doBeginRun (RunPrincipal &rp, ModuleContext const &mc) |
|
bool | doEndRun (RunPrincipal &rp, ModuleContext const &mc) |
|
bool | doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
|
bool | doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
|
bool | doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed) |
|
| ~Modifier () noexcept |
|
| Modifier () |
|
| Modifier (Modifier const &)=delete |
|
| Modifier (Modifier &&)=delete |
|
Modifier & | operator= (Modifier const &)=delete |
|
Modifier & | operator= (Modifier &&)=delete |
|
virtual | ~ModuleBase () noexcept |
|
| ModuleBase () |
|
ModuleDescription const & | moduleDescription () const |
|
void | setModuleDescription (ModuleDescription const &) |
|
std::array< std::vector< ProductInfo >, NumBranchTypes > const & | getConsumables () const |
|
void | sortConsumables (std::string const ¤t_process_name) |
|
template<typename T , BranchType BT> |
ViewToken< T > | consumesView (InputTag const &tag) |
|
template<typename T , BranchType BT> |
ViewToken< T > | mayConsumeView (InputTag const &tag) |
|
Definition at line 58 of file PDSNoiseFilter_module.cc.
opdet::PDSNoiseFilter::PDSNoiseFilter |
( |
Parameters const & |
config | ) |
|
Definition at line 95 of file PDSNoiseFilter_module.cc.
103 produces< vector< raw::OpDetWaveform > >(
label);
EDProducer(fhicl::ParameterSet const &pset)
vector< string > fInputLabels
Definition at line 177 of file PDSNoiseFilter_module.cc.
183 Int_t nComp = vec.size();
188 for(Int_t
n=0;
n<nComp ;
n++){
189 if(
n>mobileAVG &&
n<nComp-mobileAVG){
190 for(Int_t i=
n-mobileAVG; i<=
n+mobileAVG; i++){avg = avg + vec[i]; c0=c0+1;}
192 firstFilter[
n] =
avg;
198 for(Int_t i=0; i<=
n+mobileAVG; i++){ avg = avg + vec[i]; c1=c1+1;}
200 firstFilter[
n] =
avg;
204 else if(
n>=nComp-mobileAVG){
205 for(Int_t i=
n-mobileAVG; i<nComp; i++) {avg = avg + vec[i]; c2=c2+1;}
207 firstFilter[
n] =
avg;
void TV1D_denoise(vector< float > input, vector< float > &secondFilter, const int width, const float lambda)
void opdet::PDSNoiseFilter::produce |
( |
art::Event & |
evt | ) |
|
|
virtual |
Implements art::EDProducer.
Definition at line 108 of file PDSNoiseFilter_module.cc.
116 auto wfHandle = evt.
getHandle< vector< raw::OpDetWaveform > >(itag1);
119 if (!wfHandle.isValid()) {
125 vector< raw::OpDetWaveform > in_waveforms = *wfHandle;
128 auto out_waveforms = std::make_unique< vector< raw::OpDetWaveform > >();
131 for (
auto const& in_wave : in_waveforms) {
135 Int_t
nBins = in_wave.size();
136 std::vector<short unsigned int > out_wave(nBins);
137 std::vector<short unsigned int > out_wave_double(nBins);
138 for(Int_t i=0; i<
nBins; i++) out_wave_double[i]=2*in_wave[i];
148 std::vector<float> filtered =
filter(out_wave_double,nBins);
152 for(Int_t i=0; i<
nBins; i++){
153 convert = filtered[i];
154 convert2 = (short) convert + 0.5;
155 out_wave[i] = convert2;
162 raw::OpDetWaveform out_waveFinal(in_wave.TimeStamp(), in_wave.ChannelNumber(), out_wave);
164 out_waveforms->emplace_back(
std::move(out_waveFinal));
Handle< PROD > getHandle(SelectorBase const &) const
def convert(inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False)
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
std::vector< float > filter(std::vector< short unsigned int > vec, Int_t nBins)
vector< string > fInputLabels
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void opdet::PDSNoiseFilter::TV1D_denoise |
( |
vector< float > |
input, |
|
|
vector< float > & |
secondFilter, |
|
|
const int |
width, |
|
|
const float |
lambda |
|
) |
| |
|
private |
Definition at line 225 of file PDSNoiseFilter_module.cc.
229 float umin=lambda, umax=-lambda;
230 float vmin=input[0]-lambda, vmax=input[0]+lambda;
231 int kplus=0, kminus=0;
232 const float twolambda=2.0*lambda;
233 const float minlambda=-lambda;
237 do secondFilter[k0++]=vmin;
while (k0<=kminus);
238 umax=(vmin=input[kminus=k=k0])+(umin=lambda)-vmax;
239 }
else if (umax>0.0) {
240 do secondFilter[k0++]=vmax;
while (k0<=kplus);
241 umin=(vmax=input[kplus=k=k0])+(umax=minlambda)-vmin;
244 do secondFilter[k0++]=vmin;
while(k0<=k);
248 if ((umin+=input[k+1]-vmin)<minlambda) {
249 do secondFilter[k0++]=vmin;
while (k0<=kminus);
250 vmax=(vmin=input[kplus=kminus=k=k0])+twolambda;
251 umin=lambda; umax=minlambda;
252 }
else if ((umax+=input[k+1]-vmax)>lambda) {
253 do secondFilter[k0++]=vmax;
while (k0<=kplus);
254 vmin=(vmax=input[kplus=kminus=k=k0])-twolambda;
255 umin=lambda; umax=minlambda;
259 vmin+=(umin-lambda)/((kminus=k)-k0+1);
262 if (umax<=minlambda) {
263 vmax+=(umax+lambda)/((kplus=k)-k0+1);
string opdet::PDSNoiseFilter::fInputModule |
|
private |
The documentation for this class was generated from the following file: