CMS 3D CMS Logo

compareRingSums.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 
28 }
29 
30 bool compareRingSums::doCompare(TH1I *errorFlag_hist_) {
31 
32  bool errorFlag=0;
33 
34  for(unsigned int i=0; i < data_->size(); i++) {
35  //check that the GCT trig bx is being considered
36  if(data_->at(i).bx() != mbxparams_.GCTTrigBx) continue;
37 
38  for(unsigned int j=0; j < emu_->size(); j++) {
39  //now check that the Emu trig bx is being considered
40  if(emu_->at(j).bx() != mbxparams_.EmuTrigBx) continue;
41 
42  //now loop over each ring and make sure the energy sums match
43  for(unsigned int k=0; k < NUM_GCT_RINGS; k++) {
44  if(data_->at(i).etSum(k) == emu_->at(j).etSum(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
edm::Handle< L1GctHFRingEtSumsCollection > emu_
GctErrorAnalyzerMBxInfo mbxparams_
bool doCompare(TH1I *errorFlag_hist_)
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
const unsigned int NUM_GCT_RINGS
edm::Handle< L1GctHFRingEtSumsCollection > data_
compareRingSums(const edm::Handle< L1GctHFRingEtSumsCollection > &data, const edm::Handle< L1GctHFRingEtSumsCollection > &emu, const GctErrorAnalyzerMBxInfo &mbxparams)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82