26 crystal_ieta = index1;
27 crystal_iphi = index2;
37 crystal_ieta = -(i+1);
41 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Unknown mode for (int, int) constructor.";
44 if ( !
validDetId(crystal_ieta, crystal_iphi) ) {
46 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Indexes out of bounds \n"
47 <<
"eta = " << crystal_ieta <<
" phi = " << crystal_iphi;
49 id_|=((crystal_ieta>0)?(0x10000|(crystal_ieta<<9)):((-crystal_ieta)<<9))|(crystal_iphi&0x1FF);
62 if (i < -MAX_IETA || i == 0 || i >
MAX_IETA ||
81 if (
zside() < 0 )
id += 18;
86 for (
int i=0;
i < 4 ;
i++)
113 int newEta =
ieta()+nrStepsEta;
114 if( newEta*
ieta() <= 0 ) {
117 }
else if (
ieta() > 0 ) {
121 int newPhi =
iphi() + nrStepsPhi;
122 while ( newPhi>360 ) newPhi -= 360;
123 while ( newPhi<=0 ) newPhi += 360;
126 return EBDetId( newEta, newPhi);
134 int newEta =
ieta()*-1;
165 int iphi_simple=((
iphi()-1)/5)+1;
167 return ((iphi_simple<=0)?(iphi_simple+72):(iphi_simple));
176 int ieta =
id.ietaSM();
181 int iphi =
id.iphiSM();
182 return iphi == 1 || iphi == 20;
211 return s <<
"(EB ieta " <<
id.ieta() <<
", iphi" <<
id.iphi()
212 <<
" ; ism " <<
id.ism() <<
" , ic " <<
id.ic() <<
')';
static bool validDetId(int i, int j)
check if a valid index combination
static bool isNextToEtaBoundary(EBDetId id)
int tower_iphi() const
get the HCAL/trigger iphi of this crystal
EBDetId switchZSide() const
static const int kCrystalsPerSM
DetId()
Create an empty or null id (also for persistence)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
int ism() const
get the ECAL/SM id
int iphi() const
get the crystal iphi
uint32_t rawId() const
get the raw id
int im() const
get the number of module inside the SM (1-4)
static const int kCrystalsInPhi
static int distanceEta(const EBDetId &a, const EBDetId &b)
static bool isNextToBoundary(EBDetId id)
static int distancePhi(const EBDetId &a, const EBDetId &b)
static bool isNextToPhiBoundary(EBDetId id)
static const int kModuleBoundaries[4]
static const float crystalUnitToEta
EBDetId offsetBy(int nrStepsEta, int nrStepsPhi) const
int ieta() const
get the crystal ieta
EBDetId & operator=(const DetId &id)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const int ETAPHIMODE
int ic() const
get ECAL/crystal number inside SM
static const int MAX_IPHI
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
bool null() const
is this a null id ?
static const int MAX_IETA
static bool validHashIndex(int i)
static const int SMCRYSTALMODE
Detector det() const
get the detector field from this detid
int ietaAbs() const
get the absolute value of the crystal ieta
int zside() const
get the z-side of the crystal (1/-1)