CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
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 ()=default
 create a new Topology 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...
 

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 ( )
default

create a new Topology

EcalPreshowerTopology::~EcalPreshowerTopology ( )
inlineoverride

virtual destructor

Definition at line 18 of file EcalPreshowerTopology.h.

18 {}

Member Function Documentation

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

move the nagivator to smaller ix

Definition at line 85 of file EcalPreshowerTopology.cc.

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

Referenced by down(), and goWest().

85  {
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 }
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:15
ESDetId EcalPreshowerTopology::decrementIy ( const ESDetId id) const
private

move the nagivator to smaller iy

Definition at line 32 of file EcalPreshowerTopology.cc.

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

Referenced by down(), and goSouth().

32  {
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 }
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:15
ESDetId EcalPreshowerTopology::decrementIz ( const ESDetId id) const
private

move the nagivator to smaller iz

Definition at line 122 of file EcalPreshowerTopology.cc.

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

Referenced by down(), and goDown().

122  {
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 }
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:15
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 70 of file EcalPreshowerTopology.h.

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

70  {
71  ESDetId nextId = goDown(id);
72  std::vector<DetId> vNeighborsDetId;
73  if (!(nextId == ESDetId(0)))
74  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
75  return vNeighborsDetId;
76  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Definition: DetId.h:17
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 42 of file EcalPreshowerTopology.h.

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

42  {
43  ESDetId nextId = goEast(id);
44  std::vector<DetId> vNeighborsDetId;
45  if (!(nextId == ESDetId(0)))
46  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
47  return vNeighborsDetId;
48  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: DetId.h:17
DetId EcalPreshowerTopology::goDown ( const DetId id) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorTopology.

Definition at line 69 of file EcalPreshowerTopology.h.

References decrementIz().

Referenced by down().

69 { return decrementIz(ESDetId(id)); }
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 41 of file EcalPreshowerTopology.h.

References incrementIx().

Referenced by east().

41 { return incrementIx(ESDetId(id)); }
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 21 of file EcalPreshowerTopology.h.

References incrementIy().

Referenced by north().

21 { return incrementIy(ESDetId(id)); }
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 31 of file EcalPreshowerTopology.h.

References decrementIy().

Referenced by south().

31 { return decrementIy(ESDetId(id)); }
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 60 of file EcalPreshowerTopology.h.

References incrementIz().

Referenced by up().

60 { return incrementIz(ESDetId(id)); }
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 51 of file EcalPreshowerTopology.h.

References decrementIx().

Referenced by west().

51 { return decrementIx(ESDetId(id)); }
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 58 of file EcalPreshowerTopology.cc.

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

Referenced by down(), and goEast().

58  {
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 }
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:15
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)
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 }
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:15
ESDetId EcalPreshowerTopology::incrementIz ( const ESDetId id) const
private

move the nagivator to larger iz

Definition at line 111 of file EcalPreshowerTopology.cc.

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

Referenced by down(), and goUp().

111  {
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 }
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:15
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 22 of file EcalPreshowerTopology.h.

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

22  {
23  ESDetId nextId = goNorth(id);
24  std::vector<DetId> vNeighborsDetId;
25  if (!(nextId == ESDetId(0)))
26  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
27  return vNeighborsDetId;
28  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: DetId.h:17
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 32 of file EcalPreshowerTopology.h.

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

32  {
33  ESDetId nextId = goSouth(id);
34  std::vector<DetId> vNeighborsDetId;
35  if (!(nextId == ESDetId(0)))
36  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
37  return vNeighborsDetId;
38  }
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:57
Definition: DetId.h:17
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 61 of file EcalPreshowerTopology.h.

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

61  {
62  ESDetId nextId = goUp(id);
63  std::vector<DetId> vNeighborsDetId;
64  if (!(nextId == ESDetId(0)))
65  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
66  return vNeighborsDetId;
67  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Definition: DetId.h:17
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 52 of file EcalPreshowerTopology.h.

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

52  {
53  ESDetId nextId = goWest(id);
54  std::vector<DetId> vNeighborsDetId;
55  if (!(nextId == ESDetId(0)))
56  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
57  return vNeighborsDetId;
58  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Definition: DetId.h:17
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)