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(iSample==4 || iSample ==5 || iSample==6) isSaturated = 1;
65 if ( (gainId != gainId0) && (iSample==4 || iSample ==5 || iSample==6) ) iGainSwitch = 1;
67 frame(iSample) = double(dataFrame.sample(iSample).adc());
69 frame(iSample) = double(((
double)(dataFrame.sample(iSample).adc()) - pedestals[gainId-1]) * gainRatios[gainId-1]);
73 ROOT::Math::SVector <double,3> param = (*(weights[iGainSwitch])) * frame;
83 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.
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)
math::Matrix< 3, 10 >::type EcalWeightMatrix