15 using boost::multi_index_container;
42 for (
int dcc = MIN_DCCID_EBM;
dcc <= MAX_DCCID_EBM;
dcc++) {
43 LaserMonitoringMap_EB[
dcc] = ilm;
47 for (
int dcc = MIN_DCCID_EBP;
dcc <= MAX_DCCID_EBP;
dcc++) {
48 LaserMonitoringMap_EB[
dcc] = ilm;
56 for (
int dcc = MIN_DCCID_EEM;
dcc <= MAX_DCCID_EEM;
dcc++) {
57 LaserMonitoringMap_EE[
dcc] = ilm;
63 for (
int dcc = MIN_DCCID_EEP;
dcc <= MAX_DCCID_EEP;
dcc++) {
64 LaserMonitoringMap_EE[
dcc] = ilm;
80 dcc += DCCID_PHI0_EBM - 19;
82 dcc += DCCID_PHI0_EBP - 1;
96 tcc += TCCID_PHI0_EBM - 19;
98 tcc += TCCID_PHI0_EBP - 1;
111 int ie =
id.ietaAbs() - 1;
117 if (
id.
zside() < 0) {
118 ip = ((phi - 1) % kEBTowersInPhi) + 1;
120 ip = kEBTowersInPhi - ((phi - 1) % kEBTowersInPhi);
123 return (ie * kEBTowersInPhi) + ip;
125 int ie =
id.ietaAbs();
126 bool inner = (ie >= iEEEtaMinInner);
128 ie = ie - iEEEtaMinInner;
129 ie = ie % kEETowersInEtaPerInnerTCC;
131 ie = ie - iEEEtaMinOuter;
132 ie = ie % kEETowersInEtaPerOuterTCC;
136 ip = (ip + 1) % (kEETowersInPhiPerQuadrant * 4);
139 ip = ip % kEETowersInPhiPerTCC;
140 int itt = kEETowersInPhiPerTCC * ie + ip + 1;
143 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::iTT. ";
150 int phi =
id.iphi() + 2;
153 int tcc = (phi - 1) / kEBTowersInPhi + 1;
156 if (
id.
zside() < 0) {
157 tcc += TCCID_PHI0_EBM - 19;
159 tcc += TCCID_PHI0_EBP - 1;
165 int ie =
id.ietaAbs();
166 bool inner = (ie >= iEEEtaMinInner);
168 ip = (ip + 1) % (kEETowersInPhiPerQuadrant * 4);
171 int Phiindex = ip / 4;
174 Phiindex += TCCID_PHI0_EEP_IN;
176 Phiindex += TCCID_PHI0_EEM_IN;
179 Phiindex += TCCID_PHI0_EEP_OUT;
181 Phiindex += TCCID_PHI0_EEM_OUT;
185 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::TCCid.";
195 int phi =
id.iphi() + 2;
198 int dcc = (phi - 1) / kEBTowersInPhi + 1;
201 if (
id.
zside() < 0) {
202 dcc += DCCID_PHI0_EBM - 19;
204 dcc += DCCID_PHI0_EBP - 1;
208 int tccid = TCCid(
id);
215 if (tccid == 24 || tccid == 25 || tccid == 6 || tccid == 7)
217 if (tccid == 26 || tccid == 27 || tccid == 8 || tccid == 9)
219 if (tccid == 28 || tccid == 29 || tccid == 10 || tccid == 11)
221 if (tccid == 30 || tccid == 31 || tccid == 12 || tccid == 13)
223 if (tccid == 32 || tccid == 33 || tccid == 14 || tccid == 15)
225 if (tccid == 34 || tccid == 35 || tccid == 16 || tccid == 17)
227 if (tccid == 36 || tccid == 19 || tccid == 18 || tccid == 1)
229 if (tccid == 20 || tccid == 21 || tccid == 2 || tccid == 3)
231 if (tccid == 22 || tccid == 23 || tccid == 4 || tccid == 5)
236 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::DCCid.";
245 int zIndex =
zside(TCCid, TCCMODE);
249 int jtower = iTT - 1;
251 DCCid = TCCid - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
253 DCCid = TCCid - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
254 int SMid = (zIndex > 0) ? DCCid - 27 : DCCid + 9;
256 int etaTT = jtower / kTowersInPhi + 1;
260 phiTT = (SMid - 1) * kTowersInPhi + (kTowersInPhi - (jtower % kTowersInPhi)) - 1;
262 phiTT = (SMid - 19) * kTowersInPhi + jtower % kTowersInPhi;
272 bool EEminus = (zIndex < 0);
273 bool EEplus = (zIndex > 0);
274 if ((!EEminus) && (!EEplus))
275 throw cms::Exception(
"InvalidDetId") <<
"EcalElectronicsMapping: Cannot create EcalTrigTowerDetId object. ";
278 if (tcc < TCCID_PHI0_EEM_OUT + kTCCinPhi)
280 else if (tcc >= TCCID_PHI0_EEP_OUT)
284 if (iz < 0 && tcc >= TCCID_PHI0_EEM_IN && tcc < TCCID_PHI0_EEM_IN + kTCCinPhi)
286 if (iz > 0 && tcc >= TCCID_PHI0_EEP_IN && tcc < TCCID_PHI0_EEP_IN + kTCCinPhi)
290 int ieta = (iTT - 1) / kEETowersInPhiPerTCC;
291 int iphi = (iTT - 1) % kEETowersInPhiPerTCC;
293 ieta += iEEEtaMinInner;
295 ieta += iEEEtaMinOuter;
301 TCC_origin = TCCID_PHI0_EEM_IN;
303 TCC_origin = TCCID_PHI0_EEM_OUT;
305 TCC_origin = TCCID_PHI0_EEP_IN;
307 TCC_origin = TCCID_PHI0_EEP_OUT;
308 tcc = tcc - TCC_origin;
310 iphi += kEETowersInPhiPerTCC * tcc;
311 iphi = (
iphi - 2 + 4 * kEETowersInPhiPerQuadrant) % (4 * kEETowersInPhiPerQuadrant) + 1;
320 throw cms::Exception(
"InvalidDetId") <<
" Wrong indices in EcalElectronicsMapping::getTrigTowerDetId. TCCid = " 321 << TCCid <<
" iTT = " << iTT <<
".";
330 int dcc = DCCid(ebdetid);
331 bool EBPlus = (
zside(
dcc, DCCMODE) > 0);
332 bool EBMinus = !EBPlus;
336 int tower = iTT(trigtower);
342 bool RightTower = rightTower(
tower);
345 if (
strip % 2 == 0) {
347 channel = (
iphi - 1) % 5;
349 channel = 4 - ((
iphi - 1) % 5);
352 channel = 4 - ((
iphi - 1) % 5);
354 channel = (
iphi - 1) % 5;
358 if (
strip % 2 == 0) {
360 channel = 4 - ((
iphi - 1) % 5);
362 channel = (
iphi - 1) % 5;
365 channel = (
iphi - 1) % 5;
367 channel = 4 - ((
iphi - 1) % 5);
377 EcalElectronicsMap_by_DetId::const_iterator
it = get<0>(m_items).
find(
id);
378 if (
it == get<0>(m_items).end()) {
380 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
386 throw cms::Exception(
"InvalidDetId") <<
" Wrong DetId in EcalElectronicsMapping::getElectronicsId.";
398 EcalElectronicsMap_by_DetId::const_iterator
it = get<0>(m_items).
find(
id);
399 if (
it == get<0>(m_items).end()) {
401 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid trig id";
407 throw cms::Exception(
"InvalidDetId") <<
" Wrong DetId in EcalElectronicsMapping::getTriggerElectronicsId.";
415 int dcc =
id.dccId();
416 int tower =
id.towerId();
417 int strip =
id.stripId();
418 int channel =
id.xtalId();
422 bool EBPlus = (
id.zside() > 0);
423 bool EBMinus = !EBPlus;
425 if (
id.
zside() < 0) {
426 smid =
dcc + 19 - DCCID_PHI0_EBM;
427 iphi = (smid - 19) * kCrystalsInPhi;
428 iphi += 5 * ((
tower - 1) % kTowersInPhi);
430 smid =
dcc + 1 - DCCID_PHI0_EBP;
431 iphi = (smid - 1) * kCrystalsInPhi;
432 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
434 bool RightTower = rightTower(
tower);
435 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
438 if (
strip % 2 == 1) {
440 iphi += (channel - 1) + 1;
442 iphi += (4 - (channel - 1)) + 1;
445 iphi += (4 - (channel - 1)) + 1;
447 iphi += (channel - 1) + 1;
451 if (
strip % 2 == 1) {
453 iphi += (4 - (channel - 1)) + 1;
455 iphi += (channel - 1) + 1;
458 iphi += (channel - 1) + 1;
460 iphi += (4 - (channel - 1)) + 1;
471 EcalElectronicsMap_by_ElectronicsId::const_iterator
it = get<1>(m_items).
find(
id);
472 if (
it == (get<1>(m_items).end())) {
474 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non DetId";
480 throw cms::Exception(
"InvalidDetId") <<
"Wrong EcalElectronicsId in EcalElectronicsMapping::getDetId.";
487 int strip =
id.stripId();
488 int xtal =
id.xtalId();
489 int tower =
id.towerId();
490 int tcc =
id.dccId();
491 if (
id.
zside() < 0) {
492 tcc += TCCID_PHI0_EBM - DCCID_PHI0_EBM;
494 tcc += TCCID_PHI0_EBP - DCCID_PHI0_EBP;
500 EcalElectronicsMap_by_ElectronicsId::const_iterator
it = get<1>(m_items).
find(
id);
501 if (
it == get<1>(m_items).end()) {
503 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
510 <<
"Wrong EcalElectronicsId in EcalElectronicsMapping::getTriggerElectronicsId.";
518 DetId cell = getDetId(elid);
521 EcalElectronicsMap_by_TriggerElectronicsId::const_iterator
it = get<2>(m_items).
find(
id);
522 if (
it == get<2>(m_items).end()) {
524 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid DetId";
530 throw cms::Exception(
"InvalidDetId") <<
"Wrong EcalTriggerElectronicsId in EcalElectronicsMapping::getDetId.";
537 int strip =
id.pseudoStripId();
538 int xtal =
id.channelId();
539 int tower =
id.ttId();
540 int dcc =
id.tccId();
541 if (
id.
zside() < 0) {
542 dcc -= TCCID_PHI0_EBM - DCCID_PHI0_EBM;
544 dcc -= TCCID_PHI0_EBP - DCCID_PHI0_EBP;
549 EcalElectronicsMap_by_TriggerElectronicsId::const_iterator
it = get<2>(m_items).
find(
id);
550 if (
it == get<2>(m_items).end()) {
552 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
559 <<
"Wrong EcalTriggerElectronicsId in EcalElectronicsMapping::getElectronicsId.";
564 std::vector<DetId>
items;
568 std::vector<DetId> xtals = dccTowerConstituents(
dccId,
tower);
569 int size = xtals.size();
570 for (
int i = 0;
i < size;
i++) {
577 EcalElectronicsMap_by_DccId::const_iterator lb, ub;
578 boost::tuples::tie(lb, ub) = get<3>(m_items).equal_range(
dccId);
580 DetId cell = lb->cell;
581 items.emplace_back(cell);
587 <<
" in EcalElectronicsMapping::dccConstituents. ";
592 std::vector<DetId>
items;
599 smid =
dccId + 19 - DCCID_PHI0_EBM;
600 iphi = (smid - 19) * kCrystalsInPhi;
601 iphi += 5 * ((
tower - 1) % kTowersInPhi);
603 smid =
dccId + 1 - DCCID_PHI0_EBP;
604 iphi = (smid - 1) * kCrystalsInPhi;
605 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
607 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
608 for (
int ip = 1; ip <= 5; ip++) {
609 for (
int ie = 0; ie <= 4; ie++) {
610 int ieta_xtal =
ieta + ie;
611 int iphi_xtal =
iphi + ip;
613 ieta_xtal = -ieta_xtal;
615 items.emplace_back(ebdetid);
622 EcalElectronicsMap_by_DccId_and_TowerId::const_iterator lb, ub;
623 boost::tuples::tie(lb, ub) = get<4>(m_items).equal_range(boost::make_tuple(
int(
dccId),
int(
tower)));
625 DetId cell = lb->cell;
626 items.emplace_back(cell);
632 <<
" in EcalElectronicsMapping::dccTowerConstituents.";
637 std::vector<DetId>
items;
641 bool RightTower = rightTower(
tower);
645 smid =
dccId + 19 - DCCID_PHI0_EBM;
646 iphi = (smid - 19) * kCrystalsInPhi;
647 iphi += 5 * ((
tower - 1) % kTowersInPhi);
649 smid =
dccId + 1 - DCCID_PHI0_EBP;
650 iphi = (smid - 1) * kCrystalsInPhi;
651 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
653 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
659 for (
int ip = 1; ip <= 5; ip++) {
660 int ieta_xtal =
ieta;
661 int iphi_xtal =
iphi + ip;
663 ieta_xtal = -ieta_xtal;
665 items.emplace_back(ebdetid);
670 EcalElectronicsMap_by_DccId_TowerId_and_StripId::const_iterator lb, ub;
671 boost::tuples::tie(lb, ub) = get<5>(m_items).equal_range(boost::make_tuple(
int(
dccId),
int(
tower),
int(
strip)));
673 DetId cell = lb->cell;
674 items.emplace_back(cell);
683 std::vector<DetId>
items;
689 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
691 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
695 EcalElectronicsMap_by_TccId::const_iterator lb, ub;
696 boost::tuples::tie(lb, ub) = get<6>(m_items).equal_range(
tccId);
698 DetId cell = lb->cell;
699 items.emplace_back(cell);
708 std::vector<DetId>
items;
714 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
716 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
720 EcalElectronicsMap_by_TccId_and_TtId::const_iterator lb, ub;
721 boost::tuples::tie(lb, ub) = get<7>(m_items).equal_range(boost::make_tuple(
int(
tccId),
int(
tt)));
723 DetId cell = lb->cell;
724 items.emplace_back(cell);
733 std::vector<DetId>
items;
739 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
741 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
745 EcalElectronicsMap_by_TccId_TtId_and_PseudostripId::const_iterator lb, ub;
746 boost::tuples::tie(lb, ub) = get<8>(m_items).equal_range(boost::make_tuple(
int(
tccId),
int(
tt),
int(pseudostrip)));
748 DetId cell = lb->cell;
749 items.emplace_back(cell);
768 std::pair<int, int> ind;
772 int zside =
id.zside();
773 ix = (
ix - 1) * 5 + 1;
774 iy = (
iy - 1) * 5 + 1;
775 ix = 5 * (
ix / 5) + 1;
776 iy = 5 * (
iy / 5) + 1;
793 int Dccid = elid.
dccId();
794 int DCC_Channel = elid.
towerId();
796 ind.second = DCC_Channel;
802 bool ignoreSingleCrystal)
const {
804 const bool debug =
false;
811 std::vector<EcalScDetId> scDetIds;
816 std::vector<int> nReadoutXtals;
818 std::vector<DetId> xtals = dccTowerConstituents(DCCid, DCC_Channel);
821 std::ostringstream st1;
822 st1 << __FILE__ <<
":" << __LINE__ <<
": " << xtals.size() <<
" crystals read out by channel " << DCC_Channel
823 <<
" of DCC " << DCCid <<
": ";
824 for (
auto xtal : xtals) {
831 throw cms::Exception(
"InvalidDetId") <<
"EcalElectronicsMapping : can not create EcalScDetId for DCC " << DCCid
832 <<
" and DCC_Channel " << DCC_Channel <<
".";
834 for (
auto xtal : xtals) {
836 int ix = eedetid.
ix();
837 int iy = eedetid.
iy();
838 int iz = eedetid.
zside();
839 int ix_SC = (
ix - 1) / 5 + 1;
840 int iy_SC = (
iy - 1) / 5 + 1;
845 while (iSc < scDetIds.size() && scDetIds[iSc] != scdetid)
847 if (iSc == scDetIds.size()) {
848 scDetIds.emplace_back(scdetid);
849 nReadoutXtals.emplace_back(1);
851 ++nReadoutXtals[iSc];
855 if (ignoreSingleCrystal) {
861 assert(scDetIds.size() == nReadoutXtals.size());
862 for (
size_t iSc = 0; iSc < scDetIds.size(); ) {
863 if (nReadoutXtals[iSc] <= 1) {
865 edm::LogVerbatim(
"EcalMapping") <<
"EcalElectronicsMapping::getEcalScDetId: Ignore SC " << scDetIds[iSc]
866 <<
" whose only one channel is read out by " 867 "the DCC channel (DCC " 868 << DCCid <<
", ch " << DCC_Channel <<
").\n";
869 scDetIds.erase(scDetIds.begin() + iSc);
870 nReadoutXtals.erase(nReadoutXtals.begin() + iSc);
881 if (
mode == DCCMODE) {
882 if ((dcctcc >= MIN_DCCID_EBM && dcctcc <= MAX_DCCID_EBM) || (dcctcc >= MIN_DCCID_EBP && dcctcc <= MAX_DCCID_EBP))
886 }
else if (
mode == TCCMODE) {
887 if ((dcctcc >= MIN_TCCID_EBM && dcctcc <= MAX_TCCID_EBM) || (dcctcc >= MIN_TCCID_EBP && dcctcc <= MAX_TCCID_EBP))
892 throw cms::Exception(
"InvalidDetId") <<
" Wrong mode in EcalElectronicsMapping::subdet " <<
mode <<
".";
896 if (
mode == DCCMODE) {
897 if (dcctcc >= MIN_DCCID_EBM && dcctcc <= MAX_DCCID_EBM)
899 if (dcctcc >= MIN_DCCID_EBP && dcctcc <= MAX_DCCID_EBP)
901 if (dcctcc >= MIN_DCCID_EEM && dcctcc <= MAX_DCCID_EEM)
903 if (dcctcc >= MIN_DCCID_EEP && dcctcc <= MAX_DCCID_EEP)
905 }
else if (
mode == TCCMODE) {
906 if (dcctcc >= MIN_TCCID_EBM && dcctcc <= MAX_TCCID_EBM)
908 if (dcctcc >= MIN_TCCID_EBP && dcctcc <= MAX_TCCID_EBP)
910 if (dcctcc >= MIN_TCCID_EEM && dcctcc <= MAX_TCCID_EEM)
912 if (dcctcc >= MIN_TCCID_EEP && dcctcc <= MAX_TCCID_EEP)
915 throw cms::Exception(
"InvalidDetId") <<
" Wrong mode in EcalElectronicsMapping::zside " <<
mode <<
".";
931 if (FED >= MIN_DCCID_EEM && FED <= MAX_DCCID_EEM)
932 return MIN_DCCID_EEM;
933 if (FED >= MIN_DCCID_EBM && FED <= MAX_DCCID_EBM)
934 return MIN_DCCID_EBM;
935 if (FED >= MIN_DCCID_EBP && FED <= MAX_DCCID_EBP)
936 return MIN_DCCID_EBP;
937 if (FED >= MIN_DCCID_EEP && FED <= MAX_DCCID_EEP)
938 return MIN_DCCID_EEP;
943 std::vector<int>
FEDs;
952 double radTodeg = 180. /
M_PI;
957 double etalow =
region.etaLow();
958 double philow =
region.phiLow() * radTodeg;
960 edm::LogVerbatim(
"EcalMapping") <<
" etalow philow " << etalow <<
" " << philow;
961 int FED_LB = GetFED(etalow, philow);
963 double phihigh =
region.phiHigh() * radTodeg;
965 edm::LogVerbatim(
"EcalMapping") <<
" etalow phihigh " << etalow <<
" " << phihigh;
966 int FED_LT = GetFED(etalow, phihigh);
968 int DCC_BoundaryL = DCCBoundary(FED_LB);
970 if (FED_LB < MIN_DCCID_EBM || FED_LB > MAX_DCCID_EBP)
973 if (philow < -170 && phihigh > 170) {
974 FED_LB = DCC_BoundaryL;
975 FED_LT = DCC_BoundaryL + deltaL - 1;
978 edm::LogVerbatim(
"EcalMapping") <<
" FED_LB FED_LT " << FED_LB <<
" " << FED_LT;
983 int iL = (FED_LB - DCC_BoundaryL +
idx) % deltaL + DCC_BoundaryL;
984 FEDs.emplace_back(iL);
992 double etahigh =
region.etaHigh();
993 int FED_RB = GetFED(etahigh, philow);
994 if (FED_RB == FED_LB)
997 int FED_RT = GetFED(etahigh, phihigh);
1000 edm::LogVerbatim(
"EcalMapping") <<
"etahigh philow phihigh " << etahigh <<
" " << philow <<
" " << phihigh;
1001 int DCC_BoundaryR = DCCBoundary(FED_RB);
1003 if (FED_RB < MIN_DCCID_EBM || FED_RB > MAX_DCCID_EBP)
1006 if (philow < -170 && phihigh > 170) {
1007 FED_RB = DCC_BoundaryR;
1008 FED_RT = DCC_BoundaryR +
deltaR - 1;
1011 edm::LogVerbatim(
"EcalMapping") <<
" FED_RB FED_RT " << FED_RB <<
" " << FED_RT;
1014 int iR = (FED_RB - DCC_BoundaryR +
idx) %
deltaR + DCC_BoundaryR;
1015 FEDs.emplace_back(iR);
1023 if (FED_LB >= MIN_DCCID_EBM && FED_LB <= MAX_DCCID_EBM && FED_RB >= MIN_DCCID_EEP && FED_RB <= MAX_DCCID_EEP) {
1024 int minR = FED_LB + 18;
1025 int maxR = FED_LT + 18;
1028 int iR = (minR - MIN_DCCID_EBP +
idx) % 18 + MIN_DCCID_EBP;
1029 FEDs.emplace_back(iR);
1039 if (FED_LB >= MIN_DCCID_EEM && FED_LB <= MAX_DCCID_EEM && FED_RB >= MIN_DCCID_EBP && FED_RB <= MAX_DCCID_EBP) {
1040 int minL = FED_RB - 18;
1041 int maxL = FED_RT - 18;
1044 int iL = (minL - MIN_DCCID_EBM +
idx) % 18 + MIN_DCCID_EBM;
1045 FEDs.emplace_back(iL);
1055 if (FED_LB >= MIN_DCCID_EEM && FED_LB <= MAX_DCCID_EEM && FED_RB >= MIN_DCCID_EEP && FED_RB <= MAX_DCCID_EEP) {
1056 int minL = (FED_LB - 1) * 2 + MIN_DCCID_EBM;
1057 if (minL == MIN_DCCID_EBM)
1058 minL = MAX_DCCID_EBM;
1061 int maxL = (FED_LT - 1) * 2 + MIN_DCCID_EBM;
1064 int iL = (minL - MIN_DCCID_EBM +
idx) % 18 + MIN_DCCID_EBM;
1065 FEDs.emplace_back(iL);
1072 int minR = minL + 18;
1073 int maxR = maxL + 18;
1076 int iR = (minR - MIN_DCCID_EBP +
idx) % 18 + MIN_DCCID_EBP;
1077 FEDs.emplace_back(iR);
1094 bool IsBarrel =
true;
1095 if (fabs(
eta) > 1.479)
1097 bool Positive = (
eta > 0);
1099 if (IsBarrel && Positive)
1100 DCC_Phi0 = DCCID_PHI0_EBP;
1101 if (IsBarrel && (!Positive))
1102 DCC_Phi0 = DCCID_PHI0_EBM;
1103 if ((!IsBarrel) && Positive)
1104 DCC_Phi0 = MIN_DCCID_EEP;
1105 if ((!IsBarrel) && (!Positive))
1106 DCC_Phi0 = MIN_DCCID_EEM;
1142 int dccid = DCCid(ebdetid);
1143 std::map<int, int>::const_iterator
it = LaserMonitoringMap_EB.find(dccid);
1144 if (
it != LaserMonitoringMap_EB.end()) {
1145 int ilm =
it->second;
1146 int iETA = ebdetid.
ietaSM();
1147 int iPHI = ebdetid.
iphiSM();
1148 if (iPHI > 10 && iETA > 5) {
1153 throw cms::Exception(
"InvalidDCCId") <<
"Wrong DCCId (EB) in EcalElectronicsMapping::getLMNumber.";
1158 int dccid = elid.
dccId();
1160 std::map<int, int>::const_iterator
it = LaserMonitoringMap_EE.find(dccid);
1161 if (
it != LaserMonitoringMap_EB.end()) {
1162 int ilm =
it->second;
1164 int ix = eedetid.
ix();
1169 int ix = eedetid.
ix();
1175 throw cms::Exception(
"InvalidDCCId") <<
"Wrong DCCId (EE) in EcalElectronicsMapping::getLMNumber.";
Log< level::Info, true > LogVerbatim
std::pair< int, int > getDCCandSC(EcalScDetId id) const
std::vector< DetId > pseudoStripConstituents(int tccId, int tt, int pseudostrip) const
Get the constituent detids for this dccId.
ALPAKA_FN_ACC int dcc(int ieta, int iphi)
int ietaAbs() const
get the absolute value of the crystal ieta
int GetFED(double eta, double phi) const
std::vector< int > GetListofFEDs(const RectangularEtaPhiRegion ®ion) const
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
EcalSubdetector subdet() const
get the subdet
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
static const int SUBDETIJMODE
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
Log< level::Error, false > LogError
int zside(int dcctcc, int mode) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
EcalSubdetector subdet(int dccid, int mode) const
std::vector< DetId > dccConstituents(int dccId) const
Get the constituent detids for this dccId.
std::vector< DetId > tccConstituents(int tccId) const
Get the constituent detids for this dccId.
void assign(const DetId &cell, const EcalElectronicsId &, const EcalTriggerElectronicsId &tower)
set the association between a DetId and a tower
int DCCBoundary(int FED) const
int towerId() const
get the tower id
Abs< T >::type abs(const T &t)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalTrigTowerDetId getTrigTowerDetId(int TCCid, int iTT) const
Builds a EcalTrigTowerDetID from the TCCid & TriggerTower index in TCC.
static const int ETAPHIMODE
EcalSubdetector subdet() const
get the subdet
std::vector< DetId > dccTowerConstituents(int dccId, int tower) const
Get the constituent detids for this dccId.
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
int getLMNumber(const DetId &id) const
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
bool rightTower(int tower) const
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
int iphiSM() const
get the crystal iphi (1-20)
Wrap a generic EcalTrigTowerDetId to the equivalent one in z+ Quadrant 1 (from 0 < phi < pi/2) ...
int ietaSM() const
get the crystal ieta in the SM convention (1-85)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
std::vector< DetId > stripConstituents(int dccId, int tower, int strip) const
Get the constituent detids for this dccId.
std::vector< DetId > ttConstituents(int tccId, int tt) const
Get the constituent detids for this dccId.
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.