CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends
hitfit::EtaDepResElement Class Reference

Represent a resolution and an $ \eta $ range in which the resolution is valid. More...

#include <EtaDepResElement.h>

Public Member Functions

 EtaDepResElement (double eta1, double eta2, const Vector_Resolution &res)
 Construct an instance of EtaDepResElement from the lower limit, upper limit, and the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit. More...
 
 EtaDepResElement (double eta1, double eta2, std::string res)
 Construct an instance of EtaDepResElement from the lower limit, upper limit, and a string which encoded the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit. More...
 
 EtaDepResElement (double eta1, double eta2, const Resolution &p_res, const Resolution &eta_res, const Resolution &phi_res, bool use_et)
 Construct an instance of EtaDepResElement from the lower limit, upper limit, and the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit. More...
 
const double EtaMax () const
 Return the lower limit of valid $ \eta $ range. More...
 
const double EtaMin () const
 Return the lower limit of valid $ \eta $ range. More...
 
const Vector_Resolution GetResolution () const
 Access the resolution. More...
 
bool IsInInterval (const double &eta) const
 Check if an $ \eta $ value is within this instance's $ \eta $ range. More...
 
bool IsNotOverlap (const EtaDepResElement &e) const
 Check if this instance does not have overlapping $ \eta $ range with another instance. More...
 
bool IsOnEdge (const double &eta) const
 Check if an $ \eta $ value is at the edge/boundary of this instance's valid $ \eta $ range. More...
 
bool IsOnEdge (const EtaDepResElement &e) const
 Check if another instance of EtaDepResElement lies at the edge/boundary of this instance's $ \eta $ range. this instance's valid $ \eta $ range. A tolerance factor of 1/1000000 is used. More...
 
bool IsOverlap (const EtaDepResElement &e) const
 Check if this instance has overlapping $ \eta $ range with another instance of EtaDepResElement. More...
 
 ~EtaDepResElement ()
 

Static Public Attributes

static const int InverseEtaPrecision = 1000000
 Constant, the inverse of precision expected. More...
 

Private Member Functions

void SetEta (double eta1, double eta2)
 

Private Attributes

double _EtaMax
 
double _EtaMin
 
Vector_Resolution _Vector_Resolution
 

Friends

bool operator< (const EtaDepResElement &a, const EtaDepResElement &b)
 Comparison operator, compare two EtaDepResElement instances based on their respective valid $\eta$ ranges. More...
 
std::ostream & operator<< (std::ostream &s, const EtaDepResElement &e)
 Output stream operator. More...
 

Detailed Description

Represent a resolution and an $ \eta $ range in which the resolution is valid.

Usage:
Users instantiate multiple instances of this class. For each instance users provide:

See the documentation for Vector_Resolution and Resolution classes for more details.

Author
Haryo Sumowidagdo Suhar.nosp@m.yo.S.nosp@m.umowi.nosp@m.dagd.nosp@m.o@cer.nosp@m.n.ch
Creation date:
June 2009

Definition at line 61 of file EtaDepResElement.h.

Constructor & Destructor Documentation

◆ EtaDepResElement() [1/3]

hitfit::EtaDepResElement::EtaDepResElement ( double  eta1,
double  eta2,
const Vector_Resolution res 
)

Construct an instance of EtaDepResElement from the lower limit, upper limit, and the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit.

Parameters
eta1Value of $ \eta $ in one end/edge/boundary of the valid $ \eta $ range.
eta2Value of $ \eta $ in the other end/edge/boundary of the valid $ \eta $ range.
resThe resolution.

Definition at line 32 of file EtaDepResElement.cc.

References HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, and SetEta().

33  SetEta(eta1, eta2);
34  }
Definition: Electron.h:6
Vector_Resolution _Vector_Resolution
void SetEta(double eta1, double eta2)

◆ EtaDepResElement() [2/3]

hitfit::EtaDepResElement::EtaDepResElement ( double  eta1,
double  eta2,
std::string  res 
)

Construct an instance of EtaDepResElement from the lower limit, upper limit, and a string which encoded the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit.

Parameters
eta1Value of $ \eta $ in one end/edge/boundary of the valid $ \eta $ range.
eta2Value of $ \eta $ in the other end/edge/boundary of the valid $ \eta $ range.
resThe resolution encoded in string.

Definition at line 36 of file EtaDepResElement.cc.

References HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, and SetEta().

37  SetEta(eta1, eta2);
38  }
Definition: Electron.h:6
Vector_Resolution _Vector_Resolution
void SetEta(double eta1, double eta2)

◆ EtaDepResElement() [3/3]

hitfit::EtaDepResElement::EtaDepResElement ( double  eta1,
double  eta2,
const Resolution p_res,
const Resolution eta_res,
const Resolution phi_res,
bool  use_et 
)

Construct an instance of EtaDepResElement from the lower limit, upper limit, and the resolution. The constructor will determine automatically which one among the two input $ \eta $ s is the lower (upper) limit.

Parameters
eta1Value of $ \eta $ in one end of the valid $ \eta $ range.
eta2Walue of $ \eta $ in the other end of the valid $ \eta $ range.
p_resThe energy/momentum resolution.
eta_resThe $ \eta $ resolution.
phi_resThe $ \phi $ resolution.
use_etIf true, then the energy/momentum resolution is for transverse component $ (p_{T}/E_{T}) $ instead for radial $ (p/E) $ component.

Definition at line 40 of file EtaDepResElement.cc.

References HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, and SetEta().

46  : _Vector_Resolution(p_res, eta_res, phi_res, use_et) {
47  SetEta(eta1, eta2);
48  }
Vector_Resolution _Vector_Resolution
void SetEta(double eta1, double eta2)

◆ ~EtaDepResElement()

hitfit::EtaDepResElement::~EtaDepResElement ( )

Destructor.

Definition at line 50 of file EtaDepResElement.cc.

50 {}

Member Function Documentation

◆ EtaMax()

const double hitfit::EtaDepResElement::EtaMax ( ) const

Return the lower limit of valid $ \eta $ range.

Definition at line 88 of file EtaDepResElement.cc.

References _EtaMax.

88 { return _EtaMax; }

◆ EtaMin()

const double hitfit::EtaDepResElement::EtaMin ( ) const

Return the lower limit of valid $ \eta $ range.

Definition at line 86 of file EtaDepResElement.cc.

References _EtaMin.

86 { return _EtaMin; }

◆ GetResolution()

const Vector_Resolution hitfit::EtaDepResElement::GetResolution ( ) const

Access the resolution.

Return:
The resolution.

Definition at line 108 of file EtaDepResElement.cc.

References _Vector_Resolution.

108 { return _Vector_Resolution; }
Vector_Resolution _Vector_Resolution

◆ IsInInterval()

bool hitfit::EtaDepResElement::IsInInterval ( const double &  eta) const

Check if an $ \eta $ value is within this instance's $ \eta $ range.

Parameters
etaThe $ \eta $ value to be checked.
Return:
true if $ \eta $ is within the instance's $ \eta $ range. false if $ \eta $ is not within the instnace's $ \eta $ range.

Definition at line 96 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and PVValHelper::eta.

Referenced by IsOverlap().

◆ IsNotOverlap()

bool hitfit::EtaDepResElement::IsNotOverlap ( const EtaDepResElement e) const

Check if this instance does not have overlapping $ \eta $ range with another instance.

Parameters
eThe other instance of EtaDepResElement to be checked.
Return:
true if this instance does not have overlapping $ \eta $ range with another instance's $ \eta $ range. false if this instance has overlapping $ \eta $ range with another instance's $ \eta $ range.

Definition at line 94 of file EtaDepResElement.cc.

References MillePedeFileConverter_cfg::e, and IsOverlap().

94 { return !(IsOverlap(e)); }
bool IsOverlap(const EtaDepResElement &e) const
Check if this instance has overlapping range with another instance of EtaDepResElement.

◆ IsOnEdge() [1/2]

bool hitfit::EtaDepResElement::IsOnEdge ( const double &  eta) const

Check if an $ \eta $ value is at the edge/boundary of this instance's valid $ \eta $ range.

Parameters
etaThe $ \eta $ value to be checked.

Definition at line 98 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, PVValHelper::eta, and InverseEtaPrecision.

98  {
99  bool nearEtaMin = fabs(eta - _EtaMin) < (1.0 / double(InverseEtaPrecision));
100  bool nearEtaMax = fabs(eta - _EtaMax) < (1.0 / double(InverseEtaPrecision));
101  return nearEtaMin || nearEtaMax;
102  }
static const int InverseEtaPrecision
Constant, the inverse of precision expected.

◆ IsOnEdge() [2/2]

bool hitfit::EtaDepResElement::IsOnEdge ( const EtaDepResElement e) const

Check if another instance of EtaDepResElement lies at the edge/boundary of this instance's $ \eta $ range. this instance's valid $ \eta $ range. A tolerance factor of 1/1000000 is used.

Parameters
eThe $ \eta $ value to be checked.
Return:
true if $ \eta $ is at the edge/boundary the instance's $ \eta $ range. false if $ \eta $ is not at the edge/boundary within the instnace's $ \eta $ range.

Definition at line 104 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and MillePedeFileConverter_cfg::e.

104  {
105  return (e.IsOnEdge(_EtaMin) || e.IsOnEdge(_EtaMax));
106  }

◆ IsOverlap()

bool hitfit::EtaDepResElement::IsOverlap ( const EtaDepResElement e) const

Check if this instance has overlapping $ \eta $ range with another instance of EtaDepResElement.

Parameters
eThe other instance of EtaDepResElement to be checked.
Return:
true if this instance has overlapping $ \eta $ range with another instance's $ \eta $ range.
false if this instance doesn't have overlapping $ \eta $ range with another instance's $ \eta $ range.

Definition at line 90 of file EtaDepResElement.cc.

References MillePedeFileConverter_cfg::e, and IsInInterval().

Referenced by IsNotOverlap().

90  {
91  return (IsInInterval(e._EtaMin) || IsInInterval(e._EtaMax));
92  }
bool IsInInterval(const double &eta) const
Check if an value is within this instance&#39;s range.

◆ SetEta()

void hitfit::EtaDepResElement::SetEta ( double  eta1,
double  eta2 
)
private

Set the lower and upper limit of the valid eta range.

Parameters
eta1Value of $ \eta $ in one end of the valid $ \eta $ range.
eta2Value of $ \eta $ in the other end of the valid $ \eta $ range.

Definition at line 52 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, and InverseEtaPrecision.

Referenced by EtaDepResElement().

52  {
53  if (fabs(eta1 - eta2) < (1.0 / double(InverseEtaPrecision))) {
54  throw std::runtime_error("EtaDepResElement::equal EtaMin and EtaMax");
55  }
56 
57  if (eta1 < eta2) {
58  _EtaMin = eta1;
59  _EtaMax = eta2;
60  } else {
61  _EtaMin = eta2;
62  _EtaMax = eta1;
63  }
64  }
static const int InverseEtaPrecision
Constant, the inverse of precision expected.

Friends And Related Function Documentation

◆ operator<

bool operator< ( const EtaDepResElement a,
const EtaDepResElement b 
)
friend

Comparison operator, compare two EtaDepResElement instances based on their respective valid $\eta$ ranges.

Parameters
aThe first instance of EtaDepResElement to be compared.
bThe second instance of EtaDepResElement to be compared.
Return:
TRUE if a's upper limit is less than b's lower limit.
FALSE all other cases.

Definition at line 79 of file EtaDepResElement.cc.

79  {
80  if (a.IsOverlap(b)) {
81  return false;
82  }
83  return !(a._EtaMax > b._EtaMin);
84  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const EtaDepResElement e 
)
friend

Output stream operator.

Parameters
sThe output stream to write to.
eThe instance of EtaDepResElement to be printed.
Return:
The output stream s

Definition at line 110 of file EtaDepResElement.cc.

110  {
111  s << "(" << e._EtaMin << " to " << e._EtaMax << ")"
112  << " / " << e.GetResolution();
113  return s;
114  }

Member Data Documentation

◆ _EtaMax

double hitfit::EtaDepResElement::_EtaMax
private

Upper limit of the valid $ \eta $ range.

Definition at line 71 of file EtaDepResElement.h.

Referenced by EtaMax(), IsInInterval(), IsOnEdge(), and SetEta().

◆ _EtaMin

double hitfit::EtaDepResElement::_EtaMin
private

Lower limit of the valid $ \eta $ range.

Definition at line 66 of file EtaDepResElement.h.

Referenced by EtaMin(), IsInInterval(), IsOnEdge(), and SetEta().

◆ _Vector_Resolution

Vector_Resolution hitfit::EtaDepResElement::_Vector_Resolution
private

The resolution.

Definition at line 85 of file EtaDepResElement.h.

Referenced by GetResolution().

◆ InverseEtaPrecision

const int hitfit::EtaDepResElement::InverseEtaPrecision = 1000000
static

Constant, the inverse of precision expected.

Definition at line 234 of file EtaDepResElement.h.

Referenced by IsOnEdge(), and SetEta().