Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEOMETRY_CALOTOPOLOGY_CASTORTOPOLOGY_H
0002 #define GEOMETRY_CALOTOPOLOGY_CASTORTOPOLOGY_H 1
0003 
0004 #include <vector>
0005 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
0006 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0007 
0008 /** \class CastorTopology
0009 
0010    \author P. Katsas - UoA
0011 */
0012 
0013 class CastorTopology : public CaloSubdetectorTopology {
0014 public:
0015   CastorTopology();
0016   /** Exlucde a cell*/
0017   void exclude(const HcalCastorDetId& id);
0018   /** Exclude a side*/
0019   void exclude(int zside);
0020   /** Exclude a section, in either side (+1 positive, -1 negative)*/
0021   void exclude(int zside, HcalCastorDetId::Section section);
0022   /** Exclude a range of channels (deph) for a given subdetector*/
0023   int exclude(int zside,
0024               HcalCastorDetId::Section section1,
0025               int isec1,
0026               int imod1,
0027               HcalCastorDetId::Section section2,
0028               int isec2,
0029               int imod2);
0030 
0031   /** Is this a valid cell id? */
0032   using CaloSubdetectorTopology::valid;
0033   virtual bool valid(const HcalCastorDetId& id) const;
0034 
0035   /** Is this a valid cell id? */
0036   virtual bool validRaw(const HcalCastorDetId& id) const;
0037 
0038   /** Get the neighbors of the given cell with higher #sector */
0039   virtual std::vector<DetId> incSector(const DetId& id) const;
0040 
0041   /** Get the neigbors of the given cell with higher #module*/
0042   virtual std::vector<DetId> incModule(const DetId& id) const;
0043 
0044   //** I have to put this here since they inherit from CaloSubdetectorTopology
0045   std::vector<DetId> east(const DetId& id) const override;
0046   std::vector<DetId> west(const DetId& id) const override;
0047   std::vector<DetId> north(const DetId& id) const override;
0048   std::vector<DetId> south(const DetId& id) const override;
0049   std::vector<DetId> up(const DetId& id) const override;
0050   std::vector<DetId> down(const DetId& id) const override;
0051 
0052   // how many channels (deph) for a given section
0053   using CaloSubdetectorTopology::ncells;
0054   int ncells(HcalCastorDetId::Section section) const;
0055 
0056   //return first and last cell of each section
0057   int firstCell(HcalCastorDetId::Section section) const;
0058   int lastCell(HcalCastorDetId::Section section) const;
0059 
0060 private:
0061   std::vector<HcalCastorDetId> exclusionList_;
0062 
0063   bool excludeEM_, excludeHAD_, excludeZP_, excludeZN_;
0064 
0065   int firstEMModule_, lastEMModule_, firstHADModule_, lastHADModule_;
0066 
0067   bool isExcluded(const HcalCastorDetId& id) const;
0068 
0069   int firstEMModule() const { return firstEMModule_; }
0070   int firstHADModule() const { return firstHADModule_; }
0071   int lastEMModule() const { return lastEMModule_; }
0072   int lastHADModule() const { return lastHADModule_; }
0073 };
0074 
0075 #endif