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

Constructor & Destructor Documentation

EcalEndcapTopology::EcalEndcapTopology ( )
inline

create a new Topology

Definition at line 15 of file EcalEndcapTopology.h.

15 : theGeom_(nullptr){};
const CaloSubdetectorGeometry * theGeom_
EcalEndcapTopology::~EcalEndcapTopology ( )
inlineoverride

virtual destructor

Definition at line 18 of file EcalEndcapTopology.h.

18 {}
EcalEndcapTopology::EcalEndcapTopology ( CaloGeometry const &  theGeom)
inline

create a new Topology from geometry

Definition at line 21 of file EcalEndcapTopology.h.

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

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

Member Function Documentation

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

move the nagivator to smaller ix

Definition at line 52 of file EcalEndcapTopology.cc.

References 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?
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const CaloSubdetectorGeometry * theGeom_
EEDetId EcalEndcapTopology::decrementIy ( const EEDetId id) const
private

move the nagivator to smaller iy

Definition at line 19 of file EcalEndcapTopology.cc.

References 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?
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const CaloSubdetectorGeometry * theGeom_
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 71 of file EcalEndcapTopology.h.

References gather_cfg::cout.

71  {
72  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }
tuple cout
Definition: gather_cfg.py:144
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 47 of file EcalEndcapTopology.h.

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

47  {
48  EEDetId nextId = goEast(id);
49  std::vector<DetId> vNeighborsDetId;
50  if (!(nextId == EEDetId(0)))
51  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
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 EcalEndcapTopology::goEast ( const DetId id) const
inlineoverridevirtual

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 46 of file EcalEndcapTopology.h.

References incrementIx().

Referenced by east().

46 { return incrementIx(EEDetId(id)); }
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
DetId EcalEndcapTopology::goNorth ( const DetId id) const
inlineoverridevirtual

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 26 of file EcalEndcapTopology.h.

References incrementIy().

Referenced by north().

26 { return incrementIy(EEDetId(id)); }
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
DetId EcalEndcapTopology::goSouth ( const DetId id) const
inlineoverridevirtual

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 36 of file EcalEndcapTopology.h.

References decrementIy().

Referenced by south().

36 { return decrementIy(EEDetId(id)); }
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
DetId EcalEndcapTopology::goWest ( const DetId id) const
inlineoverridevirtual

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 56 of file EcalEndcapTopology.h.

References decrementIx().

Referenced by west().

56 { return decrementIx(EEDetId(id)); }
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
EEDetId EcalEndcapTopology::incrementIx ( const EEDetId id) const
private

move the nagivator to larger ix

Definition at line 35 of file EcalEndcapTopology.cc.

References 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?
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const CaloSubdetectorGeometry * theGeom_
EEDetId EcalEndcapTopology::incrementIy ( const EEDetId id) const
private

move the nagivator to larger iy

Definition at line 3 of file EcalEndcapTopology.cc.

References 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?
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const CaloSubdetectorGeometry * theGeom_
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 27 of file EcalEndcapTopology.h.

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

27  {
28  EEDetId nextId = goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (!(nextId == EEDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
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> EcalEndcapTopology::south ( const DetId id) const
inlineoverridevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 37 of file EcalEndcapTopology.h.

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

37  {
38  EEDetId nextId = goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (!(nextId == EEDetId(0)))
41  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
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> EcalEndcapTopology::up ( const DetId id) const
inlineoverridevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 65 of file EcalEndcapTopology.h.

References gather_cfg::cout.

65  {
66  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
67  std::vector<DetId> vNeighborsDetId;
68  return vNeighborsDetId;
69  }
tuple cout
Definition: gather_cfg.py:144
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 57 of file EcalEndcapTopology.h.

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

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

Member Data Documentation

const CaloSubdetectorGeometry* EcalEndcapTopology::theGeom_
private