11 Double_t
fitf(Double_t*
x, Double_t* par) {
12 Double_t wc = 0.07291;
14 Double_t v1 =
pow(wc / n * (x[0] - par[1]), n);
15 Double_t v2 = TMath::Exp(n - wc * (x[0] - par[1]));
16 Double_t
v = par[0] * v1 * v2;
25 fit_ =
new TF1(
"fit",
fitf, -200, 200, 2);
26 fit_->SetParameters(50, 10);
32 double* fitresults =
new double[3]{};
39 for (
int i = 0;
i < digi.
size();
i++)
45 if (
adc[1] < 0 ||
adc[2] < 0)
51 double r12 = (
adc[1] != 0) ?
adc[0] /
adc[1] : 99999;
52 double r23 = (
adc[2] != 0) ?
adc[1] /
adc[2] : 99999;
57 if (r23 < ratioCuts_->getR23Low())
60 if (
int(status) == 0) {
62 TGraph* gr =
new TGraph(3, tx,
adc);
63 fit_->SetParameters(50, 10);
65 fit_->GetParameters(para);
66 fitresults[0] = para[0];
67 fitresults[1] = para[1];
70 if (
adc[1] > 2800 &&
adc[2] > 2800)
72 else if (
adc[1] > 2800)
74 else if (
adc[2] > 2800)
99 double energy = results[0];
100 double t0 = results[1];
101 int status = (int)results[2];
104 double mipCalib = (std::fabs(
cos(*it_ang)) != 0.) ? (*it_mip) / fabs(
cos(*it_ang)) : 0.;
105 energy *= (mipCalib != 0.) ?
MIPGeV_ / mipCalib : 0.;
107 LogDebug(
"ESRecHitFitAlgo") <<
"ESRecHitFitAlgo : reconstructed energy " << energy <<
" T0 " <<
t0;
111 if (it_status->getStatusCode() == 1) {
116 else if (status == 5)
118 else if (status == 6)
120 else if (status == 7)
122 else if (status == 8)
124 else if (status == 9)
126 else if (status == 10)
128 else if (status == 11)
130 else if (status == 12)
132 else if (status == 13)
134 else if (status == 14)
const ESChannelStatus * channelStatus_
double fitf(double *x, double *par)
const ESDetId & id() const
const self & getMap() const
void setFlag(int flag)
set the flags (from Flags or ESFlags)
const ESRecHitRatioCuts * ratioCuts_
const ESAngleCorrectionFactors * ang_
Cos< T >::type cos(const T &t)
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
uint16_t const *__restrict__ x
EcalRecHit reconstruct(const ESDataFrame &digi) const
std::vector< Item >::const_iterator const_iterator
double * EvalAmplitude(const ESDataFrame &digi, double ped) const
int adc() const
get the ADC sample (singed 16 bits)
const ESIntercalibConstants * mips_
Power< A, B >::type pow(const A &a, const B &b)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
const ESPedestals * peds_