LArSoft
v06_85_00
Liquid Argon Software toolkit - http://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 (void) |
bool | setWireDriftData (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 (void) const |
size_t | getAdcArea (void) const |
float | poolMax (int wire, int drift, size_t r=0) const |
Pool max value in a patch around the wire/drift pixel. More... | |
float | poolSum (int wire, int drift, size_t r=0) const |
Pool sum of pixels in a patch around the wire/drift pixel. More... | |
unsigned int | Cryo (void) const |
unsigned int | TPC (void) const |
unsigned int | Plane (void) const |
unsigned int | NWires (void) const |
unsigned int | NScaledDrifts (void) const |
unsigned int | NCachedDrifts (void) const |
unsigned int | DriftWindow (void) const |
float | ZeroLevel (void) const |
Level of zero ADC after scaling. More... | |
double | LifetimeCorrection (double tick) const |
Protected Member Functions | |
void | downscaleMax (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const |
void | downscaleMaxMean (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const |
void | downscaleMean (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const |
void | downscale (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const |
size_t | getDriftIndex (float drift) const |
bool | setWireData (std::vector< float > const &adc, size_t wireIdx) |
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 void | resizeView (size_t wires, size_t drifts) |
Protected Attributes | |
unsigned int | fCryo |
unsigned int | fTPC |
unsigned int | fPlane |
unsigned int | fNWires |
unsigned int | fNDrifts |
unsigned int | fNScaledDrifts |
unsigned int | fNCachedDrifts |
std::vector< raw::ChannelID_t > | fWireChannels |
std::vector< std::vector< float > > | fWireDriftData |
std::vector< float > | fLifetimeCorrFactors |
EDownscaleMode | fDownscaleMode |
size_t | fDriftWindow |
bool | fDownscaleFullView |
float | fDriftWindowInv |
calo::CalorimetryAlg | fCalorimetryAlg |
geo::GeometryCore const * | fGeometry |
detinfo::DetectorProperties const * | fDetProp |
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 |
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 46 of file DataProviderAlg.h.
Enumerator | |
---|---|
kMax | |
kMaxMean | |
kMean |
Definition at line 49 of file DataProviderAlg.h.
|
inline |
Definition at line 98 of file DataProviderAlg.h.
References setWireDriftData(), and ~DataProviderAlg().
img::DataProviderAlg::DataProviderAlg | ( | const Config & | config | ) |
Definition at line 20 of file DataProviderAlg.cxx.
References img::DataProviderAlg::Config::AdcMax, img::DataProviderAlg::Config::AdcMin, img::DataProviderAlg::Config::BlurKernel, img::DataProviderAlg::Config::CalibrateAmpl, img::DataProviderAlg::Config::CalibrateLifetime, img::DataProviderAlg::Config::CalorimetryAlg, img::DataProviderAlg::Config::CoherentSigma, img::DataProviderAlg::Config::DownscaleFn, img::DataProviderAlg::Config::DownscaleFullView, img::DataProviderAlg::Config::DriftWindow, calo::CalorimetryAlg::ElectronsFromADCPeak(), fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAdcZero, fAmplCalibConst, fBlurKernel, fCalibrateAmpl, fCalibrateLifetime, fCalorimetryAlg, fCoherentSigma, fDownscaleFullView, fDownscaleMode, fDriftWindow, fDriftWindowInv, fGeometry, fNoiseSigma, kMax, kMaxMean, kMean, geo::GeometryCore::MaxPlanes(), img::DataProviderAlg::Config::NoiseSigma, img::DataProviderAlg::Config::OutMax, img::DataProviderAlg::Config::OutMin, and calo::CalorimetryAlg::reconfigure().
|
virtual |
|
private |
Definition at line 507 of file DataProviderAlg.cxx.
References d, fCoherentSigma, fDownscaleFullView, fDriftWindow, fNCachedDrifts, fRndEngine, fWireDriftData, noise(), scaleAdcSample(), and w.
Referenced by setWireDriftData().
|
private |
Definition at line 487 of file DataProviderAlg.cxx.
References d, fDownscaleFullView, fDriftWindow, fNCachedDrifts, fNoiseSigma, fRndEngine, fWireDriftData, noise(), and scaleAdcSample().
Referenced by setWireDriftData().
|
private |
Definition at line 375 of file DataProviderAlg.cxx.
References d, fBlurKernel, fWireDriftData, and w.
Referenced by setWireDriftData().
|
inline |
|
inlineprotected |
Definition at line 189 of file DataProviderAlg.h.
References downscaleMax(), downscaleMaxMean(), downscaleMean(), kMax, kMaxMean, and kMean.
Referenced by patchFromOriginalView(), and setWireData().
|
protected |
Definition at line 182 of file DataProviderAlg.cxx.
References fDriftWindow, fLifetimeCorrFactors, and scaleAdcSamples().
Referenced by downscale().
|
protected |
Definition at line 202 of file DataProviderAlg.cxx.
References fDriftWindow, fLifetimeCorrFactors, n, and scaleAdcSamples().
Referenced by downscale().
|
protected |
Definition at line 227 of file DataProviderAlg.cxx.
References fDriftWindow, fDriftWindowInv, fLifetimeCorrFactors, and scaleAdcSamples().
Referenced by downscale().
|
inline |
|
inline |
Definition at line 149 of file DataProviderAlg.h.
References fAdcAreaOverThr, poolMax(), and poolSum().
|
inline |
|
inlineprotected |
Definition at line 200 of file DataProviderAlg.h.
References fDriftWindowInv, patchFromDownsampledView(), patchFromOriginalView(), resizeView(), setWireData(), and lar::dump::vector().
Referenced by getPixelOrZero(), poolMax(), and poolSum().
|
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 114 of file DataProviderAlg.h.
References fDownscaleFullView, patchFromDownsampledView(), and patchFromOriginalView().
|
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 136 of file DataProviderAlg.h.
References fNCachedDrifts, fWireDriftData, and getDriftIndex().
|
inline |
Definition at line 169 of file DataProviderAlg.h.
References fCalorimetryAlg, and calo::CalorimetryAlg::LifetimeCorrection().
|
inline |
|
inline |
|
inline |
|
protected |
Definition at line 400 of file DataProviderAlg.cxx.
References d, fAdcZero, fDriftWindow, trkf::fill(), fWireDriftData, and w.
Referenced by getDriftIndex(), and getPatch().
|
protected |
Definition at line 442 of file DataProviderAlg.cxx.
References d, downscale(), fAdcZero, fDriftWindow, trkf::fill(), fWireDriftData, tmp, and w.
Referenced by getDriftIndex(), and getPatch().
|
inline |
Definition at line 159 of file DataProviderAlg.h.
References fPlane.
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 133 of file DataProviderAlg.cxx.
References col, d, fDownscaleFullView, fDriftWindow, fNCachedDrifts, fNWires, fWireDriftData, getDriftIndex(), and w.
Referenced by getAdcArea(), pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().
float img::DataProviderAlg::poolSum | ( | int | wire, |
int | drift, | ||
size_t | r = 0 |
||
) | const |
Pool sum of pixels in a patch around the wire/drift pixel.
Definition at line 159 of file DataProviderAlg.cxx.
References col, d, fDownscaleFullView, fDriftWindow, fNCachedDrifts, fNWires, fWireDriftData, getDriftIndex(), and w.
Referenced by getAdcArea().
|
protectedvirtual |
Reimplemented in nnet::TrainingDataAlg.
Definition at line 103 of file DataProviderAlg.cxx.
References fAdcZero, fCalibrateLifetime, fCalorimetryAlg, fDownscaleFullView, fDriftWindow, trkf::fill(), fLifetimeCorrFactors, fNCachedDrifts, fNDrifts, fNScaledDrifts, fNWires, fWireChannels, fWireDriftData, raw::InvalidChannelID, calo::CalorimetryAlg::LifetimeCorrection(), and w.
Referenced by getDriftIndex(), nnet::TrainingDataAlg::resizeView(), and setWireDriftData().
|
private |
Definition at line 331 of file DataProviderAlg.cxx.
References fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAmplCalibConst, and fPlane.
Referenced by addCoherentNoise(), addWhiteNoise(), and scaleAdcSamples().
|
private |
Definition at line 341 of file DataProviderAlg.cxx.
References fAdcMax, fAdcMin, fAdcOffset, fAdcScale, fAmplCalibConst, fPlane, and scaleAdcSample().
Referenced by downscaleMax(), downscaleMaxMean(), and downscaleMean().
|
protected |
Definition at line 245 of file DataProviderAlg.cxx.
References downscale(), fDownscaleFullView, and fWireDriftData.
Referenced by getDriftIndex(), and setWireDriftData().
bool img::DataProviderAlg::setWireDriftData | ( | const std::vector< recob::Wire > & | wires, |
unsigned int | plane, | ||
unsigned int | tpc, | ||
unsigned int | cryo | ||
) |
Definition at line 265 of file DataProviderAlg.cxx.
References addCoherentNoise(), addWhiteNoise(), applyBlur(), geo::GeometryCore::ChannelToWire(), fAdcAreaOverThr, fAdcSumOverThr, fAdcSumThr, fCryo, fDetProp, fGeometry, fPlane, fTPC, fWireChannels, detinfo::DetectorProperties::NumberTimeSamples(), geo::GeometryCore::Nwires(), Plane(), resizeView(), and setWireData().
Referenced by DataProviderAlg(), nnet::TrainingDataAlg::setDataEventData(), and nnet::TrainingDataAlg::setEventData().
|
inline |
|
inline |
Definition at line 109 of file DataProviderAlg.h.
References fWireDriftData.
|
inline |
Level of zero ADC after scaling.
Definition at line 167 of file DataProviderAlg.h.
References fAdcZero.
|
private |
Definition at line 228 of file DataProviderAlg.h.
Referenced by getAdcArea(), and setWireDriftData().
|
private |
Definition at line 226 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 226 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 226 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 226 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 227 of file DataProviderAlg.h.
Referenced by getAdcSum(), and setWireDriftData().
|
private |
Definition at line 227 of file DataProviderAlg.h.
Referenced by setWireDriftData().
|
private |
Definition at line 226 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), patchFromDownsampledView(), patchFromOriginalView(), resizeView(), and ZeroLevel().
|
private |
Definition at line 223 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), scaleAdcSample(), and scaleAdcSamples().
|
private |
Definition at line 233 of file DataProviderAlg.h.
Referenced by applyBlur(), and DataProviderAlg().
|
private |
Definition at line 224 of file DataProviderAlg.h.
Referenced by DataProviderAlg().
|
private |
Definition at line 224 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), and resizeView().
|
protected |
Definition at line 214 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), LifetimeCorrection(), and resizeView().
|
private |
Definition at line 239 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), and DataProviderAlg().
|
protected |
Definition at line 172 of file DataProviderAlg.h.
Referenced by nnet::TrainingDataAlg::collectVtxFlags(), Cryo(), and setWireDriftData().
|
protected |
Definition at line 218 of file DataProviderAlg.h.
Referenced by nnet::TrainingDataAlg::getProjection(), and setWireDriftData().
|
protected |
Definition at line 183 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), DataProviderAlg(), getPatch(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isSamePatch(), poolMax(), poolSum(), resizeView(), setWireData(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
protected |
Definition at line 179 of file DataProviderAlg.h.
Referenced by DataProviderAlg().
|
protected |
Definition at line 182 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), DataProviderAlg(), downscaleMax(), downscaleMaxMean(), downscaleMean(), DriftWindow(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isInsideFiducialRegion(), nnet::PointIdAlg::isSamePatch(), patchFromDownsampledView(), patchFromOriginalView(), poolMax(), poolSum(), resizeView(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
protected |
Definition at line 184 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), downscaleMean(), and getDriftIndex().
|
protected |
Definition at line 217 of file DataProviderAlg.h.
Referenced by DataProviderAlg(), nnet::TrainingDataAlg::getProjection(), and setWireDriftData().
|
protected |
Definition at line 177 of file DataProviderAlg.h.
Referenced by downscaleMax(), downscaleMaxMean(), downscaleMean(), and resizeView().
|
protected |
Definition at line 173 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), getPixelOrZero(), NCachedDrifts(), poolMax(), poolSum(), resizeView(), nnet::TrainingDataAlg::resizeView(), and nnet::TrainingDataAlg::setWireEdepsAndLabels().
|
protected |
Definition at line 173 of file DataProviderAlg.h.
Referenced by resizeView(), nnet::TrainingDataAlg::setDataEventData(), and nnet::TrainingDataAlg::setEventData().
|
private |
Definition at line 236 of file DataProviderAlg.h.
Referenced by addWhiteNoise(), and DataProviderAlg().
|
protected |
Definition at line 173 of file DataProviderAlg.h.
Referenced by nnet::PointIdAlg::isInsideFiducialRegion(), NScaledDrifts(), and resizeView().
|
protected |
Definition at line 173 of file DataProviderAlg.h.
Referenced by nnet::PointIdAlg::isInsideFiducialRegion(), NWires(), poolMax(), poolSum(), resizeView(), and nnet::TrainingDataAlg::setEventData().
|
protected |
Definition at line 172 of file DataProviderAlg.h.
Referenced by Plane(), scaleAdcSample(), scaleAdcSamples(), and setWireDriftData().
|
private |
Definition at line 230 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), and addWhiteNoise().
|
protected |
Definition at line 172 of file DataProviderAlg.h.
Referenced by nnet::TrainingDataAlg::collectVtxFlags(), setWireDriftData(), and TPC().
|
protected |
Definition at line 175 of file DataProviderAlg.h.
Referenced by resizeView(), nnet::TrainingDataAlg::setEventData(), and setWireDriftData().
|
protected |
Definition at line 176 of file DataProviderAlg.h.
Referenced by addCoherentNoise(), addWhiteNoise(), applyBlur(), getPixelOrZero(), patchFromDownsampledView(), patchFromOriginalView(), poolMax(), poolSum(), resizeView(), setWireData(), and wireData().