CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
CaloTowerTopology Class Reference

#include <CaloTowerTopology.h>

Inheritance diagram for CaloTowerTopology:
CaloSubdetectorTopology

Public Member Functions

 CaloTowerTopology ()
 standard constructor More...
 
virtual std::vector< DetIddown (const DetId &id) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 
virtual std::vector< DetIdnorth (const DetId &id) const
 
virtual std::vector< DetIdsouth (const DetId &id) const
 
virtual std::vector< DetIdup (const DetId &id) const
 
virtual bool valid (const DetId &id) const
 is this detid present in the Topology? More...
 
virtual std::vector< DetIdwest (const DetId &id) const
 
virtual ~CaloTowerTopology ()
 virtual destructor More...
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor More...
 
virtual DetId denseId2detId (unsigned int) const
 return a linear packed id More...
 
virtual bool denseIdConsistent (int topoVer) const
 return whether this topology is consistent with the numbering in the given topology More...
 
virtual unsigned int detId2denseId (const DetId &) const
 return a linear packed id More...
 
virtual std::vector< DetIdgetAllNeighbours (const DetId &id) const
 
virtual std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 
virtual std::vector< DetIdgetWindow (const DetId &id, const int &northSouthSize, const int &eastWestSize) const
 
virtual DetId goDown (const DetId &id) const
 
virtual DetId goEast (const DetId &id) const
 
virtual DetId goNorth (const DetId &id) const
 
virtual DetId goSouth (const DetId &id) const
 
virtual DetId goUp (const DetId &id) const
 
virtual DetId goWest (const DetId &id) const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
virtual int topoVersion () const
 return a version which identifies the given topology More...
 
virtual ~CaloSubdetectorTopology ()
 virtual destructor More...
 

Additional Inherited Members

- Protected Types inherited from CaloSubdetectorTopology
typedef std::pair< int, int > Coordinate
 
- Protected Member Functions inherited from CaloSubdetectorTopology
Coordinate getNeighbourIndex (const Coordinate &coord, const CaloDirection &dir) const
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 10 of file CaloTowerTopology.h.

Constructor & Destructor Documentation

CaloTowerTopology::CaloTowerTopology ( )
inline

standard constructor

Definition at line 13 of file CaloTowerTopology.h.

13 {}
virtual CaloTowerTopology::~CaloTowerTopology ( )
inlinevirtual

virtual destructor

Definition at line 15 of file CaloTowerTopology.h.

15 { }

Member Function Documentation

std::vector< DetId > CaloTowerTopology::down ( const DetId id) const
virtual

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

Implements CaloSubdetectorTopology.

Definition at line 114 of file CaloTowerTopology.cc.

114  {
115  return std::vector<DetId>();
116 }
std::vector< DetId > CaloTowerTopology::east ( const DetId id) const
virtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 13 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

13  {
14  std::vector<DetId> dd;
15  CaloTowerDetId tid(id);
16  int ieta=tid.ieta();
17  int iphi=tid.iphi();
18 
19  if (ieta==1) {
20  ieta=-1;
21  } else if (ieta==DoubleHE) {
22  ieta--;
23  dd.push_back(CaloTowerDetId(ieta,iphi+1));
24  } else if (ieta-1==-DoubleHE) {
25  if ((iphi%2)==0) iphi--;
26  ieta--;
27  } else if (ieta==QuadHF) {
28  ieta--;
29  dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));
30  } else if (ieta-1==-QuadHF) {
31  if (((iphi-1)%4)==0) {
32  if (iphi==1) iphi=71;
33  else iphi-=2;
34  }
35  ieta--;
36  } else {
37  ieta--;
38  }
39 
40  if (ieta>=-41) dd.push_back(CaloTowerDetId(ieta,iphi));
41  return dd;
42 }
static const int DoubleHE
static const int QuadHF
std::vector< DetId > CaloTowerTopology::north ( const DetId id) const
virtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 77 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

77  {
78  CaloTowerDetId tid(id);
79  int iphi_n=tid.iphi()+1;
80  if (iphi_n>72) iphi_n=1;
81  if (tid.ietaAbs()>=QuadHF) {
82  iphi_n+=3;
83  if (iphi_n>72) iphi_n-=72;
84  } else if (tid.ietaAbs()>=DoubleHE && (iphi_n%2)==0) {
85  iphi_n++;
86  if (iphi_n>72) iphi_n-=72;
87  }
88 
89  std::vector<DetId> dd;
90  dd.push_back(CaloTowerDetId(tid.ieta(),iphi_n));
91  return dd;
92 }
static const int DoubleHE
static const int QuadHF
std::vector< DetId > CaloTowerTopology::south ( const DetId id) const
virtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 94 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

94  {
95  CaloTowerDetId tid(id);
96  int iphi_s=tid.iphi()-1;
97  if (iphi_s==0) iphi_s=72;
98  if (tid.ietaAbs()>=QuadHF) {
99  iphi_s-=3;
100  if (iphi_s<=0) iphi_s+=72;
101  } else if (tid.ietaAbs()>=DoubleHE && (iphi_s%2)==0) {
102  iphi_s--;
103  }
104 
105  std::vector<DetId> dd;
106  dd.push_back(CaloTowerDetId(tid.ieta(),iphi_s));
107  return dd;
108 }
static const int DoubleHE
static const int QuadHF
std::vector< DetId > CaloTowerTopology::up ( const DetId id) const
virtual

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

Implements CaloSubdetectorTopology.

Definition at line 110 of file CaloTowerTopology.cc.

110  {
111  return std::vector<DetId>();
112 }
bool CaloTowerTopology::valid ( const DetId id) const
virtual

is this detid present in the Topology?

Reimplemented from CaloSubdetectorTopology.

Definition at line 7 of file CaloTowerTopology.cc.

References cond::ecalcond::bad(), CaloTowerDetId::ieta(), and CaloTowerDetId::iphi().

7  {
8  CaloTowerDetId tid(id);
9  bool bad=(tid.ieta()==0 || tid.iphi()<=0 || tid.iphi()>72 || tid.ieta()<-41 || tid.ieta()>41);
10  return !bad;
11 }
int bad(Items const &cont)
std::vector< DetId > CaloTowerTopology::west ( const DetId id) const
virtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 44 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

44  {
45  std::vector<DetId> dd;
46  CaloTowerDetId tid(id);
47 
48  int ieta=tid.ieta();
49  int iphi=tid.iphi();
50 
51  if (ieta==-1) {
52  ieta=1;
53  } else if (ieta==-DoubleHE) {
54  ieta++;
55  dd.push_back(CaloTowerDetId(ieta,iphi+1));
56  } else if (ieta+1==DoubleHE) {
57  if ((iphi%2)==0) iphi--;
58  ieta++;
59  } else if (ieta==-QuadHF) {
60  ieta++;
61  dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));
62  } else if (ieta+1==QuadHF) {
63  if (((iphi-1)%4)==0) {
64  if (iphi==1) iphi=71;
65  else iphi-=2;
66  }
67  ieta++;
68  } else {
69  ieta++;
70  }
71 
72  if (ieta<=41) dd.push_back(CaloTowerDetId(ieta,iphi));
73 
74  return dd;
75 }
static const int DoubleHE
static const int QuadHF