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;
197 ,
fThreshAlg{art::make_tool<opdet::IHitAlgoMakerTool>(makeHitAlgoToolConfig(pset))->makeAlgo()}
198 ,
fPedAlg{art::make_tool<opdet::IPedAlgoMakerTool>(makePedAlgoToolConfig(pset))->makeAlgo()}
202 fGenModule = pset.get<std::string>(
"GenModule");
203 fInputLabels = pset.get<std::vector<std::string>>(
"InputLabels");
206 for (
auto const& ch :
207 pset.get<std::vector<unsigned int>>(
"ChannelMasks", std::vector<unsigned int>()))
211 bool useCalibrator = pset.get<
bool>(
"UseCalibrator",
false);
217 fCalib = lar::providerFrom<calib::IPhotonCalibratorService>();
222 bool areaToPE = pset.get<
bool>(
"AreaToPE");
223 float SPEArea = pset.get<
float>(
"SPEArea");
224 float SPEShift = pset.get<
float>(
"SPEShift", 0.);
227 if (!areaToPE) SPEArea = 20;
235 produces<std::vector<recob::OpHit>>();
242 <<
"\nPedestal algorithm: '" <<
fPedAlg->Name() <<
"'";
249 std::unique_ptr<std::vector<recob::OpHit>> HitPtr(
new std::vector<recob::OpHit>);
251 std::vector<const sim::BeamGateInfo*> beamGateArray;
260 auto const clock_data =
262 auto const& calibrator(*
fCalib);
292 if (!wfHandle.
isValid())
continue;
293 totalsize += wfHandle->size();
296 std::vector<raw::OpDetWaveform> WaveformVector;
297 WaveformVector.reserve(totalsize);
299 for (
auto label : fInputLabels) {
302 if (!wfHandle.
isValid())
continue;
304 for (
auto const& wf : *wfHandle) {
306 WaveformVector.push_back(wf);
321 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)
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
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={})
void RunHitFinder(std::vector< raw::OpDetWaveform > const &opDetWaveformVector, std::vector< recob::OpHit > &hitVector, pmtana::PulseRecoManager const &pulseRecoMgr, pmtana::PMTPulseRecoBase const &threshAlg, geo::WireReadoutGeom const &wireReadoutGeom, float hitThreshold, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
#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
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)
std::unique_ptr< pmtana::PMTPulseRecoBase > const fThreshAlg
Class definition file of PulseRecoManager.