CastorTopology

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#ifndef GEOMETRY_CALOTOPOLOGY_CASTORTOPOLOGY_H
#define GEOMETRY_CALOTOPOLOGY_CASTORTOPOLOGY_H 1

#include <vector>
#include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"

/** \class CastorTopology

   \author P. Katsas - UoA
*/

class CastorTopology : public CaloSubdetectorTopology {
public:
  CastorTopology();
  /** Exlucde a cell*/
  void exclude(const HcalCastorDetId& id);
  /** Exclude a side*/
  void exclude(int zside);
  /** Exclude a section, in either side (+1 positive, -1 negative)*/
  void exclude(int zside, HcalCastorDetId::Section section);
  /** Exclude a range of channels (deph) for a given subdetector*/
  int exclude(int zside,
              HcalCastorDetId::Section section1,
              int isec1,
              int imod1,
              HcalCastorDetId::Section section2,
              int isec2,
              int imod2);

  /** Is this a valid cell id? */
  using CaloSubdetectorTopology::valid;
  virtual bool valid(const HcalCastorDetId& id) const;

  /** Is this a valid cell id? */
  virtual bool validRaw(const HcalCastorDetId& id) const;

  /** Get the neighbors of the given cell with higher #sector */
  virtual std::vector<DetId> incSector(const DetId& id) const;

  /** Get the neigbors of the given cell with higher #module*/
  virtual std::vector<DetId> incModule(const DetId& id) const;

  //** I have to put this here since they inherit from CaloSubdetectorTopology
  std::vector<DetId> east(const DetId& id) const override;
  std::vector<DetId> west(const DetId& id) const override;
  std::vector<DetId> north(const DetId& id) const override;
  std::vector<DetId> south(const DetId& id) const override;
  std::vector<DetId> up(const DetId& id) const override;
  std::vector<DetId> down(const DetId& id) const override;

  // how many channels (deph) for a given section
  using CaloSubdetectorTopology::ncells;
  int ncells(HcalCastorDetId::Section section) const;

  //return first and last cell of each section
  int firstCell(HcalCastorDetId::Section section) const;
  int lastCell(HcalCastorDetId::Section section) const;

private:
  std::vector<HcalCastorDetId> exclusionList_;

  bool excludeEM_, excludeHAD_, excludeZP_, excludeZN_;

  int firstEMModule_, lastEMModule_, firstHADModule_, lastHADModule_;

  bool isExcluded(const HcalCastorDetId& id) const;

  int firstEMModule() const { return firstEMModule_; }
  int firstHADModule() const { return firstHADModule_; }
  int lastEMModule() const { return lastEMModule_; }
  int lastHADModule() const { return lastHADModule_; }
};

#endif