00001 #ifndef GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H 00002 #define GEOMETRY_CALOTOPOLOGY_ECALBARRELHARDCODEDTOPOLOGY_H 1 00003 00004 #include <vector> 00005 #include <iostream> 00006 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00007 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" 00008 00009 class EcalBarrelHardcodedTopology : public CaloSubdetectorTopology 00010 { 00011 00012 public: 00014 EcalBarrelHardcodedTopology() {}; 00015 00016 virtual ~EcalBarrelHardcodedTopology() {}; 00017 00019 virtual std::vector<DetId> north(const DetId& id) const 00020 { 00021 EBDetId nextId=incrementIphi(EBDetId(id)); 00022 std::vector<DetId> vNeighborsDetId; 00023 if (! (nextId==EBDetId(0))) 00024 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00025 return vNeighborsDetId; 00026 } 00027 00029 virtual std::vector<DetId> south(const DetId& id) const 00030 { 00031 EBDetId nextId=decrementIphi(EBDetId(id)); 00032 std::vector<DetId> vNeighborsDetId; 00033 if (! (nextId==EBDetId(0))) 00034 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00035 return vNeighborsDetId; 00036 } 00037 00039 virtual std::vector<DetId> east(const DetId& id) const 00040 { 00041 EBDetId nextId=decrementIeta(EBDetId(id)); 00042 std::vector<DetId> vNeighborsDetId; 00043 if (! (nextId==EBDetId(0))) 00044 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00045 return vNeighborsDetId; 00046 } 00047 00049 virtual std::vector<DetId> west(const DetId& id) const 00050 { 00051 EBDetId nextId=incrementIeta(EBDetId(id)); 00052 std::vector<DetId> vNeighborsDetId; 00053 if (! (nextId==EBDetId(0))) 00054 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00055 return vNeighborsDetId; 00056 } 00057 00058 virtual std::vector<DetId> up(const DetId& /*id*/) const 00059 { 00060 std::cout << "EcalBarrelHardcodedTopology::up() not yet implemented" << std::endl; 00061 std::vector<DetId> vNeighborsDetId; 00062 return vNeighborsDetId; 00063 } 00064 00065 virtual std::vector<DetId> down(const DetId& /*id*/) const 00066 { 00067 std::cout << "EcalBarrelHardcodedTopology::down() not yet implemented" << std::endl; 00068 std::vector<DetId> vNeighborsDetId; 00069 return vNeighborsDetId; 00070 } 00071 00072 private: 00073 00075 EBDetId incrementIeta(const EBDetId&) const ; 00076 00078 EBDetId decrementIeta(const EBDetId&) const ; 00079 00081 EBDetId incrementIphi(const EBDetId&) const ; 00082 00084 EBDetId decrementIphi(const EBDetId&) const; 00085 00086 }; 00087 00088 #endif