CMS 3D CMS Logo

HFPreRecHit.cc
Go to the documentation of this file.
2 
3 std::pair<float, bool> HFPreRecHit::chargeAsymmetry(const float chargeThreshold) const {
4  std::pair<float, bool> result(0.f, false);
5  if (hasInfo_[0] && hasInfo_[1]) {
6  const float q0 = hfQIE10Info_[0].charge();
7  const float q1 = hfQIE10Info_[1].charge();
8  const float qsum = q0 + q1;
9  if (qsum > 0.f && qsum >= chargeThreshold) {
10  result.first = (q1 - q0) / qsum;
11  result.second = true;
12  }
13  }
14  return result;
15 }
16 
17 std::pair<float, bool> HFPreRecHit::energyAsymmetry(const float energyThreshold) const {
18  std::pair<float, bool> result(0.f, false);
19  if (hasInfo_[0] && hasInfo_[1]) {
20  const float e0 = hfQIE10Info_[0].energy();
21  const float e1 = hfQIE10Info_[1].energy();
22  const float esum = e0 + e1;
23  if (esum > 0.f && esum >= energyThreshold) {
24  result.first = (e1 - e0) / esum;
25  result.second = true;
26  }
27  }
28  return result;
29 }
constexpr float charge() const
Definition: HFQIE10Info.h:79
constexpr float energy() const
Definition: HFQIE10Info.h:80
double f[11][100]
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
std::pair< float, bool > energyAsymmetry(float energyThreshold) const
Definition: HFPreRecHit.cc:17
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:3