Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 
0008 /** \class ZDCTopology
0009 
0010    $Revision: 1.0 $
0011    \author E. Garcia - UIC
0012 */
0013 
0014 class ZdcTopology : public CaloSubdetectorTopology {
0015 public:
0016   ZdcTopology();
0017   /** Exlucde a cell*/
0018   void exclude(const HcalZDCDetId& id);
0019   /** Exclude a side*/
0020   void exclude(int zside);
0021   /** Exclude a section, in either side (+1 positive, -1 negative)*/
0022   void exclude(int zside, HcalZDCDetId::Section section);
0023   /** Exclude a range of channels (deph) for a given subdetector*/
0024   int exclude(int zside, HcalZDCDetId::Section section, int ich1, int ich2);
0025 
0026   /** Is this a valid cell id? */
0027   using CaloSubdetectorTopology::valid;
0028   virtual bool valid(const HcalZDCDetId& id) const;
0029 
0030   /** Get the transverse (X) neighbors of the given cell*/
0031   virtual std::vector<DetId> transverse(const DetId& id) const;
0032 
0033   /** Get the longitudinal neighbors (Z) of the given cell*/
0034   virtual std::vector<DetId> longitudinal(const DetId& id) const;
0035 
0036   //** I have to put this here since they inherit from CaloSubdetectorTopology
0037   std::vector<DetId> east(const DetId& id) const override;
0038   std::vector<DetId> west(const DetId& id) const override;
0039   std::vector<DetId> north(const DetId& id) const override;
0040   std::vector<DetId> south(const DetId& id) const override;
0041   std::vector<DetId> up(const DetId& id) const override;
0042   std::vector<DetId> down(const DetId& id) const override;
0043 
0044   // how many channels (deph) for a given section
0045   using CaloSubdetectorTopology::ncells;
0046   int ncells(HcalZDCDetId::Section section) const;
0047 
0048   //return first and last cell of each section
0049   int firstCell(HcalZDCDetId::Section section) const;
0050   int lastCell(HcalZDCDetId::Section section) const;
0051 
0052 private:
0053   bool validRaw(const HcalZDCDetId& id) const;
0054 
0055   std::vector<HcalZDCDetId> exclusionList_;
0056 
0057   bool excludeEM_, excludeHAD_, excludeLUM_, excludeRPD_, excludeZP_, excludeZN_;
0058 
0059   int firstEMModule_, lastEMModule_, firstHADModule_, lastHADModule_, firstLUMModule_, lastLUMModule_, firstRPDModule_,
0060       lastRPDModule_;
0061 
0062   bool isExcluded(const HcalZDCDetId& id) const;
0063 
0064   int firstEMModule() const { return firstEMModule_; }
0065   int firstHADModule() const { return firstHADModule_; }
0066   int firstLUMModule() const { return firstLUMModule_; }
0067   int firstRPDModule() const { return firstRPDModule_; }
0068   int lastEMModule() const { return lastEMModule_; }
0069   int lastHADModule() const { return lastHADModule_; }
0070   int lastLUMModule() const { return lastLUMModule_; }
0071   int lastRPDModule() const { return lastRPDModule_; }
0072 };
0073 
0074 #endif