CMS 3D CMS Logo

CaloTopology Class Reference

Date
2006/09/07 09:43:12
Revision
1.3
More...

#include <Geometry/CaloTopology/interface/CaloTopology.h>

List of all members.

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 (DetId::Detector det, int subdet) const
 access the subdetector Topology for the given subdetector directly
const CaloSubdetectorTopologygetSubdetectorTopology (const DetId &id) 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

std::map< int, const
CaloSubdetectorTopology * > 
theTopologies_


Detailed Description

Date
2006/09/07 09:43:12
Revision
1.3

Author:
J. Mans and P. Meridiani

Definition at line 19 of file CaloTopology.h.


Constructor & Destructor Documentation

CaloTopology::CaloTopology (  ) 

Definition at line 5 of file CaloTopology.cc.

00005                            {
00006 }

CaloTopology::~CaloTopology (  )  [inline]

Definition at line 23 of file CaloTopology.h.

00023 {};


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 54 of file CaloTopology.cc.

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

00054                                                          {
00055     const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00056     return (topology==0) ? (emptyDetIdVector):(topology->down(id));
00057 }

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

Get the neighbors of the given cell in east direction.

Definition at line 29 of file CaloTopology.cc.

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

Referenced by FastL1Region::FillEMCrystals().

00029                                                          {
00030   const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00031   return (topology==0) ? (emptyDetIdVector):(topology->east(id));
00032 }

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

Get all the neighbors of the given cell.

Definition at line 69 of file CaloTopology.cc.

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

00069                                                                      {
00070     const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00071     return (topology==0) ? (emptyDetIdVector):(topology->getAllNeighbours(id));
00072 }

std::vector< DetId > CaloTopology::getNeighbours ( const DetId id,
const CaloDirection dir 
) const

Get the neighbors of the given cell given direction.

Definition at line 59 of file CaloTopology.cc.

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

00059                                                                                            {
00060     const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00061     return (topology==0) ? (emptyDetIdVector):(topology->getNeighbours(id,dir));
00062 }

const CaloSubdetectorTopology * CaloTopology::getSubdetectorTopology ( DetId::Detector  det,
int  subdet 
) const

access the subdetector Topology for the given subdetector directly

Definition at line 22 of file CaloTopology.cc.

References i, makeIndex(), and theTopologies_.

00022                                                                                                        {
00023     std::map<int, const CaloSubdetectorTopology*>::const_iterator i=theTopologies_.find(makeIndex(det,subdet));
00024     return (i==theTopologies_.end())?(0):(i->second);
00025 }

const CaloSubdetectorTopology * CaloTopology::getSubdetectorTopology ( const DetId id  )  const

access the subdetector Topology for the given subdetector directly

Definition at line 17 of file CaloTopology.cc.

References i, makeIndex(), and theTopologies_.

Referenced by EcalClusterTools::covariances(), down(), east(), getAllNeighbours(), getNeighbours(), getWindow(), EcalClusterTools::localCovariances(), EcalDeadChannelRecoveryAlgos::MakeNxNMatrice(), EcalClusterTools::matrixDetId(), EcalClusterTools::matrixEnergy(), north(), InterestingDetIdCollectionProducer::produce(), Calorimeter::setupTopology(), south(), up(), valid(), and west().

00017                                                                                          {
00018   std::map<int, const CaloSubdetectorTopology*>::const_iterator i=theTopologies_.find(makeIndex(id.det(),id.subdetId()));
00019   return (i==theTopologies_.end())?(0):(i->second);
00020 }

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 64 of file CaloTopology.cc.

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

00064                                                                                                                   {
00065     const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00066     return (topology==0) ? (emptyDetIdVector):(topology->getWindow(id,northSouthSize, eastWestSize));
00067 }

int CaloTopology::makeIndex ( DetId::Detector  det,
int  subdet 
) const [private]

Definition at line 8 of file CaloTopology.cc.

Referenced by getSubdetectorTopology(), and setSubdetTopology().

00008                                                                {
00009   return (int(det)<<4) | (subdet&0xF);
00010 }

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

Get the neighbors of the given cell in north direction.

Definition at line 39 of file CaloTopology.cc.

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

Referenced by FastL1Region::FillEMCrystals().

00039                                                           {
00040   const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00041   return (topology==0) ? (emptyDetIdVector):(topology->north(id));
00042 }

void CaloTopology::setSubdetTopology ( DetId::Detector  det,
int  subdet,
const CaloSubdetectorTopology geom 
)

Register a subdetector Topology.

Definition at line 12 of file CaloTopology.cc.

References index, makeIndex(), and theTopologies_.

00012                                                                                                        {
00013   int index=makeIndex(det,subdet);
00014   theTopologies_[index]=geom;
00015 }

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

Get the neighbors of the given cell in south direction.

Definition at line 44 of file CaloTopology.cc.

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

Referenced by FastL1Region::FillEMCrystals().

00044                                                           {
00045   const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00046   return (topology==0) ? (emptyDetIdVector):(topology->south(id));
00047 }

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

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

Definition at line 49 of file CaloTopology.cc.

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

00049                                                        {
00050   const CaloSubdetectorTopology* topology=getSubdetectorTopology(id);
00051   return (topology==0) ? (emptyDetIdVector):(topology->up(id));
00052 }

bool CaloTopology::valid ( const DetId id  )  const

Is this a valid cell id?

Definition at line 74 of file CaloTopology.cc.

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

00074                                               {
00075   const CaloSubdetectorTopology* geom=getSubdetectorTopology(id);
00076   return (geom==0)?(false):(geom->valid(id));
00077 }

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

Get the neighbors of the given cell in west direction.

Definition at line 34 of file CaloTopology.cc.

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

Referenced by FastL1Region::FillEMCrystals().

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


Member Data Documentation

std::map<int, const CaloSubdetectorTopology*> CaloTopology::theTopologies_ [private]

Definition at line 53 of file CaloTopology.h.

Referenced by getSubdetectorTopology(), and setSubdetTopology().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:58 2009 for CMSSW by  doxygen 1.5.4