81 std::string
const& configKey,
82 std::string
const& algoClassPrefix =
"",
83 std::string
const& algoNameKey =
"Name")
91 if (
auto toolType = algoConfig.
get_if_present<std::string>(
"tool_type")) {
92 toolConfig.
put(
"tool_type", *toolType);
93 algoConfig.
erase(
"tool_type");
95 else if (
auto algoName = algoConfig.
get_if_present<std::string>(algoNameKey)) {
96 toolConfig.
put(
"tool_type", algoClassPrefix + *algoName +
"Maker");
99 toolConfig.
put(configKey, std::move(algoConfig));
116 return makeAlgoToolConfig(baseConfig,
"PedAlgoPset",
"PedAlgo");
146 toolConfig.
put(
"RiseTimeCalculator", std::move(*riseCalcCfg));
177 std::unique_ptr<pmtana::PMTPedestalBase>
const fPedAlg;
199 ,
fThreshAlg{art::make_tool<opdet::IHitAlgoMakerTool>(makeHitAlgoToolConfig(pset))->makeAlgo()}
200 ,
fPedAlg{art::make_tool<opdet::IPedAlgoMakerTool>(makePedAlgoToolConfig(pset))->makeAlgo()}
204 fGenModule = pset.get<std::string>(
"GenModule");
205 fInputLabels = pset.get<std::vector<std::string>>(
"InputLabels");
208 for (
auto const& ch :
209 pset.get<std::vector<unsigned int>>(
"ChannelMasks", std::vector<unsigned int>()))
213 bool useCalibrator = pset.get<
bool>(
"UseCalibrator",
false);
215 auto const& geometry(*lar::providerFrom<geo::Geometry>());
220 fCalib = lar::providerFrom<calib::IPhotonCalibratorService>();
225 bool areaToPE = pset.get<
bool>(
"AreaToPE");
226 float SPEArea = pset.get<
float>(
"SPEArea");
227 float SPEShift = pset.get<
float>(
"SPEShift", 0.);
230 if (!areaToPE) SPEArea = 20;
238 produces<std::vector<recob::OpHit>>();
245 <<
"\nPedestal algorithm: '" <<
fPedAlg->Name() <<
"'";
253 std::unique_ptr<std::vector<recob::OpHit>> HitPtr(
new std::vector<recob::OpHit>);
255 std::vector<const sim::BeamGateInfo*> beamGateArray;
263 auto const& geometry(*lar::providerFrom<geo::Geometry>());
264 auto const clock_data =
266 auto const& calibrator(*
fCalib);
296 if (!wfHandle.
isValid())
continue;
297 totalsize += wfHandle->size();
300 std::vector<raw::OpDetWaveform> WaveformVector;
301 WaveformVector.reserve(totalsize);
303 for (
auto label : fInputLabels) {
306 if (!wfHandle.
isValid())
continue;
310 for (
auto const& wf : *wfHandle) {
312 WaveformVector.push_back(wf);
327 evt.
put(std::move(HitPtr));
Utilities related to art service access.
unsigned int fMaxOpChannel
std::unique_ptr< pmtana::PMTPedestalBase > const fPedAlg
std::map< int, int > GetChannelMap()
EDProducer(fhicl::ParameterSet const &pset)
void AddRecoAlgo(pmtana::PMTPulseRecoBase *algo, PMTPedestalBase *ped_algo=nullptr)
A method to set pulse reconstruction algorithm.
OpHitFinder(const fhicl::ParameterSet &)
Class definition file of PMTPedestalBase.
std::set< unsigned int > fChannelMasks
bool isValid() const noexcept
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
std::vector< double > GetSPEShifts()
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
void produce(art::Event &)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
calib::IPhotonCalibrator const * fCalib
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void RunHitFinder(std::vector< raw::OpDetWaveform > const &opDetWaveformVector, std::vector< recob::OpHit > &hitVector, pmtana::PulseRecoManager const &pulseRecoMgr, pmtana::PMTPulseRecoBase const &threshAlg, geo::GeometryCore const &geometry, float hitThreshold, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
pmtana::PulseRecoManager fPulseRecoMgr
void SetDefaultPedAlgo(pmtana::PMTPedestalBase *algo)
A method to set a choice of pedestal estimation method.
std::optional< T > get_if_present(std::string const &key) const
std::vector< double > GetSPEScales()
bool erase(std::string const &key)
Class definition file of PMTPulseRecoBase.
std::vector< std::string > fInputLabels
void put(std::string const &key)
art framework interface to geometry description
std::unique_ptr< pmtana::PMTPulseRecoBase > const fThreshAlg
Class definition file of PulseRecoManager.