CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloDirectionOperations.cc
Go to the documentation of this file.
2 
3 
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 }
14 
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 }
21 
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 }
56 
57 
58 // It should be merged with the previous one. But I am afraid to break something
60 {
62  // if(i<0||i>7) return SOUTH;
63  return sides[i];
64 }
65 
66 
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 }
95 
96 
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 }
138 
139 
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 }
int i
Definition: DBlmapReader.cc:9
static CaloDirection add2d(const CaloDirection &dir1, const CaloDirection &dir2)
static CaloDirection oppositeSide(const CaloDirection &side)
static unsigned oppositeDirection(unsigned iside)
static unsigned neighbourDirection(const CaloDirection &side)
unsigned int -&gt; Direction for the neighbours
tuple result
Definition: query.py:137
static CaloDirection Side(unsigned i)
unsigned int -&gt; Side conversion
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9