130 std::map<EcalLogicID, MonCrystalConsistencyDat> crystalConsistencies;
131 std::map<EcalLogicID, MonTTConsistencyDat> towerConsistencies;
132 std::map<EcalLogicID, MonMemChConsistencyDat> memChannelConsistencies;
133 std::map<EcalLogicID, MonMemTTConsistencyDat> memTowerConsistencies;
135 MESet
const& digiME(
source_.at(
"Digi"));
136 MESet
const& gainME(
source_.at(
"Gain"));
137 MESet
const& chidME(
source_.at(
"ChId"));
138 MESet
const& gainswitchME(
source_.at(
"GainSwitch"));
139 MESet
const& qualityME(
source_.at(
"Quality"));
141 MESet
const& toweridME(
source_.at(
"TowerId"));
142 MESet
const& blocksizeME(
source_.at(
"BlockSize"));
143 MESet
const& l1aME(
source_.at(
"L1AFE"));
144 MESet
const& bxME(
source_.at(
"BXFE"));
146 MESet
const& memdigiME(
source_.at(
"MEMDigi"));
147 MESet
const& memchidME(
source_.at(
"MEMChId"));
148 MESet
const& memgainME(
source_.at(
"MEMGain"));
149 MESet
const& pnqualityME(
source_.at(
"PNQuality"));
151 MESet
const& memtoweridME(
source_.at(
"MEMTowerId"));
152 MESet
const& memblocksizeME(
source_.at(
"MEMBlockSize"));
156 MESet::const_iterator dEnd(digiME.end());
157 MESet::const_iterator qItr(qualityME);
158 for(MESet::const_iterator dItr(digiME.beginChannel()); dItr != dEnd; dItr.toNextChannel()){
161 int nDigis(dItr->getBinContent());
162 int gain(gainME.getBinContent(
id));
163 int chid(chidME.getBinContent(
id));
164 int gainswitch(gainswitchME.getBinContent(
id));
167 if(
gain > 0 || chid > 0 || gainswitch > 0){
169 data.setProcessedEvents(nDigis);
170 data.setProblematicEvents(
gain + chid + gainswitch);
172 data.setProblemsID(chid);
173 data.setProblemsGainSwitch(gainswitch);
175 int channelStatus(qItr->getBinContent());
176 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
177 data.setTaskStatus(channelBad);
186 for(
unsigned iTower(1); iTower <= 68; ++iTower){
187 if(!
ccuExists(iDCC + 1, iTower))
continue;
190 std::vector<DetId> channels(
getElectronicsMap()->dccTowerConstituents(iDCC + 1, iTower));
192 bool towerBad(
false);
193 for(
unsigned iD(0); iD < channels.size(); ++iD){
194 int n(digiME.getBinContent(channels[iD]));
195 if(
n > nDigis) nDigis =
n;
196 int channelStatus(qualityME.getBinContent(channels[iD]));
197 if(channelStatus ==
kBad || channelStatus ==
kMBad) towerBad =
true;
200 int towerid(toweridME.getBinContent(
eid));
201 int blocksize(blocksizeME.getBinContent(
eid));
202 int l1a(l1aME.getBinContent(iDCC + 1, iTower));
203 int bx(bxME.getBinContent(iDCC + 1, iTower));
205 if(towerid > 0 || blocksize > 0 || l1a > 0 || bx > 0){
207 data.setProcessedEvents(nDigis);
208 data.setProblematicEvents(towerid + blocksize + l1a + bx);
209 data.setProblemsID(towerid);
210 data.setProblemsSize(blocksize);
211 data.setProblemsLV1(l1a);
212 data.setProblemsBunchX(bx);
213 data.setTaskStatus(towerBad);
222 for(
unsigned iMD(0); iMD <
memDCC.size(); ++iMD){
223 unsigned iDCC(
memDCC[iMD]);
227 for(
unsigned iPN(1); iPN <= 10; ++iPN){
230 int nDigis(memdigiME.getBinContent(pnid));
231 int memchid(memchidME.getBinContent(pnid));
232 int memgain(memgainME.getBinContent(pnid));
234 if(memchid > 0 || memgain > 0){
237 data.setProcessedEvents(nDigis);
238 data.setProblematicEvents(memchid + memgain);
239 data.setProblemsID(memchid);
240 data.setProblemsGainZero(memgain);
242 int channelStatus(pnqualityME.getBinContent(pnid));
243 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
244 data.setTaskStatus(channelBad);
250 for(
unsigned iTower(69); iTower <= 70; ++iTower){
254 bool towerBad(
false);
255 for(
unsigned iPN(1); iPN <= 10; ++iPN){
257 int n(memdigiME.getBinContent(pnid));
258 if(
n > nDigis) nDigis =
n;
259 int channelStatus(pnqualityME.getBinContent(pnid));
260 if(channelStatus ==
kBad || channelStatus ==
kMBad) towerBad =
true;
263 int towerid(memtoweridME.getBinContent(
eid));
264 int blocksize(memblocksizeME.getBinContent(
eid));
266 if(towerid > 0 || blocksize > 0){
269 data.setProcessedEvents(nDigis);
270 data.setProblematicEvents(towerid + blocksize);
271 data.setProblemsID(towerid);
272 data.setProblemsSize(blocksize);
273 data.setTaskStatus(towerBad);
283 if(crystalConsistencies.size() > 0){
287 if(towerConsistencies.size() > 0){
291 if(memChannelConsistencies.size() > 0){
295 if(memTowerConsistencies.size() > 0){
300 catch(std::runtime_error&
e){
301 if(
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
std::vector< unsigned > const memDCC
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalElectronicsMapping const * getElectronicsMap()
bool ccuExists(unsigned, unsigned)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
EcalLogicID memChannelID(EcalPnDiodeDetId const &)
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
bool qualityOK(int _quality)
char data[epos_bytes_allocation]
EcalLogicID towerID(EcalElectronicsId const &)
EcalLogicID memTowerID(EcalElectronicsId const &)
EcalLogicID crystalID(DetId const &)