Skip to content

Commit ddae3be

Browse files
committed
Save pedestal and RMS calculation in ChannelInfo object per TPC channel. This enables retrieval of the two metrics from files where the RawDigit object is dropped. These metrics are necessary for identifying the presense of CE noise per-half-board per-event.
1 parent af2cef1 commit ddae3be

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sbndcode/Decoders/TPC/SBNDTPCDecoder_module.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "sbndaq-artdaq-core/Overlays/SBND/NevisTPCFragment.hh"
3535
#include "sbndaq-artdaq-core/Overlays/SBND/NevisTPC/NevisTPCTypes.hh"
3636
#include "sbndaq-artdaq-core/Overlays/SBND/NevisTPC/NevisTPCUtilities.hh"
37+
#include "sbnobj/Common/Analysis/TPCChannelInfo.hh"
3738

3839

3940
DEFINE_ART_MODULE(daq::SBNDTPCDecoder)
@@ -77,6 +78,7 @@ daq::SBNDTPCDecoder::SBNDTPCDecoder(fhicl::ParameterSet const & param):
7778
produces<RawDigits>();
7879
produces<RDTimeStamps>();
7980
produces<RDTsAssocs>();
81+
produces<std::vector<anab::TPCChannelInfo>>();
8082
if (_config.produce_header) {
8183
produces<std::vector<tpcAnalysis::TPCDecodeAna>>();
8284
}
@@ -113,6 +115,7 @@ void daq::SBNDTPCDecoder::produce(art::Event & event)
113115
std::unique_ptr<RawDigits> rawdigit_collection(new RawDigits);
114116
std::unique_ptr<RDTimeStamps> rdts_collection(new RDTimeStamps);
115117
std::unique_ptr<RDTsAssocs> rdtsassoc_collection(new RDTsAssocs);
118+
std::unique_ptr<std::vector<anab::TPCChannelInfo>> channeldata_collection(new std::vector<anab::TPCChannelInfo>);
116119
std::unique_ptr<std::vector<tpcAnalysis::TPCDecodeAna>> header_collection(new std::vector<tpcAnalysis::TPCDecodeAna>);
117120

118121
if ( daq_handle.isValid() ) {
@@ -125,10 +128,16 @@ void daq::SBNDTPCDecoder::produce(art::Event & event)
125128
mf::LogWarning("SBNDTPCDecoder_module") << " Invalid fragment handle: Skipping TPC digit decoding";
126129
}
127130

131+
for (const raw::RawDigit &r: *rawdigit_collection) {
132+
anab::TPCChannelInfo i {r.Channel(), r.GetPedestal(), r.GetSigma()};
133+
channeldata_collection->push_back(i);
134+
}
135+
128136

129137
event.put(std::move(rawdigit_collection));
130138
event.put(std::move(rdts_collection));
131139
event.put(std::move(rdtsassoc_collection));
140+
event.put(std::move(channeldata_collection));
132141

133142
if (_config.produce_header) {
134143
event.put(std::move(header_collection));

0 commit comments

Comments
 (0)