CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EcalPreshowerTopology Class Reference

#include <EcalPreshowerTopology.h>

Inheritance diagram for EcalPreshowerTopology:
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)
 EcalPreshowerTopology ()
 create a new Topology
 EcalPreshowerTopology (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 ~EcalPreshowerTopology ()
 virtual destructor

Private Member Functions

ESDetId decrementIx (const ESDetId &id) const
 move the nagivator to smaller ix
ESDetId decrementIy (const ESDetId &id) const
 move the nagivator to smaller iy
ESDetId decrementIz (const ESDetId &id) const
 move the nagivator to smaller iz
ESDetId incrementIx (const ESDetId &id) const
 move the nagivator to larger ix
ESDetId incrementIy (const ESDetId &id) const
 move the nagivator to larger iy
ESDetId incrementIz (const ESDetId &id) const
 move the nagivator to larger iz

Private Attributes

edm::ESHandle< CaloGeometrytheGeom_

Detailed Description

Definition at line 11 of file EcalPreshowerTopology.h.


Constructor & Destructor Documentation

EcalPreshowerTopology::EcalPreshowerTopology ( ) [inline]

create a new Topology

Definition at line 15 of file EcalPreshowerTopology.h.

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

virtual destructor

Definition at line 18 of file EcalPreshowerTopology.h.

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

create a new Topology from geometry

Definition at line 21 of file EcalPreshowerTopology.h.

                                                           : theGeom_(theGeom)
    {
    }

Member Function Documentation

ESDetId EcalPreshowerTopology::decrementIx ( const ESDetId id) const [private]

move the nagivator to smaller ix

Definition at line 143 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by west().

                                                                  {

  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
    {
      return ESDetId(0);
    }      
  ESDetId nextPoint;
  //Strips orientend along x direction for plane 2
  if (id.plane() == 2)
    {
      //Changing wafer
      if (ESDetId::validDetId(id.strip(),id.six()-1,id.siy(),id.plane(),id.zside()))
        nextPoint=ESDetId(id.strip(),id.six()-1,id.siy(),id.plane(),id.zside());
      else
        return ESDetId(0);
    }
  //Strips orientend along y direction for plane 1
  else if (id.plane() == 1)
    {
      if (id.strip() > 1 )
        {
          //Decrementing just strip number
          if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
            nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0);
        }
      else
        {
          //Changing wafer
          if (ESDetId::validDetId(32,id.six()-1,id.siy(),id.plane(),id.zside()))
            nextPoint=ESDetId(32,id.six()-1,id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0);
        }
    }
  else
    return ESDetId(0);
  
  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
    return nextPoint;
  else
    return ESDetId(0);
} 
ESDetId EcalPreshowerTopology::decrementIy ( const ESDetId id) const [private]

move the nagivator to smaller iy

Definition at line 51 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by south().

                                                                  {
  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
    {
      return ESDetId(0);
    }
  ESDetId nextPoint;
  //Strips orientend along x direction for plane 2
  if (id.plane() == 2)
    {
      if (id.strip() >1 )
        {
          //Decrementing just strip number
          if (ESDetId::validDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside()))
            nextPoint=ESDetId(id.strip()-1,id.six(),id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0);
        }
      else
        {
          //Changing wafer
          if (ESDetId::validDetId(32,id.six(),id.siy()-1,id.plane(),id.zside()))
            nextPoint=ESDetId(32,id.six(),id.siy()-1,id.plane(),id.zside());
          else
            return ESDetId(0);
        }
    }
  //Strips orientend along y direction for plane 1
  else if (id.plane() == 1)
    {
      //Changing wafer
      if (ESDetId::validDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside()))
        nextPoint=ESDetId(id.strip(),id.six(),id.siy()-1,id.plane(),id.zside());
      else
        return ESDetId(0);
    }
  else
    return ESDetId(0);

  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
    return nextPoint;
  else
    return ESDetId(0);
} 
ESDetId EcalPreshowerTopology::decrementIz ( const ESDetId id) const [private]

move the nagivator to smaller iz

Definition at line 209 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by down().

                                                                  {

  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
    {
      return ESDetId(0);
    }      
  ESDetId nextPoint;
  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside()))
    nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()-1,id.zside());
  else
    return ESDetId(0);
  
  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
    return nextPoint;
  else
    return ESDetId(0);
} 
virtual std::vector<DetId> EcalPreshowerTopology::down ( const DetId id) const [inline, virtual]

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

Implements CaloSubdetectorTopology.

Definition at line 74 of file EcalPreshowerTopology.h.

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

    {
      ESDetId nextId=decrementIz(ESDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==ESDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return  vNeighborsDetId;
    }
virtual std::vector<DetId> EcalPreshowerTopology::east ( const DetId id) const [inline, virtual]

move the Topology east (positive ix)

Implements CaloSubdetectorTopology.

Definition at line 46 of file EcalPreshowerTopology.h.

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

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

move the nagivator to larger ix

Definition at line 96 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by east().

                                                                  {

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

  //Strips orientend along x direction for plane 2
  if (id.plane() == 2)
    {
      //Changing wafer
      if (ESDetId::validDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside()))
        nextPoint=ESDetId(id.strip(),id.six()+1,id.siy(),id.plane(),id.zside());
      else
        return ESDetId(0);
    }
  //Strips orientend along y direction for plane 1
  else if (id.plane() == 1)
    {
      if (id.strip() < 32 )
        {
        //Incrementing just strip number
          if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside())) 
            nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0);
        }
      else
        {
        //Changing wafer
          if (ESDetId::validDetId(1,id.six()+1,id.siy(),id.plane(),id.zside()))
            nextPoint=ESDetId(1,id.six()+1,id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0);
        }
    }
  else
    return ESDetId(0);

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

move the nagivator to larger iy

Definition at line 5 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by north().

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

  ESDetId nextPoint;
  //Strips orientend along x direction for plane 2
  if (id.plane() == 2)
    {
      if (id.strip() < 32 )
        {
          //Incrementing just strip number
          if (ESDetId::validDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside()))
            nextPoint=ESDetId(id.strip()+1,id.six(),id.siy(),id.plane(),id.zside());
          else
            return ESDetId(0); 
        }
      else
        {
          //Changing wafer
          if (ESDetId::validDetId(1,id.six(),id.siy()+1,id.plane(),id.zside()))
            nextPoint=ESDetId(1,id.six(),id.siy()+1,id.plane(),id.zside());
          else
            return ESDetId(0);
        }
    }
  //Strips orientend along y direction for plane 1
  else if (id.plane() == 1)
    {
      //Changing wafer
      if (ESDetId::validDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside()))
        nextPoint=ESDetId(id.strip(),id.six(),id.siy()+1,id.plane(),id.zside());
      else
        return ESDetId(0);
    }
  else
    return ESDetId(0);
  
  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(nextPoint))
    return nextPoint;
  else
    return ESDetId(0);
} 
ESDetId EcalPreshowerTopology::incrementIz ( const ESDetId id) const [private]

move the nagivator to larger iz

Definition at line 189 of file EcalPreshowerTopology.cc.

References DetId::Ecal, EcalPreshower, strip(), and ESDetId::validDetId().

Referenced by up().

                                                                  {

  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalPreshower)->present(id))
    {
      return ESDetId(0);
    }      
  ESDetId nextPoint;
  if (ESDetId::validDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside()))
    nextPoint=ESDetId(id.strip(),id.six(),id.siy(),id.plane()+1,id.zside());
  else
    return ESDetId(0);

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

move the Topology north (increment iy)

Implements CaloSubdetectorTopology.

Definition at line 26 of file EcalPreshowerTopology.h.

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

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

move the Topology south (decrement iy)

Implements CaloSubdetectorTopology.

Definition at line 36 of file EcalPreshowerTopology.h.

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

    { 
      ESDetId nextId=decrementIy(ESDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==ESDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return vNeighborsDetId;
    }
virtual std::vector<DetId> EcalPreshowerTopology::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 EcalPreshowerTopology.h.

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

    {
      ESDetId nextId=incrementIz(ESDetId(id));
      std::vector<DetId> vNeighborsDetId;
      if (! (nextId==ESDetId(0)))
        vNeighborsDetId.push_back(DetId(nextId.rawId()));
      return  vNeighborsDetId;
    }
virtual std::vector<DetId> EcalPreshowerTopology::west ( const DetId id) const [inline, virtual]

move the Topology west (negative ix)

Implements CaloSubdetectorTopology.

Definition at line 56 of file EcalPreshowerTopology.h.

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

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

Member Data Documentation

Definition at line 103 of file EcalPreshowerTopology.h.