CMS 3D CMS Logo

Public Member Functions | Private Attributes

compareMissingEnergySums< T > Class Template Reference

#include <compareMissingEnergySums.h>

List of all members.

Public Member Functions

 compareMissingEnergySums (const T &data, const T &emu, const GctErrorAnalyzerMBxInfo &mbxparams)
bool doCompare (TH1I *errorFlag_hist_)
 ~compareMissingEnergySums ()

Private Attributes

T data_
T emu_
GctErrorAnalyzerMBxInfo mbxparams_

Detailed Description

template<class T>
class compareMissingEnergySums< T >

Definition at line 24 of file compareMissingEnergySums.h.


Constructor & Destructor Documentation

template<class T >
compareMissingEnergySums< T >::compareMissingEnergySums ( const T data,
const T emu,
const GctErrorAnalyzerMBxInfo mbxparams 
)

Definition at line 37 of file compareMissingEnergySums.h.

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

}

Definition at line 46 of file compareMissingEnergySums.h.

                                                       {

}

Member Function Documentation

template<class T >
bool compareMissingEnergySums< T >::doCompare ( TH1I *  errorFlag_hist_)

Definition at line 51 of file compareMissingEnergySums.h.

References i, and j.

Referenced by GctErrorAnalyzer::analyze().

                                                                 {

  bool errorFlag=0;
  
  for(unsigned int i=0; i < data_->size(); i++) {
    if(data_->at(i).bx() != mbxparams_.GCTTrigBx) continue;

    for(unsigned int j=0; j < emu_->size(); j++) {
      if(emu_->at(j).bx() != mbxparams_.EmuTrigBx) continue;

      if(data_->at(i).overFlow() && emu_->at(j).overFlow()) {
        //if both overflow bits are set then = match
        errorFlag_hist_->Fill(0);
        return errorFlag;
      }
      
      //check that we consider non-zero candidates - if we don't, return (don't fill hist)
      if(!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == 0 && emu_->at(j).et() == 0) return errorFlag;

      if(!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == emu_->at(j).et() && data_->at(i).phi() == emu_->at(j).phi()) {
      //similarly, if the overflow bits are both off but the mag/phi agree = match
        errorFlag_hist_->Fill(0);
        return errorFlag;
      }

      if(!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == emu_->at(j).et() && data_->at(i).phi() != emu_->at(j).phi()) {
        //if the overflow bits are both off but only the mag agree = mag match
        errorFlag_hist_->Fill(1);
        return errorFlag=1;
      }

      if(!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() != emu_->at(j).et() && data_->at(i).phi() == emu_->at(j).phi()) {
        //if the overflow bits are both off but only the phi agree = phi match
        errorFlag_hist_->Fill(2);
        return errorFlag=1;
      }

      //otherwise it's a total unmatch
      errorFlag_hist_->Fill(3);
      errorFlag=1;
      return errorFlag;
    }  
  }
  return errorFlag;
}

Member Data Documentation

template<class T >
T compareMissingEnergySums< T >::data_ [private]

Definition at line 32 of file compareMissingEnergySums.h.

template<class T >
T compareMissingEnergySums< T >::emu_ [private]

Definition at line 32 of file compareMissingEnergySums.h.

Definition at line 33 of file compareMissingEnergySums.h.