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 <<
"pt = " << a.
pt() <<
" eta = " << a.
eta() <<
" phi = " << a.
phi() <<
"\n";
33 cout <<
"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 <<
"hwPt = " << a.
hwPt() <<
" hwEta = " << a.
hwEta() <<
" hwPhi = " << a.
hwPhi() <<
"\n";
43 cout <<
"hwPt = " << b.
hwPt() <<
" hwEta = " << b.
hwEta() <<
" hwPhi = " << b.
hwPhi() <<
"\n";
49 cout <<
"COMPARISON FAILURE: \n";
71 virtual void endJob();
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;
190 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
191 if (bxZeroOnly_ && (ibx != 0))
continue;
192 if (ibx < XTMPB->getFirstBX())
continue;
193 if (ibx > XTMPB->getLastBX())
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;
222 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
223 if (bxZeroOnly_ && (ibx != 0))
continue;
224 if (ibx < XTMPB->getFirstBX())
continue;
225 if (ibx > XTMPB->getLastBX())
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;
252 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
253 if (bxZeroOnly_ && (ibx != 0))
continue;
254 if (ibx < XTMPB->getFirstBX())
continue;
255 if (ibx > XTMPB->getLastBX())
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;
282 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
283 if (bxZeroOnly_ && (ibx != 0))
continue;
284 if (ibx < XTMPB->getFirstBX())
continue;
285 if (ibx > XTMPB->getLastBX())
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: known issue because packer has not been udpated for Minbias\n";
295 if (sizeA > sizeB) sizeA = sizeB;
296 if (sizeB > sizeA) sizeB = sizeA;
299 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
301 auto itB=XTMPB->begin(ibx);
302 for (
auto itA=XTMPA->begin(ibx); itA!=XTMPA->end(ibx); ++itA){
303 if (itA->getType() != itB->getType()){
304 cout <<
"L1T COMPARISON FAILURE: EtSum type:" << itA->getType() <<
" vs " << itB->getType() <<
"\n";
306 if (itA->getType() < EtSum::kMissingEt2) {
308 if (fail){
cout <<
"L1T COMPARISON FAILURE: for type " << itA->getType() <<
"\n";}
309 if (! fail) { sumCount_++; }
310 else { sumFails_++; }
312 cout <<
"L1T COMPARISON WARNING: (known issue) not checking sum of type " << itA->getType() <<
"\n";
329 LogWarning(
"MissingProduct") <<
"L1Upgrade muon's not found." << std::endl;
331 for (
int ibx = XTMPA->getFirstBX(); ibx <= XTMPA->getLastBX(); ++ibx) {
332 if (bxZeroOnly_ && (ibx != 0))
continue;
333 if (ibx < XTMPB->getFirstBX())
continue;
334 if (ibx > XTMPB->getLastBX())
continue;
335 int sizeA = XTMPA->size(ibx);
336 int sizeB = XTMPB->size(ibx);
338 cout <<
"L1T COMPARISON FAILURE: collections have different sizes for bx = " << ibx <<
"\n";
340 auto itB=XTMPB->begin(ibx);
341 for (
auto itA=XTMPA->begin(ibx); itA!=XTMPA->end(ibx); ++itA){
344 if (! fail) { muonCount_++; }
345 else { muonFails_++; }
361 cout <<
"INFO: L1TComparison module beginJob called.\n";
366 cout <<
"INFO: L1T Comparison for " << tag_ <<
"\n";
367 cout <<
"INFO: count of successful comparison for each type follows:\n";
368 if (egCheck_)
cout <<
"eg: " << egCount_ <<
"\n";
369 if (tauCheck_)
cout <<
"tau: " << tauCount_ <<
"\n";
370 if (jetCheck_)
cout <<
"jet: " << jetCount_ <<
"\n";
371 if (sumCheck_)
cout <<
"sum: " << sumCount_ <<
"\n";
372 if (muonCheck_)
cout <<
"muon: " << muonCount_ <<
"\n";
373 cout <<
"INFO: count of failed comparison for each type follows:\n";
374 if (egCheck_)
cout <<
"eg: " << egFails_ <<
"\n";
375 if (tauCheck_)
cout <<
"tau: " << tauFails_ <<
"\n";
376 if (jetCheck_)
cout <<
"jet: " << jetFails_ <<
"\n";
377 if (sumCheck_)
cout <<
"sum: " << sumFails_ <<
"\n";
378 if (muonCheck_)
cout <<
"muon: " << muonFails_ <<
"\n";
381 if (egCheck_ && ((egFails_>0) || (egCount_<=0))) fail = 1;
382 if (tauCheck_ && ((tauFails_>0) || (tauCount_<=0))) fail = 1;
383 if (jetCheck_ && ((jetFails_>0) || (jetCount_<=0))) fail = 1;
384 if (sumCheck_ && ((sumFails_>0) || (sumCount_<=0))) fail = 1;
385 if (muonCheck_ && ((muonFails_>0) || (muonCount_<=0))) fail = 1;
388 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was FAILURE\n";
390 cout <<
"SUMMARY: L1T Comparison for " << tag_ <<
" was SUCCESS\n";
T getParameter(std::string const &) const
edm::EDGetTokenT< EGammaBxCollection > egTokenB_
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 &)
virtual double phi() const final
momentum azimuthal angle
void addDefault(ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< MuonBxCollection > muonTokenB_
virtual void beginRun(Run const &, EventSetup const &)
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
edm::EDGetTokenT< JetBxCollection > jetTokenA_
edm::EDGetTokenT< EtSumBxCollection > sumTokenB_
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup 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_
virtual double eta() const final
momentum pseudorapidity
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void analyze(Event const &, EventSetup const &)
virtual void endRun(Run const &, EventSetup const &)
virtual double pt() const final
transverse momentum