ATLAS Offline Software
Loading...
Searching...
No Matches
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;
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
@ Hardware
Definition BaseObject.h:11
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
MatrixReadOut * m_simulation
Definition CMROCompare.h:25
CMAword m_diffOutput
Definition CMROCompare.h:26
MatrixReadOut * m_hardware
Definition CMROCompare.h:24

◆ ~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 {
38} // end-of-CMROCompare::compare()
void compareBody()
void compareHead()
void compareSubh()
void compareFoot()

◆ 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 {
69 m_hardware->topCMABody();
70 m_simulation->topCMABody();
71 for (ubit16 i = 0; i < numberOfBodyRecHard; i++) {
72 ubit16 hardRec = m_hardware->readCMABodyCurrent();
73 ubit16 simuRec = m_simulation->readCMABodyCurrent();
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()
unsigned short int ubit16

◆ 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; }
std::string m_name
Definition BaseObject.h:16

◆ Print()

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22{ return m_tag; }
ObjectType m_tag
Definition BaseObject.h:15

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: