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

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

◆ ~compareTotalEnergySums()

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

Definition at line 43 of file compareTotalEnergySums.h.

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

Member Function Documentation

◆ doCompare()

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

Definition at line 48 of file compareTotalEnergySums.h.

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

Referenced by GctErrorAnalyzer::analyze().

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

Member Data Documentation

◆ data_

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

Definition at line 32 of file compareTotalEnergySums.h.

◆ emu_

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

Definition at line 32 of file compareTotalEnergySums.h.

◆ mbxparams_

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

Definition at line 33 of file compareTotalEnergySums.h.