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 
8 
16 class EcalTrigTowerDetId : public DetId {
17  public:
21  EcalTrigTowerDetId(uint32_t rawid);
24  EcalTrigTowerDetId(int zside, EcalSubdetector subdet, int i, int j, int mode=SUBDETIJMODE);
25 
27  EcalTrigTowerDetId(const DetId& id);
30 
31 
33  int zside() const { return (id_&0x8000)?(1):(-1); }
34 
36  EcalSubdetector subDet() const { return (id_&0x4000) ? EcalBarrel:EcalEndcap; }
37 
39  int ietaAbs() const
40  {
41  /* if ( subDet() == EcalBarrel) */
42  return (id_>>7)&0x7f;
43  /* else */
44  /* throw(std::runtime_error("EcalTrigTowerDetId: ietaAbs not applicable for this subDetector.")); */
45  }
46 
48  int ieta() const
49  {
50  /* if ( subDet() == EcalBarrel) */
51  return zside()*ietaAbs();
52  /* else */
53  /* throw(std::runtime_error("EcalTrigTowerDetId: ieta not applicable for this subDetector.")); */
54  }
55 
57  int iphi() const
58  {
59  /* if ( subDet() == EcalBarrel) */
60  return id_&0x7F;
61  /* else */
62  /* throw(std::runtime_error("EcalTrigTowerDetId: iphi not applicable for this subDetector.")); */
63 
64  }
65 
66  int iquadrant() const ;
67 
68 
69 /* /// get the tower ix (Endcap case) */
70 /* int ix() const */
71 /* { */
72 /* if ( subDet() == EcalEndcap) */
73 /* return (id_>>7)&0x7f; */
74 /* else */
75 /* throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector.")); */
76 /* } */
77 
78 /* /// get the tower iy (Endcap case) */
79 /* int iy() const throw(std::runtime_error) */
80 /* { */
81 /* if ( subDet() == EcalEndcap) */
82 /* return id_&0x7F; */
83 /* else */
84 /* throw(std::runtime_error("EcalTrigTowerDetId: ix not applicable for this subDetector.")); */
85 /* } */
86 
87 
89  int hashedIndex() const;
90 
91  uint32_t denseIndex() const { return hashedIndex() ; }
92 
93  static bool validDenseIndex( uint32_t din ) { return ( din < kSizeForDenseIndexing ) ; }
94 
95  static EcalTrigTowerDetId detIdFromDenseIndex( uint32_t di ) ;
96 
98  static bool validDetId( int iz,
100  int i, int j ) ;
101 
103  int iDCC() const ;
104 
106  int iTT() const ;
107 
108 
109 
110  static const int MIN_I = 1;
111  static const int MIN_J = 1;
112  static const int MAX_I = 127;
113  static const int MAX_J = 127;
114 
115  static const int kEBTowersInPhi = 4; // per SM (in the Barrel)
116  static const int kEBTowersPerSM = 68; // per SM (in the Barrel)
117  static const int kEBTowersInEta = 17; // per SM (in the Barrel)
118 // static const int kEETowersInEta = 11; // Endcap
119  static const int kEETowersInPhiPerQuadrant = 18; // per Quadrant (in the Endcap)
120 
121  // function modes for (int, int) constructor
122  static const int SUBDETIJMODE = 0;
123  static const int SUBDETDCCTTMODE = 1;
124 
126  kEEOuterEta = 18 ,
127  kEEInnerEta = 28 ,
129  kEBHalfTowers = kEBTowersPerSM*18 ,
134 };
135 
136 std::ostream& operator<<(std::ostream&,const EcalTrigTowerDetId& id);
137 
138 #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
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:18
int iphi() const
get the tower iphi
static const int SUBDETDCCTTMODE
double sd
uint32_t id_
Definition: DetId.h:55
static bool validDenseIndex(uint32_t din)
uint32_t denseIndex() const
std::ostream & operator<<(std::ostream &, const EcalTrigTowerDetId &id)
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