All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
opdet::SBNDOpDeconvolution Class Reference
Inheritance diagram for opdet::SBNDOpDeconvolution:

Public Member Functions

 SBNDOpDeconvolution (fhicl::ParameterSet const &p)
 
 SBNDOpDeconvolution (SBNDOpDeconvolution const &)=delete
 
 SBNDOpDeconvolution (SBNDOpDeconvolution &&)=delete
 
SBNDOpDeconvolutionoperator= (SBNDOpDeconvolution const &)=delete
 
SBNDOpDeconvolutionoperator= (SBNDOpDeconvolution &&)=delete
 
void produce (art::Event &e) override
 

Private Attributes

std::string fInputLabel
 
std::vector< std::string > fPDTypes
 
std::vector< std::string > fElectronics
 
std::unique_ptr
< opdet::OpDeconvolutionAlg
fOpDecoAlgPtr
 
opdet::sbndPDMapAlg pdsmap
 

Detailed Description

Definition at line 33 of file SBNDOpDeconvolution_module.cc.

Constructor & Destructor Documentation

opdet::SBNDOpDeconvolution::SBNDOpDeconvolution ( fhicl::ParameterSet const &  p)
explicit

Definition at line 62 of file SBNDOpDeconvolution_module.cc.

63  : EDProducer{p} // ,
64  // More initializers here.
65 {
66  // Call appropriate produces<>() functions here.
67  // Call appropriate consumes<>() for any products to be retrieved by this module.
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") );
72 
73  produces< std::vector< raw::OpDetWaveform > >();
74 }
pdgs p
Definition: selectors.fcl:22
std::vector< std::string > fPDTypes
std::unique_ptr< opdet::OpDeconvolutionAlg > fOpDecoAlgPtr
std::vector< std::string > fElectronics
opdet::SBNDOpDeconvolution::SBNDOpDeconvolution ( SBNDOpDeconvolution const &  )
delete
opdet::SBNDOpDeconvolution::SBNDOpDeconvolution ( SBNDOpDeconvolution &&  )
delete

Member Function Documentation

SBNDOpDeconvolution& opdet::SBNDOpDeconvolution::operator= ( SBNDOpDeconvolution const &  )
delete
SBNDOpDeconvolution& opdet::SBNDOpDeconvolution::operator= ( SBNDOpDeconvolution &&  )
delete
void opdet::SBNDOpDeconvolution::produce ( art::Event &  e)
override

Definition at line 76 of file SBNDOpDeconvolution_module.cc.

77 {
78  //Load the waveforms
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";
84  }
85 
86  std::vector< raw::OpDetWaveform > RawWfVector;
87  RawWfVector.reserve(wfHandle->size());
88 
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);
93  }
94  }
95 
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);
99 
100  e.put( std::move(DecoWf_VecPtr) );
101 
102 }
std::vector< std::string > fPDTypes
std::unique_ptr< opdet::OpDeconvolutionAlg > fOpDecoAlgPtr
std::vector< std::string > fElectronics
std::string electronicsType(size_t ch) const
do i e
std::string pdType(size_t ch) const override

Member Data Documentation

std::vector<std::string> opdet::SBNDOpDeconvolution::fElectronics
private

Definition at line 54 of file SBNDOpDeconvolution_module.cc.

std::string opdet::SBNDOpDeconvolution::fInputLabel
private

Definition at line 52 of file SBNDOpDeconvolution_module.cc.

std::unique_ptr<opdet::OpDeconvolutionAlg> opdet::SBNDOpDeconvolution::fOpDecoAlgPtr
private

Definition at line 56 of file SBNDOpDeconvolution_module.cc.

std::vector<std::string> opdet::SBNDOpDeconvolution::fPDTypes
private

Definition at line 53 of file SBNDOpDeconvolution_module.cc.

opdet::sbndPDMapAlg opdet::SBNDOpDeconvolution::pdsmap
private

Definition at line 58 of file SBNDOpDeconvolution_module.cc.


The documentation for this class was generated from the following file: