CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
19  data_(data),
20  emu_(emu),
21  mbxparams_(mbxparams)
22 {
23 
24 }
25 
27  //anything need to be destructed?
28 }
29 
30 bool compareBitCounts::doCompare(TH1I *errorFlag_hist_) {
31 
32  bool errorFlag=0;
33 
34  for(unsigned int i=0;i < data_->size(); i++) {
35  //check that we are looking at the triggered Bx in the data
36  if(data_->at(i).bx() != mbxparams_.GCTTrigBx) continue;
37 
38  for(unsigned int j=0; j < emu_->size(); j++) {
39  //now check that we are looking at the corresponding triggered Bx in the emulator
40  if(emu_->at(j).bx() != mbxparams_.EmuTrigBx) continue;
41 
42  for(unsigned int k=0; k < NUM_GCT_RINGS; k++) {
43  //now that we are on the right Bxs for data and emulator, check all the ring bitcounts match
44  if(data_->at(i).bitCount(k) == emu_->at(j).bitCount(k)) {
45  errorFlag_hist_->Fill(0); //i.e. the two match
46  } else {
47  errorFlag_hist_->Fill(1);
48  errorFlag=1;
49  }
50  }
51  }
52  }
53 
54  return errorFlag;
55 
56 }
int i
Definition: DBlmapReader.cc:9
GctErrorAnalyzerMBxInfo mbxparams_
compareBitCounts(const edm::Handle< L1GctHFBitCountsCollection > &data, const edm::Handle< L1GctHFBitCountsCollection > &emu, const GctErrorAnalyzerMBxInfo &mbxparams)
edm::Handle< L1GctHFBitCountsCollection > emu_
int j
Definition: DBlmapReader.cc:9
const unsigned int NUM_GCT_RINGS
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::Handle< L1GctHFBitCountsCollection > data_
bool doCompare(TH1I *errorFlag_hist_)