ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CMROCompare Class Reference

#include <CMROCompare.h>

Inheritance diagram for CMROCompare:
Collaboration diagram for CMROCompare:

Public Member Functions

 CMROCompare (MatrixReadOut *h, MatrixReadOut *s)
 
 ~CMROCompare ()
 
void compare ()
 
void compareHead ()
 
void compareSubh ()
 
void compareBody ()
 
void compareFoot ()
 
CMAword diffOut ()
 
ObjectType tag () const
 
const std::string & name () const
 
virtual void Print (std::ostream &, bool) const
 

Private Attributes

MatrixReadOutm_hardware
 
MatrixReadOutm_simulation
 
CMAword m_diffOutput
 
ObjectType m_tag
 
std::string m_name
 

Detailed Description

Definition at line 12 of file CMROCompare.h.

Constructor & Destructor Documentation

◆ CMROCompare()

CMROCompare::CMROCompare ( MatrixReadOut h,
MatrixReadOut s 
)

Definition at line 13 of file CMROCompare.cxx.

13  : BaseObject(Hardware, "CMROCompare") {
14  m_hardware = h;
15  m_simulation = s;
16  m_diffOutput = 0;
17  //
18  // m_diffOutput= 0 no differences
19  // 1 1 1 1 1 1 1 1 1 1
20  // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
21  // | | | | | * * * * * --- number of record in Body that shows the first discrepancy
22  // | | | | --------------- at least one Body record is different
23  // | | | ----------------- number of Body records is different
24  // | | ------------------- Footer record is different
25  // | --------------------- SubHeader record is different
26  // ----------------------- Header record is different
27  //
28  compare();
29 } // end-of-CMROCompare

◆ ~CMROCompare()

CMROCompare::~CMROCompare ( )

Definition at line 31 of file CMROCompare.cxx.

31 {} // distructor

Member Function Documentation

◆ compare()

void CMROCompare::compare ( )

Definition at line 33 of file CMROCompare.cxx.

33  {
34  compareHead();
35  compareSubh();
36  compareBody();
37  compareFoot();
38 } // end-of-CMROCompare::compare()

◆ compareBody()

void CMROCompare::compareBody ( )

Definition at line 52 of file CMROCompare.cxx.

52  {
53  bool FragmentOK = true;
54  bool firstDiff = true;
55 
56  cout << " ora stampo la matrice hardware" << endl
57  << m_hardware << endl
58  << " ora stampo la matrice simulata" << endl
59  << m_simulation << endl;
60 
61  ubit16 numberOfBodyRecHard = m_hardware->numberOfBodyWords();
62  ubit16 numberOfBodyRecSimu = m_simulation->numberOfBodyWords();
63  if (numberOfBodyRecHard != numberOfBodyRecSimu) {
64  FragmentOK = false;
65  m_diffOutput += 1000000;
66  cout << " CMROCompare: different number of body words " << endl
67  << " hardware: " << numberOfBodyRecHard << " simulation: " << numberOfBodyRecSimu << endl;
68  } else {
71  for (ubit16 i = 0; i < numberOfBodyRecHard; i++) {
74  if (hardRec != simuRec) {
75  FragmentOK = false;
76  cout << " CMROCompare: different body words "
77  << " hardware: " << std::hex << hardRec << std::dec << " simulation: " << std::hex << simuRec << std::dec
78  << std::endl;
79  if (firstDiff) {
80  if (i < 50000)
81  m_diffOutput += 100000 + (i + 1);
82  else
83  m_diffOutput += 150000;
84  firstDiff = false;
85  }
86  } // end-of-if
87  } // end-of-for
88  } // end-of-if(number...
89  if (FragmentOK) {
90  cout << " CMROCompare: Fragment OK " << endl;
91  } else {
92  cout << " CMROCompare: Fragment NOT OK " << endl;
93  } // end-of-if(FragmentOK)
94 } // end-of-CMROCompare::compareBody()

◆ compareFoot()

void CMROCompare::compareFoot ( )

Definition at line 96 of file CMROCompare.cxx.

96  {
97  ubit16 hardFooter = m_hardware->readFooter();
98  ubit16 simuFooter = m_simulation->readFooter();
99  if (hardFooter != simuFooter) m_diffOutput += 10000000;
100 } // end-of-compareFoot

◆ compareHead()

void CMROCompare::compareHead ( )

Definition at line 40 of file CMROCompare.cxx.

40  {
41  ubit16 hardHeader = m_hardware->readHeader();
42  ubit16 simuHeader = m_simulation->readHeader();
43  if (hardHeader != simuHeader) m_diffOutput += 1000000000;
44 } // end-of-compareHead

◆ compareSubh()

void CMROCompare::compareSubh ( )

Definition at line 46 of file CMROCompare.cxx.

46  {
47  ubit16 hardSubHeader = m_hardware->readSubHeader();
48  ubit16 simuSubHeader = m_simulation->readSubHeader();
49  if (hardSubHeader != simuSubHeader) m_diffOutput += 100000000;
50 } // end-of-compareSubh

◆ diffOut()

CMAword CMROCompare::diffOut ( )
inline

Definition at line 21 of file CMROCompare.h.

21 { return m_diffOutput; };

◆ name()

const std::string& BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23 { return m_name; }

◆ Print()

virtual void BaseObject::Print ( std::ostream &  ,
bool   
) const
inlinevirtualinherited

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22 { return m_tag; }

Member Data Documentation

◆ m_diffOutput

CMAword CMROCompare::m_diffOutput
private

Definition at line 26 of file CMROCompare.h.

◆ m_hardware

MatrixReadOut* CMROCompare::m_hardware
private

Definition at line 24 of file CMROCompare.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_simulation

MatrixReadOut* CMROCompare::m_simulation
private

Definition at line 25 of file CMROCompare.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.


The documentation for this class was generated from the following files:
MatrixReadOut::readFooter
ubit16 readFooter()
Definition: MatrixReadOut.cxx:661
CMROCompare::compareBody
void compareBody()
Definition: CMROCompare.cxx:52
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CMROCompare::compareFoot
void compareFoot()
Definition: CMROCompare.cxx:96
CMROCompare::m_diffOutput
CMAword m_diffOutput
Definition: CMROCompare.h:26
MatrixReadOut::readSubHeader
ubit16 readSubHeader()
Definition: MatrixReadOut.cxx:659
BaseObject::m_name
std::string m_name
Definition: BaseObject.h:16
CMROCompare::compareSubh
void compareSubh()
Definition: CMROCompare.cxx:46
MatrixReadOut::readHeader
ubit16 readHeader()
Definition: MatrixReadOut.cxx:657
CMROCompare::m_hardware
MatrixReadOut * m_hardware
Definition: CMROCompare.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:85
extractSporadic.h
list h
Definition: extractSporadic.py:97
CMROCompare::compare
void compare()
Definition: CMROCompare.cxx:33
MatrixReadOut::topCMABody
void topCMABody()
Definition: MatrixReadOut.cxx:718
MatrixReadOut::readCMABodyCurrent
ubit16 readCMABodyCurrent()
Definition: MatrixReadOut.cxx:663
Hardware
@ Hardware
Definition: BaseObject.h:11
BaseObject::BaseObject
BaseObject(ObjectType, const std::string &)
Definition: BaseObject.cxx:7
MatrixReadOut::numberOfBodyWords
ubit16 numberOfBodyWords()
Definition: MatrixReadOut.h:49
BaseObject::m_tag
ObjectType m_tag
Definition: BaseObject.h:15
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
CMROCompare::m_simulation
MatrixReadOut * m_simulation
Definition: CMROCompare.h:25
CMROCompare::compareHead
void compareHead()
Definition: CMROCompare.cxx:40