CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalEndcapTopology Class Referencefinal

#include <EcalEndcapTopology.h>

Inheritance diagram for EcalEndcapTopology:
CaloSubdetectorTopology

Public Member Functions

std::vector< DetIddown (const DetId &) const override
 
std::vector< DetIdeast (const DetId &id) const override
 
 EcalEndcapTopology ()
 create a new Topology More...
 
 EcalEndcapTopology (CaloGeometry const &theGeom)
 create a new Topology from geometry More...
 
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 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 &) const override
 
std::vector< DetIdwest (const DetId &id) const override
 
 ~EcalEndcapTopology () 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 DetId goDown (const DetId &id) const
 
virtual DetId goUp (const DetId &id) 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

EEDetId decrementIx (const EEDetId &id) const
 move the nagivator to smaller ix More...
 
EEDetId decrementIy (const EEDetId &id) const
 move the nagivator to smaller iy More...
 
EEDetId incrementIx (const EEDetId &id) const
 move the nagivator to larger ix More...
 
EEDetId incrementIy (const EEDetId &id) const
 move the nagivator to larger iy More...
 

Private Attributes

const CaloSubdetectorGeometrytheGeom_
 

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 13 of file EcalEndcapTopology.h.

Constructor & Destructor Documentation

◆ EcalEndcapTopology() [1/2]

EcalEndcapTopology::EcalEndcapTopology ( )
inline

create a new Topology

Definition at line 16 of file EcalEndcapTopology.h.

16 : theGeom_(nullptr) {}
const CaloSubdetectorGeometry * theGeom_

◆ ~EcalEndcapTopology()

EcalEndcapTopology::~EcalEndcapTopology ( )
inlineoverride

virtual destructor

Definition at line 19 of file EcalEndcapTopology.h.

19 {}

◆ EcalEndcapTopology() [2/2]

EcalEndcapTopology::EcalEndcapTopology ( CaloGeometry const &  theGeom)
inline

create a new Topology from geometry

Definition at line 22 of file EcalEndcapTopology.h.

References DetId::Ecal, EcalEndcap, CaloGeometry::getSubdetectorGeometry(), and theGeom_.

22  {
23  theGeom_ = theGeom.getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
24  }
const CaloSubdetectorGeometry * theGeom_

Member Function Documentation

◆ decrementIx()

EEDetId EcalEndcapTopology::decrementIx ( const EEDetId id) const
private

move the nagivator to smaller ix

Definition at line 52 of file EcalEndcapTopology.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by goWest().

52  {
53  if (!(theGeom_->present(id))) {
54  return EEDetId(0);
55  }
56 
57  EEDetId nextPoint;
58 
59  if (EEDetId::validDetId(id.ix() - 1, id.iy(), id.zside()))
60  nextPoint = EEDetId(id.ix() - 1, id.iy(), id.zside());
61  else
62  return EEDetId(0);
63 
64  if (theGeom_->present(nextPoint))
65  return nextPoint;
66  else
67  return EEDetId(0);
68 }
int zside(DetId const &)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const CaloSubdetectorGeometry * theGeom_

◆ decrementIy()

EEDetId EcalEndcapTopology::decrementIy ( const EEDetId id) const
private

move the nagivator to smaller iy

Definition at line 19 of file EcalEndcapTopology.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by goSouth().

19  {
20  if (!(theGeom_->present(id))) {
21  return EEDetId(0);
22  }
23  EEDetId nextPoint;
24  if (EEDetId::validDetId(id.ix(), id.iy() - 1, id.zside()))
25  nextPoint = EEDetId(id.ix(), id.iy() - 1, id.zside());
26  else
27  return EEDetId(0);
28 
29  if (theGeom_->present(nextPoint))
30  return nextPoint;
31  else
32  return EEDetId(0);
33 }
int zside(DetId const &)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const CaloSubdetectorGeometry * theGeom_

◆ down()

std::vector<DetId> EcalEndcapTopology::down ( const DetId id) const
inlineoverridevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 72 of file EcalEndcapTopology.h.

72  {
73  edm::LogVerbatim("CaloTopology") << "EcalBarrelTopology::down() not yet implemented";
74  std::vector<DetId> vNeighborsDetId;
75  return vNeighborsDetId;
76  }
Log< level::Info, true > LogVerbatim

◆ east()

std::vector<DetId> EcalEndcapTopology::east ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 48 of file EcalEndcapTopology.h.

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

48  {
49  EEDetId nextId = goEast(id);
50  std::vector<DetId> vNeighborsDetId;
51  if (!(nextId == EEDetId(0)))
52  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
53  return vNeighborsDetId;
54  }
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ goEast()

DetId EcalEndcapTopology::goEast ( const DetId id) const
inlineoverridevirtual

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 47 of file EcalEndcapTopology.h.

References incrementIx().

Referenced by east().

47 { return incrementIx(EEDetId(id)); }
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix

◆ goNorth()

DetId EcalEndcapTopology::goNorth ( const DetId id) const
inlineoverridevirtual

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 27 of file EcalEndcapTopology.h.

References incrementIy().

Referenced by north().

27 { return incrementIy(EEDetId(id)); }
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy

◆ goSouth()

DetId EcalEndcapTopology::goSouth ( const DetId id) const
inlineoverridevirtual

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 37 of file EcalEndcapTopology.h.

References decrementIy().

Referenced by south().

37 { return decrementIy(EEDetId(id)); }
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy

◆ goWest()

DetId EcalEndcapTopology::goWest ( const DetId id) const
inlineoverridevirtual

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 57 of file EcalEndcapTopology.h.

References decrementIx().

Referenced by west().

57 { return decrementIx(EEDetId(id)); }
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix

◆ incrementIx()

EEDetId EcalEndcapTopology::incrementIx ( const EEDetId id) const
private

move the nagivator to larger ix

Definition at line 35 of file EcalEndcapTopology.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by goEast().

35  {
36  if (!(theGeom_->present(id))) {
37  return EEDetId(0);
38  }
39 
40  EEDetId nextPoint;
41  if (EEDetId::validDetId(id.ix() + 1, id.iy(), id.zside()))
42  nextPoint = EEDetId(id.ix() + 1, id.iy(), id.zside());
43  else
44  return EEDetId(0);
45 
46  if (theGeom_->present(nextPoint))
47  return nextPoint;
48  else
49  return EEDetId(0);
50 }
int zside(DetId const &)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const CaloSubdetectorGeometry * theGeom_

◆ incrementIy()

EEDetId EcalEndcapTopology::incrementIy ( const EEDetId id) const
private

move the nagivator to larger iy

Definition at line 3 of file EcalEndcapTopology.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by goNorth().

3  {
4  if (!(theGeom_->present(id))) {
5  return EEDetId(0);
6  }
7  EEDetId nextPoint;
8  if (EEDetId::validDetId(id.ix(), id.iy() + 1, id.zside()))
9  nextPoint = EEDetId(id.ix(), id.iy() + 1, id.zside());
10  else
11  return EEDetId(0);
12 
13  if (theGeom_->present(nextPoint))
14  return nextPoint;
15  else
16  return EEDetId(0);
17 }
int zside(DetId const &)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const CaloSubdetectorGeometry * theGeom_

◆ north()

std::vector<DetId> EcalEndcapTopology::north ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 28 of file EcalEndcapTopology.h.

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

28  {
29  EEDetId nextId = goNorth(id);
30  std::vector<DetId> vNeighborsDetId;
31  if (!(nextId == EEDetId(0)))
32  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
33  return vNeighborsDetId;
34  }
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ south()

std::vector<DetId> EcalEndcapTopology::south ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 38 of file EcalEndcapTopology.h.

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

38  {
39  EEDetId nextId = goSouth(id);
40  std::vector<DetId> vNeighborsDetId;
41  if (!(nextId == EEDetId(0)))
42  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
43  return vNeighborsDetId;
44  }
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ up()

std::vector<DetId> EcalEndcapTopology::up ( const DetId id) const
inlineoverridevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 66 of file EcalEndcapTopology.h.

66  {
67  edm::LogVerbatim("CaloTopology") << "EcalBarrelTopology::up() not yet implemented";
68  std::vector<DetId> vNeighborsDetId;
69  return vNeighborsDetId;
70  }
Log< level::Info, true > LogVerbatim

◆ west()

std::vector<DetId> EcalEndcapTopology::west ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 58 of file EcalEndcapTopology.h.

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

58  {
59  EEDetId nextId = goWest(id);
60  std::vector<DetId> vNeighborsDetId;
61  if (!(nextId == EEDetId(0)))
62  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

Member Data Documentation

◆ theGeom_

const CaloSubdetectorGeometry* EcalEndcapTopology::theGeom_
private