CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
HFPreRecHit Class Reference

#include <HFPreRecHit.h>

Public Types

typedef HcalDetId key_type
 

Public Member Functions

constexpr float charge () const
 
std::pair< float, bool > chargeAsymmetry (float chargeThreshold) const
 
constexpr float energy () const
 
std::pair< float, bool > energyAsymmetry (float energyThreshold) const
 
constexpr HFQIE10Info const * getHFQIE10Info (unsigned index) const
 
constexpr HFPreRecHit ()
 
constexpr HFPreRecHit (const HcalDetId &id, const HFQIE10Info *first, const HFQIE10Info *second)
 
constexpr HcalDetId id () const
 

Private Attributes

bool hasInfo_ [2]
 
HFQIE10Info hfQIE10Info_ [2]
 
HcalDetId id_
 

Detailed Description

Class to contain the info needed to perform HF reconstruction using QIE10 chips and dual-anode readout. Groups the information provided by a single PMT.

Definition at line 14 of file HFPreRecHit.h.

Member Typedef Documentation

Definition at line 16 of file HFPreRecHit.h.

Constructor & Destructor Documentation

constexpr HFPreRecHit::HFPreRecHit ( )
inline

Definition at line 18 of file HFPreRecHit.h.

18 : hasInfo_{false, false} {}
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
constexpr HFPreRecHit::HFPreRecHit ( const HcalDetId id,
const HFQIE10Info first,
const HFQIE10Info second 
)
inline

Definition at line 22 of file HFPreRecHit.h.

23  : id_(id), hasInfo_{false, false} {
24  if (first) {
25  hfQIE10Info_[0] = *first;
26  hasInfo_[0] = true;
27  }
28  if (second) {
29  hfQIE10Info_[1] = *second;
30  hasInfo_[1] = true;
31  }
32  }
HcalDetId id_
Definition: HFPreRecHit.h:82
U second(std::pair< T, U > const &p)
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85

Member Function Documentation

constexpr float HFPreRecHit::charge ( ) const
inline

Definition at line 47 of file HFPreRecHit.h.

References HFQIE10Info::charge(), hasInfo_, hfQIE10Info_, mps_fire::i, and submitPVResolutionJobs::q.

Referenced by HFFlexibleTimeCheck::reconstruct().

47  {
48  float q = 0.f;
49  for (unsigned i = 0; i < 2; ++i)
50  if (hasInfo_[i])
51  q += hfQIE10Info_[i].charge();
52  return q;
53  }
constexpr float charge() const
Definition: HFQIE10Info.h:79
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
std::pair< float, bool > HFPreRecHit::chargeAsymmetry ( float  chargeThreshold) const

Definition at line 3 of file HFPreRecHit.cc.

References HFQIE10Info::charge(), validate-o2o-wbm::f, hasInfo_, hfQIE10Info_, and mps_fire::result.

Referenced by HFFlexibleTimeCheck::reconstruct().

3  {
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 }
tuple result
Definition: mps_fire.py:311
constexpr float charge() const
Definition: HFQIE10Info.h:79
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
constexpr float HFPreRecHit::energy ( ) const
inline

Definition at line 54 of file HFPreRecHit.h.

References alignCSCRings::e, HFQIE10Info::energy(), hasInfo_, hfQIE10Info_, and mps_fire::i.

Referenced by Jet.Jet::rawEnergy().

54  {
55  float e = 0.f;
56  for (unsigned i = 0; i < 2; ++i)
57  if (hasInfo_[i])
58  e += hfQIE10Info_[i].energy();
59  return e;
60  }
constexpr float energy() const
Definition: HFQIE10Info.h:80
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
std::pair< float, bool > HFPreRecHit::energyAsymmetry ( float  energyThreshold) const

Definition at line 17 of file HFPreRecHit.cc.

References HFQIE10Info::energy(), validate-o2o-wbm::f, hasInfo_, hfQIE10Info_, and mps_fire::result.

17  {
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 }
tuple result
Definition: mps_fire.py:311
constexpr float energy() const
Definition: HFQIE10Info.h:80
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
constexpr HFQIE10Info const* HFPreRecHit::getHFQIE10Info ( unsigned  index) const
inline

Definition at line 39 of file HFPreRecHit.h.

References hasInfo_, and hfQIE10Info_.

Referenced by HFSimpleTimeCheck::reconstruct(), and HFRecHitAuxSetter::setAux().

39  {
40  if (index < 2 && hasInfo_[index])
41  return &hfQIE10Info_[index];
42  else
43  return nullptr;
44  }
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:84
bool hasInfo_[2]
Definition: HFPreRecHit.h:85
constexpr HcalDetId HFPreRecHit::id ( ) const
inline

Definition at line 34 of file HFPreRecHit.h.

References id_.

Referenced by HFFlexibleTimeCheck::reconstruct(), and HFSimpleTimeCheck::reconstruct().

34 { return id_; }
HcalDetId id_
Definition: HFPreRecHit.h:82

Member Data Documentation

bool HFPreRecHit::hasInfo_[2]
private

Definition at line 85 of file HFPreRecHit.h.

Referenced by charge(), chargeAsymmetry(), energy(), energyAsymmetry(), and getHFQIE10Info().

HFQIE10Info HFPreRecHit::hfQIE10Info_[2]
private

Definition at line 84 of file HFPreRecHit.h.

Referenced by charge(), chargeAsymmetry(), energy(), energyAsymmetry(), and getHFQIE10Info().

HcalDetId HFPreRecHit::id_
private

Definition at line 82 of file HFPreRecHit.h.

Referenced by id().