Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OpDeconvolutionAlgData:
tool_type: "OpDeconvolutionAlgWienerData"
Debug: false
MaxFFTSizePow: 16
OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data.root"
OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data_OV6.root"
BaseSampleBins: 30
BaseVarCut: 50
SkipChannelList: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ SBNDOpDeconvolution:
SBNDOpDeconvolutionPMT_data: @local::SBNDOpDeconvolution
SBNDOpDeconvolutionPMT_data.PDTypes: ["pmt_coated", "pmt_uncoated"]
SBNDOpDeconvolutionPMT_data.Electronics: [""]
SBNDOpDeconvolutionPMT_data.OpDecoAlg.OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data.root"
SBNDOpDeconvolutionPMT_data.OpDecoAlg.OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data_OV6.root"
#SBNDOpDeconvolutionPMT_data.OpDecoAlg.UseParamFilter: true
#SBNDOpDeconvolutionPMT_data.OpDecoAlg.FilterParams: [0.049, 2] #Freq in GHz
SBNDOpDeconvolutionPMT_data.OpDecoAlg.Filter: "(x>0)*exp(-0.5*pow(x/[0],[1]))" #Gauss filter, remove DC component F(0)=0
SBNDOpDeconvolutionPMT_data.OpDecoAlg.DecoWaveformPrecision: 0.005
SBNDOpDeconvolutionPMT_data.OpDecoAlg.SkipChannelList: [39, 64, 65, 66, 67, 68, 71, 85, 86, 87, 114, 115, 118, 138, 141, 142, 148, 149, 163, 170, 194, 197, 217, 220, 221, 222, 223, 224, 226, 243, 245, 248, 296, 298, 301, 302]



SBNDOpDeconvolutionPMT_data.OpDecoAlg.SkipChannelList: [39, 66, 67, 71, 85, 86, 87, 92, 115, 138, 141, 170, 197, 217, 218, 221, 222, 223, 226, 245, 248, 249, 302]

END_PROLOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ SBNDDecoOpHitFinderPMT_data.RiseTimeCalculator: @local::sbnd_opreco_risetimeca

#HitAlgoPset
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThreshold: 25
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresholdByChannel: true
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresholdVector: [50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 18.0, 35.0, 19.0, 21.0, 19.0, 20.0, 21.0, 27.0, 19.0, 27.0, 21.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 22.0, 19.0, 37.0, 50.0, 20.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 24.0, 19.0, 26.0, 19.0, 12.0, 30.0, 50.0, 25.0, 14.0, 12.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 50.0, 50.0, 50.0, 19.0, 19.0, 24.0, 21.0, 28.0, 19.0, 22.0, 18.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 22.0, 50.0, 19.0, 22.0, 35.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 30.0, 50.0, 20.0, 25.0, 23.0, 32.0, 20.0, 22.0, 20.0, 18.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 23.0, 50.0, 19.0, 25.0, 19.0, 18.0, 19.0, 15.0, 21.0, 24.0, 21.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 20.0, 30.0, 26.0, 18.0, 34.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 27.0, 50.0, 50.0, 21.0, 28.0, 50.0, 50.0, 50.0, 19.0, 19.0, 50.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 19.0, 30.0, 20.0, 18.0, 50.0, 18.0, 19.0, 13.0, 50.0, 25.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 19.0, 25.0, 22.0, 19.0, 29.0, 19.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 22.0, 23.0, 29.0, 19.0, 27.0, 20.0, 25.0, 22.0, 50.0, 19.0, 25.0, 21.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0]
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.NSigmaThreshold: 3.4
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndADCThreshold: 8
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndNSigmaThreshold: 0.2
Expand Down
15 changes: 12 additions & 3 deletions sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ namespace opdet {
std::vector<std::string> _pd_to_use; ///< PDS to use (ex: "pmt", "barepmt")
std::string fElectronics; ///< PDS readouts to use (ex: "CAEN", "Daphne")
std::vector<int> _opch_to_use; ///< List of of opch (will be infered from _pd_to_use)
std::vector<double> fADCThresholdVector; // Vector containing the ADCThreshold to use for each channel
bool fADCThresholdByChannel; // Use an individual ADCThreshold for each channel or not

pmtana::PulseRecoManager fPulseRecoMgr;
pmtana::PMTPulseRecoBase* fThreshAlg;
Expand Down Expand Up @@ -130,7 +132,6 @@ namespace opdet {
_pd_to_use = pset.get< std::vector< std::string > >("PD", _pd_to_use);
fElectronics = pset.get< std::string >("Electronics");
_opch_to_use = this->PDNamesToList(_pd_to_use);

fDaphne_Freq = pset.get< float >("DaphneFreq");
fHitThreshold = pset.get< float >("HitThreshold");
bool useCalibrator = pset.get< bool > ("UseCalibrator", false);
Expand Down Expand Up @@ -163,8 +164,11 @@ namespace opdet {
// Initialize the rise time calculator tool
auto const rise_alg_pset = pset.get_if_present<fhicl::ParameterSet>("RiseTimeCalculator");

// Initialize the hit finder algorithm
auto const hit_alg_pset = pset.get<fhicl::ParameterSet>("HitAlgoPset");
// If we need to apply and individual threshold for each channel, set the algorithm threhsold to the lowest value
auto hit_alg_pset = pset.get<fhicl::ParameterSet>("HitAlgoPset");
fADCThresholdVector = hit_alg_pset.get< std::vector<double>>("ADCThresholdVector", {0});
fADCThresholdByChannel = hit_alg_pset.get< bool>("ADCThresholdByChannel", false);
if(fADCThresholdByChannel) hit_alg_pset.put_or_replace<double>("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end()));
std::string threshAlgName = hit_alg_pset.get<std::string>("Name");
if (threshAlgName == "Threshold")
fThreshAlg = thresholdAlgorithm<pmtana::AlgoThreshold>(hit_alg_pset, rise_alg_pset);
Expand Down Expand Up @@ -318,6 +322,11 @@ namespace opdet {
// Now correct the time. Unfortunately, there are no setter methods for OpHits,
// so we have to make a new OpHit vector.
for (auto h : *HitPtr) {
// Apply individual threshold
int channelNumber = h.OpChannel();
int PeakAmplitude = h.Amplitude();
if(fADCThresholdByChannel && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue;

(*HitPtrFinal).emplace_back(h.OpChannel(),
h.PeakTime() + clockData.TriggerTime(),
h.PeakTimeAbs(),
Expand Down