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";
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";
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;
135 cout <<
"L1T Summary for " << tag_ <<
"\n";
136 cout <<
"DEBUG: egCheck: " << egCheck_ <<
"\n";
137 cout <<
"DEBUG: tauCheck: " << tauCheck_ <<
"\n";
138 cout <<
"DEBUG: jetCheck: " << jetCheck_ <<
"\n";
139 cout <<
"DEBUG: sumCheck: " << sumCheck_ <<
"\n";
140 cout <<
"DEBUG: muonCheck: " << muonCheck_ <<
"\n";
141 cout <<
"DEBUG: algCheck: " << algCheck_ <<
"\n";
199 cout <<
"L1TComparison Module output for " << tag_ <<
"\n";
208 LogWarning(
"MissingProduct") <<
"L1Upgrade e-gamma's not found." << std::endl;
210 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
211 if (bxZeroOnly_ && (ibx != 0))
213 if (ibx < XTMPB->getFirstBX())
215 if (ibx > XTMPB->getLastBX())
217 int sizeA = XTMPA->size(ibx);
218 int sizeB = XTMPB->size(ibx);
219 if (sizeA != sizeB) {
220 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
222 auto itB = XTMPB->begin(ibx);
223 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
244 LogWarning(
"MissingProduct") <<
"L1Upgrade tau's not found." << std::endl;
246 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
247 if (bxZeroOnly_ && (ibx != 0))
249 if (ibx < XTMPB->getFirstBX())
251 if (ibx > XTMPB->getLastBX())
253 int sizeA = XTMPA->size(ibx);
254 int sizeB = XTMPB->size(ibx);
255 if (sizeA != sizeB) {
256 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
258 auto itB = XTMPB->begin(ibx);
259 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
280 LogWarning(
"MissingProduct") <<
"L1Upgrade jet's not found." << std::endl;
282 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
283 if (bxZeroOnly_ && (ibx != 0))
285 if (ibx < XTMPB->getFirstBX())
287 if (ibx > XTMPB->getLastBX())
289 int sizeA = XTMPA->size(ibx);
290 int sizeB = XTMPB->size(ibx);
291 if (sizeA != sizeB) {
292 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
294 auto itB = XTMPB->begin(ibx);
295 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
316 LogWarning(
"MissingProduct") <<
"L1Upgrade sum's not found." << std::endl;
318 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
319 if (bxZeroOnly_ && (ibx != 0))
321 if (ibx < XTMPB->getFirstBX())
323 if (ibx > XTMPB->getLastBX())
325 int sizeA = XTMPA->size(ibx);
326 int sizeB = XTMPB->size(ibx);
328 if (sizeA != sizeB) {
329 cout <<
"L1T COMPARISON WARNING: sums collections have different sizes for bx = " << ibx <<
"\n";
330 cout <<
"L1T COMPARISON WARNING: sums collections A size = " << sizeA
331 <<
" sums collection B size = " << sizeB <<
"\n";
332 cout <<
"L1T COMPARISON WARNING: known issue because packer has not been udpated for Minbias\n";
334 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
335 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
"\n";
337 for (
auto itB = XTMPB->begin(ibx); itB != XTMPB->end(ibx); ++itB) {
338 cout <<
"L1T COMPARISON : EtSum type: B = " << itB->getType() <<
"\n";
347 if (sizeA != sizeB) {
348 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
350 auto itB = XTMPB->begin(ibx);
351 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
352 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
" vs B = " << itB->getType() <<
"\n";
353 if (itA->getType() != itB->getType()) {
354 cout <<
"L1T COMPARISON FAILURE: Different types .... EtSum type:" << itA->getType() <<
" vs "
355 << itB->getType() <<
"\n";
358 cout <<
"L1T COMPARISON WARNING: (known issue) sum of type " << itA->getType()
359 <<
" when emulated has a dummy value (pending proper emulation)"
364 cout <<
"L1T COMPARISON FAILURE: for type " << itA->getType() <<
"\n";
372 cout <<
"L1T COMPARISON WARNING: (known issue) not checking sum of type " << itA->getType() <<
"\n";
388 LogWarning(
"MissingProduct") <<
"L1Upgrade muon's not found." << std::endl;
390 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
391 if (bxZeroOnly_ && (ibx != 0))
393 if (ibx < XTMPB->getFirstBX())
395 if (ibx > XTMPB->getLastBX())
397 int sizeA = XTMPA->size(ibx);
398 int sizeB = XTMPB->size(ibx);
399 if (sizeA != sizeB) {
400 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
402 auto itB = XTMPB->begin(ibx);
403 for (
auto itA = XTMPA->begin(ibx); itA != XTMPA->end(ibx); ++itA) {
421 cout <<
"INFO: L1T Comparison for " << tag_ <<
"\n";
422 cout <<
"INFO: count of successful comparison for each type follows:\n";
424 cout <<
"eg: " << egCount_ <<
"\n";
426 cout <<
"tau: " << tauCount_ <<
"\n";
428 cout <<
"jet: " << jetCount_ <<
"\n";
430 cout <<
"sum: " << sumCount_ <<
"\n";
432 cout <<
"muon: " << muonCount_ <<
"\n";
433 cout <<
"INFO: count of failed comparison for each type follows:\n";
435 cout <<
"eg: " << egFails_ <<
"\n";
437 cout <<
"tau: " << tauFails_ <<
"\n";
439 cout <<
"jet: " << jetFails_ <<
"\n";
441 cout <<
"sum: " << sumFails_ <<
"\n";
443 cout <<
"muon: " << muonFails_ <<
"\n";
446 if (egCheck_ && ((egFails_ > 0) || (egCount_ <= 0)))
448 if (tauCheck_ && ((tauFails_ > 0) || (tauCount_ <= 0)))
450 if (jetCheck_ && ((jetFails_ > 0) || (jetCount_ <= 0)))
452 if (sumCheck_ && ((sumFails_ > 0) || (sumCount_ <= 0)))
454 if (muonCheck_ && ((muonFails_ > 0) || (muonCount_ <= 0)))
458 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was FAILURE\n";
460 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was SUCCESS\n";
edm::EDGetTokenT< EGammaBxCollection > egTokenB_
double pt() const final
transverse momentum
void beginRun(Run const &, EventSetup const &) override
edm::EDGetTokenT< MuonBxCollection > muonTokenA_
static bool compare_l1candidate(const L1Candidate &a, const L1Candidate &b, int verbose=1)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< EGammaBxCollection > egTokenA_
L1TComparison(const ParameterSet &)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
~L1TComparison() override
void addDefault(ParameterSetDescription const &psetDescription)
static constexpr int verbose
edm::EDGetTokenT< MuonBxCollection > muonTokenB_
void analyze(Event const &, EventSetup const &) override
void endRun(Run const &, EventSetup const &) override
edm::EDGetTokenT< JetBxCollection > jetTokenA_
void endLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
edm::EDGetTokenT< EtSumBxCollection > sumTokenB_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
edm::EDGetTokenT< EtSumBxCollection > sumTokenA_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > algTokenB_
edm::EDGetTokenT< JetBxCollection > jetTokenB_
edm::EDGetTokenT< TauBxCollection > tauTokenB_
edm::EDGetTokenT< TauBxCollection > tauTokenA_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > algTokenA_
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Log< level::Warning, false > LogWarning
double phi() const final
momentum azimuthal angle
void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
double eta() const final
momentum pseudorapidity