CMS 3D CMS Logo

EcalBarrelTopology.cc
Go to the documentation of this file.
3 
4 
6  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
7  return EBDetId(0);
8 
9  EBDetId nextPoint;
10  if (id.ieta()==-1)
11  {
12  if (EBDetId::validDetId(1,id.iphi()))
13  nextPoint=EBDetId (1,id.iphi());
14  else
15  return EBDetId(0);
16  }
17  else
18  {
19  if (EBDetId::validDetId(id.ieta()+1,id.iphi()))
20  nextPoint=EBDetId(id.ieta()+1,id.iphi());
21  else
22  return EBDetId(0);
23  }
24  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
25  return nextPoint;
26  else
27  return EBDetId(0);
28 }
29 
31 
32  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
33  return EBDetId(0);
34 
35  EBDetId nextPoint;
36  if (id.ieta()==1)
37  {
38  if (EBDetId::validDetId(-1,id.iphi()))
39  nextPoint=EBDetId(-1,id.iphi());
40  else
41  return EBDetId(0);
42  }
43  else
44  {
45  if (EBDetId::validDetId(id.ieta()-1,id.iphi()))
46  nextPoint=EBDetId(id.ieta()-1,id.iphi());
47  else
48  return EBDetId(0);
49  }
50 
51  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
52  return nextPoint;
53  else
54  return EBDetId(0);
55 }
56 
57 
59  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
60  return EBDetId(0);
61 
62  EBDetId nextPoint;
63 
64  if (id.iphi()==EBDetId::MAX_IPHI)
65  {
67  nextPoint=EBDetId(id.ieta(),EBDetId::MIN_IPHI);
68  else
69  return EBDetId(0);
70  }
71  else
72  {
73  if (EBDetId::validDetId(id.ieta(),id.iphi()+1))
74  nextPoint=EBDetId(id.ieta(),id.iphi()+1);
75  else
76  return EBDetId(0);
77  }
78 
79  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
80  return nextPoint;
81  else
82  return EBDetId(0);
83 }
84 
85 
87  if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(id))
88  return EBDetId(0);
89 
90  EBDetId nextPoint;
91 
92  if (id.iphi()==EBDetId::MIN_IPHI)
93  {
95  nextPoint=EBDetId(id.ieta(),EBDetId::MAX_IPHI);
96  else
97  return EBDetId(0);
98  }
99  else
100  {
101  if (EBDetId::validDetId(id.ieta(),id.iphi()-1))
102  nextPoint=EBDetId(id.ieta(),id.iphi()-1);
103  else
104  return EBDetId(0);
105  }
106 
107  if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalBarrel)->present(nextPoint))
108  return nextPoint;
109  else
110  return EBDetId(0);
111 }
112 
static const int MIN_IPHI
Definition: EBDetId.h:142
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
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:144
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) ...