CMS 3D CMS Logo

CaloNavigator< T > Class Template Reference

#include <RecoCaloTools/Navigation/interface/CaloNavigator.h>

List of all members.

Public Member Functions

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

Protected Attributes

currentPoint_
const CaloSubdetectorTopologymyTopology_
startingPoint_


Detailed Description

template<class T>
class CaloNavigator< T >

Definition at line 7 of file CaloNavigator.h.


Constructor & Destructor Documentation

template<class T>
CaloNavigator< T >::CaloNavigator (  )  [inline]

Default constructor.

Definition at line 11 of file CaloNavigator.h.

00011                   : myTopology_(0)
00012     {
00013     }

template<class T>
CaloNavigator< T >::CaloNavigator ( const T &  home  )  [inline]

Definition at line 15 of file CaloNavigator.h.

00015                                : myTopology_(0)
00016     {
00017       setHome(home);
00018     };

template<class T>
CaloNavigator< T >::CaloNavigator ( const T &  home,
const CaloSubdetectorTopology topology 
) [inline]

Definition at line 21 of file CaloNavigator.h.

00021                                                                         : myTopology_(topology) 
00022     {
00023       setHome(home);
00024     };

template<class T>
virtual CaloNavigator< T >::~CaloNavigator (  )  [inline, virtual]

Default constructor.

Definition at line 27 of file CaloNavigator.h.

00027 {};


Member Function Documentation

template<class T>
virtual T CaloNavigator< T >::down (  )  const [inline, virtual]

move the navigator west

Definition at line 101 of file CaloNavigator.h.

00102     { 
00103       if ((myTopology_->down(currentPoint_)).size()==1)
00104         currentPoint_=(myTopology_->down(currentPoint_))[0];
00105       else
00106         currentPoint_=T(0);
00107       return currentPoint_;
00108     } ;

template<class T>
virtual T CaloNavigator< T >::east (  )  const [inline, virtual]

move the navigator east

Definition at line 71 of file CaloNavigator.h.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), PreshowerClusterAlgo::findRoad(), HybridClusterAlgo::makeDomino(), PreshowerClusterAlgo::makeOneCluster(), CaloNavigator< EBDetId >::offsetBy(), and IslandClusterAlgo::searchEast().

00072     { 
00073       if ((myTopology_->east(currentPoint_)).size()==1)
00074         currentPoint_=(myTopology_->east(currentPoint_))[0];
00075       else
00076         currentPoint_=T(0);
00077       return currentPoint_;
00078     } ;

template<class T>
const CaloSubdetectorTopology* CaloNavigator< T >::getTopology (  )  const [inline]

set the starting position

Definition at line 36 of file CaloNavigator.h.

00037     {
00038       return myTopology_;
00039     }

template<class T>
void CaloNavigator< T >::home (  )  const [inline]

move the navigator back to the starting point

Definition at line 143 of file CaloNavigator.h.

References CaloNavigator< T >::currentPoint_, and CaloNavigator< T >::startingPoint_.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), EcalClusterTools::covariances(), ClusterShapeAlgo::Create_Map(), SinglePionEfficiencyNew::eECALmatrix(), HybridClusterAlgo::et25(), PFClusterShapeAlgo::fill5x5Map(), PreshowerClusterAlgo::findRoad(), EcalClusterTools::localCovariances(), HybridClusterAlgo::mainSearch(), HybridClusterAlgo::makeDomino(), PreshowerClusterAlgo::makeOneCluster(), EcalClusterTools::matrixDetId(), EcalClusterTools::matrixEnergy(), Multi5x5ClusterAlgo::prepareCluster(), CosmicClusterAlgo::prepareCluster(), IslandClusterAlgo::searchEast(), IslandClusterAlgo::searchWest(), and CaloNavigator< T >::setHome().

00144 {
00145   currentPoint_=startingPoint_;
00146 }

template<class T>
virtual T CaloNavigator< T >::north (  )  const [inline, virtual]

move the navigator north

Definition at line 51 of file CaloNavigator.h.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), PreshowerClusterAlgo::findRoad(), HybridClusterAlgo::mainSearch(), PreshowerClusterAlgo::makeOneCluster(), CaloNavigator< EBDetId >::offsetBy(), and IslandClusterAlgo::searchNorth().

00052     { 
00053       if ((myTopology_->north(currentPoint_)).size()==1)
00054         currentPoint_=(myTopology_->north(currentPoint_))[0];
00055       else
00056         currentPoint_=T(0);
00057       return currentPoint_;
00058     } ;

template<class T>
virtual T CaloNavigator< T >::offsetBy ( int  deltaX,
int  deltaY 
) const [inline, virtual]

Free movement of arbitray steps.

Definition at line 111 of file CaloNavigator.h.

Referenced by EcalClusterTools::covariances(), ClusterShapeAlgo::Create_Map(), SinglePionEfficiencyNew::eECALmatrix(), HybridClusterAlgo::et25(), PFClusterShapeAlgo::fill5x5Map(), EcalClusterTools::localCovariances(), EcalClusterTools::matrixDetId(), EcalClusterTools::matrixEnergy(), Multi5x5ClusterAlgo::prepareCluster(), and CosmicClusterAlgo::prepareCluster().

00112     {
00113       for(int x=0; x < abs(deltaX) && currentPoint_ != T(0); x++)
00114         {
00115           if(deltaX > 0) east();
00116           else           west();
00117         }
00118 
00119       for(int y=0; y < abs(deltaY) && currentPoint_ != T(0); y++)
00120         {
00121           if(deltaY > 0) north();
00122           else           south();
00123         }
00124 
00125       return currentPoint_;
00126 
00127     }

template<class T>
T CaloNavigator< T >::operator * ( void   )  const [inline]

get the current position

Definition at line 48 of file CaloNavigator.h.

00048 { return currentPoint_; } 

template<class T>
T CaloNavigator< T >::pos (  )  const [inline]

get the current position

Definition at line 45 of file CaloNavigator.h.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), HybridClusterAlgo::makeDomino(), IslandClusterAlgo::searchEast(), IslandClusterAlgo::searchNorth(), IslandClusterAlgo::searchSouth(), and IslandClusterAlgo::searchWest().

00045 { return currentPoint_; }

template<class T>
void CaloNavigator< T >::setHome ( const T &  startingPoint  )  [inline]

set the starting position

Definition at line 136 of file CaloNavigator.h.

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

Referenced by CaloNavigator< EBDetId >::CaloNavigator(), EndcapPiZeroDiscriminatorAlgo::findPreshVector(), PreshowerClusterAlgo::findRoad(), and PreshowerClusterAlgo::makeOneCluster().

00137 {
00138   startingPoint_=startingPoint;
00139   home();
00140 }

template<class T>
void CaloNavigator< T >::setTopology ( const CaloSubdetectorTopology topology  )  [inline]

set the starting position

Definition at line 149 of file CaloNavigator.h.

References CaloNavigator< T >::myTopology_.

00150 {
00151   if (myTopology_ == 0)
00152     myTopology_=topology;
00153   else
00154     return;
00155 }

template<class T>
virtual T CaloNavigator< T >::south (  )  const [inline, virtual]

move the navigator south

Definition at line 61 of file CaloNavigator.h.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), PreshowerClusterAlgo::findRoad(), HybridClusterAlgo::mainSearch(), PreshowerClusterAlgo::makeOneCluster(), CaloNavigator< EBDetId >::offsetBy(), and IslandClusterAlgo::searchSouth().

00062     { 
00063       if ((myTopology_->south(currentPoint_)).size()==1)
00064         currentPoint_=(myTopology_->south(currentPoint_))[0];
00065       else
00066         currentPoint_=T(0);
00067       return currentPoint_;
00068     } ;

template<class T>
virtual T CaloNavigator< T >::up (  )  const [inline, virtual]

move the navigator west

Definition at line 91 of file CaloNavigator.h.

00092     { 
00093       if ((myTopology_->up(currentPoint_)).size()==1)
00094         currentPoint_=(myTopology_->up(currentPoint_))[0];
00095       else
00096         currentPoint_=T(0);
00097       return currentPoint_;
00098     } ;

template<class T>
virtual T CaloNavigator< T >::west (  )  const [inline, virtual]

move the navigator west

Definition at line 81 of file CaloNavigator.h.

Referenced by Multi5x5ClusterAlgo::checkMaxima(), CosmicClusterAlgo::checkMaxima(), PreshowerClusterAlgo::findRoad(), HybridClusterAlgo::makeDomino(), PreshowerClusterAlgo::makeOneCluster(), CaloNavigator< EBDetId >::offsetBy(), and IslandClusterAlgo::searchWest().

00082     { 
00083       if ((myTopology_->west(currentPoint_)).size()==1)
00084         currentPoint_=(myTopology_->west(currentPoint_))[0];
00085       else
00086         currentPoint_=T(0);
00087       return currentPoint_;
00088     } ;


Member Data Documentation

template<class T>
T CaloNavigator< T >::currentPoint_ [mutable, protected]

Definition at line 132 of file CaloNavigator.h.

Referenced by CaloNavigator< EBDetId >::down(), CaloNavigator< EBDetId >::east(), CaloNavigator< T >::home(), CaloNavigator< EBDetId >::north(), CaloNavigator< EBDetId >::offsetBy(), CaloNavigator< EBDetId >::operator *(), CaloNavigator< EBDetId >::pos(), CaloNavigator< EBDetId >::south(), CaloNavigator< EBDetId >::up(), and CaloNavigator< EBDetId >::west().

template<class T>
const CaloSubdetectorTopology* CaloNavigator< T >::myTopology_ [protected]

Definition at line 131 of file CaloNavigator.h.

Referenced by CaloNavigator< EBDetId >::down(), CaloNavigator< EBDetId >::east(), CaloNavigator< EBDetId >::getTopology(), CaloNavigator< EBDetId >::north(), CaloNavigator< T >::setTopology(), CaloNavigator< EBDetId >::south(), CaloNavigator< EBDetId >::up(), and CaloNavigator< EBDetId >::west().

template<class T>
T CaloNavigator< T >::startingPoint_ [mutable, protected]

Definition at line 132 of file CaloNavigator.h.

Referenced by CaloNavigator< T >::home(), and CaloNavigator< T >::setHome().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:15:47 2009 for CMSSW by  doxygen 1.5.4