CMS 3D CMS Logo

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

std::vector< DetIddown (const DetId &id) const override
 
std::vector< DetIdeast (const DetId &id) const override
 
 EcalPreshowerTopology ()
 create a new Topology More...
 
 EcalPreshowerTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry More...
 
DetId goDown (const DetId &id) const override
 
DetId goEast (const DetId &id) const override
 move the Topology east (positive ix) More...
 
DetId goNorth (const DetId &id) const override
 move the Topology north (increment iy) More...
 
DetId goSouth (const DetId &id) const override
 move the Topology south (decrement iy) More...
 
DetId goUp (const DetId &id) const override
 
DetId goWest (const DetId &id) const override
 move the Topology west (negative ix) More...
 
std::vector< DetIdnorth (const DetId &id) const override
 
std::vector< DetIdsouth (const DetId &id) const override
 
std::vector< DetIdup (const DetId &id) const override
 
std::vector< DetIdwest (const DetId &id) const override
 
 ~EcalPreshowerTopology () override
 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 12 of file EcalPreshowerTopology.h.

Constructor & Destructor Documentation

EcalPreshowerTopology::EcalPreshowerTopology ( )
inline

create a new Topology

Definition at line 16 of file EcalPreshowerTopology.h.

16 : theGeom_(nullptr) {};
edm::ESHandle< CaloGeometry > theGeom_
EcalPreshowerTopology::~EcalPreshowerTopology ( )
inlineoverride

virtual destructor

Definition at line 19 of file EcalPreshowerTopology.h.

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

create a new Topology from geometry

Definition at line 22 of file EcalPreshowerTopology.h.

22  : theGeom_(std::move(theGeom))
23  {
24  }
edm::ESHandle< CaloGeometry > theGeom_
def move(src, dest)
Definition: eostools.py:511

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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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
std::vector<DetId> EcalPreshowerTopology::down ( const DetId id) const
inlineoverridevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 94 of file EcalPreshowerTopology.h.

References decrementIx(), decrementIy(), decrementIz(), goDown(), incrementIx(), incrementIy(), incrementIz(), and DetId::rawId().

95  {
96  ESDetId nextId=goDown(id);
97  std::vector<DetId> vNeighborsDetId;
98  if (! (nextId==ESDetId(0)))
99  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
100  return vNeighborsDetId;
101  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Definition: DetId.h:18
DetId goDown(const DetId &id) const override
std::vector<DetId> EcalPreshowerTopology::east ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 57 of file EcalPreshowerTopology.h.

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

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

Reimplemented from CaloSubdetectorTopology.

Definition at line 91 of file EcalPreshowerTopology.h.

References decrementIz().

Referenced by down().

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

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 54 of file EcalPreshowerTopology.h.

References incrementIx().

Referenced by east().

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

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 28 of file EcalPreshowerTopology.h.

References incrementIy().

Referenced by north().

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

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 41 of file EcalPreshowerTopology.h.

References decrementIy().

Referenced by south().

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

Reimplemented from CaloSubdetectorTopology.

Definition at line 79 of file EcalPreshowerTopology.h.

References incrementIz().

Referenced by up().

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

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 67 of file EcalPreshowerTopology.h.

References decrementIx().

Referenced by west().

67  {
68  return decrementIx(ESDetId(id));
69  }
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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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 digitizers_cfi::strip, ESDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and 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
std::vector<DetId> EcalPreshowerTopology::north ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 31 of file EcalPreshowerTopology.h.

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

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

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 44 of file EcalPreshowerTopology.h.

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

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

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

Implements CaloSubdetectorTopology.

Definition at line 82 of file EcalPreshowerTopology.h.

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

83  {
84  ESDetId nextId=goUp(id);
85  std::vector<DetId> vNeighborsDetId;
86  if (! (nextId==ESDetId(0)))
87  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
88  return vNeighborsDetId;
89  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Definition: DetId.h:18
DetId goUp(const DetId &id) const override
std::vector<DetId> EcalPreshowerTopology::west ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 70 of file EcalPreshowerTopology.h.

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

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

Member Data Documentation

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

Definition at line 123 of file EcalPreshowerTopology.h.