File indexing completed on 2024-04-06 12:04:19
0001 #include "DataFormats/HcalRecHit/interface/HFPreRecHit.h"
0002
0003 std::pair<float, bool> HFPreRecHit::chargeAsymmetry(const float chargeThreshold) const {
0004 std::pair<float, bool> result(0.f, false);
0005 if (hasInfo_[0] && hasInfo_[1]) {
0006 const float q0 = hfQIE10Info_[0].charge();
0007 const float q1 = hfQIE10Info_[1].charge();
0008 const float qsum = q0 + q1;
0009 if (qsum > 0.f && qsum >= chargeThreshold) {
0010 result.first = (q1 - q0) / qsum;
0011 result.second = true;
0012 }
0013 }
0014 return result;
0015 }
0016
0017 std::pair<float, bool> HFPreRecHit::energyAsymmetry(const float energyThreshold) const {
0018 std::pair<float, bool> result(0.f, false);
0019 if (hasInfo_[0] && hasInfo_[1]) {
0020 const float e0 = hfQIE10Info_[0].energy();
0021 const float e1 = hfQIE10Info_[1].energy();
0022 const float esum = e0 + e1;
0023 if (esum > 0.f && esum >= energyThreshold) {
0024 result.first = (e1 - e0) / esum;
0025 result.second = true;
0026 }
0027 }
0028 return result;
0029 }