CMS 3D CMS Logo

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

40  : data_(data), emu_(emu), mbxparams_(mbxparams) {}
GctErrorAnalyzerMBxInfo mbxparams_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

Definition at line 43 of file compareMissingEnergySums.h.

43 {}

Member Function Documentation

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

Definition at line 46 of file compareMissingEnergySums.h.

References compareMissingEnergySums< T >::data_, compareMissingEnergySums< T >::emu_, GctErrorAnalyzerMBxInfo::EmuTrigBx, GctErrorAnalyzerMBxInfo::GCTTrigBx, mps_fire::i, dqmiolumiharvest::j, and compareMissingEnergySums< T >::mbxparams_.

Referenced by GctErrorAnalyzer::analyze().

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

Member Data Documentation

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

Definition at line 32 of file compareMissingEnergySums.h.

Referenced by compareMissingEnergySums< T >::doCompare().

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

Definition at line 32 of file compareMissingEnergySums.h.

Referenced by compareMissingEnergySums< T >::doCompare().

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

Definition at line 33 of file compareMissingEnergySums.h.

Referenced by compareMissingEnergySums< T >::doCompare().