CMS 3D CMS Logo

EcalBarrelTopology.cc
Go to the documentation of this file.
2 
4  if (!(theGeom_->present(id)))
5  return EBDetId(0);
6 
7  EBDetId nextPoint;
8  if (id.ieta() == -1) {
9  if (EBDetId::validDetId(1, id.iphi()))
10  nextPoint = EBDetId(1, id.iphi());
11  else
12  return EBDetId(0);
13  } else {
14  if (EBDetId::validDetId(id.ieta() + 1, id.iphi()))
15  nextPoint = EBDetId(id.ieta() + 1, id.iphi());
16  else
17  return EBDetId(0);
18  }
19  if (theGeom_->present(nextPoint))
20  return nextPoint;
21  else
22  return EBDetId(0);
23 }
24 
26  if (!(theGeom_->present(id)))
27  return EBDetId(0);
28 
29  EBDetId nextPoint;
30  if (id.ieta() == 1) {
31  if (EBDetId::validDetId(-1, id.iphi()))
32  nextPoint = EBDetId(-1, id.iphi());
33  else
34  return EBDetId(0);
35  } else {
36  if (EBDetId::validDetId(id.ieta() - 1, id.iphi()))
37  nextPoint = EBDetId(id.ieta() - 1, id.iphi());
38  else
39  return EBDetId(0);
40  }
41 
42  if (theGeom_->present(nextPoint))
43  return nextPoint;
44  else
45  return EBDetId(0);
46 }
47 
49  if (!(theGeom_->present(id)))
50  return EBDetId(0);
51 
52  EBDetId nextPoint;
53 
54  if (id.iphi() == EBDetId::MAX_IPHI) {
56  nextPoint = EBDetId(id.ieta(), EBDetId::MIN_IPHI);
57  else
58  return EBDetId(0);
59  } else {
60  if (EBDetId::validDetId(id.ieta(), id.iphi() + 1))
61  nextPoint = EBDetId(id.ieta(), id.iphi() + 1);
62  else
63  return EBDetId(0);
64  }
65 
66  if (theGeom_->present(nextPoint))
67  return nextPoint;
68  else
69  return EBDetId(0);
70 }
71 
73  if (!(theGeom_->present(id)))
74  return EBDetId(0);
75 
76  EBDetId nextPoint;
77 
78  if (id.iphi() == EBDetId::MIN_IPHI) {
80  nextPoint = EBDetId(id.ieta(), EBDetId::MAX_IPHI);
81  else
82  return EBDetId(0);
83  } else {
84  if (EBDetId::validDetId(id.ieta(), id.iphi() - 1))
85  nextPoint = EBDetId(id.ieta(), id.iphi() - 1);
86  else
87  return EBDetId(0);
88  }
89 
90  if (theGeom_->present(nextPoint))
91  return nextPoint;
92  else
93  return EBDetId(0);
94 }
EBDetId incrementIeta(const EBDetId &) const
move the nagivator to larger ieta (more positive z) (stops at end of barrel and returns null) ...
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
const CaloSubdetectorGeometry * theGeom_
virtual bool present(const DetId &id) const
is this detid present in the geometry?
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 decrementIeta(const EBDetId &) const
move the nagivator to smaller ieta (more negative z) (stops at end of barrel and returns null) ...
EBDetId incrementIphi(const EBDetId &) const
move the nagivator to larger iphi (wraps around the barrel)