10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
19 #include "art/Utilities/make_tool.h"
46 void produce(art::Event&
e)
override;
68 fInputLabel =
p.get< std::string >(
"InputLabel");
69 fPDTypes =
p.get< std::vector<std::string> >(
"PDTypes");
70 fElectronics =
p.get< std::vector<std::string> >(
"Electronics");
71 fOpDecoAlgPtr = art::make_tool<opdet::OpDeconvolutionAlg>(
p.get< fhicl::ParameterSet >(
"OpDecoAlg") );
73 produces< std::vector< raw::OpDetWaveform > >();
79 art::Handle< std::vector< raw::OpDetWaveform > > wfHandle;
80 e.getByLabel(fInputLabel, wfHandle);
81 if (!wfHandle.isValid()) {
82 mf::LogError(
"SBNDOpDeconvolution")<<
"Input waveforms with input label "<<fInputLabel<<
" couldn't be loaded..."<<std::endl;
83 throw cet::exception(
"SBNDOpDeconvolution") <<
"Input waveforms with input label " << fInputLabel <<
" not found\n";
86 std::vector< raw::OpDetWaveform > RawWfVector;
87 RawWfVector.reserve(wfHandle->size());
89 for(
auto const& wf : *wfHandle){
90 if((std::find(fPDTypes.begin(), fPDTypes.end(), pdsmap.pdType(wf.ChannelNumber()) ) != fPDTypes.end() ) &&
91 (std::find(fElectronics.begin(), fElectronics.end(), pdsmap.electronicsType(wf.ChannelNumber()) ) != fElectronics.end()) ){
92 RawWfVector.push_back(wf);
96 std::unique_ptr< std::vector< raw::OpDetWaveform > > DecoWf_VecPtr(std::make_unique< std::vector< raw::OpDetWaveform > > ());
97 auto & DecoWf_Vec(*DecoWf_VecPtr);
98 DecoWf_Vec = fOpDecoAlgPtr->RunDeconvolution(RawWfVector);
100 e.put( std::move(DecoWf_VecPtr) );
opdet::sbndPDMapAlg pdsmap
SBNDOpDeconvolution & operator=(SBNDOpDeconvolution const &)=delete
SBNDOpDeconvolution(fhicl::ParameterSet const &p)
std::vector< std::string > fPDTypes
BEGIN_PROLOG SBNDOpDeconvolution
std::unique_ptr< opdet::OpDeconvolutionAlg > fOpDecoAlgPtr
std::vector< std::string > fElectronics
void produce(art::Event &e) override