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
 move the Topology east (positive ix) More...
 
 EcalEndcapTopology ()
 create a new Topology More...
 
 EcalEndcapTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 move the Topology north (increment iy) More...
 
virtual std::vector< DetIdsouth (const DetId &id) const
 move the Topology south (decrement iy) More...
 
virtual std::vector< DetIdup (const DetId &) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 move the Topology west (negative ix) More...
 
virtual ~EcalEndcapTopology ()
 virtual destructor More...
 
- 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

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, and EEDetId::validDetId().

Referenced by west().

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 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
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, and EEDetId::validDetId().

Referenced by south().

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 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
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 72 of file EcalEndcapTopology.h.

References gather_cfg::cout.

73  {
74  std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl;
75  std::vector<DetId> vNeighborsDetId;
76  return vNeighborsDetId;
77  }
tuple cout
Definition: gather_cfg.py:121
virtual std::vector<DetId> EcalEndcapTopology::east ( const DetId id) const
inlinevirtual

move the Topology east (positive ix)

Implements CaloSubdetectorTopology.

Definition at line 46 of file EcalEndcapTopology.h.

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

47  {
48  EEDetId nextId=incrementIx(EEDetId(id));
49  std::vector<DetId> vNeighborsDetId;
50  if (! (nextId==EEDetId(0)))
51  vNeighborsDetId.push_back(DetId(nextId.rawId()));
52  return vNeighborsDetId;
53  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
EEDetId incrementIx(const EEDetId &id) const
move the nagivator to larger ix
Definition: DetId.h:20
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, and EEDetId::validDetId().

Referenced by east().

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 }
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
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, and EEDetId::validDetId().

Referenced by north().

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

move the Topology north (increment iy)

Implements CaloSubdetectorTopology.

Definition at line 26 of file EcalEndcapTopology.h.

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

27  {
28  EEDetId nextId=incrementIy(EEDetId(id));
29  std::vector<DetId> vNeighborsDetId;
30  if (! (nextId==EEDetId(0)))
31  vNeighborsDetId.push_back(DetId(nextId.rawId()));
32  return vNeighborsDetId;
33  }
EEDetId incrementIy(const EEDetId &id) const
move the nagivator to larger iy
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
virtual std::vector<DetId> EcalEndcapTopology::south ( const DetId id) const
inlinevirtual

move the Topology south (decrement iy)

Implements CaloSubdetectorTopology.

Definition at line 36 of file EcalEndcapTopology.h.

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

37  {
38  EEDetId nextId=decrementIy(EEDetId(id));
39  std::vector<DetId> vNeighborsDetId;
40  if (! (nextId==EEDetId(0)))
41  vNeighborsDetId.push_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
EEDetId decrementIy(const EEDetId &id) const
move the nagivator to smaller iy
Definition: DetId.h:20
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 65 of file EcalEndcapTopology.h.

References gather_cfg::cout.

66  {
67  std::cout << "EcalBarrelTopology::up() 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> EcalEndcapTopology::west ( const DetId id) const
inlinevirtual

move the Topology west (negative ix)

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalEndcapTopology.h.

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

57  {
58  EEDetId nextId=decrementIx(EEDetId(id));
59  std::vector<DetId> vNeighborsDetId;
60  if (! (nextId==EEDetId(0)))
61  vNeighborsDetId.push_back(DetId(nextId.rawId()));
62  return vNeighborsDetId;
63  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
EEDetId decrementIx(const EEDetId &id) const
move the nagivator to smaller ix
Definition: DetId.h:20

Member Data Documentation

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

Definition at line 93 of file EcalEndcapTopology.h.