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

Constructor & Destructor Documentation

◆ compareMissingEnergySums()

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

Definition at line 36 of file compareMissingEnergySums.h.

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

◆ ~compareMissingEnergySums()

Definition at line 42 of file compareMissingEnergySums.h.

42 {}

Member Function Documentation

◆ doCompare()

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

Definition at line 45 of file compareMissingEnergySums.h.

References mps_fire::i, and dqmiolumiharvest::j.

Referenced by GctErrorAnalyzer::analyze().

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

Member Data Documentation

◆ data_

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

Definition at line 31 of file compareMissingEnergySums.h.

◆ emu_

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

Definition at line 31 of file compareMissingEnergySums.h.

◆ mbxparams_

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

Definition at line 32 of file compareMissingEnergySums.h.