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

edm::ESHandle< CaloGeometrytheGeom_
 

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

16 : theGeom_(nullptr) {};
edm::ESHandle< CaloGeometry > theGeom_
EcalEndcapTopology::~EcalEndcapTopology ( )
inlineoverride

virtual destructor

Definition at line 19 of file EcalEndcapTopology.h.

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

create a new Topology from geometry

Definition at line 22 of file EcalEndcapTopology.h.

22  : theGeom_(std::move(theGeom))
23  {
24  }
edm::ESHandle< CaloGeometry > theGeom_
def move(src, dest)
Definition: eostools.py:510

Member Function Documentation

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

move the nagivator to smaller ix

Definition at line 62 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, EEDetId::validDetId(), and HcalDigiParam_cfi::zside.

Referenced by down(), and goWest().

62  {
63  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
64  {
65  return EEDetId(0);
66  }
67 
68  EEDetId nextPoint;
69 
70  if (EEDetId::validDetId(id.ix()-1,id.iy(),id.zside()))
71  nextPoint=EEDetId(id.ix()-1,id.iy(),id.zside());
72  else
73  return EEDetId(0);
74 
75  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
76  return nextPoint;
77  else
78  return EEDetId(0);
79 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
EEDetId EcalEndcapTopology::decrementIy ( const EEDetId id) const
private

move the nagivator to smaller iy

Definition at line 23 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, EEDetId::validDetId(), and HcalDigiParam_cfi::zside.

Referenced by down(), and goSouth().

23  {
24 
25  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
26  {
27  return EEDetId(0);
28  }
29  EEDetId nextPoint;
30  if (EEDetId::validDetId(id.ix(),id.iy()-1,id.zside()))
31  nextPoint=EEDetId(id.ix(),id.iy()-1,id.zside());
32  else
33  return EEDetId(0);
34 
35  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
36  return nextPoint;
37  else
38  return EEDetId(0);
39 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
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 85 of file EcalEndcapTopology.h.

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

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

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

57  {
58  EEDetId nextId=goEast(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==EEDetId(0)))
61  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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 53 of file EcalEndcapTopology.h.

References incrementIx().

Referenced by east().

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

References incrementIy().

Referenced by north().

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

References decrementIy().

Referenced by south().

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

References decrementIx().

Referenced by west().

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

References DetId::Ecal, EcalEndcap, EEDetId::validDetId(), and HcalDigiParam_cfi::zside.

Referenced by down(), and goEast().

42  {
43  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
44  {
45  return EEDetId(0);
46  }
47 
48 
49  EEDetId nextPoint;
50  if (EEDetId::validDetId(id.ix()+1,id.iy(),id.zside()))
51  nextPoint=EEDetId(id.ix()+1,id.iy(),id.zside());
52  else
53  return EEDetId(0);
54 
55  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
56  return nextPoint;
57  else
58  return EEDetId(0);
59 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
EEDetId EcalEndcapTopology::incrementIy ( const EEDetId id) const
private

move the nagivator to larger iy

Definition at line 5 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, EEDetId::validDetId(), and HcalDigiParam_cfi::zside.

Referenced by down(), and goNorth().

5  {
6  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
7  {
8  return EEDetId(0);
9  }
10  EEDetId nextPoint;
11  if (EEDetId::validDetId(id.ix(),id.iy()+1,id.zside()))
12  nextPoint=EEDetId(id.ix(),id.iy()+1,id.zside());
13  else
14  return EEDetId(0);
15 
16  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
17  return nextPoint;
18  else
19  return EEDetId(0);
20 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
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 30 of file EcalEndcapTopology.h.

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

31  {
32  EEDetId nextId= goNorth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (! (nextId==EEDetId(0)))
35  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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 43 of file EcalEndcapTopology.h.

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

44  {
45  EEDetId nextId= goSouth(id);
46  std::vector<DetId> vNeighborsDetId;
47  if (! (nextId==EEDetId(0)))
48  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
49  return vNeighborsDetId;
50  }
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iy)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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 78 of file EcalEndcapTopology.h.

References gather_cfg::cout.

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

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

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

Member Data Documentation

edm::ESHandle<CaloGeometry> EcalEndcapTopology::theGeom_
private

Definition at line 106 of file EcalEndcapTopology.h.