28 if (
a.eta() !=
b.eta())
30 if (
a.phi() !=
b.phi())
34 cout <<
"COMPARISON FAILURE: \n";
35 cout <<
"A: pt = " <<
a.pt() <<
" eta = " <<
a.eta() <<
" phi = " <<
a.phi() <<
"\n";
36 cout <<
"B: pt = " <<
b.pt() <<
" eta = " <<
b.eta() <<
" phi = " <<
b.phi() <<
"\n";
39 if (
a.hwPt() !=
b.hwPt())
41 if (
a.hwEta() !=
b.hwEta())
43 if (
a.hwPhi() !=
b.hwPhi())
47 cout <<
"COMPARISON FAILURE: \n";
48 cout <<
"A: hwPt = " <<
a.hwPt() <<
" hwEta = " <<
a.hwEta() <<
" hwPhi = " <<
a.hwPhi() <<
"\n";
49 cout <<
"B: hwPt = " <<
b.hwPt() <<
" hwEta = " <<
b.hwEta() <<
" hwPhi = " <<
b.hwPhi() <<
"\n";
52 if (
a.hwQual() !=
b.hwQual())
54 if (
a.hwIso() !=
b.hwIso())
57 cout <<
"COMPARISON FAILURE: \n";
58 cout <<
"A: hwQual = " <<
a.hwQual() <<
" hwIso = " <<
a.hwIso() <<
"\n";
59 cout <<
"B: hwQual = " <<
b.hwQual() <<
" hwIso = " <<
b.hwIso() <<
"\n";
75 void endJob()
override;
130 cout <<
"L1T Summary for " << tag_ <<
"\n";
131 cout <<
"DEBUG: egCheck: " << egCheck_ <<
"\n";
132 cout <<
"DEBUG: tauCheck: " << tauCheck_ <<
"\n";
133 cout <<
"DEBUG: jetCheck: " << jetCheck_ <<
"\n";
134 cout <<
"DEBUG: sumCheck: " << sumCheck_ <<
"\n";
135 cout <<
"DEBUG: muonCheck: " << muonCheck_ <<
"\n";
136 cout <<
"DEBUG: algCheck: " << algCheck_ <<
"\n";
194 cout <<
"L1TComparison Module output for " << tag_ <<
"\n";
198 iEvent.getByToken(egTokenA_, XTMPA);
200 iEvent.getByToken(egTokenB_, XTMPB);
203 LogWarning(
"MissingProduct") <<
"L1Upgrade e-gamma's not found." << std::endl;
206 if (bxZeroOnly_ && (ibx != 0))
208 if (ibx < XTMPB->getFirstBX())
212 int sizeA = XTMPA->
size(ibx);
213 int sizeB = XTMPB->
size(ibx);
214 if (sizeA != sizeB) {
215 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
217 auto itB = XTMPB->
begin(ibx);
218 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
234 iEvent.getByToken(tauTokenA_, XTMPA);
236 iEvent.getByToken(tauTokenB_, XTMPB);
239 LogWarning(
"MissingProduct") <<
"L1Upgrade tau's not found." << std::endl;
242 if (bxZeroOnly_ && (ibx != 0))
244 if (ibx < XTMPB->getFirstBX())
248 int sizeA = XTMPA->
size(ibx);
249 int sizeB = XTMPB->
size(ibx);
250 if (sizeA != sizeB) {
251 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
253 auto itB = XTMPB->
begin(ibx);
254 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
270 iEvent.getByToken(jetTokenA_, XTMPA);
272 iEvent.getByToken(jetTokenB_, XTMPB);
275 LogWarning(
"MissingProduct") <<
"L1Upgrade jet's not found." << std::endl;
278 if (bxZeroOnly_ && (ibx != 0))
280 if (ibx < XTMPB->getFirstBX())
284 int sizeA = XTMPA->
size(ibx);
285 int sizeB = XTMPB->
size(ibx);
286 if (sizeA != sizeB) {
287 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
289 auto itB = XTMPB->
begin(ibx);
290 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
306 iEvent.getByToken(sumTokenA_, XTMPA);
308 iEvent.getByToken(sumTokenB_, XTMPB);
311 LogWarning(
"MissingProduct") <<
"L1Upgrade sum's not found." << std::endl;
314 if (bxZeroOnly_ && (ibx != 0))
316 if (ibx < XTMPB->getFirstBX())
320 int sizeA = XTMPA->
size(ibx);
321 int sizeB = XTMPB->
size(ibx);
323 if (sizeA != sizeB) {
324 cout <<
"L1T COMPARISON WARNING: sums collections have different sizes for bx = " << ibx <<
"\n";
325 cout <<
"L1T COMPARISON WARNING: sums collections A size = " << sizeA
326 <<
" sums collection B size = " << sizeB <<
"\n";
327 cout <<
"L1T COMPARISON WARNING: known issue because packer has not been udpated for Minbias\n";
329 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
330 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
"\n";
332 for (
auto itB = XTMPB->
begin(ibx); itB != XTMPB->
end(ibx); ++itB) {
333 cout <<
"L1T COMPARISON : EtSum type: B = " << itB->getType() <<
"\n";
342 if (sizeA != sizeB) {
343 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
345 auto itB = XTMPB->
begin(ibx);
346 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
347 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
" vs B = " << itB->getType() <<
"\n";
348 if (itA->getType() != itB->getType()) {
349 cout <<
"L1T COMPARISON FAILURE: Different types .... EtSum type:" << itA->getType() <<
" vs " 350 << itB->getType() <<
"\n";
353 cout <<
"L1T COMPARISON WARNING: (known issue) sum of type " << itA->getType()
354 <<
" when emulated has a dummy value (pending proper emulation)" 359 cout <<
"L1T COMPARISON FAILURE: for type " << itA->getType() <<
"\n";
367 cout <<
"L1T COMPARISON WARNING: (known issue) not checking sum of type " << itA->getType() <<
"\n";
378 iEvent.getByToken(muonTokenA_, XTMPA);
380 iEvent.getByToken(muonTokenB_, XTMPB);
383 LogWarning(
"MissingProduct") <<
"L1Upgrade muon's not found." << std::endl;
386 if (bxZeroOnly_ && (ibx != 0))
388 if (ibx < XTMPB->getFirstBX())
392 int sizeA = XTMPA->
size(ibx);
393 int sizeB = XTMPB->
size(ibx);
394 if (sizeA != sizeB) {
395 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
397 auto itB = XTMPB->
begin(ibx);
398 for (
auto itA = XTMPA->
begin(ibx); itA != XTMPA->
end(ibx); ++itA) {
416 cout <<
"INFO: L1T Comparison for " << tag_ <<
"\n";
417 cout <<
"INFO: count of successful comparison for each type follows:\n";
419 cout <<
"eg: " << egCount_ <<
"\n";
421 cout <<
"tau: " << tauCount_ <<
"\n";
423 cout <<
"jet: " << jetCount_ <<
"\n";
425 cout <<
"sum: " << sumCount_ <<
"\n";
427 cout <<
"muon: " << muonCount_ <<
"\n";
428 cout <<
"INFO: count of failed comparison for each type follows:\n";
430 cout <<
"eg: " << egFails_ <<
"\n";
432 cout <<
"tau: " << tauFails_ <<
"\n";
434 cout <<
"jet: " << jetFails_ <<
"\n";
436 cout <<
"sum: " << sumFails_ <<
"\n";
438 cout <<
"muon: " << muonFails_ <<
"\n";
441 if (egCheck_ && ((egFails_ > 0) || (egCount_ <= 0)))
443 if (tauCheck_ && ((tauFails_ > 0) || (tauCount_ <= 0)))
445 if (jetCheck_ && ((jetFails_ > 0) || (jetCount_ <= 0)))
447 if (sumCheck_ && ((sumFails_ > 0) || (sumCount_ <= 0)))
449 if (muonCheck_ && ((muonFails_ > 0) || (muonCount_ <= 0)))
453 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was FAILURE\n";
455 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was SUCCESS\n";
edm::EDGetTokenT< EGammaBxCollection > egTokenB_
T getParameter(std::string const &) const
edm::EDGetTokenT< MuonBxCollection > muonTokenA_
static bool compare_l1candidate(const L1Candidate &a, const L1Candidate &b, int verbose=1)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< EGammaBxCollection > egTokenA_
L1TComparison(const ParameterSet &)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
const_iterator begin(int bx) const
unsigned size(int bx) const
~L1TComparison() override
void addDefault(ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< MuonBxCollection > muonTokenB_
void analyze(Event const &, EventSetup const &) override
edm::EDGetTokenT< JetBxCollection > jetTokenA_
edm::EDGetTokenT< EtSumBxCollection > sumTokenB_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< EtSumBxCollection > sumTokenA_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > algTokenB_
edm::EDGetTokenT< JetBxCollection > jetTokenB_
const_iterator end(int bx) const
edm::EDGetTokenT< TauBxCollection > tauTokenB_
edm::EDGetTokenT< TauBxCollection > tauTokenA_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > algTokenA_
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Log< level::Warning, false > LogWarning