#include "ReadoutList.h" //#include "../Mapping/Mapping.h" #include "Acl.h" #include int main( int argc, char** argv ) { ReadoutList *rl = new ReadoutList(); Acl *acl = 0; Mapping pm; rl->fillFCFS(0x123); rl->fillFCFS(1, 11, 5, 0); rl->fillFCFS(1, 11, 5, 1); rl->finalize(); // Dump data to screen cerr.setf( ios::hex, ios::basefield ); for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << endl; } // once more cout << "and again" << endl; rl->reset(); for ( int32_t i = 15; i >= 0; i-- ) rl->fill(1, 8, 6, (uint32_t)i); rl->finalize(); for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << endl; } //cout << "now get Acl" << endl; acl = rl->getAcl(); uint32_t* result = 0; result = acl->get(); // Dump data to screen cerr.setf( ios::hex, ios::basefield ); for ( uint32_t i = 0; i < acl->size(); i++ ) { //cerr << setw(3) << "0x" << i << ": 0x" << result[i] << endl; } // once more cout << "makeReadoutListFromAclHwAdd()" << endl; //cout << "makeReadoutListFromAclHLT(1)" << endl; rl->makeReadoutListFromAclHwAdd(); //rl->makeReadoutListFromAclHLT(1); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << endl; } // once more acl->reset(); acl->fill(1, 11, 6, 0x1234); acl->fill(1, 11, 7, 0x5678); for ( uint32_t i = 8; i < 16; i++ ) acl->fill(1, 11, 5, i, true); //acl->finalize(); for ( uint32_t i = 0; i < acl->size(); i++ ) { cerr << setw(3) << "0x" << i << ": 0x" << acl->at(i) << endl; } cout << "makeReadoutListFromAclHLT(0)" << endl; cout << "Center Pad of row 29 is " << pm.GetCenterPad(29, 0) << endl; rl->reset(); for (int32_t i=0; i<86; i++) rl->fill(pm.GetHWAddress(29, i, 0)); // row 29 is fully in RCU 0 rl->makeReadoutListFromAclHLT(0); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; else cout << "Readout List has size " << rl->size() << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 0) << ")" << endl; } return 1; cout << "makeReadoutListFromAclHLT(0)" << endl; cout << "Center Pad of row 30 is " << pm.GetCenterPad(30, 0) << endl; rl->reset(); for (int32_t i=0; i<86; i++) { rl->fill(pm.GetHWAddress(30, i, 0)); // row 30 is in RCUs 0 and 1 !!!! } rl->makeReadoutListFromAclHLT(0); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 0) << ")" << endl; } cout << "makeReadoutListFromAclHLT(1)" << endl; cout << "Center Pad of row 30 is " << pm.GetCenterPad(30, 1) << endl; rl->reset(); for (int32_t i=0; i<86; i++) { rl->fill(pm.GetHWAddress(30, i, 1)); // row 30 is in RCUs 0 and 1 !!!! } rl->makeReadoutListFromAclHLT(1); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 1) << ")" << endl; } cout << "makeReadoutListFromAclV21(0)" << endl; cout << "Center Pad of row 29 is " << pm.GetCenterPad(29, 0) << endl; rl->reset(); for (int32_t i=0; i<86; i++) { rl->fill(pm.GetHWAddress(29, i, 0)); // row 29 is fully in RCU 0 } rl->makeReadoutListFromAclV21(0); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; else cout << "Readout List has size " << rl->size() << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 0) << ")" << endl; } cout << "makeReadoutListFromAclV21(0)" << endl; cout << "Center Pad of row 30 is " << pm.GetCenterPad(30, 0) << endl; rl->reset(); for (int32_t i=0; i<86; i++) { rl->fill(pm.GetHWAddress(30, i, 0)); // row 30 is in RCUs 0 and 1 !!!! } rl->makeReadoutListFromAclV21(0); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 0) << ")" << endl; } cout << "makeReadoutListFromAclV21(1)" << endl; cout << "Center Pad of row 30 is " << pm.GetCenterPad(30, 1) << endl; rl->reset(); for (int32_t i=0; i<86; i++) { rl->fill(pm.GetHWAddress(30, i, 1)); // row 30 is in RCUs 0 and 1 !!!! } rl->makeReadoutListFromAclV21(1); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 1) << ")" << endl; } cout << "makeReadoutListFromAclV21(1)" << endl; cout << "Center Pad of row 62 is " << pm.GetCenterPad(62, 1) << endl; rl->reset(); for (int32_t i=0; i<108; i++) { rl->fill(pm.GetHWAddress(62, i, 1)); // row 62 is in RCU 1 and has 5 more pads on branch A } rl->makeReadoutListFromAclV21(1); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cerr.setf( ios::dec ); cerr << i << ": 0x"; cerr.setf( ios::hex, ios::basefield ); cerr << setw(3) << rl->at(i); cerr.setf( ios::dec ); cerr << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 1) << ")" << endl; } cout << "makeReadoutListFromAclV21(1)" << endl; rl->reset(); for (int32_t i=0; i<108; i++) { rl->fill(pm.GetHWAddress(62, i, 1)); // row 62 is in RCU 1 and has 5 more pads on branch A } rl->makeReadoutListFromAclV21(1); rl->finalize(); if (rl->size() <=0) cout << "Readout List is empty" << endl; for ( uint32_t i = 0; i < rl->size(); i++ ) { cout.setf( ios::dec ); cout << i << ": 0x"; cout.setf( ios::hex, ios::basefield ); cout << setw(3) << rl->at(i); cout.setf( ios::dec ); if ( rl->at(i)<0xfff ) cout << " = " << rl->at(i) << " (" << pm.GetPad(rl->at(i), 1) << ")" << endl; else cout << endl; } acl = 0; delete rl; rl = 0; return 1; }