1 #ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitRecWeightsAlgo_HH
2 #define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitRecWeightsAlgo_HH
15 #include "Math/SVector.h"
16 #include "Math/SMatrix.h"
32 ,
const double* pedestals
33 ,
const double* pedestalsRMS
34 ,
const double* gainRatios
38 double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);
43 ROOT::Math::SVector<double,C::MAXSAMPLES> frame;
47 for(
int iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
48 int gainId = dataFrame.sample(iSample).gainId();
56 if(iSample==4 || iSample ==5 || iSample==6) isSaturated = 1;
62 if ( (gainId != gainId0) && (iSample==4 || iSample ==5 || iSample==6) ) iGainSwitch = 1;
64 frame(iSample) = double(dataFrame.sample(iSample).adc());
66 frame(iSample) = double(((
double)(dataFrame.sample(iSample).adc()) - pedestals[gainId-1]) * gainRatios[gainId-1]);
70 ROOT::Math::SVector <double,3> param = (*(weights[iGainSwitch])) * frame;
80 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