ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LVL1::PhiRange Class Reference

Range class declaration. More...

#include <PhiRange.h>

Collaboration diagram for LVL1::PhiRange:

Public Member Functions

 PhiRange ()
 
 PhiRange (double min, double max)
 
 ~PhiRange ()=default
 
double min () const
 
double max () const
 
void setRange (double min, double max)
 sets range More...
 
bool contains (double number) const
 returns true if the range contains the number (i.e. More...
 
double centre () const
 returns the centre of the two ranges. More...
 

Private Member Functions

void checkValues ()
 This function makes sure m_min really is less than m_max. More...
 

Private Attributes

double m_min
 
double m_max
 

Detailed Description

Range class declaration.

Definition at line 22 of file PhiRange.h.

Constructor & Destructor Documentation

◆ PhiRange() [1/2]

LVL1::PhiRange::PhiRange ( )

Definition at line 24 of file PhiRange.cxx.

25  : m_min( min ), m_max( max ) {
26 
27  checkValues();

◆ PhiRange() [2/2]

LVL1::PhiRange::PhiRange ( double  min,
double  max 
)

Definition at line 29 of file PhiRange.cxx.

30  {
31  return m_min;
32  }
33 

◆ ~PhiRange()

LVL1::PhiRange::~PhiRange ( )
default

Member Function Documentation

◆ centre()

double LVL1::PhiRange::centre ( ) const

returns the centre of the two ranges.

The ranges are assumed to be <PI. If this is not true, then this function will return a centre opposite the true centre.

Definition at line 98 of file PhiRange.cxx.

◆ checkValues()

void LVL1::PhiRange::checkValues ( )
private

This function makes sure m_min really is less than m_max.

This function makes sure m_min really is less than m_max, and checks that phi values are sensible.

Definition at line 68 of file PhiRange.cxx.

72  {
73  // RoI range must span 2PI wraparound. In which case m_min should have higher value, m_max lower
74  if (m_min < m_max) {
75  // swap them
76  double temp = m_max;
77  m_max = m_min;
78  m_min = temp;
79  }
80  }
81  else if ( m_min >= m_max ) {
82  // swap them
83  double temp = m_max;
84  m_max = m_min;
85  m_min = temp;
86  }
87  // }
88  return;
89  }
90 
93  double LVL1::PhiRange::centre() const {
94  double diff = fabs( m_min - m_max );

◆ contains()

bool LVL1::PhiRange::contains ( double  number) const

returns true if the range contains the number (i.e.

if min<=number<=max)

if min<=number<=max). Because with phi ranges it loops at phi=2PI, the assumption is made that phiMax-phiMin<PI. If this is not true, the output from this method will be wrong!

Definition at line 55 of file PhiRange.cxx.

63  {
64  // should really check for more extreme values.
65 

◆ max()

double LVL1::PhiRange::max ( ) const

Definition at line 39 of file PhiRange.cxx.

39  {
40  m_min = min;
41  m_max = max;

◆ min()

double LVL1::PhiRange::min ( ) const

Definition at line 35 of file PhiRange.cxx.

◆ setRange()

void LVL1::PhiRange::setRange ( double  min,
double  max 
)

sets range

Definition at line 44 of file PhiRange.cxx.

Member Data Documentation

◆ m_max

double LVL1::PhiRange::m_max
private

Definition at line 50 of file PhiRange.h.

◆ m_min

double LVL1::PhiRange::m_min
private

Definition at line 49 of file PhiRange.h.


The documentation for this class was generated from the following files:
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
LVL1::PhiRange::centre
double centre() const
returns the centre of the two ranges.
Definition: PhiRange.cxx:98
LVL1::PhiRange::m_min
double m_min
Definition: PhiRange.h:49
LVL1::PhiRange::m_max
double m_max
Definition: PhiRange.h:50
LVL1::PhiRange::min
double min() const
Definition: PhiRange.cxx:35
LVL1::PhiRange::max
double max() const
Definition: PhiRange.cxx:39
LVL1::PhiRange::checkValues
void checkValues()
This function makes sure m_min really is less than m_max.
Definition: PhiRange.cxx:68