11 Double_t
fitf(Double_t *
x, Double_t *par) {
13 Double_t wc = 0.07291;
15 Double_t v1 =
pow(wc/n*(x[0]-par[1]), n);
16 Double_t v2 = TMath::Exp(n-wc*(x[0]-par[1]));
17 Double_t
v = par[0]*v1*v2;
19 if (x[0] < par[1]) v = 0;
26 fit_ =
new TF1(
"fit",
fitf, -200, 200, 2);
27 fit_->SetParameters(50, 10);
37 double *fitresults =
new double[3] {};
44 for (
int i=0;
i<digi.
size();
i++)
48 if (
adc[0] > 20) status = 14;
49 if (
adc[1] < 0 ||
adc[2] < 0) status = 10;
52 double r12 = (
adc[1] != 0) ?
adc[0]/
adc[1] : 99999;
53 double r23 = (
adc[2] != 0) ?
adc[1]/
adc[2] : 99999;
56 if (r23 < ratioCuts_->getR23Low()) status = 7;
58 if (
int(status) == 0) {
60 TGraph *gr =
new TGraph(3, tx,
adc);
61 fit_->SetParameters(50, 10);
63 fit_->GetParameters(para);
64 fitresults[0] = para[0];
65 fitresults[1] = para[1];
68 if (
adc[1] > 2800 &&
adc[2] > 2800) status = 11;
69 else if (
adc[1] > 2800) status = 12;
70 else if (
adc[2] > 2800) status = 13;
95 double energy = results[0];
96 double t0 = results[1];
100 double mipCalib = (std::fabs(
cos(*it_ang)) != 0.) ? (*it_mip)/fabs(
cos(*it_ang)) : 0.;
101 energy *= (mipCalib != 0.) ?
MIPGeV_/mipCalib : 0.;
103 LogDebug(
"ESRecHitFitAlgo") <<
"ESRecHitFitAlgo : reconstructed energy "<<energy<<
" T0 "<<
t0;
107 if (it_status->getStatusCode() == 1) {
112 else if (status == 5)
114 else if (status == 6)
116 else if (status == 7)
118 else if (status == 8)
120 else if (status == 9)
122 else if (status == 10)
124 else if (status == 11)
126 else if (status == 12)
128 else if (status == 13)
130 else if (status == 14)
int adc(sample_type sample)
get the ADC sample (12 bits)
const ESChannelStatus * channelStatus_
const ESDetId & id() const
const self & getMap() const
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Double_t fitf(Double_t *x, Double_t *par)
const ESRecHitRatioCuts * ratioCuts_
T x() const
Cartesian x coordinate.
const ESAngleCorrectionFactors * ang_
Cos< T >::type cos(const T &t)
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
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)
const ESPedestals * peds_