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
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

data_
 
emu_
 
GctErrorAnalyzerMBxInfo mbxparams_
 

Detailed Description

template<class T>
class compareTotalEnergySums< T >

Definition at line 24 of file compareTotalEnergySums.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file compareTotalEnergySums.h.

37  :
38  data_(data),
39  emu_(emu),
40  mbxparams_(mbxparams)
41 {
42  //std::cout << "initialising..." << std::endl;
43 }
GctErrorAnalyzerMBxInfo mbxparams_
template<class T >
compareTotalEnergySums< T >::~compareTotalEnergySums ( )

Definition at line 46 of file compareTotalEnergySums.h.

46  {
47  //anything need to be destructed?
48 }

Member Function Documentation

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

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

Member Data Documentation

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

Definition at line 32 of file compareTotalEnergySums.h.

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

Definition at line 32 of file compareTotalEnergySums.h.

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

Definition at line 33 of file compareTotalEnergySums.h.