4 : startTime_(
startTime), stopTime_(stopTime) {}
7 const std::vector<double>& amplitudes,
11 const float targetTimePrecision,
12 const bool correctForOOT,
13 const bool correctForSlew)
const {
19 std::vector<float> pedSubSamples(nsample);
20 std::vector<float>
weights(nsample, 1.
f);
21 for (
unsigned int iSample = 0; iSample < nsample; iSample++) {
28 double gainratio = 1.;
50 pulsenorm += fullpulse(iSample);
56 if (iSample > 0 && correctForSlew) {
58 bool GainIdInRange = GainIdPrev >= 1 && GainIdPrev <= 3 && gainId >= 1 &&
gainId <= 3;
59 bool GainSlew = GainIdPrev <
gainId;
60 if (GainIdInRange && GainSlew)
67 for (
auto const& amplit : amplitudes) {
69 int bxp3 = ipulse - 2;
70 int firstsamplet =
std::max(0, bxp3);
73 for (
unsigned int isample = firstsamplet; isample < nsample; ++isample) {
75 pedSubSamples[isample] = pedSubSamples[isample] - (amplit *
pulse / pulsenorm);
119 const float time)
const {
129 auto facM1orP2 = 0.25 *
tt * (
tt - 1);
130 auto fac = (0.25 * (
tt - 2) - 0.5 * (
tt + 1)) * (
tt - 1);
131 auto facP1 = (0.25 * (
tt + 1) - 0.5 * (
tt - 2)) *
tt;
134 facM1orP2 * fullpulse[
i - 1] + fac * fullpulse[
i] + facP1 * fullpulse[
i + 1] + facM1orP2 * fullpulse[
i + 2];
140 interpPulse[0] = facM1orP2 * fullpulse[0] + facP1 * fullpulse[1] + facM1orP2 * fullpulse[2];
148 for (
int i = 0;
i < interpPulseShifted.size(); ++
i) {
150 interpPulseShifted[
i] = interpPulse[
i +
shift];
152 interpPulseShifted[
i] = 0;
154 return interpPulseShifted;
158 const std::vector<float>&
weights,
160 const float time)
const {
162 float powerSamples = 0.;
163 float powerTemplate = 0.;
166 for (
int i = exclude;
i <
int(
samples.size() - exclude); ++
i) {
uint32_t cc[maxCellsPerHit]
Eigen::Matrix< double, FullSampleVectorSize, 1 > FullSampleVector
float computeCC(const std::vector< float > &samples, const std::vector< float > &weights, const FullSampleVector &sigmalTemplate, const float t) const
static constexpr int TIME_WHEN_NOT_CONVERGING
static constexpr int MAX_NUM_OF_ITERATIONS
static constexpr float GOLDEN_RATIO
Abs< T >::type abs(const T &t)
EcalMGPASample sample(int i) const
static constexpr double Samp_Period
double computeTimeCC(const EcalDataFrame &dataFrame, const std::vector< double > &litudes, const EcalPedestals::Item *aped, const EcalMGPAGainRatio *aGain, const FullSampleVector &fullpulse, const float targetTimePrecision, const bool correctForOOT=true, const bool correctForSlew=true) const
float gain12Over6() const
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
static constexpr float GLOBAL_TIME_SHIFT
double pulse(double x, double y, double z, double t)
EcalUncalibRecHitTimingCCAlgo(const float startTime, const float stopTime)
static std::atomic< unsigned int > counter
static unsigned int const shift
static constexpr int MAXSAMPLES
static constexpr float ONE_MINUS_GOLDEN_RATIO
FullSampleVector interpolatePulse(const FullSampleVector &fullpulse, const float t=0) const
Power< A, B >::type pow(const A &a, const B &b)
int gainId() const
get the gainId (2 bits)