CMS 3D CMS Logo

EcalBarrelTopology.cc
Go to the documentation of this file.
2 
3 
5  if (!(theGeom_->present(id)))
6  return EBDetId(0);
7 
8  EBDetId nextPoint;
9  if (id.ieta()==-1)
10  {
11  if (EBDetId::validDetId(1,id.iphi()))
12  nextPoint=EBDetId (1,id.iphi());
13  else
14  return EBDetId(0);
15  }
16  else
17  {
18  if (EBDetId::validDetId(id.ieta()+1,id.iphi()))
19  nextPoint=EBDetId(id.ieta()+1,id.iphi());
20  else
21  return EBDetId(0);
22  }
23  if (theGeom_->present(nextPoint))
24  return nextPoint;
25  else
26  return EBDetId(0);
27 }
28 
30 
31  if (!(theGeom_->present(id)))
32  return EBDetId(0);
33 
34  EBDetId nextPoint;
35  if (id.ieta()==1)
36  {
37  if (EBDetId::validDetId(-1,id.iphi()))
38  nextPoint=EBDetId(-1,id.iphi());
39  else
40  return EBDetId(0);
41  }
42  else
43  {
44  if (EBDetId::validDetId(id.ieta()-1,id.iphi()))
45  nextPoint=EBDetId(id.ieta()-1,id.iphi());
46  else
47  return EBDetId(0);
48  }
49 
50  if (theGeom_->present(nextPoint))
51  return nextPoint;
52  else
53  return EBDetId(0);
54 }
55 
56 
58  if (!(theGeom_->present(id)))
59  return EBDetId(0);
60 
61  EBDetId nextPoint;
62 
63  if (id.iphi()==EBDetId::MAX_IPHI)
64  {
66  nextPoint=EBDetId(id.ieta(),EBDetId::MIN_IPHI);
67  else
68  return EBDetId(0);
69  }
70  else
71  {
72  if (EBDetId::validDetId(id.ieta(),id.iphi()+1))
73  nextPoint=EBDetId(id.ieta(),id.iphi()+1);
74  else
75  return EBDetId(0);
76  }
77 
78  if (theGeom_->present(nextPoint))
79  return nextPoint;
80  else
81  return EBDetId(0);
82 }
83 
84 
86  if (!(theGeom_->present(id)))
87  return EBDetId(0);
88 
89  EBDetId nextPoint;
90 
91  if (id.iphi()==EBDetId::MIN_IPHI)
92  {
94  nextPoint=EBDetId(id.ieta(),EBDetId::MAX_IPHI);
95  else
96  return EBDetId(0);
97  }
98  else
99  {
100  if (EBDetId::validDetId(id.ieta(),id.iphi()-1))
101  nextPoint=EBDetId(id.ieta(),id.iphi()-1);
102  else
103  return EBDetId(0);
104  }
105 
106  if (theGeom_->present(nextPoint))
107  return nextPoint;
108  else
109  return EBDetId(0);
110 }
111 
static const int MIN_IPHI
Definition: EBDetId.h:135
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
virtual bool present(const DetId &id) const
is this detid present in the geometry?
const CaloSubdetectorGeometry * theGeom_
EBDetId decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
static const int MAX_IPHI
Definition: EBDetId.h:137
EBDetId decrementIphi(const EBDetId &) const
move the nagivator to smaller iphi (wraps around the barrel)
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...