1 #ifndef TOPOLOGY_CALOTOPOLOGY_CALOSUBDETECTORTOPOLOGY_H 2 #define TOPOLOGY_CALOTOPOLOGY_CALOSUBDETECTORTOPOLOGY_H 1 26 virtual bool valid(
const DetId& )
const {
return false; };
32 virtual unsigned int ncells()
const {
return 1; }
39 virtual std::vector<DetId>
east(
const DetId&
id)
const = 0;
41 virtual std::vector<DetId>
west(
const DetId&
id)
const = 0;
43 virtual std::vector<DetId>
north(
const DetId&
id)
const = 0;
45 virtual std::vector<DetId>
south(
const DetId&
id)
const = 0;
47 virtual std::vector<DetId>
up(
const DetId&
id)
const = 0;
49 virtual std::vector<DetId>
down(
const DetId&
id)
const = 0;
54 std::vector<DetId>
ids =
east(
id);
55 return ids.empty() ?
DetId() : ids[0];
58 std::vector<DetId>
ids =
west(
id);
59 return ids.empty() ?
DetId() : ids[0];
63 return ids.empty() ?
DetId() : ids[0];
67 return ids.empty() ?
DetId() : ids[0];
70 std::vector<DetId>
ids =
up(
id);
71 return ids.empty() ?
DetId() : ids[0];
74 std::vector<DetId>
ids =
down(
id);
75 return ids.empty() ?
DetId() : ids[0];
80 std::vector<DetId> aNullVector;
98 throw cms::Exception(
"getNeighboursError") <<
"Unsopported direction";
104 virtual std::vector<DetId>
getWindow(
const DetId&
id,
const int& northSouthSize,
const int& eastWestSize)
const;
119 CellInfo(
bool a_visited,
const DetId& a_cell) : visited(a_visited), cell(a_cell) {}
125 return Coordinate(coord.first, coord.second + 1);
127 return Coordinate(coord.first, coord.second - 1);
130 return Coordinate(coord.first + 1, coord.second);
132 return Coordinate(coord.first - 1, coord.second);
135 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 > up(const DetId &id) const =0
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
virtual std::vector< DetId > getAllNeighbours(const DetId &id) const
virtual std::vector< DetId > north(const DetId &id) const =0
virtual int topoVersion() const
return a version which identifies the given topology
virtual std::vector< DetId > east(const DetId &id) const =0
virtual std::vector< DetId > down(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 DetId goDown(const DetId &id) const
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 std::vector< DetId > west(const DetId &id) const =0
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology ...
CaloDirection
Codes the local directions in the cell lattice.
std::pair< int, int > Coordinate
CaloSubdetectorTopology()
standard constructor
virtual std::vector< DetId > south(const DetId &id) const =0