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

◆ offsetBy()

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 isotrackNtupler::start.

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

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