Skip to content

Commit a625eb4

Browse files
Merge pull request #633 from SBNSoftware/feature/acastill_newPMTCalibration
Feature/acastill new pmt calibration
2 parents c6f911b + b6cc289 commit a625eb4

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

sbndcode/OpDetReco/OpDeconvolution/Alg/opdeconvolution_alg_data.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OpDeconvolutionAlgData:
66
tool_type: "OpDeconvolutionAlgWienerData"
77
Debug: false
88
MaxFFTSizePow: 16
9-
OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data.root"
9+
OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data_OV6.root"
1010
BaseSampleBins: 30
1111
BaseVarCut: 50
1212
SkipChannelList: []

sbndcode/OpDetReco/OpDeconvolution/job/opdeconvolution_sbnd_data.fcl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ SBNDOpDeconvolution:
1414
SBNDOpDeconvolutionPMT_data: @local::SBNDOpDeconvolution
1515
SBNDOpDeconvolutionPMT_data.PDTypes: ["pmt_coated", "pmt_uncoated"]
1616
SBNDOpDeconvolutionPMT_data.Electronics: [""]
17-
SBNDOpDeconvolutionPMT_data.OpDecoAlg.OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data.root"
17+
SBNDOpDeconvolutionPMT_data.OpDecoAlg.OpDetDataFile: "./OpDetSim/digi_pmt_sbnd_data_OV6.root"
1818
#SBNDOpDeconvolutionPMT_data.OpDecoAlg.UseParamFilter: true
1919
#SBNDOpDeconvolutionPMT_data.OpDecoAlg.FilterParams: [0.049, 2] #Freq in GHz
2020
SBNDOpDeconvolutionPMT_data.OpDecoAlg.Filter: "(x>0)*exp(-0.5*pow(x/[0],[1]))" #Gauss filter, remove DC component F(0)=0
2121
SBNDOpDeconvolutionPMT_data.OpDecoAlg.DecoWaveformPrecision: 0.005
22-
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]
23-
24-
25-
22+
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]
2623

2724
END_PROLOG

sbndcode/OpDetReco/OpDeconvolution/job/sbnd_ophitfinder_deco_data.fcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ SBNDDecoOpHitFinderPMT_data.RiseTimeCalculator: @local::sbnd_opreco_risetimeca
1212

1313
#HitAlgoPset
1414
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThreshold: 25
15+
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.ADCThresholdByChannel: true
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]
1517
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.NSigmaThreshold: 3.4
1618
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndADCThreshold: 8
1719
SBNDDecoOpHitFinderPMT_data.HitAlgoPset.EndNSigmaThreshold: 0.2

sbndcode/OpDetReco/OpHit/SBNDOpHitFinder_module.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ namespace opdet {
9191
std::vector<std::string> _pd_to_use; ///< PDS to use (ex: "pmt", "barepmt")
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)
94+
std::vector<double> fADCThresholdVector; // Vector containing the ADCThreshold to use for each channel
95+
bool fADCThresholdByChannel; // Use an individual ADCThreshold for each channel or not
9496

9597
pmtana::PulseRecoManager fPulseRecoMgr;
9698
pmtana::PMTPulseRecoBase* fThreshAlg;
@@ -130,7 +132,6 @@ namespace opdet {
130132
_pd_to_use = pset.get< std::vector< std::string > >("PD", _pd_to_use);
131133
fElectronics = pset.get< std::string >("Electronics");
132134
_opch_to_use = this->PDNamesToList(_pd_to_use);
133-
134135
fDaphne_Freq = pset.get< float >("DaphneFreq");
135136
fHitThreshold = pset.get< float >("HitThreshold");
136137
bool useCalibrator = pset.get< bool > ("UseCalibrator", false);
@@ -163,8 +164,11 @@ namespace opdet {
163164
// Initialize the rise time calculator tool
164165
auto const rise_alg_pset = pset.get_if_present<fhicl::ParameterSet>("RiseTimeCalculator");
165166

166-
// Initialize the hit finder algorithm
167-
auto const hit_alg_pset = pset.get<fhicl::ParameterSet>("HitAlgoPset");
167+
// If we need to apply and individual threshold for each channel, set the algorithm threhsold to the lowest value
168+
auto hit_alg_pset = pset.get<fhicl::ParameterSet>("HitAlgoPset");
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()));
168172
std::string threshAlgName = hit_alg_pset.get<std::string>("Name");
169173
if (threshAlgName == "Threshold")
170174
fThreshAlg = thresholdAlgorithm<pmtana::AlgoThreshold>(hit_alg_pset, rise_alg_pset);
@@ -318,6 +322,11 @@ namespace opdet {
318322
// Now correct the time. Unfortunately, there are no setter methods for OpHits,
319323
// so we have to make a new OpHit vector.
320324
for (auto h : *HitPtr) {
325+
// Apply individual threshold
326+
int channelNumber = h.OpChannel();
327+
int PeakAmplitude = h.Amplitude();
328+
if(fADCThresholdByChannel && (PeakAmplitude < fADCThresholdVector[channelNumber]) ) continue;
329+
321330
(*HitPtrFinal).emplace_back(h.OpChannel(),
322331
h.PeakTime() + clockData.TriggerTime(),
323332
h.PeakTimeAbs(),

0 commit comments

Comments
 (0)