14 uint32_t ROD_run_no = robFragment->rod_run_no();
15 uint32_t ROD_lvl1_id = robFragment->rod_lvl1_id();
16 uint32_t ROD_bc_id = robFragment->rod_bc_id();
17 uint32_t ROD_lvl1_trigger_type = robFragment->rod_lvl1_trigger_type();
18 uint32_t ROD_detev_type = robFragment->rod_detev_type();
19 uint32_t ROD_marker = robFragment->rod_marker();
20 uint32_t ROD_fragment_size = robFragment->rod_fragment_size_word();
21 uint32_t ROD_header_size = robFragment->rod_header_size_word();
22 uint32_t ROD_trailer_size = robFragment->rod_trailer_size_word();
23 uint32_t ROD_version = robFragment->rod_version() >> 16;
24 uint32_t ROD_sourceID = robFragment->rod_source_id();
25 uint32_t ROD_nstatus = robFragment->rod_nstatus();
26 uint32_t ROD_ndata = robFragment->rod_ndata();
27 uint32_t ROD_status_pos = robFragment->rod_status_position();
29 uint32_t ROD_sourceID_high = ROD_sourceID >> 16;
33 <<
" ROD_run_no: " << std::dec << ROD_run_no <<
endreq
34 <<
" ROD_lvl1_id: 0x" << std::hex << ROD_lvl1_id <<
endreq
35 <<
" ROD_bc_id: " << std::dec << ROD_bc_id <<
endreq
36 <<
" ROD_lvl1_trigger_type: " << std::dec << ROD_lvl1_trigger_type <<
endreq
37 <<
" ROD_detev_type: " << std::dec << ROD_detev_type <<
endreq
38 <<
" ROD_marker: 0x" << std::hex << ROD_marker <<
endreq
39 <<
" ROD_fragment_size: " << std::dec << ROD_fragment_size <<
endreq
40 <<
" ROD_header_size: " << std::dec << ROD_header_size <<
endreq
41 <<
" ROD_trailer_size: " << std::dec << ROD_trailer_size <<
endreq
42 <<
" ROD_version: 0x" << std::hex << ROD_version <<
endreq
43 <<
" ROD_source_ID: 0x" << std::hex << ROD_sourceID <<
endreq
44 <<
" ROD_nstatus: " << std::dec << ROD_nstatus <<
endreq
45 <<
" ROD_ndata: " << std::dec << ROD_ndata <<
endreq
46 <<
" ROD_status_pos: " << std::dec << ROD_status_pos <<
endreq
52 msg(MSG::ERROR) <<
" ERROR: Invalid ROD_marker " << std::hex << ROD_marker <<
endreq;
53 return StatusCode::FAILURE;
59 msg(MSG::ERROR) <<
" ERROR: Incorrect ROD_version, expected " <<
m_rodVersion
60 <<
", found " << (ROD_version>>16) <<
endreq;
61 return StatusCode::FAILURE;
68 msg(MSG::ERROR) <<
" ERROR: invalid source ID detector word, " << ROD_sourceID <<
endreq;
69 return StatusCode::FAILURE;
72 unsigned int nwordsNoTrig = ROD_ndata - 5;
76 if (nwordsNoTrig % 32 != 0) {
77 msg(MSG::WARNING) <<
" WARNING: incorrect number of words in ROD data: " << ROD_ndata <<
endreq;
78 return StatusCode::FAILURE;
81 unsigned int numBCRead = ROD_ndata/32;
93 robFragment->rod_data (vintData);
94 robFragment->rod_status(vintStat);
97 std::vector<uint16_t> waveform;
102 while (wordIt<ROD_ndata) {
104 word = vintData[wordIt]; wordIt++;
106 if ((word & 0xf0000000) >> 28 == 0xc) {
108 if (waveform.size()) {
110 msg(MSG::ERROR) <<
" ERROR: inconsistency in LUCROD data" <<
endreq;
111 return StatusCode::FAILURE;
119 uint16_t adc2 = (word & 0xfff0000) >> 16;
120 uint16_t cid1 = (word & 0x7000) >> 12;
121 uint16_t cid2 = (word & 0x70000000) >> 28;
131 if (cid1 != cid2)
return StatusCode::FAILURE;
135 waveform.push_back(adc1);
136 waveform.push_back(adc2);
139 if (waveform.size()) {
141 msg(MSG::ERROR) <<
" ERROR: inconsistency in LUCROD data" <<
endreq;
142 return StatusCode::FAILURE;
149 waveform.push_back(adc1);
150 waveform.push_back(adc2);
156 if ((word & 0xf000) >> 12 != 0
xa)
return StatusCode::FAILURE;
159 uint16_t trigAvgC = ((word & 0xfff0000)>>16);
163 <<
" trigAvgA: " << trigAvgA
164 <<
" trigAvgC: " << trigAvgC
172 while (wordIt<ROD_ndata) {
174 word = vintData[wordIt]; wordIt++;
176 if ((word & 0xf0000000) >> 28 != 0xb)
return StatusCode::FAILURE;
179 uint16_t amp2 = (word & 0xfff0000)>>16;
202 return StatusCode::SUCCESS;