CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
compareBitCounts.cc
Go to the documentation of this file.
4 
7 
10 
12 
14 
15 #include "FWCore/ServiceRegistry/interface/Service.h" // Framework services
16 #include "CommonTools/UtilAlgos/interface/TFileService.h" // Framework service for histograms
17 
20  const GctErrorAnalyzerMBxInfo &mbxparams)
21  : data_(data), emu_(emu), mbxparams_(mbxparams) {}
22 
24  //anything need to be destructed?
25 }
26 
27 bool compareBitCounts::doCompare(TH1I *errorFlag_hist_) {
28  bool errorFlag = false;
29 
30  for (unsigned int i = 0; i < data_->size(); i++) {
31  //check that we are looking at the triggered Bx in the data
32  if (data_->at(i).bx() != mbxparams_.GCTTrigBx)
33  continue;
34 
35  for (unsigned int j = 0; j < emu_->size(); j++) {
36  //now check that we are looking at the corresponding triggered Bx in the emulator
37  if (emu_->at(j).bx() != mbxparams_.EmuTrigBx)
38  continue;
39 
40  for (unsigned int k = 0; k < NUM_GCT_RINGS; k++) {
41  //now that we are on the right Bxs for data and emulator, check all the ring bitcounts match
42  if (data_->at(i).bitCount(k) == emu_->at(j).bitCount(k)) {
43  errorFlag_hist_->Fill(0); //i.e. the two match
44  } else {
45  errorFlag_hist_->Fill(1);
46  errorFlag = true;
47  }
48  }
49  }
50  }
51 
52  return errorFlag;
53 }
GctErrorAnalyzerMBxInfo mbxparams_
compareBitCounts(const edm::Handle< L1GctHFBitCountsCollection > &data, const edm::Handle< L1GctHFBitCountsCollection > &emu, const GctErrorAnalyzerMBxInfo &mbxparams)
edm::Handle< L1GctHFBitCountsCollection > emu_
const unsigned int NUM_GCT_RINGS
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::Handle< L1GctHFBitCountsCollection > data_
bool doCompare(TH1I *errorFlag_hist_)