14 crystal_ieta = index1;
15 crystal_iphi = index2;
25 crystal_ieta = -(
i + 1);
29 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Unknown mode for (int, int) constructor.";
34 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Indexes out of bounds \n" 35 <<
"eta = " << crystal_ieta <<
" phi = " << crystal_iphi;
37 id_ |= ((crystal_ieta > 0) ? (0x10000 | (crystal_ieta << 9)) : ((-crystal_ieta) << 9)) | (crystal_iphi & 0x1FF);
51 int newEta =
ieta() + nrStepsEta;
52 if (newEta *
ieta() <= 0) {
55 }
else if (
ieta() > 0) {
59 int newPhi =
iphi() + nrStepsPhi;
73 int newEta =
ieta() * -1;
101 int iphi_simple = ((
iphi() - 1) / 5) + 1;
103 return ((iphi_simple <= 0) ? (iphi_simple + 72) : (iphi_simple));
109 int ieta =
id.ietaSM();
114 int iphi =
id.iphiSM();
119 if (
a.ieta() *
b.ieta() > 0)
120 return abs(
a.ieta() -
b.ieta());
122 return abs(
a.ieta() -
b.ieta()) - 1;
147 return s <<
"(EB ieta " <<
id.ieta() <<
", iphi " <<
id.iphi() <<
" ; ism " <<
id.ism() <<
" , ic " <<
id.ic() <<
')';
static bool isNextToEtaBoundary(EBDetId id)
int ietaAbs() const
get the absolute value of the crystal ieta
int iphi() const
get the crystal iphi
static const int kCrystalsPerSM
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
constexpr Detector det() const
get the detector field from this detid
static bool validDetId(int i, int j)
check if a valid index combination
int ieta() const
get the crystal ieta
static const int kCrystalsInPhi
static int distanceEta(const EBDetId &a, const EBDetId &b)
std::ostream & operator<<(std::ostream &s, const EBDetId &id)
static bool isNextToBoundary(EBDetId id)
static int distancePhi(const EBDetId &a, const EBDetId &b)
int ic() const
get ECAL/crystal number inside SM
static bool isNextToPhiBoundary(EBDetId id)
int ism() const
get the ECAL/SM id
Abs< T >::type abs(const T &t)
static const int kModuleBoundaries[4]
static const float crystalUnitToEta
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int tower_iphi() const
get the HCAL/trigger iphi of this crystal
static const int ETAPHIMODE
EBDetId switchZSide() const
constexpr uint32_t rawId() const
get the raw id
EBDetId offsetBy(int nrStepsEta, int nrStepsPhi) const
static const int SMCRYSTALMODE
constexpr DetId()
Create an empty or null id (also for persistence)