Skip to content

Commit bf9cddb

Browse files
committed
change exception throw to a warning and skip the decoding on Tingjun's request
1 parent aa33e49 commit bf9cddb

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

sbndcode/Decoders/TPC/SBNDTPCDecoder_module.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ daq::SBNDTPCDecoder::Config::Config(fhicl::ParameterSet const & param) {
101101
void daq::SBNDTPCDecoder::produce(art::Event & event)
102102
{
103103
auto daq_handle = event.getHandle<artdaq::Fragments>(_tag);
104-
if ( !daq_handle.isValid() ) {
105-
throw cet::exception("SBNDTPCDecoder_module ") << " invalid fragment handle";
106-
}
107104

108105
RDPmkr rdpm(event);
109106
TSPmkr tspm(event);
@@ -114,10 +111,17 @@ void daq::SBNDTPCDecoder::produce(art::Event & event)
114111
std::unique_ptr<RDTsAssocs> rdtsassoc_collection(new RDTsAssocs);
115112
std::unique_ptr<std::vector<tpcAnalysis::TPCDecodeAna>> header_collection(new std::vector<tpcAnalysis::TPCDecodeAna>);
116113

117-
for (auto const &rawfrag: *daq_handle) {
118-
process_fragment(event, rawfrag, rawdigit_collection, header_collection, rdpm, tspm, rdts_collection, rdtsassoc_collection);
114+
if ( daq_handle.isValid() ) {
115+
for (auto const &rawfrag: *daq_handle) {
116+
process_fragment(event, rawfrag, rawdigit_collection, header_collection, rdpm, tspm, rdts_collection, rdtsassoc_collection);
117+
}
119118
}
119+
else
120+
{
121+
mf::LogWarning("SBNDTPCDecoder_module") << " Invalid fragment handle: Skipping TPC digit decoding";
122+
}
120123

124+
121125
event.put(std::move(rawdigit_collection));
122126
event.put(std::move(rdts_collection));
123127
event.put(std::move(rdtsassoc_collection));

0 commit comments

Comments
 (0)