CMS 3D CMS Logo

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

#include <EcalBarrelTopology.h>

Inheritance diagram for EcalBarrelTopology:
CaloSubdetectorTopology

Public Member Functions

std::vector< DetIddown (const DetId &) const override
 
std::vector< DetIdeast (const DetId &id) const override
 
 EcalBarrelTopology ()
 create a new Topology More...
 
 EcalBarrelTopology (CaloGeometry const &theGeom)
 create a new Topology from geometry More...
 
DetId goEast (const DetId &id) const override
 move the Topology east (negative ieta) More...
 
DetId goNorth (const DetId &id) const override
 move the Topology north (increment iphi) More...
 
DetId goSouth (const DetId &id) const override
 move the Topology south (decrement iphi) More...
 
DetId goWest (const DetId &id) const override
 move the Topology west (positive ieta) 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
 
 ~EcalBarrelTopology () 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

EBDetId decrementIeta (const EBDetId &) const
 move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) More...
 
EBDetId decrementIphi (const EBDetId &) const
 move the nagivator to smaller iphi (wraps around the barrel) More...
 
EBDetId incrementIeta (const EBDetId &) const
 move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) More...
 
EBDetId incrementIphi (const EBDetId &) const
 move the nagivator to larger iphi (wraps around the barrel) 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 EcalBarrelTopology.h.

Constructor & Destructor Documentation

◆ EcalBarrelTopology() [1/2]

EcalBarrelTopology::EcalBarrelTopology ( )
inline

create a new Topology

Definition at line 15 of file EcalBarrelTopology.h.

15 : theGeom_(nullptr){};

◆ ~EcalBarrelTopology()

EcalBarrelTopology::~EcalBarrelTopology ( )
inlineoverride

virtual destructor

Definition at line 18 of file EcalBarrelTopology.h.

18 {}

◆ EcalBarrelTopology() [2/2]

EcalBarrelTopology::EcalBarrelTopology ( CaloGeometry const &  theGeom)
inline

create a new Topology from geometry

Definition at line 21 of file EcalBarrelTopology.h.

21  {
22  theGeom_ = theGeom.getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
23  }

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

Member Function Documentation

◆ decrementIeta()

EBDetId EcalBarrelTopology::decrementIeta ( const EBDetId id) const
private

move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)

Definition at line 25 of file EcalBarrelTopology.cc.

25  {
26  if (!(theGeom_->present(id)))
27  return EBDetId(0);
28 
29  EBDetId nextPoint;
30  if (id.ieta() == 1) {
31  if (EBDetId::validDetId(-1, id.iphi()))
32  nextPoint = EBDetId(-1, id.iphi());
33  else
34  return EBDetId(0);
35  } else {
36  if (EBDetId::validDetId(id.ieta() - 1, id.iphi()))
37  nextPoint = EBDetId(id.ieta() - 1, id.iphi());
38  else
39  return EBDetId(0);
40  }
41 
42  if (theGeom_->present(nextPoint))
43  return nextPoint;
44  else
45  return EBDetId(0);
46 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, CaloSubdetectorGeometry::present(), theGeom_, and EBDetId::validDetId().

Referenced by goEast().

◆ decrementIphi()

EBDetId EcalBarrelTopology::decrementIphi ( const EBDetId id) const
private

move the nagivator to smaller iphi (wraps around the barrel)

Definition at line 72 of file EcalBarrelTopology.cc.

72  {
73  if (!(theGeom_->present(id)))
74  return EBDetId(0);
75 
76  EBDetId nextPoint;
77 
78  if (id.iphi() == EBDetId::MIN_IPHI) {
80  nextPoint = EBDetId(id.ieta(), EBDetId::MAX_IPHI);
81  else
82  return EBDetId(0);
83  } else {
84  if (EBDetId::validDetId(id.ieta(), id.iphi() - 1))
85  nextPoint = EBDetId(id.ieta(), id.iphi() - 1);
86  else
87  return EBDetId(0);
88  }
89 
90  if (theGeom_->present(nextPoint))
91  return nextPoint;
92  else
93  return EBDetId(0);
94 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, CaloSubdetectorGeometry::present(), theGeom_, and EBDetId::validDetId().

Referenced by goSouth().

◆ down()

std::vector<DetId> EcalBarrelTopology::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 EcalBarrelTopology.h.

71  {
72  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
73  std::vector<DetId> vNeighborsDetId;
74  return vNeighborsDetId;
75  }

References gather_cfg::cout.

◆ east()

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

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 47 of file EcalBarrelTopology.h.

47  {
48  EBDetId nextId = goEast(id);
49  std::vector<DetId> vNeighborsDetId;
50  if (!(nextId == EBDetId(0)))
51  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }

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

◆ goEast()

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

move the Topology east (negative ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 46 of file EcalBarrelTopology.h.

46 { return decrementIeta(EBDetId(id)); }

References decrementIeta().

Referenced by east().

◆ goNorth()

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

move the Topology north (increment iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 26 of file EcalBarrelTopology.h.

26 { return incrementIphi(EBDetId(id)); }

References incrementIphi().

Referenced by north().

◆ goSouth()

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

move the Topology south (decrement iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 36 of file EcalBarrelTopology.h.

36 { return decrementIphi(EBDetId(id)); }

References decrementIphi().

Referenced by south().

◆ goWest()

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

move the Topology west (positive ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 56 of file EcalBarrelTopology.h.

56 { return incrementIeta(EBDetId(id)); }

References incrementIeta().

Referenced by west().

◆ incrementIeta()

EBDetId EcalBarrelTopology::incrementIeta ( const EBDetId id) const
private

move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)

Definition at line 3 of file EcalBarrelTopology.cc.

3  {
4  if (!(theGeom_->present(id)))
5  return EBDetId(0);
6 
7  EBDetId nextPoint;
8  if (id.ieta() == -1) {
9  if (EBDetId::validDetId(1, id.iphi()))
10  nextPoint = EBDetId(1, id.iphi());
11  else
12  return EBDetId(0);
13  } else {
14  if (EBDetId::validDetId(id.ieta() + 1, id.iphi()))
15  nextPoint = EBDetId(id.ieta() + 1, id.iphi());
16  else
17  return EBDetId(0);
18  }
19  if (theGeom_->present(nextPoint))
20  return nextPoint;
21  else
22  return EBDetId(0);
23 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, CaloSubdetectorGeometry::present(), theGeom_, and EBDetId::validDetId().

Referenced by goWest().

◆ incrementIphi()

EBDetId EcalBarrelTopology::incrementIphi ( const EBDetId id) const
private

move the nagivator to larger iphi (wraps around the barrel)

Definition at line 48 of file EcalBarrelTopology.cc.

48  {
49  if (!(theGeom_->present(id)))
50  return EBDetId(0);
51 
52  EBDetId nextPoint;
53 
54  if (id.iphi() == EBDetId::MAX_IPHI) {
56  nextPoint = EBDetId(id.ieta(), EBDetId::MIN_IPHI);
57  else
58  return EBDetId(0);
59  } else {
60  if (EBDetId::validDetId(id.ieta(), id.iphi() + 1))
61  nextPoint = EBDetId(id.ieta(), id.iphi() + 1);
62  else
63  return EBDetId(0);
64  }
65 
66  if (theGeom_->present(nextPoint))
67  return nextPoint;
68  else
69  return EBDetId(0);
70 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, CaloSubdetectorGeometry::present(), theGeom_, and EBDetId::validDetId().

Referenced by goNorth().

◆ north()

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

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 27 of file EcalBarrelTopology.h.

27  {
28  EBDetId nextId = goNorth(id);
29  std::vector<DetId> vNeighborsDetId;
30  if (!(nextId == EBDetId(0)))
31  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }

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

◆ south()

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

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 37 of file EcalBarrelTopology.h.

37  {
38  EBDetId nextId = goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (!(nextId == EBDetId(0)))
41  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }

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

◆ up()

std::vector<DetId> EcalBarrelTopology::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 EcalBarrelTopology.h.

65  {
66  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
67  std::vector<DetId> vNeighborsDetId;
68  return vNeighborsDetId;
69  }

References gather_cfg::cout.

◆ west()

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

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 57 of file EcalBarrelTopology.h.

57  {
58  EBDetId nextId = goWest(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (!(nextId == EBDetId(0)))
61  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }

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

Member Data Documentation

◆ theGeom_

const CaloSubdetectorGeometry* EcalBarrelTopology::theGeom_
private
EBDetId
Definition: EBDetId.h:17
EcalBarrelTopology::incrementIphi
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
Definition: EcalBarrelTopology.cc:48
EcalBarrelTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
Definition: EcalBarrelTopology.h:26
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalBarrelTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
Definition: EcalBarrelTopology.h:36
EcalBarrel
Definition: EcalSubdetector.h:10
EcalBarrelTopology::incrementIeta
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)
Definition: EcalBarrelTopology.cc:3
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
EcalBarrelTopology::decrementIphi
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
Definition: EcalBarrelTopology.cc:72
EBDetId::MAX_IPHI
static const int MAX_IPHI
Definition: EBDetId.h:137
EcalBarrelTopology::decrementIeta
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)
Definition: EcalBarrelTopology.cc:25
EcalBarrelTopology::theGeom_
const CaloSubdetectorGeometry * theGeom_
Definition: EcalBarrelTopology.h:90
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
CaloSubdetectorGeometry::present
virtual bool present(const DetId &id) const
is this detid present in the geometry?
Definition: CaloSubdetectorGeometry.cc:40
DetId::Ecal
Definition: DetId.h:27
EcalBarrelTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
Definition: EcalBarrelTopology.h:56
EBDetId::validDetId
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalBarrelTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
Definition: EcalBarrelTopology.h:46
EBDetId::MIN_IPHI
static const int MIN_IPHI
Definition: EBDetId.h:135