CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Geometry/CaloTopology/src/EcalEndcapTopology.cc

Go to the documentation of this file.
00001 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
00002 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00003 
00004 
00005 EEDetId EcalEndcapTopology::incrementIy(const EEDetId& id) const {
00006   if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
00007     {
00008       return EEDetId(0);
00009     }
00010   EEDetId nextPoint;
00011   if (EEDetId::validDetId(id.ix(),id.iy()+1,id.zside()))
00012     nextPoint=EEDetId(id.ix(),id.iy()+1,id.zside());
00013   else
00014     return EEDetId(0);
00015 
00016   if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
00017     return nextPoint;
00018   else
00019     return EEDetId(0);
00020 } 
00021 
00022 
00023 EEDetId EcalEndcapTopology::decrementIy(const EEDetId& id) const {
00024 
00025   if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
00026     {
00027       return EEDetId(0);
00028     }
00029   EEDetId nextPoint;
00030   if (EEDetId::validDetId(id.ix(),id.iy()-1,id.zside()))
00031     nextPoint=EEDetId(id.ix(),id.iy()-1,id.zside());
00032   else
00033     return EEDetId(0);
00034 
00035   if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
00036     return nextPoint;
00037   else
00038     return EEDetId(0);
00039 } 
00040 
00041 
00042 EEDetId EcalEndcapTopology::incrementIx(const EEDetId& id) const {
00043   if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
00044     {
00045       return EEDetId(0);
00046     }
00047   
00048   
00049   EEDetId nextPoint;
00050   if (EEDetId::validDetId(id.ix()+1,id.iy(),id.zside()))
00051     nextPoint=EEDetId(id.ix()+1,id.iy(),id.zside());
00052   else
00053     return EEDetId(0);
00054 
00055   if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
00056     return nextPoint;
00057   else
00058     return EEDetId(0);
00059 } 
00060 
00061 
00062 EEDetId EcalEndcapTopology::decrementIx(const EEDetId& id) const {
00063   if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
00064     {
00065       return EEDetId(0);
00066     }
00067   
00068   EEDetId nextPoint;
00069 
00070   if (EEDetId::validDetId(id.ix()-1,id.iy(),id.zside()))
00071     nextPoint=EEDetId(id.ix()-1,id.iy(),id.zside());
00072   else
00073     return EEDetId(0);
00074   
00075   if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
00076     return nextPoint;
00077   else
00078     return EEDetId(0);
00079 } 
00080