26 if (a.
pt() != b.
pt()) status = 1;
27 if (a.
eta() != b.
eta()) status = 1;
28 if (a.
phi() != b.
phi()) status = 1;
31 cout <<
"COMPARISON FAILURE: \n";
32 cout <<
"A: pt = " << a.
pt() <<
" eta = " << a.
eta() <<
" phi = " << a.
phi() <<
"\n";
33 cout <<
"B: pt = " << b.
pt() <<
" eta = " << b.
eta() <<
" phi = " << b.
phi() <<
"\n";
36 if (a.
hwPt() != b.
hwPt()) status = 1;
41 cout <<
"COMPARISON FAILURE: \n";
42 cout <<
"A: hwPt = " << a.
hwPt() <<
" hwEta = " << a.
hwEta() <<
" hwPhi = " << a.
hwPhi() <<
"\n";
43 cout <<
"B: hwPt = " << b.
hwPt() <<
" hwEta = " << b.
hwEta() <<
" hwPhi = " << b.
hwPhi() <<
"\n";
49 cout <<
"COMPARISON FAILURE: \n";
50 cout <<
"A: hwQual = " << a.
hwQual() <<
" hwIso = " << a.
hwIso() <<
"\n";
51 cout <<
"B: hwQual = " << b.
hwQual() <<
" hwIso = " << b.
hwIso() <<
"\n";
71 void endJob()
override;
134 cout <<
"L1T Summary for " << tag_ <<
"\n";
135 cout <<
"DEBUG: egCheck: " << egCheck_ <<
"\n";
136 cout <<
"DEBUG: tauCheck: " << tauCheck_ <<
"\n";
137 cout <<
"DEBUG: jetCheck: " << jetCheck_ <<
"\n";
138 cout <<
"DEBUG: sumCheck: " << sumCheck_ <<
"\n";
139 cout <<
"DEBUG: muonCheck: " << muonCheck_ <<
"\n";
140 cout <<
"DEBUG: algCheck: " << algCheck_ <<
"\n";
142 if (egCheck_) {egTokenA_ = consumes<EGammaBxCollection> (iConfig.
getParameter<
InputTag>(
"egTagA"));}
143 if (tauCheck_) {tauTokenA_ = consumes<TauBxCollection> (iConfig.
getParameter<
InputTag>(
"tauTagA"));}
144 if (jetCheck_) {jetTokenA_ = consumes<JetBxCollection> (iConfig.
getParameter<
InputTag>(
"jetTagA"));}
145 if (sumCheck_) {sumTokenA_ = consumes<EtSumBxCollection> (iConfig.
getParameter<
InputTag>(
"sumTagA"));}
146 if (muonCheck_) {muonTokenA_ = consumes<MuonBxCollection> (iConfig.
getParameter<
InputTag>(
"muonTagA"));}
147 if (algCheck_) {algTokenA_ = consumes<GlobalAlgBlkBxCollection> (iConfig.
getParameter<
InputTag>(
"algTagA"));}
149 if (egCheck_) {egTokenB_ = consumes<EGammaBxCollection> (iConfig.
getParameter<
InputTag>(
"egTagB"));}
150 if (tauCheck_) {tauTokenB_ = consumes<TauBxCollection> (iConfig.
getParameter<
InputTag>(
"tauTagB"));}
151 if (jetCheck_) {jetTokenB_ = consumes<JetBxCollection> (iConfig.
getParameter<
InputTag>(
"jetTagB"));}
152 if (sumCheck_) {sumTokenB_ = consumes<EtSumBxCollection> (iConfig.
getParameter<
InputTag>(
"sumTagB"));}
153 if (muonCheck_) {muonTokenB_ = consumes<MuonBxCollection> (iConfig.
getParameter<
InputTag>(
"muonTagB"));}
154 if (algCheck_) {algTokenB_ = consumes<GlobalAlgBlkBxCollection> (iConfig.
getParameter<
InputTag>(
"algTagB"));}
179 cout <<
"L1TComparison Module output for " << tag_ <<
"\n";
188 LogWarning(
"MissingProduct") <<
"L1Upgrade e-gamma's not found." << std::endl;
191 if (bxZeroOnly_ && (ibx != 0))
continue;
192 if (ibx < XTMPB->getFirstBX())
continue;
194 int sizeA = XTMPA->
size(ibx);
195 int sizeB = XTMPB->
size(ibx);
197 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
199 auto itB=XTMPB->
begin(ibx);
200 for (
auto itA=XTMPA->
begin(ibx); itA!=XTMPA->
end(ibx); ++itA){
203 if (! fail) { egCount_++; }
220 LogWarning(
"MissingProduct") <<
"L1Upgrade tau's not found." << std::endl;
223 if (bxZeroOnly_ && (ibx != 0))
continue;
224 if (ibx < XTMPB->getFirstBX())
continue;
226 int sizeA = XTMPA->
size(ibx);
227 int sizeB = XTMPB->
size(ibx);
229 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
231 auto itB=XTMPB->
begin(ibx);
232 for (
auto itA=XTMPA->
begin(ibx); itA!=XTMPA->
end(ibx); ++itA){
235 if (! fail) { tauCount_++; }
236 else { tauFails_++; }
250 LogWarning(
"MissingProduct") <<
"L1Upgrade jet's not found." << std::endl;
253 if (bxZeroOnly_ && (ibx != 0))
continue;
254 if (ibx < XTMPB->getFirstBX())
continue;
256 int sizeA = XTMPA->
size(ibx);
257 int sizeB = XTMPB->
size(ibx);
259 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
261 auto itB=XTMPB->
begin(ibx);
262 for (
auto itA=XTMPA->
begin(ibx); itA!=XTMPA->
end(ibx); ++itA){
265 if (! fail) { jetCount_++; }
266 else { jetFails_++; }
280 LogWarning(
"MissingProduct") <<
"L1Upgrade sum's not found." << std::endl;
283 if (bxZeroOnly_ && (ibx != 0))
continue;
284 if (ibx < XTMPB->getFirstBX())
continue;
286 int sizeA = XTMPA->
size(ibx);
287 int sizeB = XTMPB->
size(ibx);
290 cout <<
"L1T COMPARISON WARNING: sums collections have different sizes for bx = " << ibx <<
"\n";
291 cout <<
"L1T COMPARISON WARNING: sums collections A size = " << sizeA <<
" sums collection B size = " << sizeB <<
"\n";
292 cout <<
"L1T COMPARISON WARNING: known issue because packer has not been udpated for Minbias\n";
294 for (
auto itA=XTMPA->
begin(ibx); itA!=XTMPA->
end(ibx); ++itA){
295 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
"\n";
297 for (
auto itB=XTMPB->
begin(ibx); itB!=XTMPB->
end(ibx); ++itB){
298 cout <<
"L1T COMPARISON : EtSum type: B = " << itB->getType() <<
"\n";
302 if (sizeA > sizeB) sizeA = sizeB;
303 if (sizeB > sizeA) sizeB = sizeA;
306 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
308 auto itB=XTMPB->
begin(ibx);
309 for (
auto itA=XTMPA->
begin(ibx); itA!=XTMPA->
end(ibx); ++itA){
310 cout <<
"L1T COMPARISON : EtSum type: A = " << itA->getType() <<
" vs B = " << itB->getType() <<
"\n";
311 if (itA->getType() != itB->getType()){
312 cout <<
"L1T COMPARISON FAILURE: Different types .... EtSum type:" << itA->getType() <<
" vs " << itB->getType() <<
"\n";
315 cout <<
"L1T COMPARISON WARNING: (known issue) sum of type " << itA->getType() <<
" when emulated has a dummy value (pending proper emulation)" <<
"\n";
318 if (fail){
cout <<
"L1T COMPARISON FAILURE: for type " << itA->getType() <<
"\n";}
319 if (! fail) { sumCount_++; }
320 else { sumFails_++; }
322 cout <<
"L1T COMPARISON WARNING: (known issue) not checking sum of type " << itA->getType() <<
"\n";
339 LogWarning(
"MissingProduct") <<
"L1Upgrade muon's not found." << std::endl;
342 if (bxZeroOnly_ && (ibx != 0))
continue;
343 if (ibx < XTMPB->getFirstBX())
continue;
345 int sizeA = XTMPA->
size(ibx);
346 int sizeB = XTMPB->
size(ibx);
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){
354 if (! fail) { muonCount_++; }
355 else { muonFails_++; }
371 cout <<
"INFO: L1TComparison module beginJob called.\n";
376 cout <<
"INFO: L1T Comparison for " << tag_ <<
"\n";
377 cout <<
"INFO: count of successful comparison for each type follows:\n";
378 if (egCheck_)
cout <<
"eg: " << egCount_ <<
"\n";
379 if (tauCheck_)
cout <<
"tau: " << tauCount_ <<
"\n";
380 if (jetCheck_)
cout <<
"jet: " << jetCount_ <<
"\n";
381 if (sumCheck_)
cout <<
"sum: " << sumCount_ <<
"\n";
382 if (muonCheck_)
cout <<
"muon: " << muonCount_ <<
"\n";
383 cout <<
"INFO: count of failed comparison for each type follows:\n";
384 if (egCheck_)
cout <<
"eg: " << egFails_ <<
"\n";
385 if (tauCheck_)
cout <<
"tau: " << tauFails_ <<
"\n";
386 if (jetCheck_)
cout <<
"jet: " << jetFails_ <<
"\n";
387 if (sumCheck_)
cout <<
"sum: " << sumFails_ <<
"\n";
388 if (muonCheck_)
cout <<
"muon: " << muonFails_ <<
"\n";
391 if (egCheck_ && ((egFails_>0) || (egCount_<=0))) fail = 1;
392 if (tauCheck_ && ((tauFails_>0) || (tauCount_<=0))) fail = 1;
393 if (jetCheck_ && ((jetFails_>0) || (jetCount_<=0))) fail = 1;
394 if (sumCheck_ && ((sumFails_>0) || (sumCount_<=0))) fail = 1;
395 if (muonCheck_ && ((muonFails_>0) || (muonCount_<=0))) fail = 1;
398 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was FAILURE\n";
400 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was SUCCESS\n";
const_iterator end(int bx) const
T getParameter(std::string const &) const
edm::EDGetTokenT< EGammaBxCollection > egTokenB_
unsigned size(int bx) const
double eta() const final
momentum pseudorapidity
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
edm::EDGetTokenT< EGammaBxCollection > egTokenA_
L1TComparison(const ParameterSet &)
double pt() const final
transverse momentum
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
~L1TComparison() override
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
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)
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)
const_iterator begin(int bx) const
double phi() const final
momentum azimuthal angle
void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &) override