14 #ifndef DataProviderAlg_h 15 #define DataProviderAlg_h 31 #include "CLHEP/Random/JamesRandom.h" 57 Name(
"CalorimetryAlg"),
Comment(
"Used to eliminate amplitude variation due to electron lifetime.")
66 Name(
"CalibrateAmpl"),
Comment(
"Calibrate ADC values with CalAmpConstants")
70 Name(
"CalibrateLifetime"),
Comment(
"Calibrate ADC values with the electron lifetime")
74 Name(
"DriftWindow"),
Comment(
"Downsampling window (in drift ticks).")
78 Name(
"DownscaleFn"),
Comment(
"Downsampling function")
82 Name(
"DownscaleFullView"),
Comment(
"Downsample full view (faster / lower location precision)")
86 Name(
"BlurKernel"),
Comment(
"Blur kernel in wire direction")
94 Name(
"CoherentSigma"),
Comment(
"Coherent noise sigma")
107 unsigned int plane,
unsigned int tpc,
unsigned int cryo);
114 std::vector< std::vector<float> >
getPatch(
size_t wire,
float drift,
size_t patchSizeW,
size_t patchSizeD)
const 117 std::vector< std::vector<float> > patch;
127 if (ok)
return patch;
130 throw cet::exception(
"img::DataProviderAlg") <<
"Patch filling failed." << std::endl;
152 float poolMax(
int wire,
int drift,
size_t r = 0)
const;
155 float poolSum(
int wire,
int drift,
size_t r = 0)
const;
186 void downscaleMax(std::vector<float> & dst, std::vector<float>
const & adc,
size_t tick0)
const;
187 void downscaleMaxMean(std::vector<float> & dst, std::vector<float>
const & adc,
size_t tick0)
const;
188 void downscaleMean(std::vector<float> & dst, std::vector<float>
const & adc,
size_t tick0)
const;
189 void downscale(std::vector<float> & dst, std::vector<float>
const & adc,
size_t tick0)
const 191 switch (fDownscaleMode)
196 default:
throw cet::exception(
"img::DataProviderAlg") <<
"Downscale mode not supported." << std::endl;
break;
203 else return (
size_t)drift;
206 bool setWireData(std::vector<float>
const & adc,
size_t wireIdx);
211 virtual void resizeView(
size_t wires,
size_t drifts);
size_t getAdcArea(void) const
virtual void resizeView(size_t wires, size_t drifts)
std::vector< float > fLifetimeCorrFactors
geo::GeometryCore const * fGeometry
fhicl::Atom< float > AdcMax
double LifetimeCorrection(double tick) const
std::vector< raw::ChannelID_t > fWireChannels
fhicl::Atom< float > CoherentSigma
float poolSum(int wire, int drift, size_t r=0) const
Pool sum of pixels in a patch around the wire/drift pixel.
void downscaleMaxMean(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
std::vector< std::vector< float > > fWireDriftData
std::vector< std::vector< float > > getPatch(size_t wire, float drift, size_t patchSizeW, size_t patchSizeD) const
bool patchFromDownsampledView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float > > &patch) const
fhicl::Atom< unsigned int > DriftWindow
unsigned int NScaledDrifts(void) const
DataProviderAlg(const fhicl::ParameterSet &pset)
unsigned int NWires(void) const
unsigned int Cryo(void) const
bool setWireDriftData(const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo)
bool setWireData(std::vector< float > const &adc, size_t wireIdx)
std::vector< float > fBlurKernel
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Access the description of detector geometry.
fhicl::Sequence< float > BlurKernel
detinfo::DetectorProperties const * fDetProp
fhicl::Atom< bool > DownscaleFullView
void downscaleMax(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
unsigned int fNCachedDrifts
unsigned int NCachedDrifts(void) const
unsigned int TPC(void) const
void scaleAdcSamples(std::vector< float > &values) const
unsigned int Plane(void) const
float scaleAdcSample(float val) const
Description of geometry of one entire detector.
fhicl::Atom< float > AdcMin
calo::CalorimetryAlg fCalorimetryAlg
fhicl::Atom< bool > CalibrateLifetime
float ZeroLevel(void) const
Level of zero ADC after scaling.
unsigned int fNScaledDrifts
float getPixelOrZero(int wire, int drift) const
fhicl::Table< calo::CalorimetryAlg::Config > CalorimetryAlg
std::vector< float > fAmplCalibConst
fhicl::Atom< std::string > DownscaleFn
Declaration of basic channel signal object.
fhicl::Atom< bool > CalibrateAmpl
EDownscaleMode fDownscaleMode
fhicl::Atom< float > OutMin
fhicl::Atom< float > OutMax
CLHEP::HepJamesRandom fRndEngine
float poolMax(int wire, int drift, size_t r=0) const
Pool max value in a patch around the wire/drift pixel.
bool patchFromOriginalView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float > > &patch) const
void downscale(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
double LifetimeCorrection(double time, double T0=0) const
size_t getDriftIndex(float drift) const
art framework interface to geometry description
void downscaleMean(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
cet::coded_exception< error, detail::translate > exception
virtual ~DataProviderAlg(void)
fhicl::Atom< float > NoiseSigma
std::vector< float > const & wireData(size_t widx) const
unsigned int DriftWindow(void) const
double getAdcSum(void) const