23 firstHEDoublePhiRing_((h2_mode)?(22):(21)),
24 firstHFQuadPhiRing_(40),
25 firstHETripleDepthRing_((h2_mode)?(24):(27)),
44 switch (
id.subdet()) {
77 std::vector<DetId> vNeighborsDetId;
80 vNeighborsDetId.push_back(
DetId(neighbors[
i].rawId()));
81 return vNeighborsDetId;
85 std::vector<DetId> vNeighborsDetId;
88 vNeighborsDetId.push_back(
DetId(neighbors[
i].rawId()));
89 return vNeighborsDetId;
93 std::vector<DetId> vNeighborsDetId;
96 vNeighborsDetId.push_back(
DetId(neighbor.
rawId()));
97 return vNeighborsDetId;
101 std::vector<DetId> vNeighborsDetId;
104 vNeighborsDetId.push_back(
DetId(neighbor.
rawId()));
105 return vNeighborsDetId;
112 std::vector<DetId> vNeighborsDetId;
115 vNeighborsDetId.push_back(neighbor);
117 return vNeighborsDetId;
121 std::cout <<
"HcalTopology::down() not yet implemented" << std::endl;
122 std::vector<DetId> vNeighborsDetId;
123 return vNeighborsDetId;
143 int depth_l=
std::min(depth1,depth2);
144 int depth_h=
std::max(depth1,depth2);
147 for (
int ieta=ieta_l; ieta<=ieta_h; ieta++)
148 for (
int iphi=iphi_l; iphi<=iphi_h; iphi++)
149 for (
int depth=depth_l; depth<=depth_h; depth++) {
189 int aieta=
id.ietaAbs();
190 int depth=
id.depth();
193 if ((ieta==0 || iphi<=0 || iphi>
IPHI_MAX) || aieta>41)
return false;
198 if (aieta>16 || depth>2 || (aieta<=14 && depth>1)) ok=
false;
200 if (depth>3 || aieta<16 || aieta>
lastHERing() ||
201 (aieta==16 && depth!=3) ||
202 (aieta==17 && depth!=1 && !
h2mode_) ||
206 if (aieta>15 || iphi>IPHI_MAX || depth!=4) ok=
false;
222 switch (
id.subdet()) {
226 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()+1,
id.depth());
230 if (
id.iphi()==
IPHI_MAX-1) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),1,
id.depth());
231 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()+2,
id.depth());
234 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()+1,
id.depth());
239 if (
id.iphi()==
IPHI_MAX-1) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),3,
id.depth());
240 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()+4,
id.depth());
242 if (
id.iphi()==
IPHI_MAX-1) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),1,
id.depth());
243 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()+2,
id.depth());
256 switch (
id.subdet()) {
260 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()-1,
id.depth());
264 if (
id.iphi()==1) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
IPHI_MAX-1,
id.depth());
265 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()-2,
id.depth());
268 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()-1,
id.depth());
273 if (
id.iphi()==3) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
IPHI_MAX-1,
id.depth());
274 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()-4,
id.depth());
276 if (
id.iphi()==1) neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
IPHI_MAX-1,
id.depth());
277 else neighbor=
HcalDetId(
id.subdet(),
id.ieta(),
id.iphi()-2,
id.depth());
287 if (
id.zside()==1)
return incAIEta(
id,neighbors);
292 if (
id.zside()==1)
return decAIEta(
id,neighbors);
299 int aieta=
id.ietaAbs();
310 neighbors[0]=
HcalDetId(
id.subdet(),(aieta+1)*
id.zside(),
id.iphi(),
id.depth());
312 if (!
valid(neighbors[0])) n=0;
319 int aieta=
id.ietaAbs();
330 }
else if (aieta==1) {
331 neighbors[0]=
HcalDetId(
id.subdet(),-aieta*
id.zside(),
id.iphi(),
id.depth());
337 neighbors[0]=
HcalDetId(
id.subdet(),(aieta-1)*
id.zside(),
id.iphi(),
id.depth());
339 if (!
valid(neighbors[0]) && n==2) {
340 if (!
valid(neighbors[1])) n=0;
343 neighbors[0]=neighbors[1];
346 if (n==2 && !
valid(neighbors[1])) n=1;
347 if (n==1 && !
valid(neighbors[0])) n=0;
354 int & nDepthBins,
int & startingBin)
const {
367 }
else if (etaRing==17) {
391 std::cerr <<
"Bad HCAL subdetector " << subdet << std::endl;
399 int ieta = detId.
ieta();
401 int depth = detId.
depth();
402 int nDepthBins, startingBin;
407 if(depth > nDepthBins)
425 (ieta > 0) ? ++ieta : --ieta;
431 (ieta > 0) ? --ieta : ++ieta;
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
void excludeSubdetector(HcalSubdetector subdet)
HcalSubdetector subdet() const
get the subdetector
virtual bool valid(const HcalDetId &id) const
virtual std::vector< DetId > down(const DetId &id) const
virtual std::vector< DetId > south(const DetId &id) const
void exclude(const HcalDetId &id)
int nPhiBins(int etaRing) const
how many phi segments in this ring
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
uint32_t rawId() const
get the raw id
bool isExcluded(const HcalDetId &id) const
int depth() const
get the tower depth
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
bool validRaw(const HcalDetId &id) const
HcalTopology(bool h2_mode=false)
const T & max(const T &a, const T &b)
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
int firstHETripleDepthRing() const
int ieta() const
get the cell ieta
virtual std::vector< DetId > west(const DetId &id) const
void depthBinInformation(HcalSubdetector subdet, int etaRing, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
int firstHEDoublePhiRing() const
int ietaAbs() const
get the absolute value of the cell ieta
int iphi() const
get the cell iphi
bool incrementDepth(HcalDetId &id) const
virtual std::vector< DetId > north(const DetId &id) const
int firstHFQuadPhiRing() const
virtual std::vector< DetId > up(const DetId &id) const
std::vector< HcalDetId > exclusionList_
virtual std::vector< DetId > east(const DetId &id) const
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static const int IPHI_MAX