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 | Private Attributes
EcalBarrelTopology Class Reference

#include <EcalBarrelTopology.h>

Inheritance diagram for EcalBarrelTopology:
CaloSubdetectorTopology

Public Member Functions

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

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 11 of file EcalBarrelTopology.h.

Constructor & Destructor Documentation

EcalBarrelTopology::EcalBarrelTopology ( )
inline

create a new Topology

Definition at line 16 of file EcalBarrelTopology.h.

16 : theGeom_(0) {};
edm::ESHandle< CaloGeometry > theGeom_
virtual EcalBarrelTopology::~EcalBarrelTopology ( )
inlinevirtual

virtual destructor

Definition at line 19 of file EcalBarrelTopology.h.

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

create a new Topology from geometry

Definition at line 22 of file EcalBarrelTopology.h.

22  : theGeom_(theGeom)
23  {
24  }
edm::ESHandle< CaloGeometry > theGeom_

Member Function Documentation

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 30 of file EcalBarrelTopology.cc.

References DetId::Ecal, EcalBarrel, and EBDetId::validDetId().

Referenced by goEast().

30  {
31 
32  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
33  return EBDetId(0);
34 
35  EBDetId nextPoint;
36  if (id.ieta()==1)
37  {
38  if (EBDetId::validDetId(-1,id.iphi()))
39  nextPoint=EBDetId(-1,id.iphi());
40  else
41  return EBDetId(0);
42  }
43  else
44  {
45  if (EBDetId::validDetId(id.ieta()-1,id.iphi()))
46  nextPoint=EBDetId(id.ieta()-1,id.iphi());
47  else
48  return EBDetId(0);
49  }
50 
51  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
52  return nextPoint;
53  else
54  return EBDetId(0);
55 }
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
EBDetId EcalBarrelTopology::decrementIphi ( const EBDetId id) const
private

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

Definition at line 86 of file EcalBarrelTopology.cc.

References DetId::Ecal, EcalBarrel, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, and EBDetId::validDetId().

Referenced by goSouth().

86  {
87  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
88  return EBDetId(0);
89 
90  EBDetId nextPoint;
91 
92  if (id.iphi()==EBDetId::MIN_IPHI)
93  {
95  nextPoint=EBDetId(id.ieta(),EBDetId::MAX_IPHI);
96  else
97  return EBDetId(0);
98  }
99  else
100  {
101  if (EBDetId::validDetId(id.ieta(),id.iphi()-1))
102  nextPoint=EBDetId(id.ieta(),id.iphi()-1);
103  else
104  return EBDetId(0);
105  }
106 
107  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
108  return nextPoint;
109  else
110  return EBDetId(0);
111 }
static const int MIN_IPHI
Definition: EBDetId.h:142
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
static const int MAX_IPHI
Definition: EBDetId.h:144
virtual std::vector<DetId> EcalBarrelTopology::down ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 86 of file EcalBarrelTopology.h.

References gather_cfg::cout.

87  {
88  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
89  std::vector<DetId> vNeighborsDetId;
90  return vNeighborsDetId;
91  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalBarrelTopology::east ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalBarrelTopology.h.

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

57  {
58  EBDetId nextId=goEast(id);
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==EBDetId(0)))
61  vNeighborsDetId.push_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
virtual DetId goEast(const DetId &id) const
move the Topology east (negative ieta)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId EcalBarrelTopology::goEast ( const DetId id) const
inlinevirtual

move the Topology east (negative ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 53 of file EcalBarrelTopology.h.

References decrementIeta().

Referenced by east().

53  {
54  return decrementIeta(EBDetId(id));
55  }
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
virtual DetId EcalBarrelTopology::goNorth ( const DetId id) const
inlinevirtual

move the Topology north (increment iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 27 of file EcalBarrelTopology.h.

References incrementIphi().

Referenced by north().

27  {
28  return incrementIphi(EBDetId(id));
29  }
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
virtual DetId EcalBarrelTopology::goSouth ( const DetId id) const
inlinevirtual

move the Topology south (decrement iphi)

Reimplemented from CaloSubdetectorTopology.

Definition at line 40 of file EcalBarrelTopology.h.

References decrementIphi().

Referenced by south().

40  {
41  return decrementIphi(EBDetId(id));
42  }
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
virtual DetId EcalBarrelTopology::goWest ( const DetId id) const
inlinevirtual

move the Topology west (positive ieta)

Reimplemented from CaloSubdetectorTopology.

Definition at line 66 of file EcalBarrelTopology.h.

References incrementIeta().

Referenced by west().

66  {
67  return incrementIeta(EBDetId(id));
68  }
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
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 5 of file EcalBarrelTopology.cc.

References DetId::Ecal, EcalBarrel, and EBDetId::validDetId().

Referenced by goWest().

5  {
6  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
7  return EBDetId(0);
8 
9  EBDetId nextPoint;
10  if (id.ieta()==-1)
11  {
12  if (EBDetId::validDetId(1,id.iphi()))
13  nextPoint=EBDetId (1,id.iphi());
14  else
15  return EBDetId(0);
16  }
17  else
18  {
19  if (EBDetId::validDetId(id.ieta()+1,id.iphi()))
20  nextPoint=EBDetId(id.ieta()+1,id.iphi());
21  else
22  return EBDetId(0);
23  }
24  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
25  return nextPoint;
26  else
27  return EBDetId(0);
28 }
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
EBDetId EcalBarrelTopology::incrementIphi ( const EBDetId id) const
private

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

Definition at line 58 of file EcalBarrelTopology.cc.

References DetId::Ecal, EcalBarrel, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, and EBDetId::validDetId().

Referenced by goNorth().

58  {
59  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
60  return EBDetId(0);
61 
62  EBDetId nextPoint;
63 
64  if (id.iphi()==EBDetId::MAX_IPHI)
65  {
67  nextPoint=EBDetId(id.ieta(),EBDetId::MIN_IPHI);
68  else
69  return EBDetId(0);
70  }
71  else
72  {
73  if (EBDetId::validDetId(id.ieta(),id.iphi()+1))
74  nextPoint=EBDetId(id.ieta(),id.iphi()+1);
75  else
76  return EBDetId(0);
77  }
78 
79  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
80  return nextPoint;
81  else
82  return EBDetId(0);
83 }
static const int MIN_IPHI
Definition: EBDetId.h:142
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
static const int MAX_IPHI
Definition: EBDetId.h:144
virtual std::vector<DetId> EcalBarrelTopology::north ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 30 of file EcalBarrelTopology.h.

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

31  {
32  EBDetId nextId=goNorth(id);
33  std::vector<DetId> vNeighborsDetId;
34  if (! (nextId==EBDetId(0)))
35  vNeighborsDetId.push_back(DetId(nextId.rawId()));
36  return vNeighborsDetId;
37  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId goNorth(const DetId &id) const
move the Topology north (increment iphi)
virtual std::vector<DetId> EcalBarrelTopology::south ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 43 of file EcalBarrelTopology.h.

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

44  {
45  EBDetId nextId=goSouth(id);
46  std::vector<DetId> vNeighborsDetId;
47  if (! (nextId==EBDetId(0)))
48  vNeighborsDetId.push_back(DetId(nextId.rawId()));
49  return vNeighborsDetId;
50  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual DetId goSouth(const DetId &id) const
move the Topology south (decrement iphi)
Definition: DetId.h:18
virtual std::vector<DetId> EcalBarrelTopology::up ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 79 of file EcalBarrelTopology.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  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalBarrelTopology::west ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 69 of file EcalBarrelTopology.h.

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

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

Member Data Documentation

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

Definition at line 107 of file EcalBarrelTopology.h.