CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 11 of file EcalPreshowerTopology.h.

Constructor & Destructor Documentation

EcalPreshowerTopology::EcalPreshowerTopology ( )
default

create a new Topology

EcalPreshowerTopology::~EcalPreshowerTopology ( )
inlineoverride

virtual destructor

Definition at line 17 of file EcalPreshowerTopology.h.

17 {}

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 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 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 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 69 of file EcalPreshowerTopology.h.

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

69  {
70  ESDetId nextId = goDown(id);
71  std::vector<DetId> vNeighborsDetId;
72  if (!(nextId == ESDetId(0)))
73  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
74  return vNeighborsDetId;
75  }
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 41 of file EcalPreshowerTopology.h.

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

41  {
42  ESDetId nextId = goEast(id);
43  std::vector<DetId> vNeighborsDetId;
44  if (!(nextId == ESDetId(0)))
45  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
46  return vNeighborsDetId;
47  }
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 68 of file EcalPreshowerTopology.h.

References decrementIz().

Referenced by down().

68 { 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 40 of file EcalPreshowerTopology.h.

References incrementIx().

Referenced by east().

40 { 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 20 of file EcalPreshowerTopology.h.

References incrementIy().

Referenced by north().

20 { 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 30 of file EcalPreshowerTopology.h.

References decrementIy().

Referenced by south().

30 { 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 59 of file EcalPreshowerTopology.h.

References incrementIz().

Referenced by up().

59 { 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 50 of file EcalPreshowerTopology.h.

References decrementIx().

Referenced by west().

50 { 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 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 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 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 21 of file EcalPreshowerTopology.h.

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

21  {
22  ESDetId nextId = goNorth(id);
23  std::vector<DetId> vNeighborsDetId;
24  if (!(nextId == ESDetId(0)))
25  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
26  return vNeighborsDetId;
27  }
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 31 of file EcalPreshowerTopology.h.

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

31  {
32  ESDetId nextId = goSouth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (!(nextId == ESDetId(0)))
35  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
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 60 of file EcalPreshowerTopology.h.

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

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

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

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