52 event.getByToken(
token_, buffers);
58 if (fed.
size() != 0) {
64 std::ostringstream
ss;
65 ss <<
" -------------------------------------------- " << endl;
66 ss <<
" buffer debug ------------------------------- " << endl;
67 ss <<
" -------------------------------------------- " << endl;
68 ss <<
" buffer size : " << buffer->
bufferSize() << endl;
69 ss <<
" fed id : " << fedIndex << endl;
70 ss <<
" -------------------------------------------- " << endl;
71 ss <<
" tracker header debug ------------------------" << endl;
72 ss <<
" -------------------------------------------- " << endl;
73 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
79 ss <<
" Mode : " << hex << setw(2) << tr_header.getDebugMode() << endl;
80 ss <<
" Type : " << hex << setw(2) << (
int)tr_header.getEventType() << endl;
81 ss <<
" Readout : " << hex << setw(2) << tr_header.getReadoutMode() << endl;
82 ss <<
" Condition Data : " << (tr_header.getConditionData() ?
"Present" :
"Absent") <<
"\n";
83 ss <<
" Data Type : " << (tr_header.getDataType() ?
"Real" :
"Fake") <<
"\n";
84 ss <<
" Status : " << hex << setw(16) << (
int)tr_header.getGlibStatusCode() << endl;
86 for (
int i = 15;
i >= 0;
i--) {
87 if ((tr_header.frontendStatus())[
i]) {
94 ss <<
" Nr CBC : " << hex << setw(16) << (
int)tr_header.getNumberOfCBC() << endl;
96 for (
int i = 0;
i < tr_header.getNumberOfCBC();
i++) {
97 ss << hex << setw(2) << (
int)tr_header.CBCStatus()[
i] <<
" ";
100 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
103 ss <<
" -------------------------------------------- " << endl;
104 ss <<
" Payload ----------------------------------- " << endl;
105 ss <<
" -------------------------------------------- " << endl;
112 const Phase2TrackerFEDChannel& channel = buffer->
channel(ichan);
113 if (channel.length() > 0) {
118 ss <<
dec <<
" id from cabling : " << detid << endl;
119 ss <<
dec <<
" reading channel : " << icbc <<
" on FE " << ife;
120 ss <<
dec <<
" with length : " << (
int)channel.length() << endl;
124 std::vector<Phase2TrackerDigi> stripsTop;
125 std::vector<Phase2TrackerDigi> stripsBottom;
128 Phase2TrackerFEDRawChannelUnpacker unpacker = Phase2TrackerFEDRawChannelUnpacker(channel);
129 while (unpacker.hasData()) {
130 if (unpacker.stripOn()) {
131 if (unpacker.stripIndex() % 2) {
137 stripsBottom.push_back(
152 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
162 Registry regItemBottom(
172 std::vector<edm::DetSet<Phase2TrackerDigi>> sorted_and_merged;
179 std::vector<Phase2TrackerDigi>& digis = sorted_and_merged.back().data;
181 size_t len = it->length;
182 for (it2 = it + 1; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
188 for (it2 = it + 0; (it2 !=
end) && (it2->detid == it->detid); ++it2) {
195 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
edm::EDGetTokenT< FEDRawDataCollection > token_
void swap(DetSetVector &other)
size_t size() const
Lenght of the data buffer in bytes.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
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