5 #include <vdt/vdtMath.h> 20 for (
int i = 0;
i < digi.
size();
i++) {
22 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : Digi " <<
i <<
" ADC counts " << digi.
sample(
i).
adc() <<
" Ped " 31 if (
adc[1] <= 0 ||
adc[2] <= 0)
37 auto r12 = (
adc[1] != 0) ?
adc[0] /
adc[1] : 99.
f;
38 auto r23 = (
adc[2] != 0) ?
adc[1] /
adc[2] : 99.
f;
43 if (r23 < ratioCuts_->getR23Low())
53 auto aaa = (A2 > 0 && A1 > 0) ?
std::log(A2 / A1) /
n : 20.f;
57 auto t0 = (2.f - ccc) / (1.
f - ccc) * DeltaT - 5.f;
61 #if defined(__clang__) || defined(__INTEL_COMPILER) 68 if (
adc[1] > 2800.
f &&
adc[2] > 2800.
f)
70 else if (
adc[1] > 2800.
f)
72 else if (
adc[2] > 2800.
f)
96 auto otenergy =
results[2] * 1000000.f;
98 auto mipCalib = (mip != 0.f) ?
MIPGeV_ *
std::abs(vdt::fast_cosf(ang)) / (mip) : 0.f;
100 otenergy *= mipCalib;
102 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : reconstructed energy " <<
energy;
157 const ESDataFrame& digi,
const double&
ped,
const double& w0,
const double& w1,
const double&
w2)
const {
158 double*
results =
new double[4]{};
166 for (
int i = 0;
i < digi.
size();
i++) {
168 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : Digi " <<
i <<
" ADC counts " << digi.
sample(
i).
adc() <<
" Ped " 177 if (
adc[1] <= 0 ||
adc[2] <= 0)
183 double r12 = (
adc[1] != 0) ?
adc[0] /
adc[1] : 99;
184 double r23 = (
adc[2] != 0) ?
adc[1] /
adc[2] : 99;
189 if (r23 < ratioCuts_->getR23Low())
199 double aaa = (A2 > 0 && A1 > 0) ?
log(A2 / A1) /
n : 20.;
200 double bbb =
w /
n * DeltaT;
201 double ccc =
exp(aaa + bbb);
203 double t0 = (2. - ccc) / (1. - ccc) * DeltaT - 5;
208 double AA1 = (A_1 != 0.) ? A1 / A_1 : 0.;
210 if (
adc[1] > 2800 &&
adc[2] > 2800)
212 else if (
adc[1] > 2800)
214 else if (
adc[2] > 2800)
240 double otenergy =
results[3] * 1000000.;
243 double mipCalib = (fabs(
cos(*it_ang)) != 0.) ? (*it_mip) / fabs(
cos(*it_ang)) : 0.;
245 otenergy *= (mipCalib != 0.) ?
MIPGeV_ / mipCalib : 0.;
247 LogDebug(
"ESRecHitSimAlgo") <<
"ESRecHitSimAlgo : reconstructed energy " <<
energy;
255 if (it_status->getStatusCode() == 1) {
const ESDetId & id() const
double * oldEvalAmplitude(const ESDataFrame &digi, const double &ped, const double &w0, const double &w1, const double &w2) const
common ppss p3p6s2 common epss epspn46 common const1 w2
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
EcalRecHit reconstruct(const ESDataFrame &digi) const
EcalRecHit oldreconstruct(const ESDataFrame &digi) const
const ESPedestals * peds_
const_iterator find(uint32_t rawId) const
const ESIntercalibConstants * mips_
EcalRecHit::ESFlags evalAmplitude(float *result, const ESDataFrame &digi, float ped) const
void setEnergyError(float energy)
int adc() const
get the ADC sample (singed 16 bits)
const ESSample & sample(int i) const
const Item & preshower(size_t hashedIndex) const
const ESChannelStatus * channelStatus_
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
const ESRecHitRatioCuts * ratioCuts_
const ESAngleCorrectionFactors * ang_
std::vector< Item >::const_iterator const_iterator
const self & getMap() const
Power< A, B >::type pow(const A &a, const B &b)
uint16_t *__restrict__ uint16_t const *__restrict__ adc