CMS 3D CMS Logo

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>

List of all members.

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.
 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.
 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.
const double EtaMax () const
 Return the lower limit of valid $ \eta $ range.
const double EtaMin () const
 Return the lower limit of valid $ \eta $ range.
const Vector_Resolution GetResolution () const
 Access the resolution.
bool IsInInterval (const double &eta) const
 Check if an $ \eta $ value is within this instance's $ \eta $ range.
bool IsNotOverlap (const EtaDepResElement &e) const
 Check if this instance does not have overlapping $ \eta $ range with another instance.
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.
bool IsOnEdge (const double &eta) const
 Check if an $ \eta $ value is at the edge/boundary of this instance's valid $ \eta $ range.
bool IsOverlap (const EtaDepResElement &e) const
 Check if this instance has overlapping $ \eta $ range with another instance of EtaDepResElement.
 ~EtaDepResElement ()

Static Public Attributes

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

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.
std::ostream & operator<< (std::ostream &s, const EtaDepResElement &e)
 Output stream operator.

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 <Suharyo.Sumowidagdo@cern.ch>
Creation date:
June 2009

Definition at line 63 of file EtaDepResElement.h.


Constructor & Destructor Documentation

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 33 of file EtaDepResElement.cc.

References SetEta().

                                                                :
    _Vector_Resolution(res)
{

    SetEta(eta1,eta2);

}
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 43 of file EtaDepResElement.cc.

References SetEta().

                                                 :
    _Vector_Resolution(res)
{

    SetEta(eta1,eta2);

}
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 53 of file EtaDepResElement.cc.

References SetEta().

                                               :
    _Vector_Resolution(p_res,eta_res,phi_res,use_et)
{

    SetEta(eta1,eta2);

}
hitfit::EtaDepResElement::~EtaDepResElement ( )

Destructor.

Definition at line 66 of file EtaDepResElement.cc.

{
}

Member Function Documentation

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

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

Definition at line 122 of file EtaDepResElement.cc.

References _EtaMax.

{

    return _EtaMax;

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

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

Definition at line 113 of file EtaDepResElement.cc.

References _EtaMin.

{

    return _EtaMin;

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

Access the resolution.

Return:
The resolution.

Definition at line 178 of file EtaDepResElement.cc.

References _Vector_Resolution.

Referenced by hitfit::operator<<().

{

    return _Vector_Resolution;

}
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 149 of file EtaDepResElement.cc.

References _EtaMax, and _EtaMin.

Referenced by IsOverlap().

{

    return ((_EtaMin < eta) && (eta < _EtaMax));

}
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 140 of file EtaDepResElement.cc.

References IsOverlap().

{

    return !(IsOverlap(e));

}
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 169 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and IsOnEdge().

{

    return (e.IsOnEdge(_EtaMin) || e.IsOnEdge(_EtaMax));

}
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 158 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and InverseEtaPrecision.

Referenced by IsOnEdge().

{

    bool nearEtaMin = fabs(eta - _EtaMin) < (1.0/double(InverseEtaPrecision));
    bool nearEtaMax = fabs(eta - _EtaMax) < (1.0/double(InverseEtaPrecision));
    return nearEtaMin || nearEtaMax ;

}
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 131 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and IsInInterval().

Referenced by IsNotOverlap(), and hitfit::operator<().

{

    return (IsInInterval(e._EtaMin) || IsInInterval(e._EtaMax));

}
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 72 of file EtaDepResElement.cc.

References _EtaMax, _EtaMin, and InverseEtaPrecision.

Referenced by EtaDepResElement().

{

    if (fabs(eta1 - eta2) < (1.0/double(InverseEtaPrecision))) {
        throw
            std::runtime_error("EtaDepResElement::equal EtaMin and EtaMax");
    }

    if (eta1 < eta2) {
        _EtaMin = eta1 ;
        _EtaMax = eta2 ;
    } else {
        _EtaMin = eta2 ;
        _EtaMax = eta1 ;
    }

}

Friends And Related Function Documentation

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 103 of file EtaDepResElement.cc.

{

    if (a.IsOverlap(b)) { return false;}
    return !(a._EtaMax > b._EtaMin);

}
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 186 of file EtaDepResElement.cc.

{

    s << "(" << e._EtaMin << " to " << e._EtaMax << ")" << " / " << e.GetResolution ();
    return s ;

}

Member Data Documentation

Upper limit of the valid $ \eta $ range.

Definition at line 75 of file EtaDepResElement.h.

Referenced by EtaMax(), IsInInterval(), IsOnEdge(), IsOverlap(), hitfit::operator<(), hitfit::operator<<(), and SetEta().

Lower limit of the valid $ \eta $ range.

Definition at line 70 of file EtaDepResElement.h.

Referenced by EtaMin(), IsInInterval(), IsOnEdge(), IsOverlap(), hitfit::operator<(), hitfit::operator<<(), and SetEta().

The resolution.

Definition at line 89 of file EtaDepResElement.h.

Referenced by GetResolution().

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

Constant, the inverse of precision expected.

Definition at line 243 of file EtaDepResElement.h.

Referenced by IsOnEdge(), and SetEta().