10 firstSample_(firstSample),
11 samplesToAdd_(samplesToAdd),
12 correctForTimeslew_(correctForTimeslew) {
18 firstSample_(firstSample),
19 samplesToAdd_(samplesToAdd),
20 correctForTimeslew_(
false) {
34 namespace CastorSimpleRecAlgoImpl {
35 template<
class Digi,
class RecHit>
41 double ampl=0;
int maxI = -1;
double maxA = -1e10;
float ta=0;
43 for (
int i=ifirst;
i<tool.
size() &&
i<n+ifirst;
i++) {
44 int capid=digi[
i].capid();
47 ta*=calibs.
gain(capid);
57 if(maxI==0 || maxI==(tool.
size()-1)) {
69 int capid=digi[maxI-1].capid();
70 float t0 = fabs((tool[maxI-1]-calibs.
pedestal(capid))*calibs.
gain(capid));
71 capid=digi[maxI+1].capid();
72 float t2 = fabs((tool[maxI+1]-calibs.
pedestal(capid))*calibs.
gain(capid));
73 float wpksamp = (t0 + maxA + t2);
74 if (wpksamp!=0) wpksamp=(maxA + 2.0*t2) / wpksamp;
86 return RecHit(digi.id(),ampl,
time);
91 return CastorSimpleRecAlgoImpl::reco<CastorDataFrame,CastorRecHit>(digi,coder,calibs,
209 int index = (int)flx;
222 yval = y1 + (y2-y1)*(flx-(
float)
index);
static double delay(double fC, BiasSetting bias=Medium)
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
static double MaximumFractionalError
CastorSimpleRecAlgo(int firstSample, int samplesToAdd, bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs)
virtual void adc2fC(const CastorDataFrame &df, CaloSamples &lf) const =0
CastorRecHit reconstruct(const CastorDataFrame &digi, const CastorCoder &coder, const CastorCalibrations &calibs) const
static const float wpksamp0_hf
double getCorrection(double fc_ampl) const
const T & max(const T &a, const T &b)
static const float actual_ns_hf[num_bins_hf]
static const float scale_hf
double pedestal(int fCapId) const
get pedestal for capid=0..3
double gain(int fCapId) const
get gain for capid=0..3
int size() const
get the size
static float timeshift_ns_hf(float wpksamp)
Same as above, but for the HF PMTs.
static const int num_bins_hf
RecHit reco(const Digi &digi, const CastorCoder &coder, const CastorCalibrations &calibs, int ifirst, int n, bool slewCorrect, const CastorPulseContainmentCorrection *corr, CastorTimeSlew::BiasSetting slewFlavor)
std::auto_ptr< CastorPulseContainmentCorrection > pulseCorr_