98 event.getByToken(
token_, buffers);
103 const FEDRawData& fed = buffers->FEDData(fedIndex);
104 if (fed.
size() != 0) {
110 std::ostringstream
ss;
111 ss <<
" -------------------------------------------- " << endl;
112 ss <<
" buffer debug ------------------------------- " << endl;
113 ss <<
" -------------------------------------------- " << endl;
114 ss <<
" buffer size : " << buffer->
bufferSize() << endl;
115 ss <<
" fed id : " << fedIndex << endl;
116 ss <<
" -------------------------------------------- " << endl;
117 ss <<
" tracker header debug ------------------------" << endl;
118 ss <<
" -------------------------------------------- " << endl;
119 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
125 ss <<
" Mode : " << hex << setw(2) << tr_header.getDebugMode() << endl;
126 ss <<
" Type : " << hex << setw(2) << (int)tr_header.getEventType() << endl;
127 ss <<
" Readout : " << hex << setw(2) << tr_header.getReadoutMode() << endl;
128 ss <<
" Condition Data : " << (tr_header.getConditionData() ?
"Present" :
"Absent") <<
"\n";
129 ss <<
" Data Type : " << (tr_header.getDataType() ?
"Real" :
"Fake") <<
"\n";
130 ss <<
" Status : " << hex << setw(16) << (int)tr_header.getGlibStatusCode() << endl;
132 for (
int i = 15;
i >= 0;
i--) {
133 if ((tr_header.frontendStatus())[
i]) {
140 ss <<
" Nr CBC : " << hex << setw(16) << (int)tr_header.getNumberOfCBC() << endl;
141 ss <<
" CBC stat : ";
142 for (
int i = 0;
i < tr_header.getNumberOfCBC();
i++) {
143 ss << hex << setw(2) << (int)tr_header.CBCStatus()[
i] <<
" ";
146 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
149 ss <<
" -------------------------------------------- " << endl;
150 ss <<
" Payload ----------------------------------- " << endl;
151 ss <<
" -------------------------------------------- " << endl;
158 const Phase2TrackerFEDChannel& channel = buffer->
channel(ichan);
159 if (channel.length() > 0) {
164 ss <<
dec <<
" id from cabling : " << detid << endl;
165 ss <<
dec <<
" reading channel : " << icbc <<
" on FE " << ife;
166 ss <<
dec <<
" with length : " << (int)channel.length() << endl;
170 std::vector<Phase2TrackerDigi> stripsTop;
171 std::vector<Phase2TrackerDigi> stripsBottom;
174 Phase2TrackerFEDRawChannelUnpacker unpacker = Phase2TrackerFEDRawChannelUnpacker(channel);
175 while (unpacker.hasData()) {
176 if (unpacker.stripOn()) {
177 if (unpacker.stripIndex() % 2) {
183 stripsBottom.push_back(
198 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
208 Registry regItemBottom(
218 std::vector<edm::DetSet<Phase2TrackerDigi>> sorted_and_merged;
225 std::vector<Phase2TrackerDigi>& digis = sorted_and_merged.back().data;
227 size_t len = it->length;
228 for (it2 = it + 1; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
234 for (it2 = it + 0; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
241 pr->
swap(proc_raw_dsv);
const Phase2TrackerCabling * cabling_
const Phase2TrackerFEDChannel & channel(const uint8_t internalPhase2TrackerFEDChannelNum) const
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
size_t bufferSize() const
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_
void swap(DetSetVector &other)
size_t size() const
Lenght of the data buffer in bytes.
uint32_t getDetid() const
static const int MAX_CBC_PER_FE
std::vector< Phase2TrackerDigi > proc_work_digis_
std::vector< Registry > proc_work_registry_
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
Phase2TrackerFEDHeader trackerHeader() const
T mod(const T &a, const T &b)
static const int MAX_FE_PER_FED