14 #ifndef DataProviderAlg_h
15 #define DataProviderAlg_h
18 #include "cetlib_except/exception.h"
19 #include "fhiclcpp/types/Atom.h"
20 #include "fhiclcpp/types/Comment.h"
21 #include "fhiclcpp/types/Name.h"
22 #include "fhiclcpp/types/Sequence.h"
23 #include "fhiclcpp/types/Table.h"
26 namespace geo {
class GeometryCore; }
30 #include "CLHEP/Random/JamesRandom.h"
39 class DetectorClocksData;
40 class DetectorPropertiesData;
69 Name(
"CalorimetryAlg"),
70 Comment(
"Used to eliminate amplitude variation due to electron lifetime.")};
78 Comment(
"Calibrate ADC values with CalAmpConstants")};
81 Comment(
"Calibrate ADC values with the electron lifetime")};
84 Comment(
"Downsampling window (in drift ticks).")};
89 Name(
"DownscaleFullView"),
90 Comment(
"Downsample full view (faster / lower location precision)")};
110 const std::vector<recob::Wire>&
116 std::vector<float>
const&
125 std::vector<std::vector<float>>
126 getPatch(
size_t wire,
float drift,
size_t patchSizeW,
size_t patchSizeD)
const
129 std::vector<std::vector<float>> patch;
139 throw cet::exception(
"img::DataProviderAlg") <<
"Patch filling failed." << std::endl;
167 float poolMax(
int wire,
int drift,
size_t r = 0)
const;
234 std::vector<float>
const& adc,
237 std::vector<float>
const& adc,
240 std::vector<float>
const& adc,
243 downscale(std::size_t dst_size, std::vector<float>
const& adc,
size_t tick0)
const
250 throw cet::exception(
"img::DataProviderAlg") <<
"Downscale mode not supported." << std::endl;
259 return (
size_t)drift;
262 std::optional<std::vector<float>>
setWireData(std::vector<float>
const& adc,
263 size_t wireIdx)
const;
geo::GeometryCore const * fGeometry
fhicl::Atom< float > AdcMax
std::optional< std::vector< float > > setWireData(std::vector< float > const &adc, size_t wireIdx) const
unsigned int fNCachedDrifts
unsigned int NCachedDrifts() const
std::vector< std::vector< float > > fWireDriftData
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double tick) const
fhicl::Atom< float > CoherentSigma
virtual ~DataProviderAlg()
virtual DataProviderAlgView resizeView(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts)
fhicl::Atom< unsigned int > DriftWindow
unsigned int DriftWindow() const
std::vector< float > downscale(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
DataProviderAlg(const fhicl::ParameterSet &pset)
std::vector< float > downscaleMaxMean(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
unsigned int Plane() const
std::vector< float > fBlurKernel
unsigned int NWires() const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
fhicl::Sequence< float > BlurKernel
std::vector< float > downscaleMax(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
fhicl::Atom< bool > DownscaleFullView
std::vector< float > downscaleMean(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
unsigned int fNScaledDrifts
void scaleAdcSamples(std::vector< float > &values) const
std::vector< raw::ChannelID_t > fWireChannels
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
BEGIN_PROLOG vertical distance to the surface Name
float scaleAdcSample(float val) const
Description of geometry of one entire detector.
fhicl::Atom< float > AdcMin
DataProviderAlgView fAlgView
calo::CalorimetryAlg fCalorimetryAlg
bool patchFromOriginalView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const
fhicl::Atom< bool > CalibrateLifetime
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)
Contains all timing reference information for the detector.
std::vector< float > fLifetimeCorrFactors
unsigned int Cryo() const
Pool sum of pixels in a patch around the wire/drift pixel.
float getPixelOrZero(int wire, int drift) const
fhicl::Table< calo::CalorimetryAlg::Config > CalorimetryAlg
std::vector< float > fAmplCalibConst
unsigned int NScaledDrifts() const
fhicl::Atom< std::string > DownscaleFn
Declaration of basic channel signal object.
std::vector< std::vector< float > > getPatch(size_t wire, float drift, size_t patchSizeW, size_t patchSizeD) const
float ZeroLevel() const
Level of zero ADC after scaling.
bool patchFromDownsampledView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const
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.
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
size_t getAdcArea() const
size_t getDriftIndex(float drift) const
fhicl::Atom< float > NoiseSigma
std::vector< float > const & wireData(size_t widx) const