CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

CaloDirectionOperations Class Reference

#include <CaloDirectionOperations.h>

List of all members.

Public Member Functions

 CaloDirectionOperations ()
 ~CaloDirectionOperations ()

Static Public Member Functions

static CaloDirection add2d (const CaloDirection &dir1, const CaloDirection &dir2)
static unsigned neighbourDirection (const CaloDirection &side)
 unsigned int -> Direction for the neighbours
static CaloDirection neighbourDirection (unsigned i)
 Direction -> unsigned conversion for the neighbours.
static unsigned oppositeDirection (unsigned iside)
static CaloDirection oppositeSide (const CaloDirection &side)
static unsigned Side (const CaloDirection &side)
 Side -> unsigned conversion.
static CaloDirection Side (unsigned i)
 unsigned int -> Side conversion

Detailed Description

Definition at line 11 of file CaloDirectionOperations.h.


Constructor & Destructor Documentation

CaloDirectionOperations::CaloDirectionOperations ( ) [inline]

Definition at line 14 of file CaloDirectionOperations.h.

{;}
CaloDirectionOperations::~CaloDirectionOperations ( ) [inline]

Definition at line 15 of file CaloDirectionOperations.h.

{;}

Member Function Documentation

CaloDirection CaloDirectionOperations::add2d ( const CaloDirection dir1,
const CaloDirection dir2 
) [static]
unsigned CaloDirectionOperations::neighbourDirection ( const CaloDirection side) [static]

unsigned int -> Direction for the neighbours

Definition at line 22 of file CaloDirectionOperations.cc.

References EAST, NORTH, NORTHEAST, NORTHWEST, query::result, SOUTH, SOUTHEAST, SOUTHWEST, and WEST.

Referenced by EcalHitMaker::configureGeometry(), and EcalHitMaker::diagonalEdge().

{
  unsigned result;
  switch (side)
    {
    case NORTH:
      result=0;
      break;
    case EAST:
      result=1;
      break;
    case SOUTH:
      result=2;
      break;
    case WEST:
      result=3;
      break;
    case NORTHEAST:
      result=4;
      break;
    case SOUTHEAST:
      result=5;
      break;
    case SOUTHWEST:
      result=6;
      break;
    case NORTHWEST:
      result=7;
      break;
    default:
      result=999;
    }
  return result;
}
CaloDirection CaloDirectionOperations::neighbourDirection ( unsigned  i) [static]

Direction -> unsigned conversion for the neighbours.

Definition at line 59 of file CaloDirectionOperations.cc.

References constexpr, EAST, i, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, and WEST.

{
  constexpr CaloDirection sides[8]={NORTH,EAST,SOUTH,WEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTHWEST};
  //  if(i<0||i>7) return SOUTH;
  return sides[i];
}
unsigned CaloDirectionOperations::oppositeDirection ( unsigned  iside) [static]

Definition at line 140 of file CaloDirectionOperations.cc.

References constexpr.

Referenced by EcalHitMaker::configureGeometry().

{
  constexpr unsigned od[8]={2,3,0,1,6,7,4,5};
  return od[iside];
  //  if(iside>=0&&iside<8) return od[iside];
  //  return 999;
}
CaloDirection CaloDirectionOperations::oppositeSide ( const CaloDirection side) [static]

Definition at line 97 of file CaloDirectionOperations.cc.

References DOWN, EAST, NONE, NORTH, NORTHEAST, NORTHWEST, query::result, SOUTH, SOUTHEAST, SOUTHWEST, UP, and WEST.

Referenced by EcalHitMaker::diagonalEdge(), and EcalHitMaker::gapsLifting().

{
  CaloDirection result;
  switch (side)
    {
    case UP:
      result=DOWN;
      break;
    case DOWN:
      result=UP;
      break;
    case EAST:
      result=WEST;
      break;
    case WEST:
      result=EAST;
      break;
    case NORTH:
      result=SOUTH;
      break;
    case SOUTH:
      result=NORTH;
      break;
    case NORTHEAST:
      result=SOUTHWEST;
      break;
    case NORTHWEST:
      result=SOUTHEAST;
      break;
    case SOUTHEAST:
      result=NORTHWEST;
      break;
    case SOUTHWEST:
      result=NORTHEAST;
      break;
      
    default:
      result=NONE;
    }
  return result;
}
unsigned CaloDirectionOperations::Side ( const CaloDirection side) [static]

Side -> unsigned conversion.

Definition at line 67 of file CaloDirectionOperations.cc.

References DOWN, EAST, NORTH, query::result, SOUTH, UP, and WEST.

{
  unsigned result;
  switch (side)
    {
    case NORTH:
      result=0;
      break;
    case EAST:
      result=1;
      break;
    case SOUTH:
      result=2;
      break;
    case WEST:
      result=3;
      break;
    case UP:
      result=4;
      break;
    case DOWN:
      result=5;
      break;
    default:
      result=999;
    }
  return result;
}
CaloDirection CaloDirectionOperations::Side ( unsigned  i) [static]

unsigned int -> Side conversion

Definition at line 15 of file CaloDirectionOperations.cc.

References constexpr, DOWN, EAST, i, NORTH, SOUTH, UP, and WEST.

Referenced by add2d(), EcalHitMaker::ecalCellLine(), BaseCrystal::getSide(), and EcalHitMaker::setTrackParameters().

{
  constexpr CaloDirection sides[6]={NORTH,EAST,SOUTH,WEST,UP,DOWN};
  //  if(i<0||i>5) return DOWN;
  return sides[i];
}