CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTrigTowerDetId.h
Go to the documentation of this file.
1 #ifndef ECALDETID_ECALTRIGTOWERDETID_H
2 #define ECALDETID_ECALTRIGTOWERDETID_H
3 
4 #include <ostream>
7 
8 
17 class EcalTrigTowerDetId : public DetId {
18  public:
22  EcalTrigTowerDetId(uint32_t rawid);
25  EcalTrigTowerDetId(int zside, EcalSubdetector subdet, int i, int j, int mode=SUBDETIJMODE);
26 
28  EcalTrigTowerDetId(const DetId& id);
31 
32 
34  int zside() const { return (id_&0x8000)?(1):(-1); }
35 
37  EcalSubdetector subDet() const { return (id_&0x4000) ? EcalBarrel:EcalEndcap; }
38 
40  int ietaAbs() const
41  {
42  /* if ( subDet() == EcalBarrel) */
43  return (id_>>7)&0x7f;
44  /* else */
45  /* throw(std::runtime_error("EcalTrigTowerDetId: ietaAbs not applicable for this subDetector.")); */
46  }
47 
49  int ieta() const
50  {
51  /* if ( subDet() == EcalBarrel) */
52  return zside()*ietaAbs();
53  /* else */
54  /* throw(std::runtime_error("EcalTrigTowerDetId: ieta not applicable for this subDetector.")); */
55  }
56 
58  int iphi() const
59  {
60  /* if ( subDet() == EcalBarrel) */
61  return id_&0x7F;
62  /* else */
63  /* throw(std::runtime_error("EcalTrigTowerDetId: iphi not applicable for this subDetector.")); */
64 
65  }
66 
67  int iquadrant() const ;
68 
69 
70 /* /// get the tower ix (Endcap case) */
71 /* int ix() const */
72 /* { */
73 /* if ( subDet() == EcalEndcap) */
74 /* return (id_>>7)&0x7f; */
75 /* else */
76 /* throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector.")); */
77 /* } */
78 
79 /* /// get the tower iy (Endcap case) */
80 /* int iy() const throw(std::runtime_error) */
81 /* { */
82 /* if ( subDet() == EcalEndcap) */
83 /* return id_&0x7F; */
84 /* else */
85 /* throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector.")); */
86 /* } */
87 
88 
90  int hashedIndex() const;
91 
92  uint32_t denseIndex() const { return hashedIndex() ; }
93 
94  static bool validDenseIndex( uint32_t din ) { return ( din < kSizeForDenseIndexing ) ; }
95 
96  static EcalTrigTowerDetId detIdFromDenseIndex( uint32_t di ) ;
97 
99  static bool validDetId( int iz,
101  int i, int j ) ;
102 
104  int iDCC() const ;
105 
107  int iTT() const ;
108 
109 
110 
111  static const int MIN_I = 1;
112  static const int MIN_J = 1;
113  static const int MAX_I = 127;
114  static const int MAX_J = 127;
115 
116  static const int kEBTowersInPhi = 4; // per SM (in the Barrel)
117  static const int kEBTowersPerSM = 68; // per SM (in the Barrel)
118  static const int kEBTowersInEta = 17; // per SM (in the Barrel)
119 // static const int kEETowersInEta = 11; // Endcap
120  static const int kEETowersInPhiPerQuadrant = 18; // per Quadrant (in the Endcap)
121 
122  // function modes for (int, int) constructor
123  static const int SUBDETIJMODE = 0;
124  static const int SUBDETDCCTTMODE = 1;
125 
127  kEEOuterEta = 18 ,
128  kEEInnerEta = 28 ,
135 };
136 
137 std::ostream& operator<<(std::ostream&,const EcalTrigTowerDetId& id);
138 
139 #endif
int i
Definition: DBlmapReader.cc:9
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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
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
int j
Definition: DBlmapReader.cc:9
Definition: DetId.h:20
int iphi() const
get the tower iphi
static const int SUBDETDCCTTMODE
double sd
uint32_t id_
Definition: DetId.h:57
static bool validDenseIndex(uint32_t din)
uint32_t denseIndex() const
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