CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

CaloTopology Class Reference

#include <CaloTopology.h>

List of all members.

Public Types

typedef std::map< int, const
CaloSubdetectorTopology * > 
TopMap

Public Member Functions

 CaloTopology ()
std::vector< DetIddown (const DetId &id) const
 Get the neighbors of the given cell in down direction (inward)
std::vector< DetIdeast (const DetId &id) const
 Get the neighbors of the given cell in east direction.
std::vector< DetIdgetAllNeighbours (const DetId &id) const
 Get all the neighbors of the given cell.
std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 Get the neighbors of the given cell given direction.
const CaloSubdetectorTopologygetSubdetectorTopology (const DetId &id) const
 access the subdetector Topology for the given subdetector directly
const CaloSubdetectorTopologygetSubdetectorTopology (DetId::Detector det, int subdet) const
 access the subdetector Topology for the given subdetector directly
std::vector< DetIdgetWindow (const DetId &id, const int &northSouthSize, const int &eastWestSize) const
 Get the neighbors of the given cell in a window of given size.
std::vector< DetIdnorth (const DetId &id) const
 Get the neighbors of the given cell in north direction.
void setSubdetTopology (DetId::Detector det, int subdet, const CaloSubdetectorTopology *geom)
 Register a subdetector Topology.
std::vector< DetIdsouth (const DetId &id) const
 Get the neighbors of the given cell in south direction.
std::vector< DetIdup (const DetId &id) const
 Get the neighbors of the given cell in up direction (outward)
bool valid (const DetId &id) const
 Is this a valid cell id?
std::vector< DetIdwest (const DetId &id) const
 Get the neighbors of the given cell in west direction.
 ~CaloTopology ()

Private Member Functions

int makeIndex (DetId::Detector det, int subdet) const

Private Attributes

TopMap theTopologies_

Detailed Description

Date:
2011/09/27 09:11:27
Revision:
1.5
Author:
J. Mans and P. Meridiani

Definition at line 19 of file CaloTopology.h.


Member Typedef Documentation

typedef std::map<int, const CaloSubdetectorTopology*> CaloTopology::TopMap

Definition at line 22 of file CaloTopology.h.


Constructor & Destructor Documentation

CaloTopology::CaloTopology ( )

Definition at line 5 of file CaloTopology.cc.

                           {
}
CaloTopology::~CaloTopology ( )

Definition at line 8 of file CaloTopology.cc.

References i, and theTopologies_.

{
   for( TopMap::iterator i ( theTopologies_.begin() ) ;
        i != theTopologies_.end() ; ++i )
   {
      delete i->second ;
   }
}

Member Function Documentation

std::vector< DetId > CaloTopology::down ( const DetId id) const

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

Definition at line 63 of file CaloTopology.cc.

References CaloSubdetectorTopology::down(), emptyDetIdVector, and getSubdetectorTopology().

                                                         {
    const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
    return (topology==0) ? (emptyDetIdVector):(topology->down(id));
}
std::vector< DetId > CaloTopology::east ( const DetId id) const

Get the neighbors of the given cell in east direction.

Definition at line 38 of file CaloTopology.cc.

References CaloSubdetectorTopology::east(), emptyDetIdVector, and getSubdetectorTopology().

Referenced by FastL1Region::FillEMCrystals().

                                                         {
  const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
  return (topology==0) ? (emptyDetIdVector):(topology->east(id));
}
std::vector< DetId > CaloTopology::getAllNeighbours ( const DetId id) const

Get all the neighbors of the given cell.

Definition at line 78 of file CaloTopology.cc.

References emptyDetIdVector, CaloSubdetectorTopology::getAllNeighbours(), and getSubdetectorTopology().

                                                                     {
    const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
    return (topology==0) ? (emptyDetIdVector):(topology->getAllNeighbours(id));
}
std::vector< DetId > CaloTopology::getNeighbours ( const DetId id,
const CaloDirection dir 
) const

Get the neighbors of the given cell given direction.

Definition at line 68 of file CaloTopology.cc.

References emptyDetIdVector, CaloSubdetectorTopology::getNeighbours(), and getSubdetectorTopology().

                                                                                           {
    const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
    return (topology==0) ? (emptyDetIdVector):(topology->getNeighbours(id,dir));
}
const CaloSubdetectorTopology * CaloTopology::getSubdetectorTopology ( const DetId id) const
const CaloSubdetectorTopology * CaloTopology::getSubdetectorTopology ( DetId::Detector  det,
int  subdet 
) const

access the subdetector Topology for the given subdetector directly

Definition at line 31 of file CaloTopology.cc.

References i, makeIndex(), and theTopologies_.

                                                                                                       {
    std::map<int, const CaloSubdetectorTopology*>::const_iterator i=theTopologies_.find(makeIndex(det,subdet));
    return (i==theTopologies_.end())?(0):(i->second);
}
std::vector< DetId > CaloTopology::getWindow ( const DetId id,
const int &  northSouthSize,
const int &  eastWestSize 
) const

Get the neighbors of the given cell in a window of given size.

Definition at line 73 of file CaloTopology.cc.

References emptyDetIdVector, getSubdetectorTopology(), and CaloSubdetectorTopology::getWindow().

Referenced by EcalClusterSeverityLevelAlgo::closestProblematic(), EcalClusterSeverityLevelAlgo::fractionAroundClosestProblematic(), and ecaldqm::EnergyTask::runOnRecHits().

                                                                                                                  {
    const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
    return (topology==0) ? (emptyDetIdVector):(topology->getWindow(id,northSouthSize, eastWestSize));
}
int CaloTopology::makeIndex ( DetId::Detector  det,
int  subdet 
) const [private]

Definition at line 17 of file CaloTopology.cc.

Referenced by getSubdetectorTopology(), and setSubdetTopology().

                                                               {
  return (int(det)<<4) | (subdet&0xF);
}
std::vector< DetId > CaloTopology::north ( const DetId id) const

Get the neighbors of the given cell in north direction.

Definition at line 48 of file CaloTopology.cc.

References emptyDetIdVector, getSubdetectorTopology(), and CaloSubdetectorTopology::north().

Referenced by FastL1Region::FillEMCrystals().

                                                          {
  const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
  return (topology==0) ? (emptyDetIdVector):(topology->north(id));
}
void CaloTopology::setSubdetTopology ( DetId::Detector  det,
int  subdet,
const CaloSubdetectorTopology geom 
)

Register a subdetector Topology.

Definition at line 21 of file CaloTopology.cc.

References relativeConstraints::geom, getHLTprescales::index, makeIndex(), and theTopologies_.

                                                                                                       {
  int index=makeIndex(det,subdet);
  theTopologies_[index]=geom;
}
std::vector< DetId > CaloTopology::south ( const DetId id) const

Get the neighbors of the given cell in south direction.

Definition at line 53 of file CaloTopology.cc.

References emptyDetIdVector, getSubdetectorTopology(), and CaloSubdetectorTopology::south().

Referenced by FastL1Region::FillEMCrystals().

                                                          {
  const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
  return (topology==0) ? (emptyDetIdVector):(topology->south(id));
}
std::vector< DetId > CaloTopology::up ( const DetId id) const

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

Definition at line 58 of file CaloTopology.cc.

References emptyDetIdVector, getSubdetectorTopology(), and CaloSubdetectorTopology::up().

                                                       {
  const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
  return (topology==0) ? (emptyDetIdVector):(topology->up(id));
}
bool CaloTopology::valid ( const DetId id) const

Is this a valid cell id?

Definition at line 83 of file CaloTopology.cc.

References relativeConstraints::geom, getSubdetectorTopology(), and CaloSubdetectorTopology::valid().

                                              {
  const CaloSubdetectorTopology* geom=getSubdetectorTopology(id);
  return (geom==0)?(false):(geom->valid(id));
}
std::vector< DetId > CaloTopology::west ( const DetId id) const

Get the neighbors of the given cell in west direction.

Definition at line 43 of file CaloTopology.cc.

References emptyDetIdVector, getSubdetectorTopology(), and CaloSubdetectorTopology::west().

Referenced by FastL1Region::FillEMCrystals().

                                                         {
  const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
  return (topology==0) ? (emptyDetIdVector):(topology->west(id));
}

Member Data Documentation

Definition at line 56 of file CaloTopology.h.

Referenced by getSubdetectorTopology(), setSubdetTopology(), and ~CaloTopology().