36 #include "L1Trigger/L1TCaloLayer1/src/UCTGeometry.hh" 38 #include "L1Trigger/L1TCaloLayer1/src/UCTLogging.hh" 56 void endJob()
override;
82 uint32_t ngRegion[22];
83 uint32_t nbRegion[22];
84 uint32_t zgRegion[22];
85 uint32_t zbRegion[22];
126 nonZeroTowerCount(0),
127 badNonZeroTowerCount(0),
130 nonZeroRegionCount(0),
131 badNonZeroRegionCount(0),
141 for (uint32_t
r = 0;
r < 22;
r++)
143 for (uint32_t
c = 0;
c < 18;
c++)
156 bool badEvent =
false;
173 for (std::vector<CaloTower>::const_iterator testTower = testTowers->
begin(theBX);
174 testTower != testTowers->
end(theBX);
176 int test_iEta = testTower->hwEta();
177 int test_iPhi = testTower->hwPhi();
178 int test_et = testTower->hwPt();
179 int test_er = testTower->hwEtRatio();
180 int test_fb = testTower->hwQual();
181 for (std::vector<CaloTower>::const_iterator emulTower = emulTowers->
begin(theBX);
182 emulTower != emulTowers->
end(theBX);
184 int emul_iEta = emulTower->hwEta();
185 int emul_iPhi = emulTower->hwPhi();
186 int emul_et = emulTower->hwPt();
187 int emul_er = emulTower->hwEtRatio();
188 int emul_fb = emulTower->hwQual();
190 if (test_iEta == emul_iEta && test_iPhi == emul_iPhi) {
191 if (test_et != emul_et) {
194 if (test_er != emul_er) {
197 if (test_fb != emul_fb) {
201 if (test_et != emul_et) {
205 if (test_er != emul_er) {
209 if (test_fb != emul_fb) {
214 LOG_ERROR <<
"Checks failed for tower (" <<
std::dec << test_iEta <<
", " << test_iPhi <<
") : (" 215 << test_et <<
", " << test_er <<
", " << test_fb <<
") != (" << emul_et <<
", " << emul_er
216 <<
", " << emul_fb <<
")" << std::endl;
226 if (!
success && test_et == emul_et && test_iPhi == emul_iPhi) {
228 LOG_ERROR <<
"Incidental match for tower (" <<
std::dec << test_iEta <<
", " << test_iPhi <<
") : (" 229 << test_et <<
", " << test_er <<
", " << test_fb <<
") != (" << emul_iEta <<
"," << emul_iPhi
230 <<
") :(" << emul_et <<
", " << emul_er <<
", " << emul_fb <<
")" << std::endl;
240 uint32_t testRegionTotET = 0;
241 uint32_t emulRegionTotET = 0;
242 for (std::vector<L1CaloRegion>::const_iterator testRegion = testRegions->begin(); testRegion != testRegions->end();
245 uint32_t test_et = testRegion->et();
246 testRegionTotET += test_et;
247 uint32_t test_rEta = testRegion->id().ieta();
248 uint32_t test_rPhi = testRegion->id().iphi();
251 bool test_negativeEta =
false;
252 int test_cEta = (test_rEta - 11) * 4 + 1;
253 if (test_rEta < 11) {
254 test_negativeEta =
true;
255 test_cEta = -((10 - test_rEta) * 4 + 1);
257 int test_cPhi = test_rPhi * 4 + 1;
258 uint32_t test_crate =
g.getCrate(test_cEta, test_cPhi);
259 uint32_t test_card =
g.getCard(test_cEta, test_cPhi);
260 uint32_t test_region =
g.getRegion(test_cEta, test_cPhi);
261 for (std::vector<L1CaloRegion>::const_iterator emulRegion = emulRegions->begin();
262 emulRegion != emulRegions->end();
265 uint32_t emul_et = emulRegion->et();
266 if (testRegion == testRegions->begin())
267 emulRegionTotET += emul_et;
268 uint32_t emul_rEta = emulRegion->id().ieta();
269 uint32_t emul_rPhi = emulRegion->id().iphi();
272 bool emul_negativeEta =
false;
273 int emul_cEta = (emul_rEta - 11) * 4 + 1;
274 if (emul_rEta < 11) {
275 emul_negativeEta =
true;
276 emul_cEta = -((10 - emul_rEta) * 4 + 1);
278 int emul_cPhi = emul_rPhi * 4 + 1;
279 uint32_t emul_crate =
g.getCrate(emul_cEta, emul_cPhi);
280 uint32_t emul_card =
g.getCard(emul_cEta, emul_cPhi);
281 uint32_t emul_region =
g.getRegion(emul_cEta, emul_cPhi);
283 if (test_rEta == emul_rEta && test_rPhi == emul_rPhi) {
284 if (test_et != emul_et)
290 LOG_ERROR <<
"Checks failed for region (" <<
std::dec << test_rEta <<
", " << test_rPhi <<
") (" 291 << test_negativeEta <<
", " << test_crate <<
", " << test_card <<
", " << test_region
295 << test_et <<
") != (" << emul_negativeEta <<
", " << emul_crate <<
", " << emul_card <<
", " 300 << emul_et <<
")" << std::endl;
316 LOG_ERROR <<
"Checks passed for region (" <<
std::dec << test_rEta <<
", " << test_rPhi <<
") (" 317 << test_negativeEta <<
", " << test_crate <<
", " << test_card <<
", " << test_region
321 << test_et <<
") == (" << emul_negativeEta <<
", " << emul_crate <<
", " << emul_card <<
", " 326 << emul_et <<
")" << std::endl;
336 if (!
success && test_et == emul_et) {
338 LOG_ERROR <<
"Incidental match for region (" <<
std::dec << test_rEta <<
", " << test_rPhi
342 << test_et <<
") != (" << emul_rEta <<
", " << emul_rPhi
346 << emul_et <<
")" << std::endl;
350 uint32_t emulTowerTotET = 0;
351 for (std::vector<CaloTower>::const_iterator emulTower = emulTowers->
begin(theBX);
352 emulTower != emulTowers->
end(theBX);
354 int twr_et = emulTower->hwPt();
355 int twr_cEta = emulTower->hwEta();
356 int twr_cPhi = emulTower->hwPhi();
357 uint32_t twr_region =
g.getRegion(twr_cEta, twr_cPhi);
358 uint32_t twr_gEta = 10 - twr_region;
360 twr_gEta = twr_region + 11;
361 uint32_t twr_gPhi =
g.getUCTRegionPhiIndex(twr_cPhi);
362 if (badEvent && twr_et > 0) {
364 LOG_ERROR <<
"Non-zero tower in region (" << twr_gEta <<
", " << twr_gPhi <<
") " 365 <<
"(cEta, cPhi, et) = (" << twr_cEta <<
", " << twr_cPhi <<
", " << twr_et <<
")" << std::endl;
368 emulTowerTotET += twr_et;
371 if (emulTowerTotET < emulRegionTotET)
373 else if (emulTowerTotET > emulRegionTotET)
378 if (testRegionTotET < emulRegionTotET)
380 else if (testRegionTotET > emulRegionTotET)
399 LOG_ERROR <<
"L1TCaloLayer1Validator: Summary is Non-Zero Bad Tower / Bad Tower / Event Count = (" 403 LOG_ERROR <<
"L1TCaloLayer1Validator: Summary is Non-Zero Bad Region / Bad Region / Event Count = (" 406 LOG_ERROR <<
"L1TCaloLayer1Validator reTa, non-zero-good / non-zero-bad / zero-good / zero-bad region[rEta] = " 408 for (uint32_t
r = 0;
r < 22;
r++)
411 LOG_ERROR <<
"L1TCaloLayer1Validator rPhi, non-zero-good / non-zero-bad / zero-good / zero-bad region[rPhi] = " 413 for (uint32_t
r = 0;
r < 18;
r++)
416 LOG_ERROR <<
"L1TCaloLayer1Validator : Total ET emulator tower vs region; less / equal / greater counts: " 418 LOG_ERROR <<
"L1TCaloLayer1Validator : Total ET region test vs emulator; less / equal / greater counts: "
edm::EDGetTokenT< CaloTowerBxCollection > emulTowerToken
edm::EDGetTokenT< L1CaloRegionCollection > emulRegionToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< CaloTowerBxCollection > testTowerToken
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
const_iterator begin(int bx) const
void addDefault(ParameterSetDescription const &psetDescription)
uint32_t nonZeroRegionCount
uint32_t nonZeroTowerCount
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< L1CaloRegionCollection > testRegionToken
L1TCaloLayer1Validator(const edm::ParameterSet &)
uint32_t badNonZeroRegionCount
~L1TCaloLayer1Validator() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const_iterator end(int bx) const
std::vector< L1CaloRegion > L1CaloRegionCollection
uint32_t badNonZeroTowerCount