CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
CaloTopology Class Reference

#include <CaloTopology.h>

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) More...
 
std::vector< DetIdeast (const DetId &id) const
 Get the neighbors of the given cell in east direction. More...
 
std::vector< DetIdgetAllNeighbours (const DetId &id) const
 Get all the neighbors of the given cell. More...
 
std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 Get the neighbors of the given cell given direction. More...
 
const CaloSubdetectorTopologygetSubdetectorTopology (const DetId &id) const
 access the subdetector Topology for the given subdetector directly More...
 
const CaloSubdetectorTopologygetSubdetectorTopology (DetId::Detector det, int subdet) const
 access the subdetector Topology for the given subdetector directly More...
 
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. More...
 
std::vector< DetIdnorth (const DetId &id) const
 Get the neighbors of the given cell in north direction. More...
 
void setSubdetTopology (DetId::Detector det, int subdet, const CaloSubdetectorTopology *geom)
 Register a subdetector Topology. More...
 
std::vector< DetIdsouth (const DetId &id) const
 Get the neighbors of the given cell in south direction. More...
 
std::vector< DetIdup (const DetId &id) const
 Get the neighbors of the given cell in up direction (outward) More...
 
bool valid (const DetId &id) const
 Is this a valid cell id? More...
 
std::vector< DetIdwest (const DetId &id) const
 Get the neighbors of the given cell in west direction. More...
 
 ~CaloTopology ()
 

Private Member Functions

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

Private Attributes

TopMap theTopologies_
 

Detailed Description

Revision
1.4
Author
J. Mans and P. Meridiani

Definition at line 18 of file CaloTopology.h.

Member Typedef Documentation

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

Definition at line 21 of file CaloTopology.h.

Constructor & Destructor Documentation

CaloTopology::CaloTopology ( )

Definition at line 5 of file CaloTopology.cc.

5  {
6 }
CaloTopology::~CaloTopology ( )

Definition at line 8 of file CaloTopology.cc.

References mps_fire::i, and theTopologies_.

9 {
10  for( TopMap::iterator i ( theTopologies_.begin() ) ;
11  i != theTopologies_.end() ; ++i )
12  {
13  delete i->second ;
14  }
15 }
TopMap theTopologies_
Definition: CaloTopology.h:55

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, getSubdetectorTopology(), and ecaldqm::topology().

63  {
65  return (topology==0) ? (emptyDetIdVector):(topology->down(id));
66 }
CaloTopology const * topology(0)
virtual std::vector< DetId > down(const DetId &id) const =0
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
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, getSubdetectorTopology(), and ecaldqm::topology().

38  {
40  return (topology==0) ? (emptyDetIdVector):(topology->east(id));
41 }
CaloTopology const * topology(0)
virtual std::vector< DetId > east(const DetId &id) const =0
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
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(), getSubdetectorTopology(), and ecaldqm::topology().

78  {
80  return (topology==0) ? (emptyDetIdVector):(topology->getAllNeighbours(id));
81 }
virtual std::vector< DetId > getAllNeighbours(const DetId &id) const
CaloTopology const * topology(0)
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
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(), getSubdetectorTopology(), and ecaldqm::topology().

68  {
70  return (topology==0) ? (emptyDetIdVector):(topology->getNeighbours(id,dir));
71 }
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
CaloTopology const * topology(0)
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
dbl *** dir
Definition: mlp_gen.cc:35
const CaloSubdetectorTopology * CaloTopology::getSubdetectorTopology ( const DetId id) const

access the subdetector Topology for the given subdetector directly

Definition at line 26 of file CaloTopology.cc.

References mps_fire::i, makeIndex(), and theTopologies_.

Referenced by DQMSourcePi0::analyze(), ElectronCalibrationUniv::analyze(), EcalClusterToolsT< noZS >::covariances(), down(), east(), HLTEcalResonanceFilter::filter(), HLTRegionalEcalResonanceFilter::filter(), getAllNeighbours(), BetaCalculatorECAL::getDetailedTrackLengthInXtals(), getNeighbours(), getWindow(), EcalBoundaryInfoCalculator< EBDetId >::initializeEcalNavigator(), EcalClusterToolsT< noZS >::localCovariances(), PiZeroAnalyzer::makePizero(), EcalClusterToolsT< noZS >::matrixDetId(), spr::matrixECALIds(), EcalClusterToolsT< noZS >::matrixEnergy(), EcalClusterToolsT< noZS >::matrixSize(), north(), EcalClusterToolsT< noZS >::nrSaturatedCrysIn5x5(), InterestingEcalDetIdProducer::produce(), InterestingDetIdCollectionProducer::produce(), InterestingDetIdFromSuperClusterProducer::produce(), ReducedEGProducer::produce(), InterestingTrackEcalDetIdProducer::produce(), pat::PATPhotonProducer::produce(), pat::PATElectronProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), EEBadScFilter::scan5x5(), EcalClusterToolsT< noZS >::scLocalCovariances(), SingleEleCalibSelector::select(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), EcalDeadChannelRecoveryNN< EBDetId >::setCaloTopology(), EcalDeadChannelRecoveryNN< EEDetId >::setCaloTopology(), Calorimeter::setupTopology(), south(), up(), valid(), and west().

26  {
27  std::map<int, const CaloSubdetectorTopology*>::const_iterator i=theTopologies_.find(makeIndex(id.det(),id.subdetId()));
28  return (i==theTopologies_.end())?(0):(i->second);
29 }
TopMap theTopologies_
Definition: CaloTopology.h:55
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:17
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 mps_fire::i, makeIndex(), and theTopologies_.

31  {
32  std::map<int, const CaloSubdetectorTopology*>::const_iterator i=theTopologies_.find(makeIndex(det,subdet));
33  return (i==theTopologies_.end())?(0):(i->second);
34 }
TopMap theTopologies_
Definition: CaloTopology.h:55
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:17
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(), CaloSubdetectorTopology::getWindow(), and ecaldqm::topology().

Referenced by AlCaECALRecHitReducer::AddMiniRecHitCollection(), EcalClusterSeverityLevelAlgo::closestProblematic(), EcalMIPRecHitFilter::filter(), and EcalClusterSeverityLevelAlgo::fractionAroundClosestProblematic().

73  {
75  return (topology==0) ? (emptyDetIdVector):(topology->getWindow(id,northSouthSize, eastWestSize));
76 }
CaloTopology const * topology(0)
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
int CaloTopology::makeIndex ( DetId::Detector  det,
int  subdet 
) const
private

Definition at line 17 of file CaloTopology.cc.

Referenced by getSubdetectorTopology(), and setSubdetTopology().

17  {
18  return (int(det)<<4) | (subdet&0xF);
19 }
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(), CaloSubdetectorTopology::north(), and ecaldqm::topology().

48  {
50  return (topology==0) ? (emptyDetIdVector):(topology->north(id));
51 }
CaloTopology const * topology(0)
virtual std::vector< DetId > north(const DetId &id) const =0
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
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, diffTreeTool::index, makeIndex(), and theTopologies_.

21  {
22  int index=makeIndex(det,subdet);
24 }
TopMap theTopologies_
Definition: CaloTopology.h:55
int makeIndex(DetId::Detector det, int subdet) const
Definition: CaloTopology.cc:17
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(), CaloSubdetectorTopology::south(), and ecaldqm::topology().

53  {
55  return (topology==0) ? (emptyDetIdVector):(topology->south(id));
56 }
CaloTopology const * topology(0)
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
virtual std::vector< DetId > south(const DetId &id) const =0
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(), ecaldqm::topology(), and CaloSubdetectorTopology::up().

58  {
60  return (topology==0) ? (emptyDetIdVector):(topology->up(id));
61 }
virtual std::vector< DetId > up(const DetId &id) const =0
CaloTopology const * topology(0)
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36
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().

83  {
85  return (geom==0)?(false):(geom->valid(id));
86 }
virtual bool valid(const DetId &) const
is this detid present in the Topology?
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
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(), ecaldqm::topology(), and CaloSubdetectorTopology::west().

43  {
45  return (topology==0) ? (emptyDetIdVector):(topology->west(id));
46 }
CaloTopology const * topology(0)
virtual std::vector< DetId > west(const DetId &id) const =0
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:36

Member Data Documentation

TopMap CaloTopology::theTopologies_
private

Definition at line 55 of file CaloTopology.h.

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