CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
CaloNavigator< T, TOPO > Class Template Referencefinal

#include <CaloNavigator.h>

Public Member Functions

 CaloNavigator (const T &home, const TOPO *topology)
 
T down () const
 move the navigator west More...
 
T east () const
 move the navigator east More...
 
const TOPO * getTopology () const
 set the starting position More...
 
void home () const
 move the navigator back to the starting point More...
 
T north () const
 move the navigator north More...
 
T offsetBy (int deltaX, int deltaY) const
 Free movement of arbitray steps. More...
 
T operator* () const
 get the current position More...
 
T pos () const
 get the current position More...
 
void setHome (const T &startingPoint)
 set the starting position More...
 
void setTopology (const TOPO *)
 set the starting position More...
 
T south () const
 move the navigator south More...
 
T up () const
 move the navigator west More...
 
T west () const
 move the navigator west More...
 

Protected Attributes

T currentPoint_
 
const TOPO * myTopology_
 
T startingPoint_
 

Detailed Description

template<class T, class TOPO = CaloSubdetectorTopology>
class CaloNavigator< T, TOPO >

Definition at line 7 of file CaloNavigator.h.

Constructor & Destructor Documentation

◆ CaloNavigator()

template<class T, class TOPO = CaloSubdetectorTopology>
CaloNavigator< T, TOPO >::CaloNavigator ( const T home,
const TOPO *  topology 
)
inline

Definition at line 9 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::home(), and CaloNavigator< T, TOPO >::setHome().

void home() const
move the navigator back to the starting point
Definition: CaloNavigator.h:96
void setHome(const T &startingPoint)
set the starting position
Definition: CaloNavigator.h:90
const TOPO * myTopology_
Definition: CaloNavigator.h:85

Member Function Documentation

◆ down()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::down ( ) const
inline

move the navigator west

Definition at line 60 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::currentPoint_, and CaloNavigator< T, TOPO >::myTopology_.

60  {
62  return currentPoint_;
63  };
const TOPO * myTopology_
Definition: CaloNavigator.h:85

◆ east()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::east ( ) const
inline

◆ getTopology()

template<class T, class TOPO = CaloSubdetectorTopology>
const TOPO* CaloNavigator< T, TOPO >::getTopology ( ) const
inline

set the starting position

Definition at line 18 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::myTopology_.

18 { return myTopology_; }
const TOPO * myTopology_
Definition: CaloNavigator.h:85

◆ home()

template<class T , class TOPO >
void CaloNavigator< T, TOPO >::home ( ) const
inline

◆ north()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::north ( ) const
inline

◆ offsetBy()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::offsetBy ( int  deltaX,
int  deltaY 
) const
inline

Free movement of arbitray steps.

Definition at line 66 of file CaloNavigator.h.

References funct::abs(), CaloNavigator< T, TOPO >::currentPoint_, CaloNavigator< T, TOPO >::east(), CaloNavigator< T, TOPO >::north(), CaloNavigator< T, TOPO >::south(), CaloNavigator< T, TOPO >::west(), x, and y.

Referenced by ClusterShapeAlgo::Create_Map(), EEBadScFilter::scan5x5(), EcalMipGraphs::selectHits(), and EcalDisplaysByEvent::selectHits().

66  {
67  for (int x = 0; x < abs(deltaX) && currentPoint_ != T(0); x++) {
68  if (deltaX > 0)
69  east();
70  else
71  west();
72  }
73 
74  for (int y = 0; y < abs(deltaY) && currentPoint_ != T(0); y++) {
75  if (deltaY > 0)
76  north();
77  else
78  south();
79  }
80 
81  return currentPoint_;
82  }
T north() const
move the navigator north
Definition: CaloNavigator.h:30
T south() const
move the navigator south
Definition: CaloNavigator.h:36
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T east() const
move the navigator east
Definition: CaloNavigator.h:42
T west() const
move the navigator west
Definition: CaloNavigator.h:48
long double T

◆ operator*()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::operator* ( void  ) const
inline

get the current position

Definition at line 27 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::currentPoint_.

27 { return currentPoint_; }

◆ pos()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::pos ( ) const
inline

get the current position

Definition at line 24 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::currentPoint_.

Referenced by EcalBoundaryInfoCalculator< EBDetId >::goBackOneCell().

24 { return currentPoint_; }

◆ setHome()

template<class T , class TOPO >
void CaloNavigator< T, TOPO >::setHome ( const T startingPoint)
inline

◆ setTopology()

template<class T , class TOPO >
void CaloNavigator< T, TOPO >::setTopology ( const TOPO *  topology)
inline

set the starting position

Definition at line 101 of file CaloNavigator.h.

References HLT_2024v11_cff::topology.

101  {
102  if (myTopology_ == 0)
104  else
105  return;
106 }
const TOPO * myTopology_
Definition: CaloNavigator.h:85

◆ south()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::south ( ) const
inline

◆ up()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::up ( ) const
inline

move the navigator west

Definition at line 54 of file CaloNavigator.h.

References CaloNavigator< T, TOPO >::currentPoint_, and CaloNavigator< T, TOPO >::myTopology_.

54  {
56  return currentPoint_;
57  };
const TOPO * myTopology_
Definition: CaloNavigator.h:85

◆ west()

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::west ( ) const
inline

Member Data Documentation

◆ currentPoint_

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::currentPoint_
mutableprotected

◆ myTopology_

template<class T, class TOPO = CaloSubdetectorTopology>
const TOPO* CaloNavigator< T, TOPO >::myTopology_
protected

◆ startingPoint_

template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::startingPoint_
mutableprotected

Definition at line 86 of file CaloNavigator.h.