CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
compareMissingEnergySums< T > Class Template Reference

#include <compareMissingEnergySums.h>

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 46 of file compareMissingEnergySums.h.

46  {
47 
48 }

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().

51  {
52 
53  bool errorFlag=0;
54 
55  for(unsigned int i=0; i < data_->size(); i++) {
56  if(data_->at(i).bx() != mbxparams_.GCTTrigBx) continue;
57 
58  for(unsigned int j=0; j < emu_->size(); j++) {
59  if(emu_->at(j).bx() != mbxparams_.EmuTrigBx) continue;
60 
61  if(data_->at(i).overFlow() && emu_->at(j).overFlow()) {
62  //if both overflow bits are set then = match
63  errorFlag_hist_->Fill(0);
64  return errorFlag;
65  }
66 
67  //check that we consider non-zero candidates - if we don't, return (don't fill hist)
68  if(!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == 0 && emu_->at(j).et() == 0) return errorFlag;
69 
70  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()) {
71  //similarly, if the overflow bits are both off but the mag/phi agree = match
72  errorFlag_hist_->Fill(0);
73  return errorFlag;
74  }
75 
76  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()) {
77  //if the overflow bits are both off but only the mag agree = mag match
78  errorFlag_hist_->Fill(1);
79  return errorFlag=1;
80  }
81 
82  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()) {
83  //if the overflow bits are both off but only the phi agree = phi match
84  errorFlag_hist_->Fill(2);
85  return errorFlag=1;
86  }
87 
88  //otherwise it's a total unmatch
89  errorFlag_hist_->Fill(3);
90  errorFlag=1;
91  return errorFlag;
92  }
93  }
94  return errorFlag;
95 }
int i
Definition: DBlmapReader.cc:9
GctErrorAnalyzerMBxInfo mbxparams_
int j
Definition: DBlmapReader.cc:9

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.

template<class T >
GctErrorAnalyzerMBxInfo compareMissingEnergySums< T >::mbxparams_
private

Definition at line 33 of file compareMissingEnergySums.h.