CMS 3D CMS Logo

Public Member Functions | Private Attributes

compareBitCounts Class Reference

#include <compareBitCounts.h>

List of all members.

Public Member Functions

 compareBitCounts (const edm::Handle< L1GctHFBitCountsCollection > &data, const edm::Handle< L1GctHFBitCountsCollection > &emu, const GctErrorAnalyzerMBxInfo &mbxparams)
bool doCompare (TH1I *errorFlag_hist_)
 ~compareBitCounts ()

Private Attributes

edm::Handle
< L1GctHFBitCountsCollection
data_
edm::Handle
< L1GctHFBitCountsCollection
emu_
GctErrorAnalyzerMBxInfo mbxparams_

Detailed Description

Definition at line 23 of file compareBitCounts.h.


Constructor & Destructor Documentation

compareBitCounts::compareBitCounts ( const edm::Handle< L1GctHFBitCountsCollection > &  data,
const edm::Handle< L1GctHFBitCountsCollection > &  emu,
const GctErrorAnalyzerMBxInfo mbxparams 
)

Definition at line 18 of file compareBitCounts.cc.

                                                                                                                                                                                :
  data_(data),
  emu_(emu),
  mbxparams_(mbxparams)
{

}
compareBitCounts::~compareBitCounts ( )

Definition at line 26 of file compareBitCounts.cc.

                                    {
  //anything need to be destructed?
}

Member Function Documentation

bool compareBitCounts::doCompare ( TH1I *  errorFlag_hist_)

Definition at line 30 of file compareBitCounts.cc.

References data_, emu_, GctErrorAnalyzerMBxInfo::EmuTrigBx, GctErrorAnalyzerMBxInfo::GCTTrigBx, i, j, gen::k, mbxparams_, and NUM_GCT_RINGS.

Referenced by GctErrorAnalyzer::analyze().

                                                      {

  bool errorFlag=0;
  
  for(unsigned int i=0;i < data_->size(); i++) {
    //check that we are looking at the triggered Bx in the data
    if(data_->at(i).bx() != mbxparams_.GCTTrigBx) continue;

    for(unsigned int j=0; j < emu_->size(); j++) {
      //now check that we are looking at the corresponding triggered Bx in the emulator
      if(emu_->at(j).bx() != mbxparams_.EmuTrigBx) continue;
      
      for(unsigned int k=0; k < NUM_GCT_RINGS; k++) {
        //now that we are on the right Bxs for data and emulator, check all the ring bitcounts match
        if(data_->at(i).bitCount(k) == emu_->at(j).bitCount(k)) {
          errorFlag_hist_->Fill(0); //i.e. the two match
        } else {
          errorFlag_hist_->Fill(1);
          errorFlag=1;
        }
      }
    }
  }
  
  return errorFlag;
  
}

Member Data Documentation

Definition at line 31 of file compareBitCounts.h.

Referenced by doCompare().

Definition at line 31 of file compareBitCounts.h.

Referenced by doCompare().

Definition at line 32 of file compareBitCounts.h.

Referenced by doCompare().