4 : startTime_(
startTime), stopTime_(stopTime) {}
7 const std::vector<double>& amplitudes,
11 const float targetTimePrecision,
12 const bool correctForOOT)
const {
18 std::vector<float> pedSubSamples(nsample);
19 for (
unsigned int iSample = 0; iSample < nsample; iSample++) {
26 double gainratio = 1.;
51 pulsenorm += fullpulse(iSample);
56 for (
auto const& amplit : amplitudes) {
58 int bxp3 = ipulse - 2;
59 int firstsamplet =
std::max(0, bxp3);
62 for (
unsigned int isample = firstsamplet; isample < nsample; ++isample) {
64 pedSubSamples[isample] =
std::max(0., pedSubSamples[isample] - amplit *
pulse / pulsenorm);
77 float cc1 =
computeCC(pedSubSamples, fullpulse,
t1);
79 float cc2 =
computeCC(pedSubSamples, fullpulse,
t2);
108 const float time)
const {
118 auto facM1orP2 = 0.25 *
tt * (
tt - 1);
119 auto fac = (0.25 * (
tt - 2) - 0.5 * (
tt + 1)) * (
tt - 1);
120 auto facP1 = (0.25 * (
tt + 1) - 0.5 * (
tt - 2)) *
tt;
123 facM1orP2 * fullpulse[
i - 1] + fac * fullpulse[
i] + facP1 * fullpulse[
i + 1] + facM1orP2 * fullpulse[
i + 2];
129 interpPulse[0] = facM1orP2 * fullpulse[0] + facP1 * fullpulse[1] + facM1orP2 * fullpulse[2];
137 for (
int i = 0;
i < interpPulseShifted.size(); ++
i) {
139 interpPulseShifted[
i] = interpPulse[
i +
shift];
141 interpPulseShifted[
i] = 0;
143 return interpPulseShifted;
148 const float time)
const {
149 constexpr
int exclude = 1;
150 float powerSamples = 0.;
151 float powerTemplate = 0.;
154 for (
int i = exclude;
i <
int(
samples.size() - exclude); ++
i) {
156 powerTemplate +=
std::pow(interpolated[
i], 2);
uint32_t cc[maxCellsPerHit]
Eigen::Matrix< double, FullSampleVectorSize, 1 > FullSampleVector
static constexpr int TIME_WHEN_NOT_CONVERGING
static constexpr int MAX_NUM_OF_ITERATIONS
static constexpr float GOLDEN_RATIO
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
Abs< T >::type abs(const T &t)
EcalMGPASample sample(int i) const
static constexpr double Samp_Period
float computeCC(const std::vector< float > &samples, const FullSampleVector &sigmalTemplate, const float t) 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