CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalPreshowerTopology Class Referencefinal

#include <EcalPreshowerTopology.h>

Inheritance diagram for EcalPreshowerTopology:
CaloSubdetectorTopology

Public Member Functions

virtual std::vector< DetIddown (const DetId &id) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 
 EcalPreshowerTopology ()
 create a new Topology More...
 
 EcalPreshowerTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry More...
 
virtual DetId goDown (const DetId &id) const
 
virtual DetId goEast (const DetId &id) const
 move the Topology east (positive ix) More...
 
virtual DetId goNorth (const DetId &id) const
 move the Topology north (increment iy) More...
 
virtual DetId goSouth (const DetId &id) const
 move the Topology south (decrement iy) More...
 
virtual DetId goUp (const DetId &id) const
 
virtual DetId goWest (const DetId &id) const
 move the Topology west (negative ix) More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 
virtual std::vector< DetIdsouth (const DetId &id) const
 
virtual std::vector< DetIdup (const DetId &id) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 
virtual ~EcalPreshowerTopology ()
 virtual destructor More...
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor More...
 
virtual DetId denseId2detId (unsigned int) const
 return a linear packed id More...
 
virtual bool denseIdConsistent (int topoVer) const
 return whether this topology is consistent with the numbering in the given topology More...
 
virtual unsigned int detId2denseId (const DetId &) const
 return a linear packed id More...
 
virtual std::vector< DetIdgetAllNeighbours (const DetId &id) const
 
virtual std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 
virtual std::vector< DetIdgetWindow (const DetId &id, const int &northSouthSize, const int &eastWestSize) const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
virtual int topoVersion () const
 return a version which identifies the given topology More...
 
virtual bool valid (const DetId &) const
 is this detid present in the Topology? More...
 
virtual ~CaloSubdetectorTopology ()
 virtual destructor More...
 

Private Member Functions

ESDetId decrementIx (const ESDetId &id) const
 move the nagivator to smaller ix More...
 
ESDetId decrementIy (const ESDetId &id) const
 move the nagivator to smaller iy More...
 
ESDetId decrementIz (const ESDetId &id) const
 move the nagivator to smaller iz More...
 
ESDetId incrementIx (const ESDetId &id) const
 move the nagivator to larger ix More...
 
ESDetId incrementIy (const ESDetId &id) const
 move the nagivator to larger iy More...
 
ESDetId incrementIz (const ESDetId &id) const
 move the nagivator to larger iz More...
 

Private Attributes

edm::ESHandle< CaloGeometrytheGeom_
 

Additional Inherited Members

- Protected Types inherited from CaloSubdetectorTopology
typedef std::pair< int, int > Coordinate
 
- Protected Member Functions inherited from CaloSubdetectorTopology
Coordinate getNeighbourIndex (const Coordinate &coord, const CaloDirection &dir) const
 

Detailed Description

Definition at line 11 of file EcalPreshowerTopology.h.

Constructor & Destructor Documentation

EcalPreshowerTopology::EcalPreshowerTopology ( )
inline

create a new Topology

Definition at line 15 of file EcalPreshowerTopology.h.

15 : theGeom_(0) {};
edm::ESHandle< CaloGeometry > theGeom_
virtual EcalPreshowerTopology::~EcalPreshowerTopology ( )
inlinevirtual

virtual destructor

Definition at line 18 of file EcalPreshowerTopology.h.

18 { }
EcalPreshowerTopology::EcalPreshowerTopology ( edm::ESHandle< CaloGeometry theGeom)
inline

create a new Topology from geometry

Definition at line 21 of file EcalPreshowerTopology.h.

21  : theGeom_(theGeom)
22  {
23  }
edm::ESHandle< CaloGeometry > theGeom_

Member Function Documentation

ESDetId EcalPreshowerTopology::decrementIx ( const ESDetId id) const
private

move the nagivator to smaller ix

Definition at line 143 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goWest().

143  {
144 
145  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
146  {
147  return ESDetId(0);
148  }
149  ESDetId nextPoint;
150  //Strips orientend along x direction for plane 2
151  if (id.plane() == 2)
152  {
153  //Changing wafer
154  if (ESDetId::validDetId(id.strip(),id.six()-1,id.siy(),id.plane(),id.zside()))
155  nextPoint=ESDetId(id.strip(),id.six()-1,id.siy(),id.plane(),id.zside());
156  else
157  return ESDetId(0);
158  }
159  //Strips orientend along y direction for plane 1
160  else if (id.plane() == 1)
161  {
162  if (id.strip() > 1 )
163  {
164  //Decrementing just strip number
165  if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
166  nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
167  else
168  return ESDetId(0);
169  }
170  else
171  {
172  //Changing wafer
173  if (ESDetId::validDetId(32,id.six()-1,id.siy(),id.plane(),id.zside()))
174  nextPoint=ESDetId(32,id.six()-1,id.siy(),id.plane(),id.zside());
175  else
176  return ESDetId(0);
177  }
178  }
179  else
180  return ESDetId(0);
181 
182  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
183  return nextPoint;
184  else
185  return ESDetId(0);
186 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
ESDetId EcalPreshowerTopology::decrementIy ( const ESDetId id) const
private

move the nagivator to smaller iy

Definition at line 51 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goSouth().

51  {
52  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
53  {
54  return ESDetId(0);
55  }
56  ESDetId nextPoint;
57  //Strips orientend along x direction for plane 2
58  if (id.plane() == 2)
59  {
60  if (id.strip() >1 )
61  {
62  //Decrementing just strip number
63  if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
64  nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
65  else
66  return ESDetId(0);
67  }
68  else
69  {
70  //Changing wafer
71  if (ESDetId::validDetId(32,id.six(),id.siy()-1,id.plane(),id.zside()))
72  nextPoint=ESDetId(32,id.six(),id.siy()-1,id.plane(),id.zside());
73  else
74  return ESDetId(0);
75  }
76  }
77  //Strips orientend along y direction for plane 1
78  else if (id.plane() == 1)
79  {
80  //Changing wafer
81  if (ESDetId::validDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside()))
82  nextPoint=ESDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside());
83  else
84  return ESDetId(0);
85  }
86  else
87  return ESDetId(0);
88 
89  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
90  return nextPoint;
91  else
92  return ESDetId(0);
93 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
ESDetId EcalPreshowerTopology::decrementIz ( const ESDetId id) const
private

move the nagivator to smaller iz

Definition at line 209 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goDown().

209  {
210 
211  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
212  {
213  return ESDetId(0);
214  }
215  ESDetId nextPoint;
216  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside()))
217  nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside());
218  else
219  return ESDetId(0);
220 
221  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
222  return nextPoint;
223  else
224  return ESDetId(0);
225 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
virtual std::vector<DetId> EcalPreshowerTopology::down ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in down direction (inward)

Implements CaloSubdetectorTopology.

Definition at line 93 of file EcalPreshowerTopology.h.

References goDown(), and DetId::rawId().

94  {
95  ESDetId nextId=goDown(id);
96  std::vector<DetId> vNeighborsDetId;
97  if (! (nextId==ESDetId(0)))
98  vNeighborsDetId.push_back(DetId(nextId.rawId()));
99  return vNeighborsDetId;
100  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual DetId goDown(const DetId &id) const
Definition: DetId.h:18
virtual std::vector<DetId> EcalPreshowerTopology::east ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalPreshowerTopology.h.

References goEast(), and DetId::rawId().

57  {
58  ESDetId nextId=goEast(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==ESDetId(0)))
61  vNeighborsDetId.push_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
virtual DetId goEast(const DetId &id) const
move the Topology east (positive ix)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId EcalPreshowerTopology::goDown ( const DetId id) const
inlinevirtual

Reimplemented from CaloSubdetectorTopology.

Definition at line 90 of file EcalPreshowerTopology.h.

References decrementIz().

Referenced by down().

90  {
91  return decrementIz(ESDetId(id));
92  }
ESDetId decrementIz(const ESDetId &id) const
move the nagivator to smaller iz
virtual DetId EcalPreshowerTopology::goEast ( const DetId id) const
inlinevirtual

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 53 of file EcalPreshowerTopology.h.

References incrementIx().

Referenced by east().

53  {
54  return incrementIx(ESDetId(id));
55  }
ESDetId incrementIx(const ESDetId &id) const
move the nagivator to larger ix
virtual DetId EcalPreshowerTopology::goNorth ( const DetId id) const
inlinevirtual

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 27 of file EcalPreshowerTopology.h.

References incrementIy().

Referenced by north().

27  {
28  return incrementIy(ESDetId(id));
29  }
ESDetId incrementIy(const ESDetId &id) const
move the nagivator to larger iy
virtual DetId EcalPreshowerTopology::goSouth ( const DetId id) const
inlinevirtual

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 40 of file EcalPreshowerTopology.h.

References decrementIy().

Referenced by south().

40  {
41  return decrementIy(ESDetId(id));
42  }
ESDetId decrementIy(const ESDetId &id) const
move the nagivator to smaller iy
virtual DetId EcalPreshowerTopology::goUp ( const DetId id) const
inlinevirtual

Reimplemented from CaloSubdetectorTopology.

Definition at line 78 of file EcalPreshowerTopology.h.

References incrementIz().

Referenced by up().

78  {
79  return incrementIz(ESDetId(id));
80  }
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
virtual DetId EcalPreshowerTopology::goWest ( const DetId id) const
inlinevirtual

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 66 of file EcalPreshowerTopology.h.

References decrementIx().

Referenced by west().

66  {
67  return decrementIx(ESDetId(id));
68  }
ESDetId decrementIx(const ESDetId &id) const
move the nagivator to smaller ix
ESDetId EcalPreshowerTopology::incrementIx ( const ESDetId id) const
private

move the nagivator to larger ix

Definition at line 96 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goEast().

96  {
97 
98  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
99  {
100  return ESDetId(0);
101  }
102  ESDetId nextPoint;
103 
104  //Strips orientend along x direction for plane 2
105  if (id.plane() == 2)
106  {
107  //Changing wafer
108  if (ESDetId::validDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside()))
109  nextPoint=ESDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside());
110  else
111  return ESDetId(0);
112  }
113  //Strips orientend along y direction for plane 1
114  else if (id.plane() == 1)
115  {
116  if (id.strip() < 32 )
117  {
118  //Incrementing just strip number
119  if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside()))
120  nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
121  else
122  return ESDetId(0);
123  }
124  else
125  {
126  //Changing wafer
127  if (ESDetId::validDetId(1,id.six()+1,id.siy(),id.plane(),id.zside()))
128  nextPoint=ESDetId(1,id.six()+1,id.siy(),id.plane(),id.zside());
129  else
130  return ESDetId(0);
131  }
132  }
133  else
134  return ESDetId(0);
135 
136  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
137  return nextPoint;
138  else
139  return ESDetId(0);
140 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
ESDetId EcalPreshowerTopology::incrementIy ( const ESDetId id) const
private

move the nagivator to larger iy

Definition at line 5 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goNorth().

5  {
6  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
7  {
8  return ESDetId(0);
9  }
10 
11  ESDetId nextPoint;
12  //Strips orientend along x direction for plane 2
13  if (id.plane() == 2)
14  {
15  if (id.strip() < 32 )
16  {
17  //Incrementing just strip number
18  if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside()))
19  nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
20  else
21  return ESDetId(0);
22  }
23  else
24  {
25  //Changing wafer
26  if (ESDetId::validDetId(1,id.six(),id.siy()+1,id.plane(),id.zside()))
27  nextPoint=ESDetId(1,id.six(),id.siy()+1,id.plane(),id.zside());
28  else
29  return ESDetId(0);
30  }
31  }
32  //Strips orientend along y direction for plane 1
33  else if (id.plane() == 1)
34  {
35  //Changing wafer
36  if (ESDetId::validDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside()))
37  nextPoint=ESDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside());
38  else
39  return ESDetId(0);
40  }
41  else
42  return ESDetId(0);
43 
44  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
45  return nextPoint;
46  else
47  return ESDetId(0);
48 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
ESDetId EcalPreshowerTopology::incrementIz ( const ESDetId id) const
private

move the nagivator to larger iz

Definition at line 189 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goUp().

189  {
190 
191  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
192  {
193  return ESDetId(0);
194  }
195  ESDetId nextPoint;
196  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside()))
197  nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside());
198  else
199  return ESDetId(0);
200 
201  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
202  return nextPoint;
203  else
204  return ESDetId(0);
205 }
int zside(DetId const &)
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:34
virtual std::vector<DetId> EcalPreshowerTopology::north ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 30 of file EcalPreshowerTopology.h.

References goNorth(), and DetId::rawId().

31  {
32  ESDetId nextId= goNorth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (! (nextId==ESDetId(0)))
35  vNeighborsDetId.push_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId goNorth(const DetId &id) const
move the Topology north (increment iy)
virtual std::vector<DetId> EcalPreshowerTopology::south ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 43 of file EcalPreshowerTopology.h.

References goSouth(), and DetId::rawId().

44  {
45  ESDetId nextId= goSouth(id);
46  std::vector<DetId> vNeighborsDetId;
47  if (! (nextId==ESDetId(0)))
48  vNeighborsDetId.push_back(DetId(nextId.rawId()));
49  return vNeighborsDetId;
50  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId goSouth(const DetId &id) const
move the Topology south (decrement iy)
virtual std::vector<DetId> EcalPreshowerTopology::up ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in up direction (outward)

Implements CaloSubdetectorTopology.

Definition at line 81 of file EcalPreshowerTopology.h.

References goUp(), and DetId::rawId().

82  {
83  ESDetId nextId=goUp(id);
84  std::vector<DetId> vNeighborsDetId;
85  if (! (nextId==ESDetId(0)))
86  vNeighborsDetId.push_back(DetId(nextId.rawId()));
87  return vNeighborsDetId;
88  }
virtual DetId goUp(const DetId &id) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual std::vector<DetId> EcalPreshowerTopology::west ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 69 of file EcalPreshowerTopology.h.

References goWest(), and DetId::rawId().

70  {
71  ESDetId nextId=goWest(id);
72  std::vector<DetId> vNeighborsDetId;
73  if (! (nextId==ESDetId(0)))
74  vNeighborsDetId.push_back(DetId(nextId.rawId()));
75  return vNeighborsDetId;
76  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId goWest(const DetId &id) const
move the Topology west (negative ix)

Member Data Documentation

edm::ESHandle<CaloGeometry> EcalPreshowerTopology::theGeom_
private

Definition at line 122 of file EcalPreshowerTopology.h.