CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EcalBarrelTopology Class Reference

#include <EcalBarrelTopology.h>

Inheritance diagram for EcalBarrelTopology:
CaloSubdetectorTopology

List of all members.

Public Member Functions

virtual std::vector< DetIddown (const DetId &id) const
virtual std::vector< DetIdeast (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< DetIdnorth (const DetId &id) const
 move the Topology north (increment iphi)
virtual std::vector< DetIdsouth (const DetId &id) const
 move the Topology south (decrement iphi)
virtual std::vector< DetIdup (const DetId &id) const
virtual std::vector< DetIdwest (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< CaloGeometrytheGeom_

Detailed Description

Definition at line 11 of file EcalBarrelTopology.h.


Constructor & Destructor Documentation

EcalBarrelTopology::EcalBarrelTopology ( ) [inline]

create a new Topology

Definition at line 16 of file EcalBarrelTopology.h.

: theGeom_(0) {};
virtual EcalBarrelTopology::~EcalBarrelTopology ( ) [inline, virtual]

virtual destructor

Definition at line 19 of file EcalBarrelTopology.h.

{ }  
EcalBarrelTopology::EcalBarrelTopology ( edm::ESHandle< CaloGeometry theGeom) [inline]

create a new Topology from geometry

Definition at line 22 of file EcalBarrelTopology.h.

                                                        : theGeom_(theGeom)
    {
    }

Member Function Documentation

EBDetId EcalBarrelTopology::decrementIeta ( const EBDetId id) const [private]

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);
} 
EBDetId EcalBarrelTopology::decrementIphi ( const EBDetId id) const [private]

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);
} 
virtual std::vector<DetId> EcalBarrelTopology::down ( const DetId id) const [inline, virtual]

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;
    }
virtual std::vector<DetId> EcalBarrelTopology::east ( const DetId id) const [inline, virtual]

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;
    }
EBDetId EcalBarrelTopology::incrementIeta ( const EBDetId id) const [private]

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);
}
EBDetId EcalBarrelTopology::incrementIphi ( const EBDetId id) const [private]

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);
} 
virtual std::vector<DetId> EcalBarrelTopology::north ( const DetId id) const [inline, virtual]

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;
    }
virtual std::vector<DetId> EcalBarrelTopology::south ( const DetId id) const [inline, virtual]

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;
    }
virtual std::vector<DetId> EcalBarrelTopology::up ( const DetId id) const [inline, virtual]

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;
    }
virtual std::vector<DetId> EcalBarrelTopology::west ( const DetId id) const [inline, virtual]

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;
    }

Member Data Documentation

Definition at line 94 of file EcalBarrelTopology.h.