CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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 >::setHome().

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

Member Function Documentation

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
template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::east ( ) const
inline
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
template<class T , class TOPO >
void CaloNavigator< T, TOPO >::home ( ) const
inline
template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::north ( ) const
inline
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 spr::chargeIsolation(), ClusterShapeAlgo::Create_Map(), HybridClusterAlgo::e2Et(), HybridClusterAlgo::et25(), CosmicClusterAlgo::prepareCluster(), Multi5x5ClusterAlgo::prepareCluster(), 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 west() const
move the navigator west
Definition: CaloNavigator.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T south() const
move the navigator south
Definition: CaloNavigator.h:36
T east() const
move the navigator east
Definition: CaloNavigator.h:42
T north() const
move the navigator north
Definition: CaloNavigator.h:30
long double T
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_; }
template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::pos ( ) const
inline
template<class T , class TOPO >
void CaloNavigator< T, TOPO >::setHome ( const T startingPoint)
inline
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.

101  {
102  if (myTopology_ == 0)
103  myTopology_ = topology;
104  else
105  return;
106 }
const TOPO * myTopology_
Definition: CaloNavigator.h:85
template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::south ( ) const
inline
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
template<class T, class TOPO = CaloSubdetectorTopology>
T CaloNavigator< T, TOPO >::west ( ) const
inline

Member Data Documentation

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

Definition at line 86 of file CaloNavigator.h.