14 using boost::multi_index_container;
41 for (
int dcc = MIN_DCCID_EBM; dcc <= MAX_DCCID_EBM; dcc++) {
42 LaserMonitoringMap_EB[dcc] = ilm;
46 for (
int dcc = MIN_DCCID_EBP; dcc <= MAX_DCCID_EBP; dcc++) {
47 LaserMonitoringMap_EB[dcc] = ilm;
55 for (
int dcc = MIN_DCCID_EEM; dcc <= MAX_DCCID_EEM; dcc++) {
56 LaserMonitoringMap_EE[dcc] = ilm;
62 for (
int dcc = MIN_DCCID_EEP; dcc <= MAX_DCCID_EEP; dcc++) {
63 LaserMonitoringMap_EE[dcc] = ilm;
79 dcc += DCCID_PHI0_EBM - 19;
81 dcc += DCCID_PHI0_EBP - 1;
95 tcc += TCCID_PHI0_EBM - 19;
97 tcc += TCCID_PHI0_EBP - 1;
110 int ie =
id.ietaAbs() - 1;
116 if (
id.
zside() < 0) {
117 ip = ((phi - 1) % kEBTowersInPhi) + 1;
119 ip = kEBTowersInPhi - ((phi - 1) % kEBTowersInPhi);
122 return (ie * kEBTowersInPhi) + ip;
124 int ie =
id.ietaAbs();
125 bool inner = (ie >= iEEEtaMinInner);
127 ie = ie - iEEEtaMinInner;
128 ie = ie % kEETowersInEtaPerInnerTCC;
130 ie = ie - iEEEtaMinOuter;
131 ie = ie % kEETowersInEtaPerOuterTCC;
135 ip = (ip + 1) % (kEETowersInPhiPerQuadrant * 4);
138 ip = ip % kEETowersInPhiPerTCC;
139 int itt = kEETowersInPhiPerTCC * ie + ip + 1;
142 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::iTT. ";
149 int phi =
id.iphi() + 2;
152 int tcc = (phi - 1) / kEBTowersInPhi + 1;
155 if (
id.
zside() < 0) {
156 tcc += TCCID_PHI0_EBM - 19;
158 tcc += TCCID_PHI0_EBP - 1;
164 int ie =
id.ietaAbs();
165 bool inner = (ie >= iEEEtaMinInner);
167 ip = (ip + 1) % (kEETowersInPhiPerQuadrant * 4);
170 int Phiindex = ip / 4;
173 Phiindex += TCCID_PHI0_EEP_IN;
175 Phiindex += TCCID_PHI0_EEM_IN;
178 Phiindex += TCCID_PHI0_EEP_OUT;
180 Phiindex += TCCID_PHI0_EEM_OUT;
184 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::TCCid.";
194 int phi =
id.iphi() + 2;
197 int dcc = (phi - 1) / kEBTowersInPhi + 1;
200 if (
id.
zside() < 0) {
201 dcc += DCCID_PHI0_EBM - 19;
203 dcc += DCCID_PHI0_EBP - 1;
207 int tccid = TCCid(
id);
214 if (tccid == 24 || tccid == 25 || tccid == 6 || tccid == 7)
216 if (tccid == 26 || tccid == 27 || tccid == 8 || tccid == 9)
218 if (tccid == 28 || tccid == 29 || tccid == 10 || tccid == 11)
220 if (tccid == 30 || tccid == 31 || tccid == 12 || tccid == 13)
222 if (tccid == 32 || tccid == 33 || tccid == 14 || tccid == 15)
224 if (tccid == 34 || tccid == 35 || tccid == 16 || tccid == 17)
226 if (tccid == 36 || tccid == 19 || tccid == 18 || tccid == 1)
228 if (tccid == 20 || tccid == 21 || tccid == 2 || tccid == 3)
230 if (tccid == 22 || tccid == 23 || tccid == 4 || tccid == 5)
235 throw cms::Exception(
"InvalidDetId") <<
" Wrong EcalTrigTowerDetId in EcalElectronicsMapping::DCCid.";
244 int zIndex =
zside(TCCid, TCCMODE);
248 int jtower = iTT - 1;
250 DCCid = TCCid - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
252 DCCid = TCCid - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
253 int SMid = (zIndex > 0) ? DCCid - 27 : DCCid + 9;
255 int etaTT = jtower / kTowersInPhi + 1;
259 phiTT = (SMid - 1) * kTowersInPhi + (kTowersInPhi - (jtower % kTowersInPhi)) - 1;
261 phiTT = (SMid - 19) * kTowersInPhi + jtower % kTowersInPhi;
271 bool EEminus = (zIndex < 0);
272 bool EEplus = (zIndex > 0);
273 if ((!EEminus) && (!EEplus))
274 throw cms::Exception(
"InvalidDetId") <<
"EcalElectronicsMapping: Cannot create EcalTrigTowerDetId object. ";
277 if (tcc < TCCID_PHI0_EEM_OUT + kTCCinPhi)
279 else if (tcc >= TCCID_PHI0_EEP_OUT)
283 if (iz < 0 && tcc >= TCCID_PHI0_EEM_IN && tcc < TCCID_PHI0_EEM_IN + kTCCinPhi)
285 if (iz > 0 && tcc >= TCCID_PHI0_EEP_IN && tcc < TCCID_PHI0_EEP_IN + kTCCinPhi)
289 int ieta = (iTT - 1) / kEETowersInPhiPerTCC;
290 int iphi = (iTT - 1) % kEETowersInPhiPerTCC;
292 ieta += iEEEtaMinInner;
294 ieta += iEEEtaMinOuter;
300 TCC_origin = TCCID_PHI0_EEM_IN;
302 TCC_origin = TCCID_PHI0_EEM_OUT;
304 TCC_origin = TCCID_PHI0_EEP_IN;
306 TCC_origin = TCCID_PHI0_EEP_OUT;
307 tcc = tcc - TCC_origin;
309 iphi += kEETowersInPhiPerTCC * tcc;
310 iphi = (
iphi - 2 + 4 * kEETowersInPhiPerQuadrant) % (4 * kEETowersInPhiPerQuadrant) + 1;
319 throw cms::Exception(
"InvalidDetId") <<
" Wrong indices in EcalElectronicsMapping::getTrigTowerDetId. TCCid = " 320 << TCCid <<
" iTT = " << iTT <<
".";
329 int dcc = DCCid(ebdetid);
330 bool EBPlus = (
zside(dcc, DCCMODE) > 0);
331 bool EBMinus = !EBPlus;
335 int tower = iTT(trigtower);
341 bool RightTower = rightTower(
tower);
344 if (
strip % 2 == 0) {
346 channel = (
iphi - 1) % 5;
348 channel = 4 - ((
iphi - 1) % 5);
351 channel = 4 - ((
iphi - 1) % 5);
353 channel = (
iphi - 1) % 5;
357 if (
strip % 2 == 0) {
359 channel = 4 - ((
iphi - 1) % 5);
361 channel = (
iphi - 1) % 5;
364 channel = (
iphi - 1) % 5;
366 channel = 4 - ((
iphi - 1) % 5);
376 EcalElectronicsMap_by_DetId::const_iterator it = get<0>(m_items).
find(
id);
377 if (it == get<0>(m_items).end()) {
379 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
385 throw cms::Exception(
"InvalidDetId") <<
" Wrong DetId in EcalElectronicsMapping::getElectronicsId.";
397 EcalElectronicsMap_by_DetId::const_iterator it = get<0>(m_items).
find(
id);
398 if (it == get<0>(m_items).end()) {
400 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid trig id";
406 throw cms::Exception(
"InvalidDetId") <<
" Wrong DetId in EcalElectronicsMapping::getTriggerElectronicsId.";
414 int dcc =
id.dccId();
415 int tower =
id.towerId();
416 int strip =
id.stripId();
417 int channel =
id.xtalId();
421 bool EBPlus = (
id.zside() > 0);
422 bool EBMinus = !EBPlus;
424 if (
id.
zside() < 0) {
425 smid = dcc + 19 - DCCID_PHI0_EBM;
426 iphi = (smid - 19) * kCrystalsInPhi;
427 iphi += 5 * ((
tower - 1) % kTowersInPhi);
429 smid = dcc + 1 - DCCID_PHI0_EBP;
430 iphi = (smid - 1) * kCrystalsInPhi;
431 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
433 bool RightTower = rightTower(
tower);
434 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
437 if (
strip % 2 == 1) {
439 iphi += (channel - 1) + 1;
441 iphi += (4 - (channel - 1)) + 1;
444 iphi += (4 - (channel - 1)) + 1;
446 iphi += (channel - 1) + 1;
450 if (
strip % 2 == 1) {
452 iphi += (4 - (channel - 1)) + 1;
454 iphi += (channel - 1) + 1;
457 iphi += (channel - 1) + 1;
459 iphi += (4 - (channel - 1)) + 1;
470 EcalElectronicsMap_by_ElectronicsId::const_iterator it = get<1>(m_items).
find(
id);
471 if (it == (get<1>(m_items).end())) {
473 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non DetId";
476 DetId cell = it->cell;
479 throw cms::Exception(
"InvalidDetId") <<
"Wrong EcalElectronicsId in EcalElectronicsMapping::getDetId.";
486 int strip =
id.stripId();
487 int xtal =
id.xtalId();
488 int tower =
id.towerId();
489 int tcc =
id.dccId();
490 if (
id.
zside() < 0) {
491 tcc += TCCID_PHI0_EBM - DCCID_PHI0_EBM;
493 tcc += TCCID_PHI0_EBP - DCCID_PHI0_EBP;
499 EcalElectronicsMap_by_ElectronicsId::const_iterator it = get<1>(m_items).
find(
id);
500 if (it == get<1>(m_items).end()) {
502 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
509 <<
"Wrong EcalElectronicsId in EcalElectronicsMapping::getTriggerElectronicsId.";
517 DetId cell = getDetId(elid);
520 EcalElectronicsMap_by_TriggerElectronicsId::const_iterator it = get<2>(m_items).
find(
id);
521 if (it == get<2>(m_items).end()) {
523 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid DetId";
526 DetId cell = it->cell;
529 throw cms::Exception(
"InvalidDetId") <<
"Wrong EcalTriggerElectronicsId in EcalElectronicsMapping::getDetId.";
536 int strip =
id.pseudoStripId();
537 int xtal =
id.channelId();
538 int tower =
id.ttId();
539 int dcc =
id.tccId();
540 if (
id.
zside() < 0) {
541 dcc -= TCCID_PHI0_EBM - DCCID_PHI0_EBM;
543 dcc -= TCCID_PHI0_EBP - DCCID_PHI0_EBP;
548 EcalElectronicsMap_by_TriggerElectronicsId::const_iterator it = get<2>(m_items).
find(
id);
549 if (it == get<2>(m_items).end()) {
551 edm::LogError(
"EcalElectronicsMapping") <<
"Ecal mapping was asked non valid id";
558 <<
"Wrong EcalTriggerElectronicsId in EcalElectronicsMapping::getElectronicsId.";
563 std::vector<DetId>
items;
567 std::vector<DetId> xtals = dccTowerConstituents(
dccId,
tower);
568 int size = xtals.size();
569 for (
int i = 0;
i <
size;
i++) {
571 items.emplace_back(detid);
576 EcalElectronicsMap_by_DccId::const_iterator lb, ub;
577 boost::tuples::tie(lb, ub) = get<3>(m_items).equal_range(
dccId);
579 DetId cell = lb->cell;
580 items.emplace_back(cell);
586 <<
" in EcalElectronicsMapping::dccConstituents. ";
591 std::vector<DetId>
items;
598 smid =
dccId + 19 - DCCID_PHI0_EBM;
599 iphi = (smid - 19) * kCrystalsInPhi;
600 iphi += 5 * ((
tower - 1) % kTowersInPhi);
602 smid =
dccId + 1 - DCCID_PHI0_EBP;
603 iphi = (smid - 1) * kCrystalsInPhi;
604 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
606 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
607 for (
int ip = 1; ip <= 5; ip++) {
608 for (
int ie = 0; ie <= 4; ie++) {
609 int ieta_xtal =
ieta + ie;
610 int iphi_xtal =
iphi + ip;
612 ieta_xtal = -ieta_xtal;
614 items.emplace_back(ebdetid);
621 EcalElectronicsMap_by_DccId_and_TowerId::const_iterator lb, ub;
622 boost::tuples::tie(lb, ub) = get<4>(m_items).equal_range(boost::make_tuple(
int(
dccId),
int(
tower)));
624 DetId cell = lb->cell;
625 items.emplace_back(cell);
631 <<
" in EcalElectronicsMapping::dccTowerConstituents.";
636 std::vector<DetId>
items;
640 bool RightTower = rightTower(
tower);
644 smid =
dccId + 19 - DCCID_PHI0_EBM;
645 iphi = (smid - 19) * kCrystalsInPhi;
646 iphi += 5 * ((
tower - 1) % kTowersInPhi);
648 smid =
dccId + 1 - DCCID_PHI0_EBP;
649 iphi = (smid - 1) * kCrystalsInPhi;
650 iphi += 5 * (kTowersInPhi - ((
tower - 1) % kTowersInPhi) - 1);
652 int ieta = 5 * ((
tower - 1) / kTowersInPhi) + 1;
658 for (
int ip = 1; ip <= 5; ip++) {
659 int ieta_xtal =
ieta;
660 int iphi_xtal =
iphi + ip;
662 ieta_xtal = -ieta_xtal;
664 items.emplace_back(ebdetid);
669 EcalElectronicsMap_by_DccId_TowerId_and_StripId::const_iterator lb, ub;
670 boost::tuples::tie(lb, ub) = get<5>(m_items).equal_range(boost::make_tuple(
int(
dccId),
int(
tower),
int(
strip)));
672 DetId cell = lb->cell;
673 items.emplace_back(cell);
682 std::vector<DetId>
items;
688 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
690 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
694 EcalElectronicsMap_by_TccId::const_iterator lb, ub;
695 boost::tuples::tie(lb, ub) = get<6>(m_items).equal_range(
tccId);
697 DetId cell = lb->cell;
698 items.emplace_back(cell);
707 std::vector<DetId>
items;
713 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
715 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
719 EcalElectronicsMap_by_TccId_and_TtId::const_iterator lb, ub;
720 boost::tuples::tie(lb, ub) = get<7>(m_items).equal_range(boost::make_tuple(
int(
tccId),
int(
tt)));
722 DetId cell = lb->cell;
723 items.emplace_back(cell);
732 std::vector<DetId>
items;
738 dccId =
dccId - TCCID_PHI0_EBP + DCCID_PHI0_EBP;
740 dccId =
dccId - TCCID_PHI0_EBM + DCCID_PHI0_EBM;
744 EcalElectronicsMap_by_TccId_TtId_and_PseudostripId::const_iterator lb, ub;
745 boost::tuples::tie(lb, ub) = get<8>(m_items).equal_range(boost::make_tuple(
int(
tccId),
int(
tt),
int(pseudostrip)));
747 DetId cell = lb->cell;
748 items.emplace_back(cell);
767 std::pair<int, int> ind;
771 int zside =
id.zside();
772 ix = (ix - 1) * 5 + 1;
773 iy = (iy - 1) * 5 + 1;
774 ix = 5 * (ix / 5) + 1;
775 iy = 5 * (iy / 5) + 1;
792 int Dccid = elid.
dccId();
793 int DCC_Channel = elid.
towerId();
795 ind.second = DCC_Channel;
801 bool ignoreSingleCrystal)
const {
803 const bool debug =
false;
810 std::vector<EcalScDetId> scDetIds;
815 std::vector<int> nReadoutXtals;
817 std::vector<DetId> xtals = dccTowerConstituents(DCCid, DCC_Channel);
820 std::cout << __FILE__ <<
":" << __LINE__ <<
": " << xtals.size() <<
" crystals read out by channel " << DCC_Channel
821 <<
" of DCC " << DCCid <<
": ";
822 for (
auto xtal : xtals) {
829 throw cms::Exception(
"InvalidDetId") <<
"EcalElectronicsMapping : can not create EcalScDetId for DCC " << DCCid
830 <<
" and DCC_Channel " << DCC_Channel <<
".";
832 for (
auto xtal : xtals) {
834 int ix = eedetid.
ix();
835 int iy = eedetid.
iy();
836 int iz = eedetid.
zside();
837 int ix_SC = (ix - 1) / 5 + 1;
838 int iy_SC = (iy - 1) / 5 + 1;
843 while (iSc < scDetIds.size() && scDetIds[iSc] != scdetid)
845 if (iSc == scDetIds.size()) {
846 scDetIds.emplace_back(scdetid);
847 nReadoutXtals.emplace_back(1);
849 ++nReadoutXtals[iSc];
853 if (ignoreSingleCrystal) {
859 assert(scDetIds.size() == nReadoutXtals.size());
860 for (
size_t iSc = 0; iSc < scDetIds.size(); ) {
861 if (nReadoutXtals[iSc] <= 1) {
863 std::cout <<
"EcalElectronicsMapping::getEcalScDetId: Ignore SC " << scDetIds[iSc]
864 <<
" whose only one channel is read out by " 865 "the DCC channel (DCC " 866 << DCCid <<
", ch " << DCC_Channel <<
").\n";
867 scDetIds.erase(scDetIds.begin() + iSc);
868 nReadoutXtals.erase(nReadoutXtals.begin() + iSc);
879 if (
mode == DCCMODE) {
880 if ((dcctcc >= MIN_DCCID_EBM && dcctcc <= MAX_DCCID_EBM) || (dcctcc >= MIN_DCCID_EBP && dcctcc <= MAX_DCCID_EBP))
884 }
else if (
mode == TCCMODE) {
885 if ((dcctcc >= MIN_TCCID_EBM && dcctcc <= MAX_TCCID_EBM) || (dcctcc >= MIN_TCCID_EBP && dcctcc <= MAX_TCCID_EBP))
890 throw cms::Exception(
"InvalidDetId") <<
" Wrong mode in EcalElectronicsMapping::subdet " <<
mode <<
".";
894 if (
mode == DCCMODE) {
895 if (dcctcc >= MIN_DCCID_EBM && dcctcc <= MAX_DCCID_EBM)
897 if (dcctcc >= MIN_DCCID_EBP && dcctcc <= MAX_DCCID_EBP)
899 if (dcctcc >= MIN_DCCID_EEM && dcctcc <= MAX_DCCID_EEM)
901 if (dcctcc >= MIN_DCCID_EEP && dcctcc <= MAX_DCCID_EEP)
903 }
else if (
mode == TCCMODE) {
904 if (dcctcc >= MIN_TCCID_EBM && dcctcc <= MAX_TCCID_EBM)
906 if (dcctcc >= MIN_TCCID_EBP && dcctcc <= MAX_TCCID_EBP)
908 if (dcctcc >= MIN_TCCID_EEM && dcctcc <= MAX_TCCID_EEM)
910 if (dcctcc >= MIN_TCCID_EEP && dcctcc <= MAX_TCCID_EEP)
913 throw cms::Exception(
"InvalidDetId") <<
" Wrong mode in EcalElectronicsMapping::zside " <<
mode <<
".";
929 if (FED >= MIN_DCCID_EEM && FED <= MAX_DCCID_EEM)
930 return MIN_DCCID_EEM;
931 if (FED >= MIN_DCCID_EBM && FED <= MAX_DCCID_EBM)
932 return MIN_DCCID_EBM;
933 if (FED >= MIN_DCCID_EBP && FED <= MAX_DCCID_EBP)
934 return MIN_DCCID_EBP;
935 if (FED >= MIN_DCCID_EEP && FED <= MAX_DCCID_EEP)
936 return MIN_DCCID_EEP;
941 std::vector<int>
FEDs;
950 double radTodeg = 180. /
M_PI;
955 double etalow =
region.etaLow();
956 double philow =
region.phiLow() * radTodeg;
958 std::cout <<
" etalow philow " << etalow <<
" " << philow << std::endl;
959 int FED_LB = GetFED(etalow, philow);
961 double phihigh =
region.phiHigh() * radTodeg;
963 std::cout <<
" etalow phihigh " << etalow <<
" " << phihigh << std::endl;
964 int FED_LT = GetFED(etalow, phihigh);
966 int DCC_BoundaryL = DCCBoundary(FED_LB);
968 if (FED_LB < MIN_DCCID_EBM || FED_LB > MAX_DCCID_EBP)
971 if (philow < -170 && phihigh > 170) {
972 FED_LB = DCC_BoundaryL;
973 FED_LT = DCC_BoundaryL + deltaL - 1;
976 std::cout <<
" FED_LB FED_LT " << FED_LB <<
" " << FED_LT << std::endl;
981 int iL = (FED_LB - DCC_BoundaryL +
idx) % deltaL + DCC_BoundaryL;
982 FEDs.emplace_back(iL);
984 std::cout <<
" add fed " << iL << std::endl;
990 double etahigh =
region.etaHigh();
991 int FED_RB = GetFED(etahigh, philow);
992 if (FED_RB == FED_LB)
995 int FED_RT = GetFED(etahigh, phihigh);
998 std::cout <<
"etahigh philow phihigh " << etahigh <<
" " << philow <<
" " << phihigh << std::endl;
999 int DCC_BoundaryR = DCCBoundary(FED_RB);
1001 if (FED_RB < MIN_DCCID_EBM || FED_RB > MAX_DCCID_EBP)
1004 if (philow < -170 && phihigh > 170) {
1005 FED_RB = DCC_BoundaryR;
1006 FED_RT = DCC_BoundaryR +
deltaR - 1;
1009 std::cout <<
" FED_RB FED_RT " << FED_RB <<
" " << FED_RT << std::endl;
1012 int iR = (FED_RB - DCC_BoundaryR +
idx) %
deltaR + DCC_BoundaryR;
1013 FEDs.emplace_back(iR);
1015 std::cout <<
" add fed " << iR << std::endl;
1021 if (FED_LB >= MIN_DCCID_EBM && FED_LB <= MAX_DCCID_EBM && FED_RB >= MIN_DCCID_EEP && FED_RB <= MAX_DCCID_EEP) {
1022 int minR = FED_LB + 18;
1023 int maxR = FED_LT + 18;
1026 int iR = (minR - MIN_DCCID_EBP +
idx) % 18 + MIN_DCCID_EBP;
1027 FEDs.emplace_back(iR);
1029 std::cout <<
" add fed " << iR << std::endl;
1037 if (FED_LB >= MIN_DCCID_EEM && FED_LB <= MAX_DCCID_EEM && FED_RB >= MIN_DCCID_EBP && FED_RB <= MAX_DCCID_EBP) {
1038 int minL = FED_RB - 18;
1039 int maxL = FED_RT - 18;
1042 int iL = (minL - MIN_DCCID_EBM +
idx) % 18 + MIN_DCCID_EBM;
1043 FEDs.emplace_back(iL);
1045 std::cout <<
" add fed " << iL << std::endl;
1053 if (FED_LB >= MIN_DCCID_EEM && FED_LB <= MAX_DCCID_EEM && FED_RB >= MIN_DCCID_EEP && FED_RB <= MAX_DCCID_EEP) {
1054 int minL = (FED_LB - 1) * 2 + MIN_DCCID_EBM;
1055 if (minL == MIN_DCCID_EBM)
1056 minL = MAX_DCCID_EBM;
1059 int maxL = (FED_LT - 1) * 2 + MIN_DCCID_EBM;
1062 int iL = (minL - MIN_DCCID_EBM +
idx) % 18 + MIN_DCCID_EBM;
1063 FEDs.emplace_back(iL);
1065 std::cout <<
" add fed " << iL << std::endl;
1070 int minR = minL + 18;
1071 int maxR = maxL + 18;
1074 int iR = (minR - MIN_DCCID_EBP +
idx) % 18 + MIN_DCCID_EBP;
1075 FEDs.emplace_back(iR);
1077 std::cout <<
" add fed " << iR << std::endl;
1092 bool IsBarrel =
true;
1093 if (fabs(
eta) > 1.479)
1095 bool Positive = (
eta > 0);
1097 if (IsBarrel && Positive)
1098 DCC_Phi0 = DCCID_PHI0_EBP;
1099 if (IsBarrel && (!Positive))
1100 DCC_Phi0 = DCCID_PHI0_EBM;
1101 if ((!IsBarrel) && Positive)
1102 DCC_Phi0 = MIN_DCCID_EEP;
1103 if ((!IsBarrel) && (!Positive))
1104 DCC_Phi0 = MIN_DCCID_EEM;
1140 int dccid = DCCid(ebdetid);
1141 std::map<int, int>::const_iterator it = LaserMonitoringMap_EB.find(dccid);
1142 if (it != LaserMonitoringMap_EB.end()) {
1143 int ilm = it->second;
1144 int iETA = ebdetid.
ietaSM();
1145 int iPHI = ebdetid.
iphiSM();
1146 if (iPHI > 10 && iETA > 5) {
1151 throw cms::Exception(
"InvalidDCCId") <<
"Wrong DCCId (EB) in EcalElectronicsMapping::getLMNumber.";
1156 int dccid = elid.
dccId();
1158 std::map<int, int>::const_iterator it = LaserMonitoringMap_EE.find(dccid);
1159 if (it != LaserMonitoringMap_EB.end()) {
1160 int ilm = it->second;
1162 int ix = eedetid.
ix();
1167 int ix = eedetid.
ix();
1173 throw cms::Exception(
"InvalidDCCId") <<
"Wrong DCCId (EE) in EcalElectronicsMapping::getLMNumber.";
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.
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.
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
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.