File indexing completed on 2023-03-17 11:11:44
0001 #include "L1Trigger/L1GctAnalyzer/interface/compareBitCounts.h"
0002 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
0003 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCollections.h"
0004
0005 compareBitCounts::compareBitCounts(const edm::Handle<L1GctHFBitCountsCollection> &data,
0006 const edm::Handle<L1GctHFBitCountsCollection> &emu,
0007 const GctErrorAnalyzerMBxInfo &mbxparams)
0008 : data_(data), emu_(emu), mbxparams_(mbxparams) {}
0009
0010 compareBitCounts::~compareBitCounts() {
0011
0012 }
0013
0014 bool compareBitCounts::doCompare(TH1I *errorFlag_hist_) {
0015 bool errorFlag = false;
0016
0017 for (unsigned int i = 0; i < data_->size(); i++) {
0018
0019 if (data_->at(i).bx() != mbxparams_.GCTTrigBx)
0020 continue;
0021
0022 for (unsigned int j = 0; j < emu_->size(); j++) {
0023
0024 if (emu_->at(j).bx() != mbxparams_.EmuTrigBx)
0025 continue;
0026
0027 for (unsigned int k = 0; k < NUM_GCT_RINGS; k++) {
0028
0029 if (data_->at(i).bitCount(k) == emu_->at(j).bitCount(k)) {
0030 errorFlag_hist_->Fill(0);
0031 } else {
0032 errorFlag_hist_->Fill(1);
0033 errorFlag = true;
0034 }
0035 }
0036 }
0037 }
0038
0039 return errorFlag;
0040 }