LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "DataProviderAlg.h"
Classes | |
struct | Config |
Public Types | |
enum | EDownscaleMode { kMax = 1, kMaxMean = 2, kMean = 3 } |
Public Member Functions | |
DataProviderAlg (const fhicl::ParameterSet &pset) | |
DataProviderAlg (const Config &config) | |
virtual | ~DataProviderAlg () |
bool | setWireDriftData (const detinfo::DetectorClocksData &clock_data, const detinfo::DetectorPropertiesData &det_prop, const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo) |
std::vector< float > const & | wireData (size_t widx) const |
std::vector< std::vector< float > > | getPatch (size_t wire, float drift, size_t patchSizeW, size_t patchSizeD) const |
float | getPixelOrZero (int wire, int drift) const |
double | getAdcSum () const |
size_t | getAdcArea () const |
float | poolMax (int wire, int drift, size_t r=0) const |
Pool max value in a patch around the wire/drift pixel. More... | |
unsigned int | Cryo () const |
Pool sum of pixels in a patch around the wire/drift pixel. More... | |
unsigned int | TPC () const |
unsigned int | Plane () const |
unsigned int | NWires () const |
unsigned int | NScaledDrifts () const |
unsigned int | NCachedDrifts () const |
unsigned int | DriftWindow () const |
float | ZeroLevel () const |
Level of zero ADC after scaling. More... | |
double | LifetimeCorrection (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double tick) const |
Protected Member Functions | |
std::vector< float > | downscaleMax (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscaleMaxMean (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscaleMean (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscale (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
size_t | getDriftIndex (float drift) const |
std::optional< std::vector< float > > | setWireData (std::vector< float > const &adc, size_t wireIdx) const |
bool | patchFromDownsampledView (size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const |
bool | patchFromOriginalView (size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const |
virtual DataProviderAlgView | resizeView (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts) |
Protected Attributes | |
DataProviderAlgView | fAlgView |
EDownscaleMode | fDownscaleMode |
size_t | fDriftWindow |
bool | fDownscaleFullView |
float | fDriftWindowInv |
calo::CalorimetryAlg | fCalorimetryAlg |
geo::GeometryCore const * | fGeometry |
Private Member Functions | |
float | scaleAdcSample (float val) const |
void | scaleAdcSamples (std::vector< float > &values) const |
void | applyBlur () |
void | addWhiteNoise () |
void | addCoherentNoise () |
Private Attributes | |
std::vector< float > | fAmplCalibConst |
bool | fCalibrateAmpl |
bool | fCalibrateLifetime |
unsigned int | fCryo = 9999 |
unsigned int | fTPC = 9999 |
unsigned int | fPlane = 9999 |
float | fAdcMax |
float | fAdcMin |
float | fAdcScale |
float | fAdcOffset |
float | fAdcZero |
double | fAdcSumOverThr |
double | fAdcSumThr |
size_t | fAdcAreaOverThr |
CLHEP::HepJamesRandom | fRndEngine |
std::vector< float > | fBlurKernel |
float | fNoiseSigma |
float | fCoherentSigma |
Base class providing data for training / running image based classifiers. It can be used also for any other algorithms where 2D projection image is useful. Currently the image is 32-bit fp / pixel, as sson as have time will template it so e.g. byte pixels would be possible.
Definition at line 62 of file DataProviderAlg.h.
Enumerator | |
---|---|
kMax | |
kMaxMean | |
kMean |
Definition at line 64 of file DataProviderAlg.h.
|
inline |
Definition at line 101 of file DataProviderAlg.h.
img::DataProviderAlg::DataProviderAlg | ( | const Config & | config | ) |
Definition at line 32 of file DataProviderAlg.cxx.
References calo::CalorimetryAlg::ElectronsFromADCPeak(), fAdcAreaOverThr, fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAdcSumOverThr, fAdcSumThr, fAdcZero, fAmplCalibConst, fBlurKernel, fCalibrateAmpl, fCalibrateLifetime, fCalorimetryAlg, fCoherentSigma, fDownscaleFullView, fDownscaleMode, fDriftWindow, fDriftWindowInv, fGeometry, fNoiseSigma, art::ServiceHandle< T, SCOPE >::get(), kMax, kMaxMean, kMean, geo::GeometryCore::MaxPlanes(), and ~DataProviderAlg().
|
virtualdefault |
Referenced by DataProviderAlg().
|
private |
Definition at line 535 of file DataProviderAlg.cxx.
References d, fAlgView, fCoherentSigma, fDownscaleFullView, fDriftWindow, img::DataProviderAlgView::fNCachedDrifts, fRndEngine, img::DataProviderAlgView::fWireDriftData, noise(), scaleAdcSample(), and w.
Referenced by setWireDriftData().
|
private |
Definition at line 517 of file DataProviderAlg.cxx.
References d, fAlgView, fDownscaleFullView, fDriftWindow, img::DataProviderAlgView::fNCachedDrifts, fNoiseSigma, fRndEngine, img::DataProviderAlgView::fWireDriftData, noise(), and scaleAdcSample().
Referenced by setWireDriftData().
|
private |
Definition at line 414 of file DataProviderAlg.cxx.
References d, fAlgView, fBlurKernel, img::DataProviderAlgView::fWireDriftData, sum, and w.
Referenced by setWireDriftData().
|
inline |
Pool sum of pixels in a patch around the wire/drift pixel.
Definition at line 161 of file DataProviderAlg.h.
Referenced by nnet::TrainingDataAlg::collectVtxFlags().
|
inlineprotected |
Definition at line 198 of file DataProviderAlg.h.
References kMax, kMaxMean, and kMean.
Referenced by patchFromOriginalView(), and setWireData().
|
protected |
Definition at line 196 of file DataProviderAlg.cxx.
References fAlgView, fDriftWindow, img::DataProviderAlgView::fLifetimeCorrFactors, and scaleAdcSamples().
|
protected |
Definition at line 217 of file DataProviderAlg.cxx.
References fAlgView, fDriftWindow, img::DataProviderAlgView::fLifetimeCorrFactors, n, and scaleAdcSamples().
|
protected |
Definition at line 252 of file DataProviderAlg.cxx.
References fAlgView, fDriftWindow, fDriftWindowInv, img::DataProviderAlgView::fLifetimeCorrFactors, and scaleAdcSamples().
|
inline |
Definition at line 168 of file DataProviderAlg.h.
|
inline |
|
inline |
Definition at line 152 of file DataProviderAlg.h.
|
inlineprotected |
Definition at line 210 of file DataProviderAlg.h.
References lar::dump::vector().
Referenced by poolMax().
|
inline |
Return patch of data centered on the wire and drift, witht the size in (downscaled) pixels givent with patchSizeW and patchSizeD. Pad with the zero-level calue if patch extends beyond the event projection.
Definition at line 122 of file DataProviderAlg.h.
|
inline |
Return value from the ADC buffer, or zero if coordinates are out of the view; will scale the drift according to the downscale settings.
Definition at line 142 of file DataProviderAlg.h.
|
inline |
Definition at line 173 of file DataProviderAlg.h.
|
inline |
Definition at line 167 of file DataProviderAlg.h.
|
inline |
Definition at line 166 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inline |
Definition at line 165 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
protected |
Definition at line 439 of file DataProviderAlg.cxx.
References d, fAdcZero, fAlgView, fDriftWindow, trkf::fill(), img::DataProviderAlgView::fWireDriftData, and w.
|
protected |
Definition at line 476 of file DataProviderAlg.cxx.
References d, downscale(), fAdcZero, fAlgView, fDriftWindow, trkf::fill(), img::DataProviderAlgView::fWireDriftData, util::size(), tmp, and w.
|
inline |
Definition at line 163 of file DataProviderAlg.h.
Referenced by setWireDriftData(), pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().
float img::DataProviderAlg::poolMax | ( | int | wire, |
int | drift, | ||
size_t | r = 0 |
||
) | const |
Pool max value in a patch around the wire/drift pixel.
Definition at line 145 of file DataProviderAlg.cxx.
References col, d, fAlgView, fDownscaleFullView, fDriftWindow, img::DataProviderAlgView::fNCachedDrifts, img::DataProviderAlgView::fNWires, img::DataProviderAlgView::fWireDriftData, getDriftIndex(), r, and w.
Referenced by pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().
|
protectedvirtual |
Reimplemented in nnet::TrainingDataAlg.
Definition at line 114 of file DataProviderAlg.cxx.
References fAdcZero, fCalibrateLifetime, fCalorimetryAlg, fDownscaleFullView, fDriftWindow, img::DataProviderAlgView::fLifetimeCorrFactors, img::DataProviderAlgView::fNCachedDrifts, img::DataProviderAlgView::fNDrifts, img::DataProviderAlgView::fNScaledDrifts, img::DataProviderAlgView::fNWires, img::DataProviderAlgView::fWireChannels, img::DataProviderAlgView::fWireDriftData, raw::InvalidChannelID, and calo::CalorimetryAlg::LifetimeCorrection().
Referenced by nnet::TrainingDataAlg::resizeView(), and setWireDriftData().
|
private |
Definition at line 361 of file DataProviderAlg.cxx.
References fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAmplCalibConst, and fPlane.
Referenced by addCoherentNoise(), addWhiteNoise(), and scaleAdcSamples().
|
private |
Definition at line 375 of file DataProviderAlg.cxx.
References fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAmplCalibConst, fPlane, scaleAdcSample(), and util::size().
Referenced by downscaleMax(), downscaleMaxMean(), and downscaleMean().
|
protected |
Definition at line 273 of file DataProviderAlg.cxx.
References downscale(), fAlgView, fDownscaleFullView, and img::DataProviderAlgView::fWireDriftData.
Referenced by setWireDriftData().
bool img::DataProviderAlg::setWireDriftData | ( | const detinfo::DetectorClocksData & | clock_data, |
const detinfo::DetectorPropertiesData & | det_prop, | ||
const std::vector< recob::Wire > & | wires, | ||
unsigned int | plane, | ||
unsigned int | tpc, | ||
unsigned int | cryo | ||
) |
Definition at line 289 of file DataProviderAlg.cxx.
References addCoherentNoise(), addWhiteNoise(), applyBlur(), geo::GeometryCore::ChannelToWire(), fAdcAreaOverThr, fAdcSumOverThr, fAdcSumThr, fAlgView, fCryo, fGeometry, fPlane, fTPC, img::DataProviderAlgView::fWireChannels, img::DataProviderAlgView::fWireDriftData, detinfo::DetectorPropertiesData::NumberTimeSamples(), geo::GeometryCore::Nwires(), Plane(), resizeView(), and setWireData().
Referenced by nnet::ParticleDecayId::DetectDecay(), nnet::EmTrackClusterId2out::produce(), nnet::EmTrackClusterId::produce(), nnet::EmTrackMichelId::produce(), nnet::TrainingDataAlg::setDataEventData(), and nnet::TrainingDataAlg::setEventData().
|
inline |
Definition at line 162 of file DataProviderAlg.h.
Referenced by nnet::TrainingDataAlg::collectVtxFlags().
|
inline |
Definition at line 117 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inline |
|
private |
Definition at line 251 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and setWireDriftData().
|
private |
Definition at line 249 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 249 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 249 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 249 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 250 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and setWireDriftData().
|
private |
Definition at line 250 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and setWireDriftData().
|
private |
Definition at line 249 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), patchFromDownsampledView(), patchFromOriginalView(), and resizeView().
|
protected |
Definition at line 181 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), applyBlur(), downscaleMax(), downscaleMaxMean(), downscaleMean(), nnet::PointIdAlg::isInsideFiducialRegion(), patchFromDownsampledView(), patchFromOriginalView(), poolMax(), nnet::TrainingDataAlg::setDataEventData(), nnet::TrainingDataAlg::setEventData(), setWireData(), setWireDriftData(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
private |
Definition at line 246 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 256 of file DataProviderAlg.h.
Referenced by applyBlur(), and DataProviderAlg().
|
private |
Definition at line 247 of file DataProviderAlg.h.
Referenced by DataProviderAlg().
|
private |
Definition at line 247 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and resizeView().
|
protected |
Definition at line 238 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and resizeView().
|
private |
Definition at line 262 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), and DataProviderAlg().
|
private |
Definition at line 248 of file DataProviderAlg.h.
Referenced by setWireDriftData().
|
protected |
Definition at line 186 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), DataProviderAlg(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isSamePatch(), poolMax(), resizeView(), setWireData(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
protected |
Definition at line 182 of file DataProviderAlg.h.
Referenced by DataProviderAlg().
|
protected |
Definition at line 185 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), DataProviderAlg(), downscaleMax(), downscaleMaxMean(), downscaleMean(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isInsideFiducialRegion(), nnet::PointIdAlg::isSamePatch(), patchFromDownsampledView(), patchFromOriginalView(), poolMax(), resizeView(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
protected |
Definition at line 187 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and downscaleMean().
|
protected |
Definition at line 241 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), nnet::TrainingDataAlg::getProjection(), and setWireDriftData().
|
private |
Definition at line 259 of file DataProviderAlg.h.
Referenced by addWhiteNoise(), and DataProviderAlg().
|
private |
Definition at line 248 of file DataProviderAlg.h.
Referenced by scaleAdcSample(), scaleAdcSamples(), and setWireDriftData().
|
private |
Definition at line 253 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), and addWhiteNoise().
|
private |
Definition at line 248 of file DataProviderAlg.h.
Referenced by setWireDriftData().