11 _prefitMaxChiSq(1.0) {
35 for(
unsigned int iSample = 0; iSample < nsample; iSample++) {
39 double amplitude = 0.;
44 double gainratio = 1.;
46 if (gainId==0 || gainId==3) {
62 amplitude = ((double)(sample.
adc()) - pedestal) * gainratio;
66 amplitude = (4095. -
pedestal) * gainratio;
69 amplitudes[iSample] = amplitude;
71 if (amplitude>maxamplitude) {
73 maxamplitude = amplitude;
75 pedrms = pederr*gainratio;
80 double amplitude, amperr, chisq;
84 bool usePrefit =
false;
99 status =
_pulsefunc.
DoFit(amplitudes,noisecor,pedrms,activeBX,fullpulse,fullpulsecov);
103 edm::LogWarning(
"EcalUncalibRecHitMultiFitAlgo::makeRecHit") <<
"Failed Fit" << std::endl;
106 unsigned int ipulseintime = 0;
107 for (
unsigned int ipulse=0; ipulse<
_pulsefunc.
BXs().rows(); ++ipulse) {
109 ipulseintime = ipulse;
114 amplitude = status ?
_pulsefunc.
X()[ipulseintime] : 0.;
128 for (
unsigned int ipulse=0; ipulse<
_pulsefunc.
BXs().rows(); ++ipulse) {
131 rh.setOutOfTimeAmplitude(bx+5, status ?
_pulsefunc.
X().coeff(ipulse) : 0.);
void setMaxIterWarnings(bool b)
int gainId(sample_type sample)
get the gainId (2 bits)
void disableErrorCalculation()
EcalUncalibratedRecHit makeRecHit(const EcalDataFrame &dataFrame, const EcalPedestals::Item *aped, const EcalMGPAGainRatio *aGain, const SampleMatrix &noisecor, const FullSampleVector &fullpulse, const FullSampleMatrix &fullpulsecov, const BXVector &activeBX)
compute rechits
const PulseVector & Errors() const
Eigen::Matrix< double, 10, 1 > SampleVector
EcalMGPASample sample(int i) const
std::vector< Variable::Flags > flags
Eigen::Matrix< double, 19, 19 > FullSampleMatrix
int gainId() const
get the gainId (2 bits)
EcalUncalibRecHitMultiFitAlgo()
const PulseVector & X() const
void setAmplitudeError(float amplitudeerror)
Eigen::Matrix< double, 19, 1 > FullSampleVector
void resize(int bx, unsigned size)
float gain12Over6() const
const BXVector & BXs() const
PulseChiSqSNNLS _pulsefuncSingle
PulseChiSqSNNLS _pulsefunc
volatile std::atomic< bool > shutdown_flag false
Eigen::Matrix< double, 10, 10 > SampleMatrix
static const int MAXSAMPLES
bool DoFit(const SampleVector &samples, const SampleMatrix &samplecor, double pederr, const BXVector &bxs, const FullSampleVector &fullpulse, const FullSampleMatrix &fullpulsecov)
int adc() const
get the ADC sample (12 bits)