CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
EcalBarrelHardcodedTopology Class Reference

#include <EcalBarrelHardcodedTopology.h>

Inheritance diagram for EcalBarrelHardcodedTopology:
CaloSubdetectorTopology

Public Member Functions

virtual std::vector< DetIddown (const DetId &) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 move the Topology east (negative ieta) More...
 
 EcalBarrelHardcodedTopology ()
 create a new Topology More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 move the Topology north (increment iphi) More...
 
virtual std::vector< DetIdsouth (const DetId &id) const
 move the Topology south (decrement iphi) More...
 
virtual std::vector< DetIdup (const DetId &) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 move the Topology west (positive ieta) More...
 
virtual ~EcalBarrelHardcodedTopology ()
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor 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 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 ( )
inline

create a new Topology

Definition at line 14 of file EcalBarrelHardcodedTopology.h.

14 {};
virtual EcalBarrelHardcodedTopology::~EcalBarrelHardcodedTopology ( )
inlinevirtual

Definition at line 16 of file EcalBarrelHardcodedTopology.h.

16 {};

Member Function Documentation

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

References EBDetId::MAX_IETA.

Referenced by east().

9  {
10  if (id.ieta()==-EBDetId::MAX_IETA) return EBDetId(0); // null det id
11  else if (id.ieta()==1) return EBDetId(-1,id.iphi());
12  else return EBDetId(id.ieta()-1,id.iphi());
13 }
static const int MAX_IETA
Definition: EBDetId.h:122
EBDetId EcalBarrelHardcodedTopology::decrementIphi ( const EBDetId id) const
private

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

Definition at line 20 of file EcalBarrelHardcodedTopology.cc.

References EBDetId::MAX_IPHI, and EBDetId::MIN_IPHI.

Referenced by south().

20  {
21  if (id.iphi()==EBDetId::MIN_IPHI) return EBDetId(id.ieta(),EBDetId::MAX_IPHI);
22  else return EBDetId(id.ieta(),id.iphi()-1);
23 }
static const int MIN_IPHI
Definition: EBDetId.h:121
static const int MAX_IPHI
Definition: EBDetId.h:123
virtual std::vector<DetId> EcalBarrelHardcodedTopology::down ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 65 of file EcalBarrelHardcodedTopology.h.

References gather_cfg::cout.

66  {
67  std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl;
68  std::vector<DetId> vNeighborsDetId;
69  return vNeighborsDetId;
70  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalBarrelHardcodedTopology::east ( const DetId id) const
inlinevirtual

move the Topology east (negative ieta)

Implements CaloSubdetectorTopology.

Definition at line 39 of file EcalBarrelHardcodedTopology.h.

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

40  {
41  EBDetId nextId=decrementIeta(EBDetId(id));
42  std::vector<DetId> vNeighborsDetId;
43  if (! (nextId==EBDetId(0)))
44  vNeighborsDetId.push_back(DetId(nextId.rawId()));
45  return vNeighborsDetId;
46  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
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.

References EBDetId::MAX_IETA.

Referenced by west().

3  {
4  if (id.ieta()==EBDetId::MAX_IETA) return EBDetId(0); // null det id
5  else if (id.ieta()==-1) return EBDetId(1,id.iphi());
6  else return EBDetId(id.ieta()+1,id.iphi());
7 }
static const int MAX_IETA
Definition: EBDetId.h:122
EBDetId EcalBarrelHardcodedTopology::incrementIphi ( const EBDetId id) const
private

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

Definition at line 15 of file EcalBarrelHardcodedTopology.cc.

References EBDetId::MAX_IPHI, and EBDetId::MIN_IPHI.

Referenced by north().

15  {
16  if (id.iphi()==EBDetId::MAX_IPHI) return EBDetId(id.ieta(),EBDetId::MIN_IPHI);
17  else return EBDetId(id.ieta(),id.iphi()+1);
18 }
static const int MIN_IPHI
Definition: EBDetId.h:121
static const int MAX_IPHI
Definition: EBDetId.h:123
virtual std::vector<DetId> EcalBarrelHardcodedTopology::north ( const DetId id) const
inlinevirtual

move the Topology north (increment iphi)

Implements CaloSubdetectorTopology.

Definition at line 19 of file EcalBarrelHardcodedTopology.h.

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

20  {
21  EBDetId nextId=incrementIphi(EBDetId(id));
22  std::vector<DetId> vNeighborsDetId;
23  if (! (nextId==EBDetId(0)))
24  vNeighborsDetId.push_back(DetId(nextId.rawId()));
25  return vNeighborsDetId;
26  }
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
virtual std::vector<DetId> EcalBarrelHardcodedTopology::south ( const DetId id) const
inlinevirtual

move the Topology south (decrement iphi)

Implements CaloSubdetectorTopology.

Definition at line 29 of file EcalBarrelHardcodedTopology.h.

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

30  {
31  EBDetId nextId=decrementIphi(EBDetId(id));
32  std::vector<DetId> vNeighborsDetId;
33  if (! (nextId==EBDetId(0)))
34  vNeighborsDetId.push_back(DetId(nextId.rawId()));
35  return vNeighborsDetId;
36  }
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
virtual std::vector<DetId> EcalBarrelHardcodedTopology::up ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 58 of file EcalBarrelHardcodedTopology.h.

References gather_cfg::cout.

59  {
60  std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl;
61  std::vector<DetId> vNeighborsDetId;
62  return vNeighborsDetId;
63  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalBarrelHardcodedTopology::west ( const DetId id) const
inlinevirtual

move the Topology west (positive ieta)

Implements CaloSubdetectorTopology.

Definition at line 49 of file EcalBarrelHardcodedTopology.h.

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

50  {
51  EBDetId nextId=incrementIeta(EBDetId(id));
52  std::vector<DetId> vNeighborsDetId;
53  if (! (nextId==EBDetId(0)))
54  vNeighborsDetId.push_back(DetId(nextId.rawId()));
55  return vNeighborsDetId;
56  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...