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 25 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*().

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