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

Public Member Functions

 ADCFilter (fhicl::ParameterSet const &)
 

Private Member Functions

bool filter (art::Event &evt)
 

Private Attributes

std::string fDigitModuleLabel
 
double fMinADC
 

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

Member Function Documentation

bool filter::ADCFilter::filter ( art::Event &  evt)
private

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
61  = art::ServiceHandle<lariov::ChannelStatusService const>()->GetProvider();
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.
Class providing information about the quality of channels.
TCEvent evt
Definition: DataStructs.cxx:8
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: