1 #ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitRecWeightsAlgo_HH
2 #define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitRecWeightsAlgo_HH
18 #include "Math/SVector.h"
19 #include "Math/SMatrix.h"
35 ,
const double* pedestals
36 ,
const double* pedestalsRMS
37 ,
const double* gainRatios
41 double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);
46 ROOT::Math::SVector<double,C::MAXSAMPLES> frame;
50 for(
int iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
51 int gainId = dataFrame.sample(iSample).gainId();
59 if (gainId != gainId0) iGainSwitch = 1;
61 frame(iSample) = double(dataFrame.sample(iSample).adc());
63 frame(iSample) = double(((
double)(dataFrame.sample(iSample).adc()) - pedestals[gainId-1]) * gainRatios[gainId-1]);
67 ROOT::Math::SVector <double,3> param = (*(weights[iGainSwitch])) * frame;
77 amplitude_ = double((4095. - pedestals[2]) * gainRatios[2]);
int gainId(sample_type sample)
get the gainId (2 bits)
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *pedestalsRMS, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalShapeBase &testbeamPulseShape)
Compute parameters.
math::Matrix< 3, 10 >::type EcalWeightMatrix