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

19 { }

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:15
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:15
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: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 89 of file EcalPreshowerTopology.h.

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

90  {
91  ESDetId nextId=goDown(id);
92  std::vector<DetId> vNeighborsDetId;
93  if (! (nextId==ESDetId(0)))
94  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
95  return vNeighborsDetId;
96  }
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 52 of file EcalPreshowerTopology.h.

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

53  {
54  ESDetId nextId=goEast(id);
55  std::vector<DetId> vNeighborsDetId;
56  if (! (nextId==ESDetId(0)))
57  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
58  return vNeighborsDetId;
59  }
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 86 of file EcalPreshowerTopology.h.

References decrementIz().

Referenced by down().

86  {
87  return decrementIz(ESDetId(id));
88  }
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 49 of file EcalPreshowerTopology.h.

References incrementIx().

Referenced by east().

49  {
50  return incrementIx(ESDetId(id));
51  }
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 23 of file EcalPreshowerTopology.h.

References incrementIy().

Referenced by north().

23  {
24  return incrementIy(ESDetId(id));
25  }
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 36 of file EcalPreshowerTopology.h.

References decrementIy().

Referenced by south().

36  {
37  return decrementIy(ESDetId(id));
38  }
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 74 of file EcalPreshowerTopology.h.

References incrementIz().

Referenced by up().

74  {
75  return incrementIz(ESDetId(id));
76  }
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 62 of file EcalPreshowerTopology.h.

References decrementIx().

Referenced by west().

62  {
63  return decrementIx(ESDetId(id));
64  }
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: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) 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:15
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: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 26 of file EcalPreshowerTopology.h.

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

27  {
28  ESDetId nextId= goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (! (nextId==ESDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
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 39 of file EcalPreshowerTopology.h.

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

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

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

78  {
79  ESDetId nextId=goUp(id);
80  std::vector<DetId> vNeighborsDetId;
81  if (! (nextId==ESDetId(0)))
82  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
83  return vNeighborsDetId;
84  }
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 65 of file EcalPreshowerTopology.h.

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

66  {
67  ESDetId nextId=goWest(id);
68  std::vector<DetId> vNeighborsDetId;
69  if (! (nextId==ESDetId(0)))
70  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
71  return vNeighborsDetId;
72  }
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)