14 #include "art/Framework/Core/EDProducer.h"
15 #include "art/Framework/Core/ModuleMacros.h"
16 #include "art/Framework/Principal/Event.h"
17 #include "art/Framework/Principal/Handle.h"
18 #include "fhiclcpp/ParameterSet.h"
44 DEFINE_ART_MODULE(OpticalRawDigitReformatter)
55 fInputModule = pset.get<std::string>(
"InputModule");
56 fGenModule = pset.get<std::string>(
"GenModule");
58 CategoryLabels.push_back(
"Undefined");
59 CategoryLabels.push_back(
"HighGain");
60 CategoryLabels.push_back(
"LowGain");
61 CategoryLabels.push_back(
"LogicPulse");
62 CategoryLabels.push_back(
"FEMCosmicHighGain");
63 CategoryLabels.push_back(
"FEMCosmicLowGain");
64 CategoryLabels.push_back(
"FEMCosmicLogicPulse");
65 CategoryLabels.push_back(
"FEMBeamHighGain");
66 CategoryLabels.push_back(
"FEMBeamLowGain");
67 CategoryLabels.push_back(
"FEMBeamLogicPulse");
68 CategoryLabels.push_back(
"BeamPMTTrigger");
69 CategoryLabels.push_back(
"CosmicPMTTrigger");
72 for (
auto label : CategoryLabels)
73 produces<std::vector<raw::OpDetWaveform>>(label);
82 std::vector<std::unique_ptr<std::vector<raw::OpDetWaveform>>> RawOpDetVecs;
84 std::unique_ptr<std::vector<raw::OpDetWaveform>> tmp(
new std::vector<raw::OpDetWaveform>);
85 RawOpDetVecs.push_back(std::move(tmp));
88 std::vector<const sim::BeamGateInfo*> beamGateArray;
90 evt.getView(fGenModule, beamGateArray);
92 catch (art::Exception
const&
err) {
93 if (err.categoryCode() != art::errors::ProductNotFound)
throw;
97 art::Handle<std::vector<optdata::OpticalRawDigit>> ordHandle;
99 std::vector<optdata::OpticalRawDigit>
const& ord_vec(*ordHandle);
101 auto const clock_data =
102 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
104 for (
auto ord : ord_vec) {
112 double timeStamp = clock_data.OpticalClock().Time(timeSlice, frame);
120 if (RawOpDetVecs[i]->
size() > 0) { evt.put(std::move(RawOpDetVecs[i]),
CategoryLabels[i]); }
EResult err(const char *call)
enum optdata::_optical_category_t Optical_Category_t
std::size_t size(FixedBins< T, C > const &) noexcept