#include <Geometry/CaloTopology/interface/CaloTowerTopology.h>
Public Member Functions | |
CaloTowerTopology () | |
standard constructor | |
virtual std::vector< DetId > | down (const DetId &id) const |
Get the neighbors of the given cell in down direction (inward). | |
virtual std::vector< DetId > | east (const DetId &id) const |
Get the neighbors of the given cell in east direction. | |
virtual std::vector< DetId > | north (const DetId &id) const |
Get the neighbors of the given cell in north direction. | |
virtual std::vector< DetId > | south (const DetId &id) const |
Get the neighbors of the given cell in south direction. | |
virtual std::vector< DetId > | up (const DetId &id) const |
Get the neighbors of the given cell in up direction (outward). | |
virtual bool | valid (const DetId &id) const |
is this detid present in the Topology? | |
virtual std::vector< DetId > | west (const DetId &id) const |
Get the neighbors of the given cell in west direction. | |
virtual | ~CaloTowerTopology () |
virtual destructor |
Definition at line 12 of file CaloTowerTopology.h.
CaloTowerTopology::CaloTowerTopology | ( | ) | [inline] |
virtual CaloTowerTopology::~CaloTowerTopology | ( | ) | [inline, virtual] |
Get the neighbors of the given cell in down direction (inward).
Implements CaloSubdetectorTopology.
Definition at line 108 of file CaloTowerTopology.cc.
Get the neighbors of the given cell in east direction.
Implements CaloSubdetectorTopology.
Definition at line 13 of file CaloTowerTopology.cc.
References dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.
Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().
00013 { 00014 std::vector<DetId> dd; 00015 CaloTowerDetId tid(id); 00016 int ieta=tid.ieta(); 00017 int iphi=tid.iphi(); 00018 00019 if (ieta==1) ieta=-1; 00020 else if (ieta==DoubleHE) { 00021 ieta--; 00022 dd.push_back(CaloTowerDetId(ieta,iphi+1)); 00023 } else if (ieta-1==-DoubleHE) { 00024 if ((iphi%2)==0) iphi--; 00025 ieta--; 00026 } else if (ieta==QuadHF) { 00027 ieta--; 00028 dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1)); 00029 } else if (ieta-1==-QuadHF) { 00030 if (((iphi-1)%4)==0) 00031 if (iphi==1) iphi=71; 00032 else iphi-=2; 00033 ieta--; 00034 } else ieta--; 00035 00036 if (ieta>=-41) 00037 dd.push_back(CaloTowerDetId(ieta,iphi)); 00038 return dd; 00039 }
Get the neighbors of the given cell in north direction.
Implements CaloSubdetectorTopology.
Definition at line 71 of file CaloTowerTopology.cc.
References dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.
Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().
00071 { 00072 CaloTowerDetId tid(id); 00073 int iphi_n=tid.iphi()+1; 00074 if (iphi_n>72) iphi_n=1; 00075 if (tid.ietaAbs()>=DoubleHE && (iphi_n%2)==0) { 00076 iphi_n++; 00077 if (iphi_n>72) iphi_n-=72; 00078 } 00079 if (tid.ietaAbs()>=QuadHF) { 00080 iphi_n+=3; 00081 if (iphi_n>72) iphi_n-=72; 00082 } 00083 00084 std::vector<DetId> dd; 00085 dd.push_back(CaloTowerDetId(tid.ieta(),iphi_n)); 00086 return dd; 00087 }
Get the neighbors of the given cell in south direction.
Implements CaloSubdetectorTopology.
Definition at line 89 of file CaloTowerTopology.cc.
References dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.
Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().
00089 { 00090 CaloTowerDetId tid(id); 00091 int iphi_s=tid.iphi()-1; 00092 if (iphi_s==0) iphi_s=72; 00093 if (tid.ietaAbs()>=DoubleHE && (iphi_s%2)==0) iphi_s--; 00094 if (tid.ietaAbs()>=QuadHF) { 00095 iphi_s-=3; 00096 if (iphi_s<=0) iphi_s+=72; 00097 } 00098 00099 std::vector<DetId> dd; 00100 dd.push_back(CaloTowerDetId(tid.ieta(),iphi_s)); 00101 return dd; 00102 }
Get the neighbors of the given cell in up direction (outward).
Implements CaloSubdetectorTopology.
Definition at line 104 of file CaloTowerTopology.cc.
is this detid present in the Topology?
Reimplemented from CaloSubdetectorTopology.
Definition at line 7 of file CaloTowerTopology.cc.
References CaloTowerDetId::ieta(), and CaloTowerDetId::iphi().
00007 { 00008 CaloTowerDetId tid(id); 00009 bool bad=(tid.ieta()==0 || tid.iphi()<=0 || tid.iphi()>72 || tid.ieta()<-41 || tid.ieta()>41); 00010 return !bad; 00011 }
Get the neighbors of the given cell in west direction.
Implements CaloSubdetectorTopology.
Definition at line 41 of file CaloTowerTopology.cc.
References dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.
Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().
00041 { 00042 std::vector<DetId> dd; 00043 CaloTowerDetId tid(id); 00044 00045 int ieta=tid.ieta(); 00046 int iphi=tid.iphi(); 00047 00048 if (ieta==-1) ieta=1; 00049 else if (ieta==-DoubleHE) { 00050 ieta++; 00051 dd.push_back(CaloTowerDetId(ieta,iphi+1)); 00052 } else if (ieta+1==DoubleHE) { 00053 if ((iphi%2)==0) iphi--; 00054 ieta++; 00055 } else if (ieta==-QuadHF) { 00056 ieta++; 00057 dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1)); 00058 } else if (ieta+1==QuadHF) { 00059 if (((iphi-1)%4)==0) 00060 if (iphi==1) iphi=71; 00061 else iphi-=2; 00062 ieta++; 00063 } else ieta++; 00064 00065 if (ieta<=41) 00066 dd.push_back(CaloTowerDetId(ieta,iphi)); 00067 00068 return dd; 00069 }