CMS 3D CMS Logo

Classes | Functions
CaloRectangle.h File Reference
#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
#include "Geometry/CaloTopology/interface/CaloTopology.h"

Go to the source code of this file.

Classes

struct  CaloRectangle
 
class  CaloRectangleRange< T >
 
class  CaloRectangleRange< T >::Iterator
 

Functions

template<class T >
T offsetBy (T start, CaloSubdetectorTopology const &topo, int dIEtaOrIX, int dIPhiOrIY)
 

Function Documentation

template<class T >
T offsetBy ( T  start,
CaloSubdetectorTopology const &  topo,
int  dIEtaOrIX,
int  dIPhiOrIY 
)

Definition at line 24 of file CaloRectangle.h.

References funct::abs(), CaloSubdetectorTopology::goEast(), CaloSubdetectorTopology::goNorth(), CaloSubdetectorTopology::goSouth(), CaloSubdetectorTopology::goWest(), mps_fire::i, and command_line::start.

Referenced by CaloRectangleRange< T >::Iterator::operator*().

24  {
25  for (int i = 0; i < std::abs(dIEtaOrIX) && start != T(0); i++) {
26  start = dIEtaOrIX > 0 ? topo.goEast(start) : topo.goWest(start);
27  }
28 
29  for (int i = 0; i < std::abs(dIPhiOrIY) && start != T(0); i++) {
30  start = dIPhiOrIY > 0 ? topo.goNorth(start) : topo.goSouth(start);
31  }
32  return start;
33 }
Definition: start.py:1
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
long double T