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

Constructor & Destructor Documentation

◆ EcalPreshowerTopology()

EcalPreshowerTopology::EcalPreshowerTopology ( )
default

create a new Topology

◆ ~EcalPreshowerTopology()

EcalPreshowerTopology::~EcalPreshowerTopology ( )
inlineoverride

virtual destructor

Definition at line 17 of file EcalPreshowerTopology.h.

17 {}

Member Function Documentation

◆ decrementIx()

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

move the nagivator to smaller ix

Definition at line 85 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goWest().

◆ decrementIy()

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

move the nagivator to smaller iy

Definition at line 32 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goSouth().

◆ decrementIz()

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

move the nagivator to smaller iz

Definition at line 122 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goDown().

◆ down()

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.

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  }

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

◆ east()

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.

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  }

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

◆ goDown()

DetId EcalPreshowerTopology::goDown ( const DetId id) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorTopology.

Definition at line 68 of file EcalPreshowerTopology.h.

68 { return decrementIz(ESDetId(id)); }

References decrementIz().

Referenced by down().

◆ goEast()

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.

40 { return incrementIx(ESDetId(id)); }

References incrementIx().

Referenced by east().

◆ goNorth()

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.

20 { return incrementIy(ESDetId(id)); }

References incrementIy().

Referenced by north().

◆ goSouth()

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.

30 { return decrementIy(ESDetId(id)); }

References decrementIy().

Referenced by south().

◆ goUp()

DetId EcalPreshowerTopology::goUp ( const DetId id) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorTopology.

Definition at line 59 of file EcalPreshowerTopology.h.

59 { return incrementIz(ESDetId(id)); }

References incrementIz().

Referenced by up().

◆ goWest()

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.

50 { return decrementIx(ESDetId(id)); }

References decrementIx().

Referenced by west().

◆ incrementIx()

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

move the nagivator to larger ix

Definition at line 58 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goEast().

◆ incrementIy()

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

move the nagivator to larger iy

Definition at line 5 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goNorth().

◆ incrementIz()

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

move the nagivator to larger iz

Definition at line 111 of file EcalPreshowerTopology.cc.

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 }

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

Referenced by goUp().

◆ north()

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.

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  }

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

◆ south()

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.

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  }

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

◆ up()

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.

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  }

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

◆ west()

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.

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  }

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

EcalPreshowerTopology::decrementIy
ESDetId decrementIy(const ESDetId &id) const
move the nagivator to smaller iy
Definition: EcalPreshowerTopology.cc:32
EcalPreshowerTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: EcalPreshowerTopology.h:50
EcalPreshowerTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: EcalPreshowerTopology.h:30
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EcalPreshowerTopology::decrementIz
ESDetId decrementIz(const ESDetId &id) const
move the nagivator to smaller iz
Definition: EcalPreshowerTopology.cc:122
EcalPreshowerTopology::goDown
DetId goDown(const DetId &id) const override
Definition: EcalPreshowerTopology.h:68
EcalPreshowerTopology::incrementIx
ESDetId incrementIx(const ESDetId &id) const
move the nagivator to larger ix
Definition: EcalPreshowerTopology.cc:58
EcalPreshowerTopology::incrementIy
ESDetId incrementIy(const ESDetId &id) const
move the nagivator to larger iy
Definition: EcalPreshowerTopology.cc:5
ESDetId
Definition: ESDetId.h:15
DetId
Definition: DetId.h:17
EcalPreshowerTopology::goUp
DetId goUp(const DetId &id) const override
Definition: EcalPreshowerTopology.h:59
EcalPreshowerTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: EcalPreshowerTopology.h:20
EcalPreshowerTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: EcalPreshowerTopology.h:40
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalPreshowerTopology::decrementIx
ESDetId decrementIx(const ESDetId &id) const
move the nagivator to smaller ix
Definition: EcalPreshowerTopology.cc:85
ESDetId::validDetId
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:15
EcalPreshowerTopology::incrementIz
ESDetId incrementIz(const ESDetId &id) const
move the nagivator to larger iz
Definition: EcalPreshowerTopology.cc:111