Skip to content

Commit 7d194d7

Browse files
Fix bug
1 parent e617375 commit 7d194d7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SBNDDecoOpHitFinderPMT_data.RiseTimeCalculator: @local::sbnd_opreco_risetimeca
1313
#HitAlgoPset
1414
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThreshold: 25
1515
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresholdByChannel: true
16-
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]
16+
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]
1717
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.NSigmaThreshold: 3.4
1818
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndADCThreshold: 8
1919
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndNSigmaThreshold: 0.2

sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace opdet {
9292
std::string fElectronics; ///< PDS readouts to use (ex: "CAEN", "Daphne")
9393
std::vector<int> _opch_to_use; ///< List of of opch (will be infered from _pd_to_use)
9494
std::vector<double> fADCThresholdVector; // Vector containing the ADCThreshold to use for each channel
95-
bool fUseIndividualHitThreshold; // Use an individual ADCThreshold for each channel or not
95+
bool fADCThresholdByChannel; // Use an individual ADCThreshold for each channel or not
9696

9797
pmtana::PulseRecoManager fPulseRecoMgr;
9898
pmtana::PMTPulseRecoBase* fThreshAlg;
@@ -132,8 +132,6 @@ namespace opdet {
132132
_pd_to_use = pset.get< std::vector< std::string > >("PD", _pd_to_use);
133133
fElectronics = pset.get< std::string >("Electronics");
134134
_opch_to_use = this->PDNamesToList(_pd_to_use);
135-
fADCThresholdVector = pset.get< std::vector<double>>("ADCThresholdVector", {0});
136-
fUseIndividualHitThreshold = pset.get< bool>("UseIndividualHitThreshold", false);
137135
fDaphne_Freq = pset.get< float >("DaphneFreq");
138136
fHitThreshold = pset.get< float >("HitThreshold");
139137
bool useCalibrator = pset.get< bool > ("UseCalibrator", false);
@@ -168,7 +166,9 @@ namespace opdet {
168166

169167
// If we need to apply and individual threshold for each channel, set the algorithm threhsold to the lowest value
170168
auto hit_alg_pset = pset.get<fhicl::ParameterSet>("HitAlgoPset");
171-
if(fUseIndividualHitThreshold) hit_alg_pset.put_or_replace<double>("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end()));
169+
fADCThresholdVector = hit_alg_pset.get< std::vector<double>>("ADCThresholdVector", {0});
170+
fADCThresholdByChannel = hit_alg_pset.get< bool>("ADCThresholdByChannel", false);
171+
if(fADCThresholdByChannel) hit_alg_pset.put_or_replace<double>("ADCThreshold", *min_element(fADCThresholdVector.begin(), fADCThresholdVector.end()));
172172
std::string threshAlgName = hit_alg_pset.get<std::string>("Name");
173173
if (threshAlgName == "Threshold")
174174
fThreshAlg = thresholdAlgorithm<pmtana::AlgoThreshold>(hit_alg_pset, rise_alg_pset);
@@ -325,7 +325,7 @@ namespace opdet {
325325
// Apply individual threshold
326326
int channelNumber = h.OpChannel();
327327
int PeakAmplitude = h.Amplitude();
328-
if(fUseIndividualHitThreshold && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue;
328+
if(fADCThresholdByChannel && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue;
329329

330330
(*HitPtrFinal).emplace_back(h.OpChannel(),
331331
h.PeakTime() + clockData.TriggerTime(),

0 commit comments

Comments
 (0)