13 double *
results =
new double[4];
21 for (
int i=0;
i<digi.
size();
i++) {
23 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : Digi "<<
i<<
" ADC counts "<<digi.
sample(
i).
adc()<<
" Ped "<<ped;
29 if (adc[0] > 20) status = 14;
30 if (adc[1] <= 0 || adc[2] <= 0) status = 10;
31 if (adc[0] > adc[1] && adc[0] > adc[2]) status = 8;
32 if (adc[2] > adc[1] && adc[2] > adc[0]) status = 9;
33 double r12 = (adc[1] != 0) ? adc[0]/adc[1] : 99;
34 double r23 = (adc[2] != 0) ? adc[1]/adc[2] : 99;
37 if (r23 < ratioCuts_->getR23Low()) status = 7;
46 double aaa = (A2 > 0 && A1 > 0) ?
log(A2/A1)/n : 20.;
47 double bbb = w/n*DeltaT;
48 double ccc=
exp(aaa+bbb);
50 double t0 = (2.-ccc)/(1.-ccc) * DeltaT - 5;
54 double A_1 =
pow(w/n*(t1),n) *
exp(n-w*(t1));
55 double AA1 = (A_1 != 0.) ? A1 / A_1 : 0.;
57 if (adc[1] > 2800 && adc[2] > 2800) status = 11;
58 else if (adc[1] > 2800) status = 12;
59 else if (adc[2] > 2800) status = 13;
82 double energy = results[0];
83 double t0 = results[1];
84 int status = (int) results[2];
85 double otenergy = results[3] * 1000000.;
88 double mipCalib = (fabs(
cos(*it_ang)) != 0.) ? (*it_mip)/fabs(
cos(*it_ang)) : 0.;
89 energy *= (mipCalib != 0.) ?
MIPGeV_/mipCalib : 0.;
90 otenergy *= (mipCalib != 0.) ?
MIPGeV_/mipCalib : 0.;
92 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : reconstructed energy "<<
energy;
97 if (it_status->getStatusCode() == 1) {
102 else if (status == 5)
104 else if (status == 6)
106 else if (status == 7)
108 else if (status == 8)
110 else if (status == 9)
112 else if (status == 10)
114 else if (status == 11)
116 else if (status == 12)
118 else if (status == 13)
120 else if (status == 14)
int adc(sample_type sample)
get the ADC sample (12 bits)
EcalRecHit reconstruct(const ESDataFrame &digi) const
common ppss p3p6s2 common epss epspn46 common const1 w2
const ESDetId & id() const
const self & getMap() const
const ESPedestals * peds_
const ESIntercalibConstants * mips_
const ESChannelStatus * channelStatus_
Cos< T >::type cos(const T &t)
const_iterator find(uint32_t rawId) const
const ESSample & sample(int i) const
const ESRecHitRatioCuts * ratioCuts_
const ESAngleCorrectionFactors * ang_
std::vector< Item >::const_iterator const_iterator
void setOutOfTimeEnergy(float energy)
int adc() const
get the ADC sample (singed 16 bits)
Power< A, B >::type pow(const A &a, const B &b)
double * EvalAmplitude(const ESDataFrame &digi, const double &ped, const double &w0, const double &w1, const double &w2) const