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: [] diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl index 6db9affb0..16f5bb45c 100644 --- a/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl +++ b/sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl @@ -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 diff --git a/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl b/sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl index 036e15d47..02eadf426 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.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 b83aa34fa..866b1b9df 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 fADCThresholdByChannel; // Use an individual ADCThreshold for each channel or not pmtana::PulseRecoManager fPulseRecoMgr; pmtana::PMTPulseRecoBase* fThreshAlg; @@ -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); @@ -163,8 +164,11 @@ 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"); + // 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"); + 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); @@ -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(),