-
Notifications
You must be signed in to change notification settings - Fork 32
Allow for different thresholds for OpHitFinder #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
d09f49d
885fe73
4a8cca3
3d534da
9d845cc
a1f9638
af6e19c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,8 @@ namespace pmtana { | |
| const std::string name) | ||
| : PMTPulseRecoBase(name) | ||
| { | ||
|
|
||
| _adc_thres_by_channel = pset.get<bool>("ADCThresholdByChannel", false); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment about default values |
||
| _adc_thres_vector = pset.get<std::vector<float>>("ADCThresVector", {}); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment about default values |
||
| _adc_thres = pset.get<float>("ADCThreshold"); | ||
| _min_width = pset.get<float>("MinWidth"); | ||
| _2nd_thres = pset.get<float>("SecondThreshold"); | ||
|
|
@@ -34,7 +35,7 @@ namespace pmtana { | |
| } | ||
|
|
||
| //--------------------------------------------------------------------------- | ||
| bool AlgoSiPM::RecoPulse(const pmtana::Waveform_t& wf, | ||
| bool AlgoSiPM::RecoPulse(const raw::OpDetWaveform& wf, | ||
| const pmtana::PedestalMean_t& ped_mean, | ||
| const pmtana::PedestalSigma_t& ped_rms) | ||
| { | ||
|
|
@@ -49,6 +50,14 @@ namespace pmtana { | |
| ped_mean | ||
| .front(); //Switch pedestal definition to incoroprate pedestal finder - K.S. 04/18/2019 | ||
|
|
||
| if (_adc_thres_by_channel) { | ||
| uint ChannelNumber = wf.ChannelNumber(); | ||
| if (ChannelNumber >= _adc_thres_vector.size()) | ||
| throw cet::exception("OpHitFinder") | ||
| << "ADC Threshold not found for channel " << ChannelNumber << "\n"; | ||
| _adc_thres = _adc_thres_vector[ChannelNumber]; | ||
| } | ||
|
|
||
| double threshold = _adc_thres; | ||
| threshold += pedestal; | ||
| double pre_threshold = _2nd_thres; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,10 @@ namespace pmtana { | |
| { | ||
| _positive = pset.get<bool>("PositivePolarity", true); | ||
|
|
||
| _adc_thres_by_channel = pset.get<bool>("ADCThresholdByChannel", false); | ||
|
|
||
| _adc_thres_vector = pset.get<std::vector<float>>("ADCThresVector", {}); | ||
|
|
||
|
Comment on lines
+29
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default values |
||
| _adc_thres = pset.get<float>("ADCThreshold"); | ||
|
|
||
| _tail_adc_thres = pset.get<float>("TailADCThreshold", _adc_thres); | ||
|
|
@@ -59,7 +63,7 @@ namespace pmtana { | |
| } | ||
|
|
||
| //*************************************************************** | ||
| bool AlgoSlidingWindow::RecoPulse(const pmtana::Waveform_t& wf, | ||
| bool AlgoSlidingWindow::RecoPulse(const raw::OpDetWaveform& wf, | ||
| const pmtana::PedestalMean_t& mean_v, | ||
| const pmtana::PedestalSigma_t& sigma_v) | ||
| //*************************************************************** | ||
|
|
@@ -87,6 +91,17 @@ namespace pmtana { | |
|
|
||
| Reset(); | ||
|
|
||
| if (_adc_thres_by_channel) { | ||
| uint ChannelNumber = wf.ChannelNumber(); | ||
| if (ChannelNumber >= _adc_thres_vector.size()) | ||
| throw cet::exception("OpHitFinder") | ||
| << "ADC Threshold not found for channel " << ChannelNumber << "\n"; | ||
| _adc_thres = _adc_thres_vector[ChannelNumber]; | ||
| } | ||
|
|
||
| std::cout << " The channel number is " << wf.ChannelNumber() << " and the adc threshold is " | ||
| << _adc_thres << std::endl; | ||
|
|
||
| for (size_t i = 0; i < wf.size(); ++i) { | ||
|
|
||
| double value = 0.; | ||
|
|
@@ -298,4 +313,4 @@ namespace pmtana { | |
| return true; | ||
| } | ||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this module is not using fcl validation, so default fcl values should be avoided. Could these be removed from the producer, and then add the parameters to the default fcl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We suggest a different approach. It looks like two configuration parameters are being used: one that says "use the threshold-by-channel option", and another that says "here are the thresholds by channel". Instead of using two parameters, it is better to use one optional parameter. For example, make this change:
You would then switch to:
If
_peak_thresh_vectoris "engaged" (i.e. there's a value associated with it), then "PeakThreshVector" has been specified in the configuration. If it is not engaged, then there is no configuration parameter present. The check would then look something like: