CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
EcalBarrelHardcodedTopology Class Referencefinal

#include <EcalBarrelHardcodedTopology.h>

Inheritance diagram for EcalBarrelHardcodedTopology:
CaloSubdetectorTopology

Public Member Functions

std::vector< DetIddown (const DetId &) const override
 
std::vector< DetIdeast (const DetId &id) const override
 
 EcalBarrelHardcodedTopology ()
 create a new Topology 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
 
 ~EcalBarrelHardcodedTopology () override
 
- 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...
 

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 9 of file EcalBarrelHardcodedTopology.h.

Constructor & Destructor Documentation

◆ EcalBarrelHardcodedTopology()

EcalBarrelHardcodedTopology::EcalBarrelHardcodedTopology ( )
inline

create a new Topology

Definition at line 12 of file EcalBarrelHardcodedTopology.h.

12 {};

◆ ~EcalBarrelHardcodedTopology()

EcalBarrelHardcodedTopology::~EcalBarrelHardcodedTopology ( )
inlineoverride

Definition at line 14 of file EcalBarrelHardcodedTopology.h.

14 {};

Member Function Documentation

◆ decrementIeta()

EBDetId EcalBarrelHardcodedTopology::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 12 of file EcalBarrelHardcodedTopology.cc.

12  {
13  if (id.ieta() == -EBDetId::MAX_IETA)
14  return EBDetId(0); // null det id
15  else if (id.ieta() == 1)
16  return EBDetId(-1, id.iphi());
17  else
18  return EBDetId(id.ieta() - 1, id.iphi());
19 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, and EBDetId::MAX_IETA.

Referenced by goEast().

◆ decrementIphi()

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

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

Definition at line 28 of file EcalBarrelHardcodedTopology.cc.

28  {
29  if (id.iphi() == EBDetId::MIN_IPHI)
30  return EBDetId(id.ieta(), EBDetId::MAX_IPHI);
31  else
32  return EBDetId(id.ieta(), id.iphi() - 1);
33 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, EBDetId::MAX_IPHI, and EBDetId::MIN_IPHI.

Referenced by goSouth().

◆ down()

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

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

Implements CaloSubdetectorTopology.

Definition at line 62 of file EcalBarrelHardcodedTopology.h.

62  {
63  std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl;
64  std::vector<DetId> vNeighborsDetId;
65  return vNeighborsDetId;
66  }

References gather_cfg::cout.

◆ east()

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

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 38 of file EcalBarrelHardcodedTopology.h.

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

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

◆ goEast()

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

move the Topology east (negative ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 37 of file EcalBarrelHardcodedTopology.h.

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

References decrementIeta().

Referenced by east().

◆ goNorth()

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

move the Topology north (increment iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 17 of file EcalBarrelHardcodedTopology.h.

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

References incrementIphi().

Referenced by north().

◆ goSouth()

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

move the Topology south (decrement iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 27 of file EcalBarrelHardcodedTopology.h.

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

References decrementIphi().

Referenced by south().

◆ goWest()

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

move the Topology west (positive ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 47 of file EcalBarrelHardcodedTopology.h.

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

References incrementIeta().

Referenced by west().

◆ incrementIeta()

EBDetId EcalBarrelHardcodedTopology::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 EcalBarrelHardcodedTopology.cc.

3  {
4  if (id.ieta() == EBDetId::MAX_IETA)
5  return EBDetId(0); // null det id
6  else if (id.ieta() == -1)
7  return EBDetId(1, id.iphi());
8  else
9  return EBDetId(id.ieta() + 1, id.iphi());
10 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, and EBDetId::MAX_IETA.

Referenced by goWest().

◆ incrementIphi()

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

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

Definition at line 21 of file EcalBarrelHardcodedTopology.cc.

21  {
22  if (id.iphi() == EBDetId::MAX_IPHI)
23  return EBDetId(id.ieta(), EBDetId::MIN_IPHI);
24  else
25  return EBDetId(id.ieta(), id.iphi() + 1);
26 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, EBDetId::MAX_IPHI, and EBDetId::MIN_IPHI.

Referenced by goNorth().

◆ north()

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

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 18 of file EcalBarrelHardcodedTopology.h.

18  {
19  EBDetId nextId = goNorth(id);
20  std::vector<DetId> vNeighborsDetId;
21  if (!(nextId == EBDetId(0)))
22  vNeighborsDetId.emplace_back(DetId(nextId.rawId()));
23  return vNeighborsDetId;
24  }

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

◆ south()

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

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 28 of file EcalBarrelHardcodedTopology.h.

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

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

◆ up()

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

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

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalBarrelHardcodedTopology.h.

56  {
57  std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl;
58  std::vector<DetId> vNeighborsDetId;
59  return vNeighborsDetId;
60  }

References gather_cfg::cout.

◆ west()

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

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 48 of file EcalBarrelHardcodedTopology.h.

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

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

EBDetId
Definition: EBDetId.h:17
EcalBarrelHardcodedTopology::incrementIphi
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
Definition: EcalBarrelHardcodedTopology.cc:21
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalBarrelHardcodedTopology::decrementIeta
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)
Definition: EcalBarrelHardcodedTopology.cc:12
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
EcalBarrelHardcodedTopology::decrementIphi
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
Definition: EcalBarrelHardcodedTopology.cc:28
EBDetId::MAX_IPHI
static const int MAX_IPHI
Definition: EBDetId.h:137
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalBarrelHardcodedTopology::goSouth
DetId goSouth(const DetId &id) const override
move the Topology south (decrement iphi)
Definition: EcalBarrelHardcodedTopology.h:27
EcalBarrelHardcodedTopology::goWest
DetId goWest(const DetId &id) const override
move the Topology west (positive ieta)
Definition: EcalBarrelHardcodedTopology.h:47
EcalBarrelHardcodedTopology::incrementIeta
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)
Definition: EcalBarrelHardcodedTopology.cc:3
EcalBarrelHardcodedTopology::goNorth
DetId goNorth(const DetId &id) const override
move the Topology north (increment iphi)
Definition: EcalBarrelHardcodedTopology.h:17
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalBarrelHardcodedTopology::goEast
DetId goEast(const DetId &id) const override
move the Topology east (negative ieta)
Definition: EcalBarrelHardcodedTopology.h:37
EBDetId::MAX_IETA
static const int MAX_IETA
Definition: EBDetId.h:136
EBDetId::MIN_IPHI
static const int MIN_IPHI
Definition: EBDetId.h:135