test
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 100 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goWest().

100  {
101  ESDetId nextPoint(0);
102  if (id==nextPoint) return 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  }
111  //Strips orientend along y direction for plane 1
112  else if (id.plane() == 1)
113  {
114  if (id.strip() > 1 )
115  {
116  //Decrementing just strip number
117  if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
118  nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
119  }
120  else
121  {
122  //Changing wafer
123  if (ESDetId::validDetId(32,id.six()-1,id.siy(),id.plane(),id.zside()))
124  nextPoint=ESDetId(32,id.six()-1,id.siy(),id.plane(),id.zside());
125  }
126  }
127  return nextPoint;
128 }
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:22
ESDetId EcalPreshowerTopology::decrementIy ( const ESDetId id) const
private

move the nagivator to smaller iy

Definition at line 37 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goSouth().

37  {
38  ESDetId nextPoint(0);
39  if (id==nextPoint) return nextPoint;
40 
41  //Strips orientend along x direction for plane 2
42  if (id.plane() == 2)
43  {
44  if (id.strip() >1 )
45  {
46  //Decrementing just strip number
47  if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
48  nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
49  }
50  else
51  {
52  //Changing wafer
53  if (ESDetId::validDetId(32,id.six(),id.siy()-1,id.plane(),id.zside()))
54  nextPoint=ESDetId(32,id.six(),id.siy()-1,id.plane(),id.zside());
55  }
56  }
57  //Strips orientend along y direction for plane 1
58  else if (id.plane() == 1)
59  {
60  //Changing wafer
61  if (ESDetId::validDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside()))
62  nextPoint=ESDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside());
63  }
64  return nextPoint;
65 }
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:22
ESDetId EcalPreshowerTopology::decrementIz ( const ESDetId id) const
private

move the nagivator to smaller iz

Definition at line 143 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goDown().

143  {
144  ESDetId nextPoint(0);
145  if (id==nextPoint) return nextPoint;
146 
147  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside()))
148  nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside());
149 
150  return nextPoint;
151 }
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:22
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 68 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goEast().

68  {
69  ESDetId nextPoint(0);
70  if (id==nextPoint) return nextPoint;
71 
72  //Strips orientend along x direction for plane 2
73  if (id.plane() == 2)
74  {
75  //Changing wafer
76  if (ESDetId::validDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside()))
77  nextPoint=ESDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside());
78  }
79  //Strips orientend along y direction for plane 1
80  else if (id.plane() == 1)
81  {
82  if (id.strip() < 32 )
83  {
84  //Incrementing just strip number
85  if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside()))
86  nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
87  }
88  else
89  {
90  //Changing wafer
91  if (ESDetId::validDetId(1,id.six()+1,id.siy(),id.plane(),id.zside()))
92  nextPoint=ESDetId(1,id.six()+1,id.siy(),id.plane(),id.zside());
93  }
94  }
95 
96  return nextPoint;
97 }
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:22
ESDetId EcalPreshowerTopology::incrementIy ( const ESDetId id) const
private

move the nagivator to larger iy

Definition at line 5 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goNorth().

5  {
6  ESDetId nextPoint(0);
7  if (id==nextPoint) return nextPoint;
8 
9  //Strips orientend along x direction for plane 2
10  if (id.plane() == 2)
11  {
12  if (id.strip() < 32 )
13  {
14  //Incrementing just strip number
15  if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside()))
16  nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
17  }
18  else
19  {
20  //Changing wafer
21  if (ESDetId::validDetId(1,id.six(),id.siy()+1,id.plane(),id.zside()))
22  nextPoint=ESDetId(1,id.six(),id.siy()+1,id.plane(),id.zside());
23  }
24  }
25  //Strips orientend along y direction for plane 1
26  else if (id.plane() == 1)
27  {
28  //Changing wafer
29  if (ESDetId::validDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside()))
30  nextPoint=ESDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside());
31  }
32 
33  return nextPoint;
34 }
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:22
ESDetId EcalPreshowerTopology::incrementIz ( const ESDetId id) const
private

move the nagivator to larger iz

Definition at line 131 of file EcalPreshowerTopology.cc.

References ESDetId::validDetId(), and ecaldqm::zside().

Referenced by goUp().

131  {
132  ESDetId nextPoint(0);
133  if (id==nextPoint) return nextPoint;
134 
135  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside()))
136  nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside());
137 
138  return nextPoint;
139 }
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:22
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.