From 0b78afff3561caf5a5f4e7dfdff233e7df2e65d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez=20Castillo?= Date: Wed, 12 Feb 2025 03:52:59 -0600 Subject: [PATCH 1/5] Change data file to new calibration --- .../OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbndcode/OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl index 05c2c5ef6..fb1f68deb 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl @@ -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: [] From 52eeb15c29015939e893c196a9b3e65294d23c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez=20Castillo?= Date: Wed, 12 Feb 2025 05:19:36 -0600 Subject: [PATCH 2/5] Allow channel dependent threshold for OpHitFinder --- sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc index b83aa34fa..3eb9fa35e 100644 --- a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc +++ b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc @@ -91,6 +91,8 @@ namespace opdet { std::vector _pd_to_use; ///< PDS to use (ex: "pmt", "barepmt") std::string fElectronics; ///< PDS readouts to use (ex: "CAEN", "Daphne") std::vector _opch_to_use; ///< List of of opch (will be infered from _pd_to_use) + std::vector fADCThresholdVector; // Vector containing the ADCThreshold to use for each channel + bool fUseIndividualHitThreshold; // Use an individual ADCThreshold for each channel or not pmtana::PulseRecoManager fPulseRecoMgr; pmtana::PMTPulseRecoBase* fThreshAlg; @@ -130,7 +132,8 @@ 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); - + fADCThresholdVector = pset.get< std::vector>("ADCThresholdVector", {0}); + fUseIndividualHitThreshold = pset.get< bool>("UseIndividualHitThreshold", false); fDaphne_Freq = pset.get< float >("DaphneFreq"); fHitThreshold = pset.get< float >("HitThreshold"); bool useCalibrator = pset.get< bool > ("UseCalibrator", false); @@ -166,6 +169,8 @@ namespace opdet { // Initialize the hit finder algorithm auto const hit_alg_pset = pset.get("HitAlgoPset"); std::string threshAlgName = hit_alg_pset.get("Name"); + auto hit_alg_pset = pset.get("HitAlgoPset"); + if(fUseIndividualHitThreshold) hit_alg_pset.put_or_replace("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end())); if (threshAlgName == "Threshold") fThreshAlg = thresholdAlgorithm(hit_alg_pset, rise_alg_pset); else if (threshAlgName == "SiPM") @@ -318,6 +323,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(fUseIndividualHitThreshold && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue; + (*HitPtrFinal).emplace_back(h.OpChannel(), h.PeakTime() + clockData.TriggerTime(), h.PeakTimeAbs(), From e617375b5e094c8e690334cc695672c60ed507e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez=20Castillo?= Date: Wed, 12 Feb 2025 05:30:20 -0600 Subject: [PATCH 3/5] Update fcl --- .../OpDeconvolution/job/opdeconvolution_sbnd_data.fcl | 5 +---- .../OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl | 2 ++ sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl index 6db9affb0..6f57b425e 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl @@ -19,9 +19,6 @@ SBNDOpDeconvolutionPMT_data.OpDecoAlg.OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_d #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 diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl index 036e15d47..7b2262661 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl @@ -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.ADCThresVector: [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 diff --git a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc index 3eb9fa35e..d04cad318 100644 --- a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc +++ b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc @@ -166,11 +166,10 @@ namespace opdet { // Initialize the rise time calculator tool auto const rise_alg_pset = pset.get_if_present("RiseTimeCalculator"); - // Initialize the hit finder algorithm - auto const hit_alg_pset = pset.get("HitAlgoPset"); - std::string threshAlgName = hit_alg_pset.get("Name"); + // 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("HitAlgoPset"); if(fUseIndividualHitThreshold) hit_alg_pset.put_or_replace("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end())); + std::string threshAlgName = hit_alg_pset.get("Name"); if (threshAlgName == "Threshold") fThreshAlg = thresholdAlgorithm(hit_alg_pset, rise_alg_pset); else if (threshAlgName == "SiPM") From 7d194d73179dc8c9d2b16f9bd85a51648b1234fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez=20Castillo?= Date: Wed, 12 Feb 2025 06:06:10 -0600 Subject: [PATCH 4/5] Fix bug --- .../OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl | 2 +- sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl index 7b2262661..02eadf426 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl @@ -13,7 +13,7 @@ SBNDDecoOpHitFinderPMT_data.RiseTimeCalculator: @local::sbnd_opreco_risetimeca #HitAlgoPset SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThreshold: 25 SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresholdByChannel: true -SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresVector: [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.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 diff --git a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc index d04cad318..866b1b9df 100644 --- a/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc +++ b/sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc @@ -92,7 +92,7 @@ namespace opdet { std::string fElectronics; ///< PDS readouts to use (ex: "CAEN", "Daphne") std::vector _opch_to_use; ///< List of of opch (will be infered from _pd_to_use) std::vector fADCThresholdVector; // Vector containing the ADCThreshold to use for each channel - bool fUseIndividualHitThreshold; // Use an individual ADCThreshold for each channel or not + bool fADCThresholdByChannel; // Use an individual ADCThreshold for each channel or not pmtana::PulseRecoManager fPulseRecoMgr; pmtana::PMTPulseRecoBase* fThreshAlg; @@ -132,8 +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); - fADCThresholdVector = pset.get< std::vector>("ADCThresholdVector", {0}); - fUseIndividualHitThreshold = pset.get< bool>("UseIndividualHitThreshold", false); fDaphne_Freq = pset.get< float >("DaphneFreq"); fHitThreshold = pset.get< float >("HitThreshold"); bool useCalibrator = pset.get< bool > ("UseCalibrator", false); @@ -168,7 +166,9 @@ namespace opdet { // 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("HitAlgoPset"); - if(fUseIndividualHitThreshold) hit_alg_pset.put_or_replace("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end())); + fADCThresholdVector = hit_alg_pset.get< std::vector>("ADCThresholdVector", {0}); + fADCThresholdByChannel = hit_alg_pset.get< bool>("ADCThresholdByChannel", false); + if(fADCThresholdByChannel) hit_alg_pset.put_or_replace("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end())); std::string threshAlgName = hit_alg_pset.get("Name"); if (threshAlgName == "Threshold") fThreshAlg = thresholdAlgorithm(hit_alg_pset, rise_alg_pset); @@ -325,7 +325,7 @@ namespace opdet { // Apply individual threshold int channelNumber = h.OpChannel(); int PeakAmplitude = h.Amplitude(); - if(fUseIndividualHitThreshold && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue; + if(fADCThresholdByChannel && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue; (*HitPtrFinal).emplace_back(h.OpChannel(), h.PeakTime() + clockData.TriggerTime(), From da7c67d4b8fbd70e7f3cca9d7d10485f9d83ae3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez=20Castillo?= Date: Wed, 12 Feb 2025 08:03:53 -0600 Subject: [PATCH 5/5] Fix bug with fcl configuration --- .../OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl index 6f57b425e..16f5bb45c 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl @@ -14,7 +14,7 @@ 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