CMS 3D CMS Logo

EcalPreshowerTopology.cc
Go to the documentation of this file.
3 #include <stdexcept>
4 
6  ESDetId nextPoint(0);
7  if (id == nextPoint)
8  return nextPoint;
9 
10  //Strips orientend along x direction for plane 2
11  if (id.plane() == 2) {
12  if (id.strip() < 32) {
13  //Incrementing just strip number
14  if (ESDetId::validDetId(id.strip() + 1, id.six(), id.siy(), id.plane(), id.zside()))
15  nextPoint = ESDetId(id.strip() + 1, id.six(), id.siy(), id.plane(), id.zside());
16  } else {
17  //Changing wafer
18  if (ESDetId::validDetId(1, id.six(), id.siy() + 1, id.plane(), id.zside()))
19  nextPoint = ESDetId(1, id.six(), id.siy() + 1, id.plane(), id.zside());
20  }
21  }
22  //Strips orientend along y direction for plane 1
23  else if (id.plane() == 1) {
24  //Changing wafer
25  if (ESDetId::validDetId(id.strip(), id.six(), id.siy() + 1, id.plane(), id.zside()))
26  nextPoint = ESDetId(id.strip(), id.six(), id.siy() + 1, id.plane(), id.zside());
27  }
28 
29  return nextPoint;
30 }
31 
33  ESDetId nextPoint(0);
34  if (id == nextPoint)
35  return nextPoint;
36 
37  //Strips orientend along x direction for plane 2
38  if (id.plane() == 2) {
39  if (id.strip() > 1) {
40  //Decrementing just strip number
41  if (ESDetId::validDetId(id.strip() - 1, id.six(), id.siy(), id.plane(), id.zside()))
42  nextPoint = ESDetId(id.strip() - 1, id.six(), id.siy(), id.plane(), id.zside());
43  } else {
44  //Changing wafer
45  if (ESDetId::validDetId(32, id.six(), id.siy() - 1, id.plane(), id.zside()))
46  nextPoint = ESDetId(32, id.six(), id.siy() - 1, id.plane(), id.zside());
47  }
48  }
49  //Strips orientend along y direction for plane 1
50  else if (id.plane() == 1) {
51  //Changing wafer
52  if (ESDetId::validDetId(id.strip(), id.six(), id.siy() - 1, id.plane(), id.zside()))
53  nextPoint = ESDetId(id.strip(), id.six(), id.siy() - 1, id.plane(), id.zside());
54  }
55  return nextPoint;
56 }
57 
59  ESDetId nextPoint(0);
60  if (id == nextPoint)
61  return nextPoint;
62 
63  //Strips orientend along x direction for plane 2
64  if (id.plane() == 2) {
65  //Changing wafer
66  if (ESDetId::validDetId(id.strip(), id.six() + 1, id.siy(), id.plane(), id.zside()))
67  nextPoint = ESDetId(id.strip(), id.six() + 1, id.siy(), id.plane(), id.zside());
68  }
69  //Strips orientend along y direction for plane 1
70  else if (id.plane() == 1) {
71  if (id.strip() < 32) {
72  //Incrementing just strip number
73  if (ESDetId::validDetId(id.strip() + 1, id.six(), id.siy(), id.plane(), id.zside()))
74  nextPoint = ESDetId(id.strip() + 1, id.six(), id.siy(), id.plane(), id.zside());
75  } else {
76  //Changing wafer
77  if (ESDetId::validDetId(1, id.six() + 1, id.siy(), id.plane(), id.zside()))
78  nextPoint = ESDetId(1, id.six() + 1, id.siy(), id.plane(), id.zside());
79  }
80  }
81 
82  return nextPoint;
83 }
84 
86  ESDetId nextPoint(0);
87  if (id == nextPoint)
88  return nextPoint;
89 
90  //Strips orientend along x direction for plane 2
91  if (id.plane() == 2) {
92  //Changing wafer
93  if (ESDetId::validDetId(id.strip(), id.six() - 1, id.siy(), id.plane(), id.zside()))
94  nextPoint = ESDetId(id.strip(), id.six() - 1, id.siy(), id.plane(), id.zside());
95  }
96  //Strips orientend along y direction for plane 1
97  else if (id.plane() == 1) {
98  if (id.strip() > 1) {
99  //Decrementing just strip number
100  if (ESDetId::validDetId(id.strip() - 1, id.six(), id.siy(), id.plane(), id.zside()))
101  nextPoint = ESDetId(id.strip() - 1, id.six(), id.siy(), id.plane(), id.zside());
102  } else {
103  //Changing wafer
104  if (ESDetId::validDetId(32, id.six() - 1, id.siy(), id.plane(), id.zside()))
105  nextPoint = ESDetId(32, id.six() - 1, id.siy(), id.plane(), id.zside());
106  }
107  }
108  return nextPoint;
109 }
110 
112  ESDetId nextPoint(0);
113  if (id == nextPoint)
114  return nextPoint;
115 
116  if (ESDetId::validDetId(id.strip(), id.six(), id.siy(), id.plane() + 1, id.zside()))
117  nextPoint = ESDetId(id.strip(), id.six(), id.siy(), id.plane() + 1, id.zside());
118 
119  return nextPoint;
120 }
121 
123  ESDetId nextPoint(0);
124  if (id == nextPoint)
125  return nextPoint;
126 
127  if (ESDetId::validDetId(id.strip(), id.six(), id.siy(), id.plane() - 1, id.zside()))
128  nextPoint = ESDetId(id.strip(), id.six(), id.siy(), id.plane() - 1, id.zside());
129 
130  return nextPoint;
131 }
ESDetId decrementIx(const ESDetId &id) const
move the nagivator to smaller ix
ESDetId decrementIz(const ESDetId &id) const
move the nagivator to smaller iz
int zside(DetId const &)
ESDetId incrementIx(const ESDetId &id) const
move the nagivator to larger ix
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
ESDetId decrementIy(const ESDetId &id) const
move the nagivator to smaller iy
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:15
ESDetId incrementIy(const ESDetId &id) const
move the nagivator to larger iy