CMS 3D CMS Logo

EcalTrigTowerDetId.h
Go to the documentation of this file.
1 #ifndef ECALDETID_ECALTRIGTOWERDETID_H
2 #define ECALDETID_ECALTRIGTOWERDETID_H
3 
4 #include <iosfwd>
7 
14 class EcalTrigTowerDetId : public DetId {
15 public:
19  EcalTrigTowerDetId(uint32_t rawid);
22  EcalTrigTowerDetId(int zside, EcalSubdetector subdet, int i, int j, int mode = SUBDETIJMODE);
23 
25  EcalTrigTowerDetId(const DetId& id);
28 
30  int zside() const { return (id_ & 0x8000) ? (1) : (-1); }
31 
33  EcalSubdetector subDet() const { return (id_ & 0x4000) ? EcalBarrel : EcalEndcap; }
34 
36  int ietaAbs() const {
37  /* if ( subDet() == EcalBarrel) */
38  return (id_ >> 7) & 0x7f;
39  /* else */
40  /* throw(std::runtime_error("EcalTrigTowerDetId: ietaAbs not applicable for this subDetector.")); */
41  }
42 
44  int ieta() const {
45  /* if ( subDet() == EcalBarrel) */
46  return zside() * ietaAbs();
47  /* else */
48  /* throw(std::runtime_error("EcalTrigTowerDetId: ieta not applicable for this subDetector.")); */
49  }
50 
52  int iphi() const {
53  /* if ( subDet() == EcalBarrel) */
54  return id_ & 0x7F;
55  /* else */
56  /* throw(std::runtime_error("EcalTrigTowerDetId: iphi not applicable for this subDetector.")); */
57  }
58 
59  int iquadrant() const;
60 
62  int ix() const {
63  if (subDet() == EcalEndcap)
64  return (id_ >> 7) & 0x7f;
65  else
66  throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector."));
67  }
68 
70  int iy() const {
71  if (subDet() == EcalEndcap)
72  return id_ & 0x7F;
73  else
74  throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector."));
75  }
76 
78  int hashedIndex() const;
79 
80  uint32_t denseIndex() const { return hashedIndex(); }
81 
82  static bool validDenseIndex(uint32_t din) { return (din < kSizeForDenseIndexing); }
83 
84  static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di);
85 
87  static bool validDetId(int iz, EcalSubdetector sd, int i, int j);
88 
90  int iDCC() const;
91 
93  int iTT() const;
94 
95  static const int MIN_I = 1;
96  static const int MIN_J = 1;
97  static const int MAX_I = 127;
98  static const int MAX_J = 127;
99 
100  static const int kEBTowersInPhi = 4; // per SM (in the Barrel)
101  static const int kEBTowersPerSM = 68; // per SM (in the Barrel)
102  static const int kEBTowersInEta = 17; // per SM (in the Barrel)
103  // static const int kEETowersInEta = 11; // Endcap
104  static const int kEETowersInPhiPerQuadrant = 18; // per Quadrant (in the Endcap)
105 
106  // function modes for (int, int) constructor
107  static const int SUBDETIJMODE = 0;
108  static const int SUBDETDCCTTMODE = 1;
109 
110  enum {
115  kEBHalfTowers = kEBTowersPerSM * 18,
120  };
121 };
122 
123 std::ostream& operator<<(std::ostream&, const EcalTrigTowerDetId& id);
124 
125 #endif
int ix() const
get the tower ix (Endcap case) */
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static const int SUBDETIJMODE
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
static const int kEBTowersInPhi
static const int MIN_J
int iDCC() const
get the ECAL DCC id - in the barrrel ism == iDCC
static const int MAX_J
int ieta() const
get the tower ieta
int zside() const
get the z-side of the tower (1/-1)
static const int kEETowersInPhiPerQuadrant
static const int MIN_I
int ietaAbs() const
get the absolute value of the tower ieta
EcalTrigTowerDetId & operator=(const DetId &id)
static const int MAX_I
static const int kEBTowersInEta
Definition: DetId.h:17
int iphi() const
get the tower iphi
static const int SUBDETDCCTTMODE
double sd
uint32_t id_
Definition: DetId.h:69
static bool validDenseIndex(uint32_t din)
uint32_t denseIndex() const
std::ostream & operator<<(std::ostream &, const EcalTrigTowerDetId &id)
int iy() const
get the tower iy (Endcap case) */
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
int iTT() const
sequential index within one DCC
static const int kEBTowersPerSM
EcalSubdetector