14 #ifndef DataProviderAlg_h 15 #define DataProviderAlg_h 27 #include "CLHEP/Random/JamesRandom.h" 33 class DetectorClocksData;
34 class DetectorPropertiesData;
63 Name(
"CalorimetryAlg"),
64 Comment(
"Used to eliminate amplitude variation due to electron lifetime.")};
72 Comment(
"Calibrate ADC values with CalAmpConstants")};
75 Comment(
"Calibrate ADC values with the electron lifetime")};
78 Comment(
"Downsampling window (in drift ticks).")};
83 Name(
"DownscaleFullView"),
84 Comment(
"Downsample full view (faster / lower location precision)")};
104 const std::vector<recob::Wire>&
110 std::vector<float>
const&
113 return fAlgView.fWireDriftData[widx];
119 std::vector<std::vector<float>>
120 getPatch(
size_t wire,
float drift,
size_t patchSizeW,
size_t patchSizeD)
const 123 std::vector<std::vector<float>>
patch;
124 if (fDownscaleFullView) {
125 ok = patchFromDownsampledView(wire, drift, patchSizeW, patchSizeD, patch);
128 ok = patchFromOriginalView(wire, drift, patchSizeW, patchSizeD, patch);
141 size_t didx = getDriftIndex(drift), widx = (size_t)wire;
143 if ((widx < fAlgView.fWireDriftData.size()) && (didx < fAlgView.fNCachedDrifts)) {
144 return fAlgView.fWireDriftData[widx][didx];
152 return fAdcSumOverThr;
157 return fAdcAreaOverThr;
161 float poolMax(
int wire,
int drift,
size_t r = 0)
const;
185 return fAlgView.fNWires;
190 return fAlgView.fNScaledDrifts;
195 return fAlgView.fNCachedDrifts;
215 return fCalorimetryAlg.LifetimeCorrection(clock_data, det_prop, tick);
227 std::vector<float> downscaleMax(std::size_t dst_size,
228 std::vector<float>
const&
adc,
230 std::vector<float> downscaleMaxMean(std::size_t dst_size,
231 std::vector<float>
const&
adc,
233 std::vector<float> downscaleMean(std::size_t dst_size,
234 std::vector<float>
const&
adc,
237 downscale(std::size_t dst_size, std::vector<float>
const&
adc,
size_t tick0)
const 239 switch (fDownscaleMode) {
250 if (fDownscaleFullView)
251 return (
size_t)(drift * fDriftWindowInv);
253 return (
size_t)drift;
256 std::optional<std::vector<float>> setWireData(std::vector<float>
const&
adc,
257 size_t wireIdx)
const;
259 bool patchFromDownsampledView(
size_t wire,
264 bool patchFromOriginalView(
size_t wire,
282 float scaleAdcSample(
float val)
const;
283 void scaleAdcSamples(std::vector<float>&
values)
const;
286 unsigned int fCryo = 9999, fTPC = 9999, fPlane = 9999;
287 float fAdcMax, fAdcMin, fAdcScale, fAdcOffset,
fAdcZero;
geo::GeometryCore const * fGeometry
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
unsigned int DriftWindow() const
ChannelGroupService::Name Name
std::vector< float > downscale(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
DataProviderAlg(const fhicl::ParameterSet &pset)
unsigned int Plane() const
def addWhiteNoise(a, sigma)
std::vector< float > fBlurKernel
unsigned int NWires() const
unsigned int fNScaledDrifts
std::vector< raw::ChannelID_t > fWireChannels
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
General LArSoft Utilities.
Description of geometry of one entire detector.
DataProviderAlgView fAlgView
def addCoherentNoise(a, sigma)
calo::CalorimetryAlg fCalorimetryAlg
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
std::vector< float > fAmplCalibConst
unsigned int NScaledDrifts() const
Access the description of detector geometry.
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.
EDownscaleMode fDownscaleMode
CLHEP::HepJamesRandom fRndEngine
size_t getAdcArea() const
size_t getDriftIndex(float drift) const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
std::vector< float > const & wireData(size_t widx) const