CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EcalEndcapTopology Class Reference

#include <EcalEndcapTopology.h>

Inheritance diagram for EcalEndcapTopology:
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 (positive ix)
 EcalEndcapTopology ()
 create a new Topology
 EcalEndcapTopology (edm::ESHandle< CaloGeometry > theGeom)
 create a new Topology from geometry
virtual std::vector< DetIdnorth (const DetId &id) const
 move the Topology north (increment iy)
virtual std::vector< DetIdsouth (const DetId &id) const
 move the Topology south (decrement iy)
virtual std::vector< DetIdup (const DetId &id) const
virtual std::vector< DetIdwest (const DetId &id) const
 move the Topology west (negative ix)
virtual ~EcalEndcapTopology ()
 virtual destructor

Private Member Functions

EEDetId decrementIx (const EEDetId &id) const
 move the nagivator to smaller ix
EEDetId decrementIy (const EEDetId &id) const
 move the nagivator to smaller iy
EEDetId incrementIx (const EEDetId &id) const
 move the nagivator to larger ix
EEDetId incrementIy (const EEDetId &id) const
 move the nagivator to larger iy

Private Attributes

edm::ESHandle< CaloGeometrytheGeom_

Detailed Description

Definition at line 11 of file EcalEndcapTopology.h.


Constructor & Destructor Documentation

EcalEndcapTopology::EcalEndcapTopology ( ) [inline]

create a new Topology

Definition at line 15 of file EcalEndcapTopology.h.

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

virtual destructor

Definition at line 18 of file EcalEndcapTopology.h.

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

create a new Topology from geometry

Definition at line 21 of file EcalEndcapTopology.h.

                                                        : theGeom_(theGeom)
    {
    }

Member Function Documentation

EEDetId EcalEndcapTopology::decrementIx ( const EEDetId id) const [private]

move the nagivator to smaller ix

Definition at line 62 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, and EEDetId::validDetId().

Referenced by west().

                                                               {
  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
    {
      return EEDetId(0);
    }
  
  EEDetId nextPoint;

  if (EEDetId::validDetId(id.ix()-1,id.iy(),id.zside()))
    nextPoint=EEDetId(id.ix()-1,id.iy(),id.zside());
  else
    return EEDetId(0);
  
  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
    return nextPoint;
  else
    return EEDetId(0);
} 
EEDetId EcalEndcapTopology::decrementIy ( const EEDetId id) const [private]

move the nagivator to smaller iy

Definition at line 23 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, and EEDetId::validDetId().

Referenced by south().

                                                               {

  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
    {
      return EEDetId(0);
    }
  EEDetId nextPoint;
  if (EEDetId::validDetId(id.ix(),id.iy()-1,id.zside()))
    nextPoint=EEDetId(id.ix(),id.iy()-1,id.zside());
  else
    return EEDetId(0);

  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
    return nextPoint;
  else
    return EEDetId(0);
} 
virtual std::vector<DetId> EcalEndcapTopology::down ( const DetId id) const [inline, virtual]

Get the neighbors of the given cell in down direction (inward)

Implements CaloSubdetectorTopology.

Definition at line 72 of file EcalEndcapTopology.h.

References gather_cfg::cout.

    {
      std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl; 
      std::vector<DetId> vNeighborsDetId;
      return  vNeighborsDetId;
    }
virtual std::vector<DetId> EcalEndcapTopology::east ( const DetId id) const [inline, virtual]

move the Topology east (positive ix)

Implements CaloSubdetectorTopology.

Definition at line 46 of file EcalEndcapTopology.h.

References incrementIx(), and DetId::rawId().

    { 
      EEDetId nextId=incrementIx(EEDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==EEDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return vNeighborsDetId;
    }
EEDetId EcalEndcapTopology::incrementIx ( const EEDetId id) const [private]

move the nagivator to larger ix

Definition at line 42 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, and EEDetId::validDetId().

Referenced by east().

                                                               {
  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
    {
      return EEDetId(0);
    }
  
  
  EEDetId nextPoint;
  if (EEDetId::validDetId(id.ix()+1,id.iy(),id.zside()))
    nextPoint=EEDetId(id.ix()+1,id.iy(),id.zside());
  else
    return EEDetId(0);

  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
    return nextPoint;
  else
    return EEDetId(0);
} 
EEDetId EcalEndcapTopology::incrementIy ( const EEDetId id) const [private]

move the nagivator to larger iy

Definition at line 5 of file EcalEndcapTopology.cc.

References DetId::Ecal, EcalEndcap, and EEDetId::validDetId().

Referenced by north().

                                                               {
  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
    {
      return EEDetId(0);
    }
  EEDetId nextPoint;
  if (EEDetId::validDetId(id.ix(),id.iy()+1,id.zside()))
    nextPoint=EEDetId(id.ix(),id.iy()+1,id.zside());
  else
    return EEDetId(0);

  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
    return nextPoint;
  else
    return EEDetId(0);
} 
virtual std::vector<DetId> EcalEndcapTopology::north ( const DetId id) const [inline, virtual]

move the Topology north (increment iy)

Implements CaloSubdetectorTopology.

Definition at line 26 of file EcalEndcapTopology.h.

References incrementIy(), and DetId::rawId().

    { 
      EEDetId nextId=incrementIy(EEDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==EEDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return vNeighborsDetId;
    }
virtual std::vector<DetId> EcalEndcapTopology::south ( const DetId id) const [inline, virtual]

move the Topology south (decrement iy)

Implements CaloSubdetectorTopology.

Definition at line 36 of file EcalEndcapTopology.h.

References decrementIy(), and DetId::rawId().

    { 
      EEDetId nextId=decrementIy(EEDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==EEDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return vNeighborsDetId;
    }
virtual std::vector<DetId> EcalEndcapTopology::up ( const DetId id) const [inline, virtual]

Get the neighbors of the given cell in up direction (outward)

Implements CaloSubdetectorTopology.

Definition at line 65 of file EcalEndcapTopology.h.

References gather_cfg::cout.

    {
      std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl; 
      std::vector<DetId> vNeighborsDetId;
      return  vNeighborsDetId;
    }
virtual std::vector<DetId> EcalEndcapTopology::west ( const DetId id) const [inline, virtual]

move the Topology west (negative ix)

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalEndcapTopology.h.

References decrementIx(), and DetId::rawId().

    { 
      EEDetId nextId=decrementIx(EEDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==EEDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return vNeighborsDetId;
    }

Member Data Documentation

Definition at line 93 of file EcalEndcapTopology.h.