Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:13

0001 #include "L1Trigger/L1GctAnalyzer/interface/compareRingSums.h"
0002 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
0003 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCollections.h"
0004 
0005 compareRingSums::compareRingSums(const edm::Handle<L1GctHFRingEtSumsCollection> &data,
0006                                  const edm::Handle<L1GctHFRingEtSumsCollection> &emu,
0007                                  const GctErrorAnalyzerMBxInfo &mbxparams)
0008     : data_(data), emu_(emu), mbxparams_(mbxparams) {}
0009 
0010 compareRingSums::~compareRingSums() {}
0011 
0012 bool compareRingSums::doCompare(TH1I *errorFlag_hist_) {
0013   bool errorFlag = false;
0014 
0015   for (unsigned int i = 0; i < data_->size(); i++) {
0016     //check that the GCT trig bx is being considered
0017     if (data_->at(i).bx() != mbxparams_.GCTTrigBx)
0018       continue;
0019 
0020     for (unsigned int j = 0; j < emu_->size(); j++) {
0021       //now check that the Emu trig bx is being considered
0022       if (emu_->at(j).bx() != mbxparams_.EmuTrigBx)
0023         continue;
0024 
0025       //now loop over each ring and make sure the energy sums match
0026       for (unsigned int k = 0; k < NUM_GCT_RINGS; k++) {
0027         if (data_->at(i).etSum(k) == emu_->at(j).etSum(k)) {
0028           errorFlag_hist_->Fill(0);  //i.e. the two match
0029         } else {
0030           errorFlag_hist_->Fill(1);
0031           errorFlag = true;
0032         }
0033       }
0034     }
0035   }
0036 
0037   return errorFlag;
0038 }