15 id_ |= ((depth&0x1F)<<14) |
16 ((tower_ieta>0)?(0x2000|(tower_ieta<<7)):((-tower_ieta)<<7)) |
27 throw cms::Exception(
"Invalid DetId") <<
"Cannot initialize HcalDetId from " << std::hex << gen.
rawId() << std::dec;
40 throw cms::Exception(
"Invalid DetId") <<
"Cannot assign HcalDetId from " << std::hex << gen.
rawId() << std::dec;
48 int simple_iphi=((
iphi()-1)*5)+1;
50 return ((simple_iphi>360)?(simple_iphi-360):(simple_iphi));
54 int simple_iphi=((
iphi()-1)*5)+5;
56 return ((simple_iphi>360)?(simple_iphi-360):(simple_iphi));
60 switch (
id.subdet()) {
61 case(
HcalBarrel) :
return s <<
"(HB " <<
id.ieta() <<
',' <<
id.iphi() <<
',' <<
id.depth() <<
')';
62 case(
HcalEndcap) :
return s <<
"(HE " <<
id.ieta() <<
',' <<
id.iphi() <<
',' <<
id.depth() <<
')';
63 case(
HcalForward) :
return s <<
"(HF " <<
id.ieta() <<
',' <<
id.iphi() <<
',' <<
id.depth() <<
')';
64 case(
HcalOuter) :
return s <<
"(HO " <<
id.ieta() <<
',' <<
id.iphi() <<
')';
65 default :
return s <<
id.rawId();
75 const int ie (
abs( ies ) ) ;
77 return ( ( ip >= 1 ) &&
84 ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
104 ( ip%2 == 1 ) ) ) ) ||
115 ( ip%4 == 3 ) ) ) ) ) ) ;
122 const int ip (
iphi() ) ;
124 const int dp (
depth() ) ;
125 const int zn (
zside() < 0 ? 1 : 0 ) ;
138 ( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*
kHBhalf :
140 2*
kHBhalf + ( ip - 1 )*8 + ( ip/2 )*20 +
141 ( ( ie==16 || ie==17 ) ? ie - 16 :
142 ( ( ie>=18 && ie<=20 ) ? 2 + 2*( ie - 18 ) + dp - 1 :
143 ( ( ie>=21 && ie<=26 ) ? 8 + 2*( ie - 21 ) + dp - 1 :
144 ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 :
145 26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*
kHEhalf :
150 ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
151 2*( ie - 29 ) + ( dp - 1 ) + zn*
kHFhalf : -1 ) ) ) ) ;
173 ip += 1 + ( in>21 ? 2 : 0 ) ;
174 if( 3 == ip%4 ) in -= 22 ;
188 ie = 1 + ( in - 15*( ip - 1 ) ) ;
201 if( 0 == ip%2 ) in %= 28 ;
202 ie = 15 + ( in<2 ? 1 + in : 2 +
203 ( in<20 ? 1 + ( in - 2 )/2 : 9 +
204 ( in<26 ? 1 + ( in - 20 )/3 : 3 ) ) ) ;
207 ( in<20 ? 1 + ( in - 2 )%2 :
208 ( in<26 ? 1 + ( in - 20 )%3 :
209 ( 1 + ( in - 26 )%2 ) ) ) ) ) ;
231 return HcalDetId( sd, iz*
int(ie), ip, dp ) ;
static const HcalDetId Undefined
HcalDetId & operator=(const DetId &id)
HcalSubdetector subdet() const
get the subdetector
int zside() const
get the z-side of the cell (1/-1)
int crystal_iphi_low() const
get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static bool validDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
uint32_t rawId() const
get the raw id
int depth() const
get the tower depth
static HcalDetId detIdFromDenseIndex(uint32_t di)
static bool validDenseIndex(uint32_t din)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int ietaAbs() const
get the absolute value of the cell ieta
int iphi() const
get the cell iphi
bool null() const
is this a null id ?
int crystal_iphi_high() const
get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
Detector det() const
get the detector field from this detid