15 fixedphasens_ = fixedphase_ns;
18 const int binsize_ns = 25;
23 integrationwindowns_ = (double)(binsize_ns*num_samples);
28 for (
int shift_ns=0; shift_ns<binsize_ns; shift_ns++) {
33 double tmin = -(double)shift_ns;
34 double bin0val = (double)shape_.
integrate(tmin, tmin+binsize_ns);
35 double bin1val = (double)shape_.integrate(tmin+binsize_ns, tmin+2*binsize_ns);
39 sprintf (s,
"%7.3f %8.5f %8.5f\n", tmin, bin0val, bin1val);
43 if (bin1val > bin0val) {
44 time0shiftns_ = shift_ns;
50 cout <<
"time0shiftns_ = " << time0shiftns_ << endl;
59 double shift_ns = fixedphasens_ - time0shiftns_ + timeslew_ns;
61 double tmin = -shift_ns;
62 double tmax = tmin+integrationwindowns_;
64 double integral = shape_.integrate( tmin, tmax );
66 double recofc = (double)truefc * integral;
70 sprintf (s,
"%8.2f %8.4f %8.4f %8.5f %8.5f %8.5f ",
71 truefc, tmin, tmax, integral, corfactor, recofc);
75 std::pair<double,double> thepair(recofc,corfactor);
90 genlkupmap< RecoFCcorFactorAlgo<CastorPulseShapes::Shape> > (1.0, 5000.0f,
102 std::map<double,double>::const_iterator fcupper,fclower;
109 correction = fclower->second;
112 correction = fcupper->second;
115 if (fabs(fclower->first - fc_ampl) <
116 fabs(fcupper->first - fc_ampl) )
117 correction = fclower->second;
119 correction = fcupper->second;
124 sprintf (s,
"%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f",
126 fclower->first, fclower->second,
127 fcupper->first, fcupper->second,
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...
std::pair< double, double > calcpair(double)
std::map< double, double > mCorFactors_
double getCorrection(double fc_ampl) const
const T & max(const T &a, const T &b)
RecoFCcorFactorAlgo(int num_samples, double fixedphase_ns)
Integral< F, X >::type integral(const F &f)
static const double tmax[3]
CastorPulseContainmentCorrection(int num_samples, float fixedphase_ns, float max_fracerror)
Generate energy correction factors based on a predetermined phase of the hit + time slew...
float integrate(double tmin, double tmax) const
const Shape & castorShape() const