CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
compareTotalEnergySums< T > Class Template Reference

#include <compareTotalEnergySums.h>

Public Member Functions

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

Private Attributes

T data_
 
T emu_
 
GctErrorAnalyzerMBxInfo mbxparams_
 

Detailed Description

template<class T>
class compareTotalEnergySums< T >

Definition at line 23 of file compareTotalEnergySums.h.

Constructor & Destructor Documentation

◆ compareTotalEnergySums()

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

Definition at line 36 of file compareTotalEnergySums.h.

37  : data_(data), emu_(emu), mbxparams_(mbxparams) {
38  //std::cout << "initialising..." << std::endl;
39 }
GctErrorAnalyzerMBxInfo mbxparams_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ ~compareTotalEnergySums()

template<class T >
compareTotalEnergySums< T >::~compareTotalEnergySums ( )

Definition at line 42 of file compareTotalEnergySums.h.

42  {
43  //anything need to be destructed?
44 }

Member Function Documentation

◆ doCompare()

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

Definition at line 47 of file compareTotalEnergySums.h.

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

Referenced by GctErrorAnalyzer::analyze().

47  {
48  bool errorFlag = false;
49 
50  for (unsigned int i = 0; i < data_->size(); i++) {
51  //check the GCTTrigBx is the one being considered
52  if (data_->at(i).bx() != mbxparams_.GCTTrigBx)
53  continue;
54 
55  for (unsigned int j = 0; j < emu_->size(); j++) {
56  //check the EmuTrigBx is the one being considered
57  if (emu_->at(j).bx() != mbxparams_.EmuTrigBx)
58  continue;
59 
60  //now check if both overflow bits (from the trigbx) are set
61  if (data_->at(i).overFlow() && emu_->at(j).overFlow()) {
62  //if the overflow bits in data and emulator are set, that's enough to call a match
63  errorFlag_hist_->Fill(0);
64  return errorFlag;
65  }
66 
67  //check if both over flow bits are not set and if both values are zero, and if so return the errorFlag
68  //without making any modifications (a zero et match doesn't mean so much).
69  if (!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == 0 && emu_->at(j).et() == 0)
70  return errorFlag;
71 
72  //now check if the values correspond, again with both overflow bits not set
73  if (!data_->at(i).overFlow() && !emu_->at(j).overFlow() && data_->at(i).et() == emu_->at(j).et()) {
74  //if they are both explicitly not set, and the resulting energies are identical, that's a match
75  errorFlag_hist_->Fill(0);
76  return errorFlag;
77  }
78 
79  //otherwise, it's a fail
80  errorFlag_hist_->Fill(1);
81  errorFlag = true;
82  return errorFlag;
83  }
84  }
85  return errorFlag;
86 }
GctErrorAnalyzerMBxInfo mbxparams_

Member Data Documentation

◆ data_

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

Definition at line 31 of file compareTotalEnergySums.h.

◆ emu_

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

Definition at line 31 of file compareTotalEnergySums.h.

◆ mbxparams_

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

Definition at line 32 of file compareTotalEnergySums.h.