Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-18 05:06:58

0001 #ifndef Geometry_ForwardGeometry_ZdcTopology_H
0002 #define Geometry_ForwardGeometry_ZdcTopology_H 1
0003 
0004 #include <vector>
0005 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0006 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0007 #include "Geometry/HcalCommonData/interface/HcalTopologyMode.h"
0008 #include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
0009 
0010 /** \class ZDCTopology
0011 
0012    $Revision: 1.0 $
0013    \author E. Garcia - UIC
0014 */
0015 
0016 class ZdcTopology : public CaloSubdetectorTopology {
0017 public:
0018   ZdcTopology(const HcalDDDRecConstants* hcons);
0019 
0020   HcalTopologyMode::Mode mode() const { return mode_; }
0021   /** Exlucde a cell*/
0022   void exclude(const HcalZDCDetId& id);
0023   /** Exclude a side*/
0024   void exclude(int zside);
0025   /** Exclude a section, in either side (+1 positive, -1 negative)*/
0026   void exclude(int zside, HcalZDCDetId::Section section);
0027   /** Exclude a range of channels (deph) for a given subdetector*/
0028   int exclude(int zside, HcalZDCDetId::Section section, int ich1, int ich2);
0029 
0030   /** Is this a valid cell id? */
0031   using CaloSubdetectorTopology::valid;
0032   virtual bool valid(const HcalZDCDetId& id) const;
0033 
0034   /** Get the transverse (X) neighbors of the given cell*/
0035   virtual std::vector<DetId> transverse(const DetId& id) const;
0036 
0037   /** Get the longitudinal neighbors (Z) of the given cell*/
0038   virtual std::vector<DetId> longitudinal(const DetId& id) const;
0039 
0040   //** I have to put this here since they inherit from CaloSubdetectorTopology
0041   std::vector<DetId> east(const DetId& id) const override;
0042   std::vector<DetId> west(const DetId& id) const override;
0043   std::vector<DetId> north(const DetId& id) const override;
0044   std::vector<DetId> south(const DetId& id) const override;
0045   std::vector<DetId> up(const DetId& id) const override;
0046   std::vector<DetId> down(const DetId& id) const override;
0047 
0048   // how many channels (deph) for a given section
0049   using CaloSubdetectorTopology::ncells;
0050   int ncells(HcalZDCDetId::Section section) const;
0051 
0052   //return first and last cell of each section
0053   int firstCell(HcalZDCDetId::Section section) const;
0054   int lastCell(HcalZDCDetId::Section section) const;
0055 
0056   uint32_t kSizeForDenseIndexing() const;
0057   bool validDenseIndex(uint32_t din) const { return (din < kSizeForDenseIndexing()); }
0058 
0059   DetId denseId2detId(uint32_t di) const override;
0060   uint32_t detId2DenseIndex(const DetId& id) const;
0061 
0062 private:
0063   bool validRaw(const HcalZDCDetId& id) const;
0064 
0065   bool isExcluded(const HcalZDCDetId& id) const;
0066 
0067   int firstEMModule() const { return firstEMModule_; }
0068   int firstHADModule() const { return firstHADModule_; }
0069   int firstLUMModule() const { return firstLUMModule_; }
0070   int firstRPDModule() const { return firstRPDModule_; }
0071   int lastEMModule() const { return lastEMModule_; }
0072   int lastHADModule() const { return lastHADModule_; }
0073   int lastLUMModule() const { return lastLUMModule_; }
0074   int lastRPDModule() const { return lastRPDModule_; }
0075 
0076   const HcalDDDRecConstants* hcons_;
0077   HcalTopologyMode::Mode mode_;
0078 
0079   std::vector<HcalZDCDetId> exclusionList_;
0080 
0081   bool excludeEM_, excludeHAD_, excludeLUM_, excludeRPD_, excludeZP_, excludeZN_;
0082 
0083   int firstEMModule_, lastEMModule_, firstHADModule_, lastHADModule_, firstLUMModule_, lastLUMModule_, firstRPDModule_,
0084       lastRPDModule_;
0085 };
0086 
0087 #endif