21 : theTriggerMap(nullptr), theElecMap(nullptr),
dEta(dEta_),
dPhi(dPhi_) {}
25 for (
size_t iCap = 0; iCap <
nEndcaps; ++iCap) {
26 for (
int iDccPhi = 0; iDccPhi <
nDccPerEe; ++iDccPhi) {
27 for (
int iDccCh = 0; iDccCh <
maxDccChs; ++iDccCh) {
28 eeRuInterest_[iCap][iDccPhi][iDccCh] =
UNKNOWN;
41 int nTriggerTowerE[] = {0, 0, 0, 0, 0, 0, 0, 0};
42 int nTriggerTowerB[] = {0, 0, 0, 0, 0, 0, 0, 0};
43 static std::atomic<int> ncall{0};
50 ++nTriggerTowerE[towerInterest[
iEta][iPhi]];
52 ++nTriggerTowerB[towerInterest[
iEta][iPhi]];
55 assert(towerInterest[
iEta][iPhi] >= 0 && towerInterest[
iEta][iPhi] <= 0x7);
58 edm::LogInfo(
"EcalSelectiveReadout") <<
"without forced bit + with forced bit set:\n"
61 <<
" low interest TT(s) in barrel\n"
63 <<
" single TT(s) in barrel\n"
66 <<
" neighbor interest TT(s) in barrel\n"
68 <<
" centre interest TT(s) in barrel\n"
71 <<
" low interest TT(s) in endcap\n"
73 <<
" single TT(s) in endcap\n"
77 <<
" center TT(s) in endcap\n";
84 #ifndef ECALSELECTIVEREADOUT_NOGEOM
86 for (std::vector<DetId>::const_iterator eeDetIdItr = endcapDetIds.begin(); eeDetIdItr != endcapDetIds.end();
95 int iz = (eeDetId.zside() > 0) ? 1 : 0;
101 #else //ECALSELECTIVEREADOUT_NOGEOM defined
103 for (
int iZ0 = 0; iZ0 < 2; ++iZ0) {
106 if (!(xtal.
validDetId(iX0 + 1, iY0 + 1, (iZ0 > 0 ? 1 : -1)))) {
109 xtal =
EEDetId(iX0 + 1, iY0 + 1, (iZ0 > 0 ? 1 : -1));
111 if (39 <= iX0 && iX0 <= 60 && 45 <= iY0 && iY0 <= 54) {
128 #endif //ECALSELECTIVEREADOUT_NOGEOM not defined
141 return const_cast<EcalSelectiveReadout*>(
this)->eeRuInterest(eeDetId);
145 return const_cast<EcalSelectiveReadout*>(
this)->eeRuInterest(scDetId);
150 const int iZ0 =
id.
zside() > 0 ? 1 : 0;
151 const int iDcc0 =
id.dccId() - 1;
152 const int iDccPhi0 = (iDcc0 < 9) ? iDcc0 : (iDcc0 - 45);
153 const int iDccCh0 =
id.towerId() - 1;
158 (0 <= eeRuInterest_[iZ0][iDccPhi0][iDccCh0] && eeRuInterest_[iZ0][iDccPhi0][iDccCh0] <= 7));
160 return eeRuInterest_[iZ0][iDccPhi0][iDccCh0];
164 std::pair<int, int> dccAndDccCh = theElecMap->getDCCandSC(scDetId);
165 const int iZ0 = (scDetId.
zside() > 0) ? 1 : 0;
166 const int iDcc0 = dccAndDccCh.first - 1;
167 const int iDccPhi0 = (iDcc0 < 9) ? iDcc0 : (iDcc0 - 45);
168 const int iDccCh0 = dccAndDccCh.second - 1;
172 assert(-1 <= eeRuInterest_[iZ0][iDccPhi0][iDccCh0] && eeRuInterest_[iZ0][iDccPhi0][iDccCh0] <= 7);
174 return eeRuInterest_[iZ0][iDccPhi0][iDccCh0];
180 int iPhi =
tower.iphi() - 1;
182 assert(-1 <= towerInterest[
iEta][iPhi] &&
int(towerInterest[
iEta][iPhi]) < 8);
184 return towerInterest[
iEta][iPhi];
203 for (
int iEtaNeigh = std::max<int>(0,
iEta -
dEta);
206 for (
int iPhiNeigh = iPhi -
dPhi; iPhiNeigh <= iPhi +
dPhi; ++iPhiNeigh) {
210 if (iPhiNeigh_ < 0) {
227 for (
size_t i = 0;
i < 4; ++
i) {
228 size_t iEta = innerEtas[
i];
231 towerInterest[
iEta][iPhi] = srf;
232 towerInterest[
iEta][iPhi + 1] = srf;
238 os <<
"#SRP flag map\n#\n"
241 <<
": low interest\n"
253 <<
": forced low interest\n"
256 <<
": forced single\n"
259 <<
": forced neighbout\n"
262 <<
": forced center\n"
307 selectiveReadout.
print(os);
311 void EcalSelectiveReadout::printDccChMap(std::ostream& os)
const {
312 for (
int i = -1;
i <= 68; ++
i) {
313 if ((
i + 1) % 10 == 0)
315 os << std::setw(2) <<
i <<
": " << (char)(
'0' +
i);
325 os <<
"Sc2DCCch0: " << (
endcap ?
"EE+" :
"EE-") <<
"\n";
332 os << (char)(
'0' - 1);
335 os << (char)(
'0' + (theElecMap->getDCCandSC(
EcalScDetId(iX + 1, iY + 1,
endcap > 0 ? 1 : -1)).second - 1));