CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Geometry/CaloTopology/interface/EcalEndcapTopology.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H
00002 #define GEOMETRY_CALOTOPOLOGY_ECALENDCAPTOPOLOGY_H 1
00003 
00004 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00005 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00006 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00007 #include "FWCore/Framework/interface/ESHandle.h"
00008 #include <vector>
00009 #include <iostream>
00010 
00011 class EcalEndcapTopology : public CaloSubdetectorTopology {
00012 
00013  public:
00015   EcalEndcapTopology() : theGeom_(0) {};
00016 
00018   virtual ~EcalEndcapTopology() { }  
00019   
00021   EcalEndcapTopology(edm::ESHandle<CaloGeometry> theGeom) : theGeom_(theGeom)
00022     {
00023     }
00024 
00026   virtual std::vector<DetId> north(const DetId& id) const
00027     { 
00028       EEDetId nextId=incrementIy(EEDetId(id));
00029       std::vector<DetId> vNeighborsDetId;
00030       if (! (nextId==EEDetId(0)))
00031         vNeighborsDetId.push_back(DetId(nextId.rawId()));
00032       return vNeighborsDetId;
00033     }
00034 
00036   virtual std::vector<DetId> south(const DetId& id) const
00037     { 
00038       EEDetId nextId=decrementIy(EEDetId(id));
00039       std::vector<DetId> vNeighborsDetId;
00040       if (! (nextId==EEDetId(0)))
00041         vNeighborsDetId.push_back(DetId(nextId.rawId()));
00042       return vNeighborsDetId;
00043     }
00044 
00046   virtual std::vector<DetId> east(const DetId& id) const
00047     { 
00048       EEDetId nextId=incrementIx(EEDetId(id));
00049       std::vector<DetId> vNeighborsDetId;
00050       if (! (nextId==EEDetId(0)))
00051         vNeighborsDetId.push_back(DetId(nextId.rawId()));
00052       return vNeighborsDetId;
00053     }
00054 
00056   virtual std::vector<DetId> west(const DetId& id) const
00057     { 
00058       EEDetId nextId=decrementIx(EEDetId(id));
00059       std::vector<DetId> vNeighborsDetId;
00060       if (! (nextId==EEDetId(0)))
00061         vNeighborsDetId.push_back(DetId(nextId.rawId()));
00062       return vNeighborsDetId;
00063     }
00064   
00065   virtual std::vector<DetId> up(const DetId& /*id*/) const
00066     {
00067       std::cout << "EcalBarrelTopology::up() not yet implemented" << std::endl; 
00068       std::vector<DetId> vNeighborsDetId;
00069       return  vNeighborsDetId;
00070     }
00071   
00072   virtual std::vector<DetId> down(const DetId& /*id*/) const
00073     {
00074       std::cout << "EcalBarrelTopology::down() not yet implemented" << std::endl; 
00075       std::vector<DetId> vNeighborsDetId;
00076       return  vNeighborsDetId;
00077     }
00078 
00079  private:
00080 
00082   EEDetId incrementIx(const EEDetId& id) const ;
00083 
00085   EEDetId decrementIx(const EEDetId& id) const ;
00086 
00088   EEDetId incrementIy(const EEDetId& id) const ;
00089 
00091   EEDetId decrementIy(const EEDetId& id) const;
00092 
00093   edm::ESHandle<CaloGeometry> theGeom_;
00094 };
00095 
00096 #endif