1 #ifndef TOPOLOGY_CALOTOPOLOGY_CALOSUBDETECTORTOPOLOGY_H
2 #define TOPOLOGY_CALOTOPOLOGY_CALOSUBDETECTORTOPOLOGY_H 1
24 virtual bool valid(
const DetId& )
const {
return false; };
30 virtual unsigned int ncells()
const {
return 1; }
37 virtual std::vector<DetId>
east(
const DetId&
id)
const = 0;
39 virtual std::vector<DetId>
west(
const DetId&
id)
const = 0;
41 virtual std::vector<DetId>
north(
const DetId&
id)
const = 0;
43 virtual std::vector<DetId>
south(
const DetId&
id)
const = 0;
45 virtual std::vector<DetId>
up(
const DetId&
id)
const = 0;
47 virtual std::vector<DetId>
down(
const DetId&
id)
const = 0;
52 std::vector<DetId> ids =
east(
id);
53 return ids.empty() ?
DetId() : ids[0];
56 std::vector<DetId> ids =
west(
id);
57 return ids.empty() ?
DetId() : ids[0];
60 std::vector<DetId> ids =
north(
id);
61 return ids.empty() ?
DetId() : ids[0];
64 std::vector<DetId> ids =
south(
id);
65 return ids.empty() ?
DetId() : ids[0];
68 std::vector<DetId> ids =
up(
id);
69 return ids.empty() ?
DetId() : ids[0];
72 std::vector<DetId> ids =
down(
id);
73 return ids.empty() ?
DetId() : ids[0];
78 std::vector<DetId> aNullVector;
96 throw cms::Exception(
"getNeighboursError") <<
"Unsopported direction";
102 virtual std::vector<DetId>
getWindow(
const DetId&
id,
const int& northSouthSize,
const int& eastWestSize)
const;
123 return Coordinate(coord.first, coord.second + 1);
125 return Coordinate(coord.first, coord.second - 1);
128 return Coordinate(coord.first + 1, coord.second);
130 return Coordinate(coord.first - 1, coord.second);
133 throw cms::Exception(
"getWindowError") <<
"Unsopported direction";
virtual DetId goSouth(const DetId &id) const
virtual DetId goWest(const DetId &id) const
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
virtual std::vector< DetId > getAllNeighbours(const DetId &id) const
virtual int topoVersion() const
return a version which identifies the given topology
virtual std::vector< DetId > west(const DetId &id) const =0
virtual ~CaloSubdetectorTopology()
virtual destructor
virtual DetId goEast(const DetId &id) const
virtual unsigned int detId2denseId(const DetId &) const
return a linear packed id
virtual DetId goUp(const DetId &id) const
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
CellInfo(bool a_visited, const DetId &a_cell)
virtual DetId goNorth(const DetId &id) const
Coordinate getNeighbourIndex(const Coordinate &coord, const CaloDirection &dir) const
virtual std::vector< DetId > north(const DetId &id) const =0
virtual DetId goDown(const DetId &id) const
virtual std::vector< DetId > up(const DetId &id) const =0
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
virtual bool valid(const DetId &) const
is this detid present in the Topology?
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology ...
virtual std::vector< DetId > south(const DetId &id) const =0
CaloDirection
Codes the local directions in the cell lattice.
std::pair< int, int > Coordinate
CaloSubdetectorTopology()
standard constructor
virtual std::vector< DetId > east(const DetId &id) const =0
virtual std::vector< DetId > down(const DetId &id) const =0