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};
27 return map->getElectronicsId(
EEDetId(_id)).dccId();
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());
65 return map->getTriggerElectronicsId(
EEDetId(_id)).tccId();
68 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::tccId(" << uint32_t(_id) <<
")" << std::endl;
74 return map->getTriggerElectronicsId(_id).tccId();
88 return map->getElectronicsId(
EEDetId(_id)).towerId();
91 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::towerId(" << std::hex << uint32_t(_id) <<
")" 107 return map->getTriggerElectronicsId(_id).ttId();
109 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::ttId(" << std::hex << uint32_t(_id) <<
")" 116 return map->getTriggerElectronicsId(_id).ttId();
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;
142 res.first =
res.second = _dccId + 27;
153 std::pair<unsigned, unsigned>
outerTCCs(
unsigned _dccId) {
154 int iDCC(_dccId - 1);
155 std::pair<unsigned, unsigned>
res;
162 res.first =
res.second = _dccId + 27;
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) {
194 return (((
rawId >> 16) & 0x1) == 1 ? 1 : -1);
196 return (((
rawId >> 14) & 0x1) == 1 ? 1 : -1);
198 return (((
rawId >> 15) & 0x1) == 1 ? 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 iTT() const
sequential index within one DCC
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int iphi() const
get the crystal iphi
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool isForward(DetId const &)
std::pair< unsigned, unsigned > outerTCCs(unsigned)
bool ccuExists(unsigned, unsigned)
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
unsigned nSuperCrystals(unsigned)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
unsigned EEPnDCC(unsigned _dee, unsigned _ab)
bool isEndcapTTId(DetId const &)
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
int towerId() const
get the tower id
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
static const float crystalUnitToEta
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int zside() const
get the z-side of the crystal (1/-1)
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
bool isSingleChannelId(DetId const &)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
std::string smName(unsigned)
constexpr uint32_t rawId() const
get the raw id
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
bool isCrystalId(DetId const &)
unsigned rtHalf(DetId const &, EcalElectronicsMapping const *)
std::pair< unsigned, unsigned > innerTCCs(unsigned)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
double eta(EBDetId const &, CaloGeometry const *)
std::vector< DetId > scConstituents(EcalScDetId const &)
int iDCCId() const
get the DCCId
int iphi() const
get the tower iphi
double phi(EBDetId const &)