89 event.getByToken(
token_, buffers);
95 if (fed.
size() != 0) {
101 std::ostringstream
ss;
102 ss <<
" -------------------------------------------- " << endl;
103 ss <<
" buffer debug ------------------------------- " << endl;
104 ss <<
" -------------------------------------------- " << endl;
105 ss <<
" buffer size : " <<
buffer->bufferSize() << endl;
107 ss <<
" -------------------------------------------- " << endl;
108 ss <<
" tracker header debug ------------------------" << endl;
109 ss <<
" -------------------------------------------- " << endl;
110 LogTrace(
"Phase2TrackerDigiProducer") <<
ss.str();
114 Phase2TrackerFEDHeader tr_header =
buffer->trackerHeader();
115 ss <<
" Version : " << hex << setw(2) << (
int)tr_header.getDataFormatVersion() << endl;
116 ss <<
" Mode : " << hex << setw(2) << tr_header.getDebugMode() << endl;
117 ss <<
" Type : " << hex << setw(2) << (
int)tr_header.getEventType() << endl;
118 ss <<
" Readout : " << hex << setw(2) << tr_header.getReadoutMode() << endl;
119 ss <<
" Condition Data : " << (tr_header.getConditionData() ?
"Present" :
"Absent") <<
"\n";
120 ss <<
" Data Type : " << (tr_header.getDataType() ?
"Real" :
"Fake") <<
"\n";
121 ss <<
" Status : " << hex << setw(16) << (
int)tr_header.getGlibStatusCode() << endl;
123 for (
int i = 15;
i >= 0;
i--) {
124 if ((tr_header.frontendStatus())[
i]) {
131 ss <<
" Nr CBC : " << hex << setw(16) << (
int)tr_header.getNumberOfCBC() << endl;
132 ss <<
" CBC stat : ";
133 for (
int i = 0;
i < tr_header.getNumberOfCBC();
i++) {
134 ss << hex << setw(2) << (
int)tr_header.CBCStatus()[
i] <<
" ";
137 LogTrace(
"Phase2TrackerDigiProducer") <<
ss.str();
140 ss <<
" -------------------------------------------- " << endl;
141 ss <<
" Payload ----------------------------------- " << endl;
142 ss <<
" -------------------------------------------- " << endl;
149 const Phase2TrackerFEDChannel& channel =
buffer->channel(ichan);
150 if (channel.length() > 0) {
153 uint32_t detid =
mod.getDetid();
155 ss <<
dec <<
" id from cabling : " << detid << endl;
156 ss <<
dec <<
" reading channel : " << icbc <<
" on FE " << ife;
157 ss <<
dec <<
" with length : " << (
int)channel.length() << endl;
161 std::vector<Phase2TrackerDigi> stripsTop;
162 std::vector<Phase2TrackerDigi> stripsBottom;
165 Phase2TrackerFEDRawChannelUnpacker unpacker = Phase2TrackerFEDRawChannelUnpacker(channel);
166 while (unpacker.hasData()) {
167 if (unpacker.stripOn()) {
168 if (unpacker.stripIndex() % 2) {
174 stripsBottom.push_back(
189 LogTrace(
"Phase2TrackerDigiProducer") <<
ss.str();
199 Registry regItemBottom(
209 std::vector<edm::DetSet<Phase2TrackerDigi>> sorted_and_merged;
216 std::vector<Phase2TrackerDigi>& digis = sorted_and_merged.back().data;
218 size_t len = it->length;
219 for (it2 = it + 1; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
225 for (it2 = it + 0; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
232 pr->swap(proc_raw_dsv);
const Phase2TrackerCabling * cabling_
size_t size() const
Lenght of the data buffer in bytes.
static const uint16_t CMS_FED_ID_MAX
void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
edm::EDGetTokenT< FEDRawDataCollection > token_
static const int MAX_CBC_PER_FE
std::vector< Phase2TrackerDigi > proc_work_digis_
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
std::vector< Registry > proc_work_registry_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
static const int STRIPS_PER_CBC
static const uint16_t FED_ID_MIN
T mod(const T &a, const T &b)
static const int MAX_FE_PER_FED