Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:41

0001 #ifndef GEOMETRY_CALOTOPOLOGY_CALOTOWERTOPOLOGY_H
0002 #define GEOMETRY_CALOTOPOLOGY_CALOTOWERTOPOLOGY_H 1
0003 
0004 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0005 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0006 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
0007 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0008 
0009 /** \class CaloTowerTopology
0010   *  
0011   * \author J. Mans - Minnesota
0012   */
0013 class CaloTowerTopology final : public CaloSubdetectorTopology {
0014 public:
0015   /// standard constructor
0016   CaloTowerTopology(const HcalTopology* topology);
0017   /// virtual destructor
0018   ~CaloTowerTopology() override {}
0019   /// is this detid present in the Topology?
0020   bool valid(const DetId& id) const override;
0021   virtual bool validDetId(const CaloTowerDetId& id) const;
0022   /** Get the neighbors of the given cell in east direction*/
0023   std::vector<DetId> east(const DetId& id) const override;
0024   /** Get the neighbors of the given cell in west direction*/
0025   std::vector<DetId> west(const DetId& id) const override;
0026   /** Get the neighbors of the given cell in north direction*/
0027   std::vector<DetId> north(const DetId& id) const override;
0028   /** Get the neighbors of the given cell in south direction*/
0029   std::vector<DetId> south(const DetId& id) const override;
0030   /** Get the neighbors of the given cell in up direction (outward)*/
0031   std::vector<DetId> up(const DetId& id) const override;
0032   /** Get the neighbors of the given cell in down direction (inward)*/
0033   std::vector<DetId> down(const DetId& id) const override;
0034 
0035   //mimic accessors from HcalTopology, but with continuous ieta
0036   int firstHBRing() const { return firstHBRing_; }
0037   int lastHBRing() const { return lastHBRing_; }
0038   int firstHERing() const { return firstHERing_; }
0039   int lastHERing() const { return lastHERing_; }
0040   int firstHFRing() const { return firstHFRing_; }
0041   int lastHFRing() const { return lastHFRing_; }
0042   int firstHORing() const { return firstHORing_; }
0043   int lastHORing() const { return lastHORing_; }
0044   int firstHEDoublePhiRing() const { return firstHEDoublePhiRing_; }
0045   int firstHEQuadPhiRing() const { return firstHEQuadPhiRing_; }
0046   int firstHFQuadPhiRing() const { return firstHFQuadPhiRing_; }
0047 
0048   //conversion between CaloTowerTopology ieta and HcalTopology ieta
0049   int convertCTtoHcal(int ct_ieta) const;
0050   int convertHcaltoCT(int hcal_ieta, HcalSubdetector subdet) const;
0051 
0052   //dense index functions moved from CaloTowerDetId
0053   uint32_t denseIndex(const DetId& id) const;
0054   CaloTowerDetId detIdFromDenseIndex(uint32_t din) const;
0055   bool validDenseIndex(uint32_t din) const { return (din < kSizeForDenseIndexing); }
0056   uint32_t sizeForDenseIndexing() const { return kSizeForDenseIndexing; }
0057 
0058 private:
0059   //member variables
0060   const HcalTopology* hcaltopo;
0061   int firstHBRing_, lastHBRing_;
0062   int firstHERing_, lastHERing_;
0063   int firstHFRing_, lastHFRing_;
0064   int firstHORing_, lastHORing_;
0065   int firstHEDoublePhiRing_, firstHEQuadPhiRing_, firstHFQuadPhiRing_;
0066   int nSinglePhi_, nDoublePhi_, nQuadPhi_, nEtaHE_;
0067   uint32_t kSizeForDenseIndexing;
0068 };
0069 #endif