17 crystal_ieta = index1;
18 crystal_iphi = index2;
28 crystal_ieta = -(i+1);
32 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Unknown mode for (int, int) constructor.";
35 if ( !
validDetId(crystal_ieta, crystal_iphi) ) {
37 throw cms::Exception(
"InvalidDetId") <<
"EBDetId: Cannot create object. Indexes out of bounds \n"
38 <<
"eta = " << crystal_ieta <<
" phi = " << crystal_iphi;
40 id_|=((crystal_ieta>0)?(0x10000|(crystal_ieta<<9)):((-crystal_ieta)<<9))|(crystal_iphi&0x1FF);
50 ( kCrystalsInPhi - ( (
iphi() -1 ) % kCrystalsInPhi ) )
51 : ( (
iphi() -1 ) % kCrystalsInPhi + 1)
63 int newEta =
ieta()+nrStepsEta;
64 if( newEta*
ieta() <= 0 ) {
67 }
else if (
ieta() > 0 ) {
71 int newPhi =
iphi() + nrStepsPhi;
72 while ( newPhi>360 ) newPhi -= 360;
73 while ( newPhi<=0 ) newPhi += 360;
76 return EBDetId( newEta, newPhi);
84 int newEta =
ieta()*-1;
115 int iphi_simple=((
iphi()-1)/5)+1;
117 return ((iphi_simple<=0)?(iphi_simple+72):(iphi_simple));
126 int ieta =
id.ietaSM();
131 int iphi =
id.iphiSM();
132 return iphi == 1 || iphi == 20;
147 while (result > PI) result -= 2*
PI;
148 while (result <= -PI) result += 2*
PI;
165 return s <<
"(EB ieta " <<
id.ieta() <<
", iphi " <<
id.iphi()
166 <<
" ; ism " <<
id.ism() <<
" , ic " <<
id.ic() <<
')';
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)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int ism() const
get the ECAL/SM id
static bool validDetId(int i, int j)
check if a valid index combination
int iphi() const
get the crystal iphi
uint32_t rawId() const
get the raw id
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
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 SMCRYSTALMODE
Detector det() const
get the detector field from this detid
int ietaAbs() const
get the absolute value of the crystal ieta