Public Member Functions | Private Member Functions | Private Attributes | List of all members
filter::ADCFilter Class Reference
Inheritance diagram for filter::ADCFilter:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 ADCFilter (fhicl::ParameterSet const &)
 
- Public Member Functions inherited from art::EDFilter
 EDFilter (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDFilter (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Filter
virtual ~Filter () noexcept
 
 Filter (fhicl::ParameterSet const &)
 
 Filter (Filter const &)=delete
 
 Filter (Filter &&)=delete
 
Filteroperator= (Filter const &)=delete
 
Filteroperator= (Filter &&)=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 &)
 
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)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
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 &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

bool filter (art::Event &evt)
 

Private Attributes

std::string fDigitModuleLabel
 
double fMinADC
 

Additional Inherited Members

- Public Types inherited from art::EDFilter
using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
- Public Types inherited from art::detail::Filter
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Attributes inherited from art::detail::Filter
static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 30 of file ADCFilter_module.cc.

Constructor & Destructor Documentation

filter::ADCFilter::ADCFilter ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 44 of file ADCFilter_module.cc.

45  : EDFilter{pset}
46  {
47  fDigitModuleLabel = pset.get< std::string > ("DigitModuleLabel");
48  fMinADC = pset.get< double > ("MinADC");
49  }
std::string fDigitModuleLabel
std::string string
Definition: nybbler.cc:12
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:21

Member Function Documentation

bool filter::ADCFilter::filter ( art::Event evt)
privatevirtual

Implements art::EDFilter.

Definition at line 52 of file ADCFilter_module.cc.

53  {
54  //Read in raw data
55  art::View<raw::RawDigit> rawdigitView;
56  evt.getView(fDigitModuleLabel, rawdigitView);
57 
58  if(!rawdigitView.size()) return false;
59 
60  lariov::ChannelStatusProvider const& channelFilter
62 
63  // look through the good channels
64 // for(const raw::RawDigit* digit: filter::SelectGoodChannels(rawdigitView))
65  for(const raw::RawDigit* digit: rawdigitView)
66  {
67  if (!channelFilter.IsGood(digit->Channel())) continue;
68  //get ADC values after decompressing
69  std::vector<short> rawadc(digit->Samples());
70  raw::Uncompress(digit->ADCs(),rawadc,digit->Compression());
71  short max = *std::max_element(rawadc.begin(),rawadc.end()) - digit->GetPedestal();
72  if(max>=fMinADC) return true;//found one ADC value above threshold, pass filter
73  }
74 
75  return false;//didn't find ADC above threshold
76 
77  }
std::string fDigitModuleLabel
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
virtual bool IsGood(raw::ChannelID_t channel) const
Returns whether the specified channel is physical and good.
Definition: fwd.h:46
Class providing information about the quality of channels.
static int max(int a, int b)
auto size() const noexcept
Definition: View.h:119
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:776

Member Data Documentation

std::string filter::ADCFilter::fDigitModuleLabel
private

Definition at line 39 of file ADCFilter_module.cc.

double filter::ADCFilter::fMinADC
private

Definition at line 40 of file ADCFilter_module.cc.


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