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
EcalEndcapTopology Class Reference

#include <EcalEndcapTopology.h>

Inheritance diagram for EcalEndcapTopology:
CaloSubdetectorTopology

Public Member Functions

virtual std::vector< DetIddown (const DetId &) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 
 EcalEndcapTopology ()
 create a new Topology More...
 
 EcalEndcapTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry More...
 
virtual DetId goEast (const DetId &id) const
 move the Topology east (positive ix) More...
 
virtual DetId goNorth (const DetId &id) const
 move the Topology north (increment iy) More...
 
virtual DetId goSouth (const DetId &id) const
 move the Topology south (decrement iy) More...
 
virtual DetId goWest (const DetId &id) const
 move the Topology west (negative ix) 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 ~EcalEndcapTopology ()
 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 11 of file EcalEndcapTopology.h.

Constructor & Destructor Documentation

EcalEndcapTopology::EcalEndcapTopology ( )
inline

create a new Topology

Definition at line 15 of file EcalEndcapTopology.h.

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

virtual destructor

Definition at line 18 of file EcalEndcapTopology.h.

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

create a new Topology from geometry

Definition at line 21 of file EcalEndcapTopology.h.

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

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 ecaldqm::zside().

Referenced by 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 }
int zside(DetId const &)
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 ecaldqm::zside().

Referenced by 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 }
int zside(DetId const &)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
virtual std::vector<DetId> EcalEndcapTopology::down ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 84 of file EcalEndcapTopology.h.

References gather_cfg::cout.

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

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 55 of file EcalEndcapTopology.h.

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

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

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 52 of file EcalEndcapTopology.h.

References incrementIx().

Referenced by east().

52  {
53  return incrementIx(EEDetId(id));
54  }
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
virtual DetId EcalEndcapTopology::goNorth ( const DetId id) const
inlinevirtual

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 26 of file EcalEndcapTopology.h.

References incrementIy().

Referenced by north().

26  {
27  return incrementIy(EEDetId(id));
28  }
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
virtual DetId EcalEndcapTopology::goSouth ( const DetId id) const
inlinevirtual

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 39 of file EcalEndcapTopology.h.

References decrementIy().

Referenced by south().

39  {
40  return decrementIy(EEDetId(id));
41  }
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
virtual DetId EcalEndcapTopology::goWest ( const DetId id) const
inlinevirtual

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 65 of file EcalEndcapTopology.h.

References decrementIx().

Referenced by west().

65  {
66  return decrementIx(EEDetId(id));
67  }
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 ecaldqm::zside().

Referenced by 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 }
int zside(DetId const &)
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 ecaldqm::zside().

Referenced by 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 }
int zside(DetId const &)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
virtual std::vector<DetId> EcalEndcapTopology::north ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 29 of file EcalEndcapTopology.h.

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

30  {
31  EEDetId nextId= goNorth(id);
32  std::vector<DetId> vNeighborsDetId;
33  if (! (nextId==EEDetId(0)))
34  vNeighborsDetId.push_back(DetId(nextId.rawId()));
35  return vNeighborsDetId;
36  }
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 iy)
virtual std::vector<DetId> EcalEndcapTopology::south ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 42 of file EcalEndcapTopology.h.

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

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

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

Implements CaloSubdetectorTopology.

Definition at line 77 of file EcalEndcapTopology.h.

References gather_cfg::cout.

78  {
79  std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl;
80  std::vector<DetId> vNeighborsDetId;
81  return vNeighborsDetId;
82  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalEndcapTopology::west ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 68 of file EcalEndcapTopology.h.

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

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

Member Data Documentation

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

Definition at line 105 of file EcalEndcapTopology.h.