#include <EcalBarrelTopology.h>
Public Member Functions | |
virtual std::vector< DetId > | down (const DetId &) const |
virtual std::vector< DetId > | east (const DetId &id) const |
move the Topology east (negative ieta) | |
EcalBarrelTopology () | |
create a new Topology | |
EcalBarrelTopology (edm::ESHandle< CaloGeometry > theGeom) | |
create a new Topology from geometry | |
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 &) const |
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.
: theGeom_(theGeom) { }
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().
{ if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) return EBDetId(0); EBDetId nextPoint; if (id.ieta()==1) { if (EBDetId::validDetId(-1,id.iphi())) nextPoint=EBDetId(-1,id.iphi()); else return EBDetId(0); } else { if (EBDetId::validDetId(id.ieta()-1,id.iphi())) nextPoint=EBDetId(id.ieta()-1,id.iphi()); else return EBDetId(0); } if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) return nextPoint; else return EBDetId(0); }
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().
{ if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) return EBDetId(0); EBDetId nextPoint; if (id.iphi()==EBDetId::MIN_IPHI) { if (EBDetId::validDetId(id.ieta(),EBDetId::MAX_IPHI)) nextPoint=EBDetId(id.ieta(),EBDetId::MAX_IPHI); else return EBDetId(0); } else { if (EBDetId::validDetId(id.ieta(),id.iphi()-1)) nextPoint=EBDetId(id.ieta(),id.iphi()-1); else return EBDetId(0); } if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) return nextPoint; else return EBDetId(0); }
Get the neighbors of the given cell in down direction (inward)
Implements CaloSubdetectorTopology.
Definition at line 73 of file EcalBarrelTopology.h.
References gather_cfg::cout.
{ std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl; std::vector<DetId> vNeighborsDetId; return vNeighborsDetId; }
move the Topology east (negative ieta)
Implements CaloSubdetectorTopology.
Definition at line 47 of file EcalBarrelTopology.h.
References decrementIeta(), and DetId::rawId().
{ EBDetId nextId(decrementIeta(EBDetId(id))); std::vector<DetId> vNeighborsDetId; if (! (nextId==EBDetId(0))) vNeighborsDetId.push_back(DetId(nextId.rawId())); return vNeighborsDetId; }
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().
{ if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) return EBDetId(0); EBDetId nextPoint; if (id.ieta()==-1) { if (EBDetId::validDetId(1,id.iphi())) nextPoint=EBDetId (1,id.iphi()); else return EBDetId(0); } else { if (EBDetId::validDetId(id.ieta()+1,id.iphi())) nextPoint=EBDetId(id.ieta()+1,id.iphi()); else return EBDetId(0); } if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) return nextPoint; else return EBDetId(0); }
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().
{ if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id)) return EBDetId(0); EBDetId nextPoint; if (id.iphi()==EBDetId::MAX_IPHI) { if (EBDetId::validDetId(id.ieta(),EBDetId::MIN_IPHI)) nextPoint=EBDetId(id.ieta(),EBDetId::MIN_IPHI); else return EBDetId(0); } else { if (EBDetId::validDetId(id.ieta(),id.iphi()+1)) nextPoint=EBDetId(id.ieta(),id.iphi()+1); else return EBDetId(0); } if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint)) return nextPoint; else return EBDetId(0); }
move the Topology north (increment iphi)
Implements CaloSubdetectorTopology.
Definition at line 27 of file EcalBarrelTopology.h.
References incrementIphi(), and DetId::rawId().
{ EBDetId nextId(incrementIphi(EBDetId(id))); std::vector<DetId> vNeighborsDetId; if (! (nextId==EBDetId(0))) vNeighborsDetId.push_back(DetId(nextId.rawId())); return vNeighborsDetId; }
move the Topology south (decrement iphi)
Implements CaloSubdetectorTopology.
Definition at line 37 of file EcalBarrelTopology.h.
References decrementIphi(), and DetId::rawId().
{ EBDetId nextId(decrementIphi(EBDetId(id))); std::vector<DetId> vNeighborsDetId; if (! (nextId==EBDetId(0))) vNeighborsDetId.push_back(DetId(nextId.rawId())); return vNeighborsDetId; }
Get the neighbors of the given cell in up direction (outward)
Implements CaloSubdetectorTopology.
Definition at line 66 of file EcalBarrelTopology.h.
References gather_cfg::cout.
{ std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl; std::vector<DetId> vNeighborsDetId; return vNeighborsDetId; }
move the Topology west (positive ieta)
Implements CaloSubdetectorTopology.
Definition at line 57 of file EcalBarrelTopology.h.
References incrementIeta(), and DetId::rawId().
{ EBDetId nextId(incrementIeta(EBDetId(id))); std::vector<DetId> vNeighborsDetId; if (! (nextId==EBDetId(0))) vNeighborsDetId.push_back(DetId(nextId.rawId())); return vNeighborsDetId; }
Definition at line 94 of file EcalBarrelTopology.h.