CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 11 of file CaloDirectionOperations.h.

Constructor & Destructor Documentation

CaloDirectionOperations::CaloDirectionOperations ( )
inline

Definition at line 14 of file CaloDirectionOperations.h.

14 {;}
CaloDirectionOperations::~CaloDirectionOperations ( )
inline

Definition at line 15 of file CaloDirectionOperations.h.

15 {;}

Member Function Documentation

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

Definition at line 4 of file CaloDirectionOperations.cc.

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

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

5 {
6  // unsigned d1=Side(dir1);
7  // unsigned d2=Side(dir2);
8  static CaloDirection tab[4][4]={{NORTH,NORTHEAST,NONE,NORTHWEST},
12  return tab[Side(dir1)][Side(dir2)];
13 }
static CaloDirection Side(unsigned i)
unsigned int -&gt; Side conversion
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
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().

23 {
24  unsigned result;
25  switch (side)
26  {
27  case NORTH:
28  result=0;
29  break;
30  case EAST:
31  result=1;
32  break;
33  case SOUTH:
34  result=2;
35  break;
36  case WEST:
37  result=3;
38  break;
39  case NORTHEAST:
40  result=4;
41  break;
42  case SOUTHEAST:
43  result=5;
44  break;
45  case SOUTHWEST:
46  result=6;
47  break;
48  case NORTHWEST:
49  result=7;
50  break;
51  default:
52  result=999;
53  }
54  return result;
55 }
tuple result
Definition: query.py:137
CaloDirection CaloDirectionOperations::neighbourDirection ( unsigned  i)
static

Direction -> unsigned conversion for the neighbours.

Definition at line 59 of file CaloDirectionOperations.cc.

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

60 {
62  // if(i<0||i>7) return SOUTH;
63  return sides[i];
64 }
int i
Definition: DBlmapReader.cc:9
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
unsigned CaloDirectionOperations::oppositeDirection ( unsigned  iside)
static

Definition at line 140 of file CaloDirectionOperations.cc.

Referenced by EcalHitMaker::configureGeometry().

141 {
142  static unsigned od[8]={2,3,0,1,6,7,4,5};
143  return od[iside];
144  // if(iside>=0&&iside<8) return od[iside];
145  // return 999;
146 }
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::correspondingEdge(), EcalHitMaker::diagonalEdge(), and EcalHitMaker::gapsLifting().

98 {
100  switch (side)
101  {
102  case UP:
103  result=DOWN;
104  break;
105  case DOWN:
106  result=UP;
107  break;
108  case EAST:
109  result=WEST;
110  break;
111  case WEST:
112  result=EAST;
113  break;
114  case NORTH:
115  result=SOUTH;
116  break;
117  case SOUTH:
118  result=NORTH;
119  break;
120  case NORTHEAST:
121  result=SOUTHWEST;
122  break;
123  case NORTHWEST:
124  result=SOUTHEAST;
125  break;
126  case SOUTHEAST:
127  result=NORTHWEST;
128  break;
129  case SOUTHWEST:
130  result=NORTHEAST;
131  break;
132 
133  default:
134  result=NONE;
135  }
136  return result;
137 }
tuple result
Definition: query.py:137
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
CaloDirection CaloDirectionOperations::Side ( unsigned  i)
static

unsigned int -> Side conversion

Definition at line 15 of file CaloDirectionOperations.cc.

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

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

16 {
17  static CaloDirection sides[6]={NORTH,EAST,SOUTH,WEST,UP,DOWN};
18  // if(i<0||i>5) return DOWN;
19  return sides[i];
20 }
int i
Definition: DBlmapReader.cc:9
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
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.

68 {
69  unsigned result;
70  switch (side)
71  {
72  case NORTH:
73  result=0;
74  break;
75  case EAST:
76  result=1;
77  break;
78  case SOUTH:
79  result=2;
80  break;
81  case WEST:
82  result=3;
83  break;
84  case UP:
85  result=4;
86  break;
87  case DOWN:
88  result=5;
89  break;
90  default:
91  result=999;
92  }
93  return result;
94 }
tuple result
Definition: query.py:137