#include <Geometry/CaloTopology/interface/EcalBarrelTopology.h>
Public Member Functions | |
virtual std::vector< DetId > | down (const DetId &id) const |
Get the neighbors of the given cell in down direction (inward). | |
virtual std::vector< DetId > | east (const DetId &id) const |
move the Topology east (negative ieta) | |
EcalBarrelTopology (edm::ESHandle< CaloGeometry > theGeom) | |
create a new Topology from geometry | |
EcalBarrelTopology () | |
create a new Topology | |
virtual std::vector< DetId > | north (const DetId &id) const |
move the Topology north (increment iphi) | |
virtual std::vector< DetId > | south (const DetId &id) const |
move the Topology south (decrement iphi) | |
virtual std::vector< DetId > | up (const DetId &id) const |
Get the neighbors of the given cell in up direction (outward). | |
virtual std::vector< DetId > | west (const DetId &id) const |
move the Topology west (positive ieta) | |
virtual | ~EcalBarrelTopology () |
virtual destructor | |
Private Member Functions | |
EBDetId | decrementIeta (const EBDetId &) const |
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) | |
EBDetId | decrementIphi (const EBDetId &) const |
move the nagivator to smaller iphi (wraps around the barrel) | |
EBDetId | incrementIeta (const EBDetId &) const |
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) | |
EBDetId | incrementIphi (const EBDetId &) const |
move the nagivator to larger iphi (wraps around the barrel) | |
Private Attributes | |
edm::ESHandle< CaloGeometry > | theGeom_ |
Definition at line 11 of file EcalBarrelTopology.h.
EcalBarrelTopology::EcalBarrelTopology | ( | ) | [inline] |
virtual EcalBarrelTopology::~EcalBarrelTopology | ( | ) | [inline, virtual] |
EcalBarrelTopology::EcalBarrelTopology | ( | edm::ESHandle< CaloGeometry > | theGeom | ) | [inline] |
create a new Topology from geometry
Definition at line 22 of file EcalBarrelTopology.h.
00022 : theGeom_(theGeom) 00023 { 00024 }
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null)
Definition at line 30 of file EcalBarrelTopology.cc.
References DetId::Ecal, EcalBarrel, and EBDetId::validDetId().
Referenced by east().
00030 { 00031 00032 if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) 00033 return EBDetId(0); 00034 00035 EBDetId nextPoint; 00036 if (id.ieta()==1) 00037 { 00038 if (EBDetId::validDetId(-1,id.iphi())) 00039 nextPoint=EBDetId(-1,id.iphi()); 00040 else 00041 return EBDetId(0); 00042 } 00043 else 00044 { 00045 if (EBDetId::validDetId(id.ieta()-1,id.iphi())) 00046 nextPoint=EBDetId(id.ieta()-1,id.iphi()); 00047 else 00048 return EBDetId(0); 00049 } 00050 00051 if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) 00052 return nextPoint; 00053 else 00054 return EBDetId(0); 00055 }
move the nagivator to smaller iphi (wraps around the barrel)
Definition at line 86 of file EcalBarrelTopology.cc.
References DetId::Ecal, EcalBarrel, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, and EBDetId::validDetId().
Referenced by south().
00086 { 00087 if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) 00088 return EBDetId(0); 00089 00090 EBDetId nextPoint; 00091 00092 if (id.iphi()==EBDetId::MIN_IPHI) 00093 { 00094 if (EBDetId::validDetId(id.ieta(),EBDetId::MAX_IPHI)) 00095 nextPoint=EBDetId(id.ieta(),EBDetId::MAX_IPHI); 00096 else 00097 return EBDetId(0); 00098 } 00099 else 00100 { 00101 if (EBDetId::validDetId(id.ieta(),id.iphi()-1)) 00102 nextPoint=EBDetId(id.ieta(),id.iphi()-1); 00103 else 00104 return EBDetId(0); 00105 } 00106 00107 if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) 00108 return nextPoint; 00109 else 00110 return EBDetId(0); 00111 }
Get the neighbors of the given cell in down direction (inward).
Implements CaloSubdetectorTopology.
Definition at line 73 of file EcalBarrelTopology.h.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00074 { 00075 std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl; 00076 std::vector<DetId> vNeighborsDetId; 00077 return vNeighborsDetId; 00078 }
move the Topology east (negative ieta)
Implements CaloSubdetectorTopology.
Definition at line 47 of file EcalBarrelTopology.h.
References decrementIeta(), and DetId::rawId().
00048 { 00049 EBDetId nextId(decrementIeta(EBDetId(id))); 00050 std::vector<DetId> vNeighborsDetId; 00051 if (! (nextId==EBDetId(0))) 00052 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00053 return vNeighborsDetId; 00054 }
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null)
Definition at line 5 of file EcalBarrelTopology.cc.
References DetId::Ecal, EcalBarrel, and EBDetId::validDetId().
Referenced by west().
00005 { 00006 if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) 00007 return EBDetId(0); 00008 00009 EBDetId nextPoint; 00010 if (id.ieta()==-1) 00011 { 00012 if (EBDetId::validDetId(1,id.iphi())) 00013 nextPoint=EBDetId (1,id.iphi()); 00014 else 00015 return EBDetId(0); 00016 } 00017 else 00018 { 00019 if (EBDetId::validDetId(id.ieta()+1,id.iphi())) 00020 nextPoint=EBDetId(id.ieta()+1,id.iphi()); 00021 else 00022 return EBDetId(0); 00023 } 00024 if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) 00025 return nextPoint; 00026 else 00027 return EBDetId(0); 00028 }
move the nagivator to larger iphi (wraps around the barrel)
Definition at line 58 of file EcalBarrelTopology.cc.
References DetId::Ecal, EcalBarrel, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, and EBDetId::validDetId().
Referenced by north().
00058 { 00059 if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) 00060 return EBDetId(0); 00061 00062 EBDetId nextPoint; 00063 00064 if (id.iphi()==EBDetId::MAX_IPHI) 00065 { 00066 if (EBDetId::validDetId(id.ieta(),EBDetId::MIN_IPHI)) 00067 nextPoint=EBDetId(id.ieta(),EBDetId::MIN_IPHI); 00068 else 00069 return EBDetId(0); 00070 } 00071 else 00072 { 00073 if (EBDetId::validDetId(id.ieta(),id.iphi()+1)) 00074 nextPoint=EBDetId(id.ieta(),id.iphi()+1); 00075 else 00076 return EBDetId(0); 00077 } 00078 00079 if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) 00080 return nextPoint; 00081 else 00082 return EBDetId(0); 00083 }
move the Topology north (increment iphi)
Implements CaloSubdetectorTopology.
Definition at line 27 of file EcalBarrelTopology.h.
References incrementIphi(), and DetId::rawId().
00028 { 00029 EBDetId nextId(incrementIphi(EBDetId(id))); 00030 std::vector<DetId> vNeighborsDetId; 00031 if (! (nextId==EBDetId(0))) 00032 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00033 return vNeighborsDetId; 00034 }
move the Topology south (decrement iphi)
Implements CaloSubdetectorTopology.
Definition at line 37 of file EcalBarrelTopology.h.
References decrementIphi(), and DetId::rawId().
00038 { 00039 EBDetId nextId(decrementIphi(EBDetId(id))); 00040 std::vector<DetId> vNeighborsDetId; 00041 if (! (nextId==EBDetId(0))) 00042 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00043 return vNeighborsDetId; 00044 }
Get the neighbors of the given cell in up direction (outward).
Implements CaloSubdetectorTopology.
Definition at line 66 of file EcalBarrelTopology.h.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00067 { 00068 std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl; 00069 std::vector<DetId> vNeighborsDetId; 00070 return vNeighborsDetId; 00071 }
move the Topology west (positive ieta)
Implements CaloSubdetectorTopology.
Definition at line 57 of file EcalBarrelTopology.h.
References incrementIeta(), and DetId::rawId().
00058 { 00059 EBDetId nextId(incrementIeta(EBDetId(id))); 00060 std::vector<DetId> vNeighborsDetId; 00061 if (! (nextId==EBDetId(0))) 00062 vNeighborsDetId.push_back(DetId(nextId.rawId())); 00063 return vNeighborsDetId; 00064 }
Definition at line 94 of file EcalBarrelTopology.h.