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 Reference

#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
 move the Topology east (positive ix) More...
 
 EcalPreshowerTopology ()
 create a new Topology More...
 
 EcalPreshowerTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 move the Topology north (increment iy) More...
 
virtual std::vector< DetIdsouth (const DetId &id) const
 move the Topology south (decrement iy) More...
 
virtual std::vector< DetIdup (const DetId &id) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 move the Topology west (negative ix) More...
 
virtual ~EcalPreshowerTopology ()
 virtual destructor More...
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor 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 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, strip(), and ESDetId::validDetId().

Referenced by west().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
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, strip(), and ESDetId::validDetId().

Referenced by south().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
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, strip(), and ESDetId::validDetId().

Referenced by down().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
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 74 of file EcalPreshowerTopology.h.

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

75  {
76  ESDetId nextId=decrementIz(ESDetId(id));
77  std::vector<DetId> vNeighborsDetId;
78  if (! (nextId==ESDetId(0)))
79  vNeighborsDetId.push_back(DetId(nextId.rawId()));
80  return vNeighborsDetId;
81  }
ESDetId decrementIz(const ESDetId &id) const
move the nagivator to smaller iz
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
virtual std::vector<DetId> EcalPreshowerTopology::east ( const DetId id) const
inlinevirtual

move the Topology east (positive ix)

Implements CaloSubdetectorTopology.

Definition at line 46 of file EcalPreshowerTopology.h.

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

47  {
48  ESDetId nextId=incrementIx(ESDetId(id));
49  std::vector<DetId> vNeighborsDetId;
50  if (! (nextId==ESDetId(0)))
51  vNeighborsDetId.push_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
ESDetId incrementIx(const ESDetId &id) const
move the nagivator to larger ix
Definition: DetId.h:20
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, strip(), and ESDetId::validDetId().

Referenced by east().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
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, strip(), and ESDetId::validDetId().

Referenced by north().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
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, strip(), and ESDetId::validDetId().

Referenced by up().

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 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
virtual std::vector<DetId> EcalPreshowerTopology::north ( const DetId id) const
inlinevirtual

move the Topology north (increment iy)

Implements CaloSubdetectorTopology.

Definition at line 26 of file EcalPreshowerTopology.h.

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

27  {
28  ESDetId nextId=incrementIy(ESDetId(id));
29  std::vector<DetId> vNeighborsDetId;
30  if (! (nextId==ESDetId(0)))
31  vNeighborsDetId.push_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
ESDetId incrementIy(const ESDetId &id) const
move the nagivator to larger iy
virtual std::vector<DetId> EcalPreshowerTopology::south ( const DetId id) const
inlinevirtual

move the Topology south (decrement iy)

Implements CaloSubdetectorTopology.

Definition at line 36 of file EcalPreshowerTopology.h.

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

37  {
38  ESDetId nextId=decrementIy(ESDetId(id));
39  std::vector<DetId> vNeighborsDetId;
40  if (! (nextId==ESDetId(0)))
41  vNeighborsDetId.push_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
ESDetId decrementIy(const ESDetId &id) const
move the nagivator to smaller 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 65 of file EcalPreshowerTopology.h.

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

66  {
67  ESDetId nextId=incrementIz(ESDetId(id));
68  std::vector<DetId> vNeighborsDetId;
69  if (! (nextId==ESDetId(0)))
70  vNeighborsDetId.push_back(DetId(nextId.rawId()));
71  return vNeighborsDetId;
72  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
virtual std::vector<DetId> EcalPreshowerTopology::west ( const DetId id) const
inlinevirtual

move the Topology west (negative ix)

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalPreshowerTopology.h.

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

57  {
58  ESDetId nextId=decrementIx(ESDetId(id));
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==ESDetId(0)))
61  vNeighborsDetId.push_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
ESDetId decrementIx(const ESDetId &id) const
move the nagivator to smaller ix
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20

Member Data Documentation

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

Definition at line 103 of file EcalPreshowerTopology.h.