CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
CaloDirectionOperations Class Reference

#include <CaloDirectionOperations.h>

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 More...
 
static CaloDirection neighbourDirection (unsigned i)
 Direction -> unsigned conversion for the neighbours. More...
 
static unsigned oppositeDirection (unsigned iside)
 
static CaloDirection oppositeSide (const CaloDirection &side)
 
static CaloDirection Side (unsigned i)
 unsigned int -> Side conversion More...
 
static unsigned Side (const CaloDirection &side)
 Side -> unsigned conversion. More...
 

Detailed Description

Definition at line 10 of file CaloDirectionOperations.h.

Constructor & Destructor Documentation

◆ CaloDirectionOperations()

CaloDirectionOperations::CaloDirectionOperations ( )
inline

Definition at line 12 of file CaloDirectionOperations.h.

12 { ; }

◆ ~CaloDirectionOperations()

CaloDirectionOperations::~CaloDirectionOperations ( )
inline

Definition at line 13 of file CaloDirectionOperations.h.

13 { ; }

Member Function Documentation

◆ add2d()

CaloDirection CaloDirectionOperations::add2d ( const CaloDirection dir1,
const CaloDirection dir2 
)
static

Definition at line 3 of file CaloDirectionOperations.cc.

References L1TDiffHarvesting_cfi::dir1, L1TDiffHarvesting_cfi::dir2, EAST, NONE, NORTH, NORTHEAST, NORTHWEST, Side(), SOUTH, SOUTHEAST, SOUTHWEST, and WEST.

Referenced by EcalHitMaker::correspondingEdge(), EcalHitMaker::gapsLifting(), and EcalHitMaker::unbalancedDirection().

3  {
4  // unsigned d1=Side(dir1);
5  // unsigned d2=Side(dir2);
6  constexpr CaloDirection tab[4][4] = {{NORTH, NORTHEAST, NONE, NORTHWEST},
10  return tab[Side(dir1)][Side(dir2)];
11 }
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
Definition: TkAlStyle.h:43

◆ neighbourDirection() [1/2]

unsigned CaloDirectionOperations::neighbourDirection ( const CaloDirection side)
static

unsigned int -> Direction for the neighbours

Definition at line 19 of file CaloDirectionOperations.cc.

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

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

19  {
20  unsigned result;
21  switch (side) {
22  case NORTH:
23  result = 0;
24  break;
25  case EAST:
26  result = 1;
27  break;
28  case SOUTH:
29  result = 2;
30  break;
31  case WEST:
32  result = 3;
33  break;
34  case NORTHEAST:
35  result = 4;
36  break;
37  case SOUTHEAST:
38  result = 5;
39  break;
40  case SOUTHWEST:
41  result = 6;
42  break;
43  case NORTHWEST:
44  result = 7;
45  break;
46  default:
47  result = 999;
48  }
49  return result;
50 }

◆ neighbourDirection() [2/2]

CaloDirection CaloDirectionOperations::neighbourDirection ( unsigned  i)
static

Direction -> unsigned conversion for the neighbours.

Definition at line 53 of file CaloDirectionOperations.cc.

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

53  {
54  constexpr CaloDirection sides[8] = {NORTH, EAST, SOUTH, WEST, NORTHEAST, SOUTHEAST, SOUTHWEST, NORTHWEST};
55  // if(i<0||i>7) return SOUTH;
56  return sides[i];
57 }
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9

◆ oppositeDirection()

unsigned CaloDirectionOperations::oppositeDirection ( unsigned  iside)
static

Definition at line 126 of file CaloDirectionOperations.cc.

References submitPVValidationJobs::od.

Referenced by EcalHitMaker::configureGeometry().

126  {
127  constexpr unsigned od[8] = {2, 3, 0, 1, 6, 7, 4, 5};
128  return od[iside];
129  // if(iside>=0&&iside<8) return od[iside];
130  // return 999;
131 }

◆ oppositeSide()

CaloDirection CaloDirectionOperations::oppositeSide ( const CaloDirection side)
static

Definition at line 86 of file CaloDirectionOperations.cc.

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

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

86  {
88  switch (side) {
89  case UP:
90  result = DOWN;
91  break;
92  case DOWN:
93  result = UP;
94  break;
95  case EAST:
96  result = WEST;
97  break;
98  case WEST:
99  result = EAST;
100  break;
101  case NORTH:
102  result = SOUTH;
103  break;
104  case SOUTH:
105  result = NORTH;
106  break;
107  case NORTHEAST:
108  result = SOUTHWEST;
109  break;
110  case NORTHWEST:
111  result = SOUTHEAST;
112  break;
113  case SOUTHEAST:
114  result = NORTHWEST;
115  break;
116  case SOUTHWEST:
117  result = NORTHEAST;
118  break;
119 
120  default:
121  result = NONE;
122  }
123  return result;
124 }
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
Definition: TkAlStyle.h:43

◆ Side() [1/2]

CaloDirection CaloDirectionOperations::Side ( unsigned  i)
static

unsigned int -> Side conversion

Definition at line 13 of file CaloDirectionOperations.cc.

References DOWN, EAST, mps_fire::i, NORTH, SOUTH, UP, and WEST.

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

13  {
14  constexpr CaloDirection sides[6] = {NORTH, EAST, SOUTH, WEST, UP, DOWN};
15  // if(i<0||i>5) return DOWN;
16  return sides[i];
17 }
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9

◆ Side() [2/2]

unsigned CaloDirectionOperations::Side ( const CaloDirection side)
static

Side -> unsigned conversion.

Definition at line 59 of file CaloDirectionOperations.cc.

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

59  {
60  unsigned result;
61  switch (side) {
62  case NORTH:
63  result = 0;
64  break;
65  case EAST:
66  result = 1;
67  break;
68  case SOUTH:
69  result = 2;
70  break;
71  case WEST:
72  result = 3;
73  break;
74  case UP:
75  result = 4;
76  break;
77  case DOWN:
78  result = 5;
79  break;
80  default:
81  result = 999;
82  }
83  return result;
84 }