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 (edm::ESHandle< CaloGeometry > 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::EcalEndcapTopology ( )
inline

create a new Topology

Definition at line 17 of file EcalEndcapTopology.h.

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

virtual destructor

Definition at line 20 of file EcalEndcapTopology.h.

20 { }
EcalEndcapTopology::EcalEndcapTopology ( edm::ESHandle< CaloGeometry theGeom)
inline

create a new Topology from geometry

Definition at line 23 of file EcalEndcapTopology.h.

References DetId::Ecal, EcalEndcap, CaloGeometry::getSubdetectorGeometry(), edm::ESHandle< T >::product(), and theGeom_.

23  {
25  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
T const * product() const
Definition: ESHandle.h:86
const CaloSubdetectorGeometry * theGeom_

Member Function Documentation

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

move the nagivator to smaller ix

Definition at line 58 of file EcalEndcapTopology.cc.

References CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and goWest().

58  {
59  if (!(theGeom_->present(id))) {
60  return EEDetId(0);
61  }
62 
63  EEDetId nextPoint;
64 
65  if (EEDetId::validDetId(id.ix()-1,id.iy(),id.zside()))
66  nextPoint=EEDetId(id.ix()-1,id.iy(),id.zside());
67  else
68  return EEDetId(0);
69 
70  if (theGeom_->present(nextPoint))
71  return nextPoint;
72  else
73  return EEDetId(0);
74 }
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 21 of file EcalEndcapTopology.cc.

References CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and goSouth().

21  {
22 
23  if (!(theGeom_->present(id))) {
24  return EEDetId(0);
25  }
26  EEDetId nextPoint;
27  if (EEDetId::validDetId(id.ix(),id.iy()-1,id.zside()))
28  nextPoint=EEDetId(id.ix(),id.iy()-1,id.zside());
29  else
30  return EEDetId(0);
31 
32  if (theGeom_->present(nextPoint))
33  return nextPoint;
34  else
35  return EEDetId(0);
36 }
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 86 of file EcalEndcapTopology.h.

References gather_cfg::cout, decrementIx(), decrementIy(), incrementIx(), and incrementIy().

87  {
88  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
89  std::vector<DetId> vNeighborsDetId;
90  return vNeighborsDetId;
91  }
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 57 of file EcalEndcapTopology.h.

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

58  {
59  EEDetId nextId=goEast(id);
60  std::vector<DetId> vNeighborsDetId;
61  if (! (nextId==EEDetId(0)))
62  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
63  return vNeighborsDetId;
64  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
Definition: DetId.h:18
DetId goEast(const DetId &id) const override
move the Topology east (positive ix)
DetId EcalEndcapTopology::goEast ( const DetId id) const
inlineoverridevirtual

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 54 of file EcalEndcapTopology.h.

References incrementIx().

Referenced by east().

54  {
55  return incrementIx(EEDetId(id));
56  }
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 28 of file EcalEndcapTopology.h.

References incrementIy().

Referenced by north().

28  {
29  return incrementIy(EEDetId(id));
30  }
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 41 of file EcalEndcapTopology.h.

References decrementIy().

Referenced by south().

41  {
42  return decrementIy(EEDetId(id));
43  }
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 67 of file EcalEndcapTopology.h.

References decrementIx().

Referenced by west().

67  {
68  return decrementIx(EEDetId(id));
69  }
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 39 of file EcalEndcapTopology.cc.

References CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and goEast().

39  {
40  if (!(theGeom_->present(id))) {
41  return EEDetId(0);
42  }
43 
44 
45  EEDetId nextPoint;
46  if (EEDetId::validDetId(id.ix()+1,id.iy(),id.zside()))
47  nextPoint=EEDetId(id.ix()+1,id.iy(),id.zside());
48  else
49  return EEDetId(0);
50 
51  if (theGeom_->present(nextPoint))
52  return nextPoint;
53  else
54  return EEDetId(0);
55 }
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 4 of file EcalEndcapTopology.cc.

References CaloSubdetectorGeometry::present(), theGeom_, EEDetId::validDetId(), and ecaldqm::zside().

Referenced by down(), and goNorth().

4  {
5  if (!(theGeom_->present(id))) {
6  return EEDetId(0);
7  }
8  EEDetId nextPoint;
9  if (EEDetId::validDetId(id.ix(),id.iy()+1,id.zside()))
10  nextPoint=EEDetId(id.ix(),id.iy()+1,id.zside());
11  else
12  return EEDetId(0);
13 
14  if (theGeom_->present(nextPoint))
15  return nextPoint;
16  else
17  return EEDetId(0);
18 }
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 31 of file EcalEndcapTopology.h.

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

32  {
33  EEDetId nextId= goNorth(id);
34  std::vector<DetId> vNeighborsDetId;
35  if (! (nextId==EEDetId(0)))
36  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
37  return vNeighborsDetId;
38  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
Definition: DetId.h:18
DetId goNorth(const DetId &id) const override
move the Topology north (increment iy)
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 44 of file EcalEndcapTopology.h.

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

45  {
46  EEDetId nextId= goSouth(id);
47  std::vector<DetId> vNeighborsDetId;
48  if (! (nextId==EEDetId(0)))
49  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
50  return vNeighborsDetId;
51  }
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:47
Definition: DetId.h:18
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 79 of file EcalEndcapTopology.h.

References gather_cfg::cout.

80  {
81  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
82  std::vector<DetId> vNeighborsDetId;
83  return vNeighborsDetId;
84  }
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 70 of file EcalEndcapTopology.h.

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

71  {
72  EEDetId nextId=goWest(id);
73  std::vector<DetId> vNeighborsDetId;
74  if (! (nextId==EEDetId(0)))
75  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
76  return vNeighborsDetId;
77  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
Definition: DetId.h:18
DetId goWest(const DetId &id) const override
move the Topology west (negative ix)

Member Data Documentation

const CaloSubdetectorGeometry* EcalEndcapTopology::theGeom_
private