8 unsigned memarr[] = {
kEEm07,
kEEm08,
kEEm02,
kEEm03,
kEBm01,
kEBm02,
kEBm03,
kEBm04,
kEBm05,
kEBm06,
kEBm07,
9 kEBm08,
kEBm09,
kEBm10,
kEBm11,
kEBm12,
kEBm13,
kEBm14,
kEBm15,
kEBm16,
kEBm17,
kEBm18,
10 kEBp01,
kEBp02,
kEBp03,
kEBp04,
kEBp05,
kEBp06,
kEBp07,
kEBp08,
kEBp09,
kEBp10,
kEBp11,
11 kEBp12,
kEBp13,
kEBp14,
kEBp15,
kEBp16,
kEBp17,
kEBp18,
kEEp07,
kEEp08,
kEEp02,
kEEp03};
31 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::dccId(" << _id.
rawId() <<
")" << std::endl;
41 if (_index >=
memDCC.size())
43 return memDCC.at(_index) + 1;
51 return (itr -
memDCC.begin());
68 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::tccId(" << uint32_t(_id) <<
")" << std::endl;
91 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::towerId(" << std::hex << uint32_t(_id) <<
")"
109 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::ttId(" << std::hex << uint32_t(_id) <<
")"
122 if ((ic - 1) / 20 > 4 && (ic - 1) % 20 < 10)
125 unsigned iDCC(
dccId(_id, electronicsMap) - 1);
133 std::pair<unsigned, unsigned>
innerTCCs(
unsigned _dccId) {
134 int iDCC(_dccId - 1);
135 std::pair<unsigned, unsigned> res;
137 res.first = (iDCC -
kEEmLow) * 2;
140 res.second = (iDCC -
kEEmLow) * 2 + 1;
142 res.first = res.second = _dccId + 27;
144 res.first = (iDCC -
kEEpLow) * 2 + 90;
147 res.second = (iDCC -
kEEpLow) * 2 + 91;
153 std::pair<unsigned, unsigned>
outerTCCs(
unsigned _dccId) {
154 int iDCC(_dccId - 1);
155 std::pair<unsigned, unsigned> res;
157 res.first = (iDCC -
kEEmLow) * 2 + 18;
160 res.second = (iDCC -
kEEmLow) * 2 + 19;
162 res.first = res.second = _dccId + 27;
164 res.first = (iDCC -
kEEpLow) * 2 + 72;
167 res.second = (iDCC -
kEEpLow) * 2 + 73;
174 std::vector<DetId> res;
176 int ixbase((_scid.
ix() - 1) * 5);
177 int iybase((_scid.
iy() - 1) * 5);
179 for (
int ix(1); ix <= 5; ++ix) {
180 for (
int iy(1); iy <= 5; ++iy) {
182 res.push_back(
EEDetId(ixbase + ix, iybase + iy, _scid.
zside()));
194 return (((rawId >> 16) & 0x1) == 1 ? 1 : -1);
196 return (((rawId >> 14) & 0x1) == 1 ? 1 : -1);
198 return (((rawId >> 15) & 0x1) == 1 ? 1 : -1);
200 return (((rawId >> 4) & 0x7f) >
kEBpLow ? 1 : -1);
203 <<
"EcalDQMCommonUtils::zside(" << std::hex << uint32_t(_id) <<
")" << std::endl;
216 const double degToRad(0.0174533);
217 return (_ebid.
iphi() - 10.5) * degToRad;
221 const double degToRad(0.0174533);
222 double p(std::atan2(_eeid.
ix() - 50.5, _eeid.
iy() - 50.5));
223 if (
p < -10. * degToRad)
224 p += 360. * degToRad;
229 const double degToRad(0.0174533);
230 double p((_ttid.
iphi() - 0.5) * 5. * degToRad);
231 if (
p > 350. * degToRad)
232 p -= 360. * degToRad;
237 const double degToRad(0.0174533);
238 if (_phi < -10. * degToRad)
239 _phi += 360. * degToRad;
250 return (scid.
ix() - 10) * (scid.
ix() - 10) + (scid.
iy() - 10) * (scid.
iy() - 10) < 25.;
253 return (eeid.
ix() - 50) * (eeid.
ix() - 50) + (eeid.
iy() - 50) * (eeid.
iy() - 50) < 625.;
275 unsigned smNumber(std::atoi(_smName.substr(3).c_str()));
277 if (_smName.find(
"EE-") == 0)
278 return kEEmLow + 1 + ((smNumber + 2) % 9);
279 else if (_smName.find(
"EB-") == 0)
281 else if (_smName.find(
"EB+") == 0)
283 else if (_smName.find(
"EE+") == 0)
284 return kEEpLow + 1 + ((smNumber + 2) % 9);
290 std::stringstream
ss;
292 unsigned iSM(_dccId - 1);
295 ss <<
"EE-" << std::setw(2) << std::setfill(
'0') << (((iSM -
kEEmLow + 6) % 9) + 1);
297 ss <<
"EB-" << std::setw(2) << std::setfill(
'0') << (iSM -
kEBmLow + 1);
299 ss <<
"EB+" << std::setw(2) << std::setfill(
'0') << (iSM -
kEBpLow + 1);
301 ss <<
"EE+" << std::setw(2) << std::setfill(
'0') << (((iSM -
kEEpLow + 6) % 9) + 1);
307 unsigned EEPnDCC(
unsigned _dee,
unsigned _ab) {
335 unsigned iSM(_dccId - 1);
370 unsigned iSM(_dccId - 1);
404 if (_towerId == 69 || _towerId == 70)
406 else if ((_dccId == 8 || _dccId == 53) && _towerId >= 18 && _towerId <= 24)
408 else if (_dccId <= kEEmHigh + 1 || _dccId >=
kEEpLow + 1)
411 return _towerId <= 68;
std::vector< unsigned > const memDCC
unsigned memDCCIndex(unsigned)
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
constexpr uint32_t rawId() const
get the raw id
bool isForward(DetId const &)
std::pair< unsigned, unsigned > outerTCCs(unsigned)
int towerId() const
get the tower id
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
bool ccuExists(unsigned, unsigned)
std::pair< int, int > getDCCandSC(EcalScDetId id) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned nSuperCrystals(unsigned)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
int iphi() const
get the crystal iphi
unsigned EEPnDCC(unsigned _dee, unsigned _ab)
bool isEndcapTTId(DetId const &)
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
int ttId() const
get the tower id
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
static const float crystalUnitToEta
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
int iDCCId() const
get the DCCId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
bool isSingleChannelId(DetId const &)
int iphi() const
get the tower iphi
std::string smName(unsigned)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
bool isCrystalId(DetId const &)
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
std::pair< unsigned, unsigned > innerTCCs(unsigned)
double eta(EBDetId const &, CaloGeometry const *)
std::vector< DetId > scConstituents(EcalScDetId const &)
int iTT() const
sequential index within one DCC
double phi(EBDetId const &)
int zside() const
get the z-side of the crystal (1/-1)
constexpr Detector det() const
get the detector field from this detid