|
ATLAS Offline Software
|
Go to the documentation of this file.
24 FEevent = FEevent % 512;
42 FEevent = FEevent % 512;
92 }
else if (
field ==
'S') {
99 }
else if (
field ==
'F') {
287 throw std::runtime_error(
"MatrixReadOut::makeHeader: m_CM object does not exist");
295 throw std::runtime_error(
"MatrixReadOut::makeSubHeader: m_CM object does not exist");
305 throw std::runtime_error(
"MatrixReadOut::makeCMABody: m_CM object does not exist");
313 throw std::runtime_error(
"MatrixReadOut::makeFooter: m_CM object does not exist");
350 for (ijk = 0; ijk < 6; ijk++) {
361 if (ijk == 0 || ijk == 2 || ijk == 3)
370 for (lijk = 0; lijk < 32; lijk++) {
375 if (ijk == 3 || ijk == 5)
l = lijk + 32;
416 IJK = 2 * j +
l / 32 + 2;
429 CMABodyval[2] =
TIME;
431 CMABodyval[4] = CHANNEL;
442 throw std::runtime_error(
"MatrixReadOut::makeCMABodyHit: m_CM object does not exist");
484 CMABodyval[2] =
TIME;
486 CMABodyval[4] = CHANNEL;
500 over_h = over_h << 2;
503 CHANNEL = (over_h | thresh_h);
512 CMABodyval[2] =
TIME;
514 CMABodyval[4] = CHANNEL;
524 throw std::runtime_error(
"MatrixReadOut::makeHeader: m_CM object does not exist");
532 headerval[1] = CMcode;
550 CMABodyval[2] =
TIME;
552 CMABodyval[4] = CHANNEL;
582 newElement->
hit = newHit;
638 throw std::runtime_error(
"duplicazione di hit???");
679 *(Body +
i) =
p->hit;
735 if (!errorDecode &&
field ==
'H') {
739 stream <<
" ERROR IN HEADER DECODING ";
748 if (!errorDecode &&
field ==
'S') {
751 stream <<
" ERROR IN SUBHEADER DECODING ";
762 stream << hex <<
p->hit << dec;
764 if (!errorDecode &&
field ==
'B') {
775 stream <<
" ERROR IN BODY DECODING ";
785 stream <<
" -- CODE " << 1;
787 if (!errorDecode &&
field ==
'F') {
790 stream <<
" ERROR IN FOOTER DECODING ";
801 stream << hex <<
p->hit << dec << endl;
840 ubit16 currIJK, currBCID, currTIME, currCHANNEL;
841 ubit16 nextIJK, nextBCID, nextTIME, nextCHANNEL;
870 if (nextIJK < currIJK) {
873 }
else if (nextIJK == currIJK) {
874 if (nextBCID < currBCID) {
877 }
else if (nextBCID == currBCID) {
878 if (nextTIME < currTIME) {
881 }
else if (nextTIME == currTIME) {
882 if (nextCHANNEL <= currCHANNEL) {
890 }
else if (currIJK == 6) {
892 if (nextIJK == currIJK) {
893 if (nextBCID != currBCID || nextTIME != currTIME) {
897 if (nextCHANNEL <= currCHANNEL) {
902 }
else if (nextIJK == 7) {
905 }
else if (currIJK == 7) {
916 cout <<
"checkBodyOrder output= " <<
output <<
" with " << hex << pnext->
hit << dec << endl;
924 if (
debugPrint) cout <<
" CheckBodyOrder; IJK 6 exists but the related IJK 7 has been found " << endl;
925 }
else if (currIJK == 7 && prevIJK != 6) {
927 if (
debugPrint) cout <<
" CheckBodyOrder; IJK 7 exists but the related IJK 6 has been found " << endl;
972 const ubit16 ROOffset = 2;
990 stripaddress = CHANNEL;
995 stripaddress = CHANNEL;
1000 stripaddress = CHANNEL;
1005 stripaddress = CHANNEL;
1010 stripaddress = CHANNEL;
1015 stripaddress = CHANNEL;
1017 default:
throw std::runtime_error(
"MatrixReadOut::doMatrix: IJK= " +
std::to_string(IJK) +
" out of RANGE");
1022 absTime = 25. * ((
float)
BCID + ((
float)(
TIME - ROOffset)) / 8.);
1038 std::cout <<
" makeTestPattern " << std::endl;
1043 vhdlinput.open(
"vhdl.input", ios::app);
1044 if (!vhdlinput) { cout <<
" File for vhdl analysis not opened. " << endl <<
" ==================================" << endl << endl; };
1046 const ubit16 maxchan = 100;
1047 const ubit16 maxtimes = 200;
1049 float times[maxtimes] = {0};
1051 strcpy(plane[0],
"I0");
1052 strcpy(plane[1],
"I1");
1053 strcpy(plane[2],
"J0");
1054 strcpy(plane[3],
"J1");
1060 float timeover = 999999.;
1062 float timelast = -timeover;
1064 std::cout <<
this << std::endl;
1067 float timemin = timeover;
1070 int ijk = MRS.
ijk();
1079 if (timemin == timeover) {
1082 ubit16 this_time_counter = 0;
1085 int ijk = MRS.
ijk();
1089 if (
time == timemin && ntimes < maxtimes) {
1090 if (!this_time_counter) ntimes++;
1091 this_time_counter++;
1097 else if (ijk == 2 || ijk == 3)
1099 else if (ijk == 4 || ijk == 5)
1102 if (IJ[ntimes - 1][ijk_index] < maxchan) {
1103 IJ[ntimes - 1][ijk_index]++;
1104 channels[ntimes - 1][ijk_index][IJ[ntimes - 1][ijk_index] - 1] =
channel;
1117 vhdlinput <<
" RUN " <<
run <<
" EVENT " << eventNum <<
" CMID " << cmid <<
" WINDOW " << NBunch;
1118 vhdlinput <<
" LINES " << (ntimes + ktimes) << std::endl;
1121 vhdlinput <<
" TIME " <<
times[
l] <<
" ";
1123 vhdlinput << plane[
i][0] << plane[
i][1] <<
" " << IJ[
l][
i] <<
" ";
1126 vhdlinput << std::endl;
ubit16 makeBody(ubit16 *inputData)
void putData(int sidemat, int layer, int stripaddress, float time)
void initialize(uint NOBXS)
ubit16 m_checkSubHeaderNum
ubit16 decodeFragment(ubit16 inputWord, char &field)
MatrixReadOut::DataVersion m_data_version
ubit16 numberOfFragmentWords()
void display(std::ostream &stream)
MatrixReadOutStructure getHeader()
void displaySubHeader(std::ostream &stream)
MatrixReadOut(Matrix *p, ubit16 FEevent, uint NOBXS, DataVersion=MatrixReadOut::Atlas)
MatrixReadOutStructure getSubHeader()
int getProjection() const
ubit16 m_addressOfWordScanned
MatrixReadOutStructure getFooter()
ubit16 m_numberOfWordsInFrag
ubit16 m_checkSubHeaderPos
void displayFooter(std::ostream &stream)
ubit16 checkBodyOrder(bool debugPrint=false)
void setBCzero(ubit16 offset)
ubit16 m_numberOfWordsInBody
ubit16 makeFooter(ubit16 inputData)
void displayHeader(std::ostream &stream)
void makeTestPattern(ubit16 mode, ubit16 ktimes, int eventNum)
ubit16 readCMABodyCurrent()
ubit16 makeHeader(ubit16 *inputData)
void displayBody(std::ostream &stream)
void readCMABody(ubit16 *Body)
std::string to_string(const DetectorType &type)
MatrixReadOutStructure getCMAHit(int index)
void setManager(ReadOutManager *boss)
void bytestream(std::ostream &stream)
def time(flags, cells_name, *args, **kw)
void sortAndMakeNewHit(ubit16 newHit)
void writeHeader(ubit16 CMcode)
void writeRecord(ubit16 thisRecord, bool last)
void makeNewHit(ubit16 newHit)
MatrixReadOutStructure m_MROS
void writeCMABody(ubit16 _BC, ubit16 _TIME, ubit16 IJK, ubit16 _STRIP)
unsigned short int ubit16
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.
CMAword rodat[2][2][64][2]
Note array lengths using hardcoded values rather than to depend on NOBXS as they were in the past (as...
void doMatrix(Matrix *CMpointer)
ubit16 checkCRC8(ubit16 foot)
ReadOutManager * m_myBoss