63 event.getByToken(
token_, buffers );
77 std::ostringstream ss;
78 ss <<
" -------------------------------------------- " << endl;
79 ss <<
" buffer debug ------------------------------- " << endl;
80 ss <<
" -------------------------------------------- " << endl;
81 ss <<
" buffer size : " << buffer->
bufferSize() << endl;
82 ss <<
" fed id : " << fedIndex << endl;
83 ss <<
" -------------------------------------------- " << endl;
84 ss <<
" tracker header debug ------------------------" << endl;
85 ss <<
" -------------------------------------------- " << endl;
86 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
90 ss <<
" Mode : " << hex << setw(2) << tr_header.getDebugMode() << endl;
91 ss <<
" Type : " << hex << setw(2) << (
int) tr_header.getEventType() << endl;
92 ss <<
" Readout : " << hex << setw(2) << tr_header.getReadoutMode() << endl;
93 ss <<
" Condition Data : " << ( tr_header.getConditionData() ?
"Present" :
"Absent") <<
"\n";
94 ss <<
" Data Type : " << ( tr_header.getDataType() ?
"Real" :
"Fake" ) <<
"\n";
95 ss <<
" Status : " << hex << setw(16)<< (
int) tr_header.getGlibStatusCode() << endl;
97 for(
int i=15;
i>=0;
i--)
99 if((tr_header.frontendStatus())[
i])
109 ss <<
" Nr CBC : " << hex << setw(16)<< (
int) tr_header.getNumberOfCBC() << endl;
110 ss <<
" CBC stat : ";
111 for(
int i=0;
i<tr_header.getNumberOfCBC();
i++)
113 ss << hex << setw(2) << (
int) tr_header.CBCStatus()[
i] <<
" ";
116 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
117 ss <<
" -------------------------------------------- " << endl;
118 ss <<
" Payload ----------------------------------- " << endl;
119 ss <<
" -------------------------------------------- " << endl;
128 const Phase2TrackerFEDChannel& channel = buffer->
channel(ichan);
129 if(channel.length() > 0)
135 ss <<
dec <<
" id from cabling : " << detid << endl;
136 ss <<
dec <<
" reading channel : " << icbc <<
" on FE " << ife;
137 ss <<
dec <<
" with length : " << (
int) channel.length() << endl;
141 std::vector<Phase2TrackerDigi> stripsTop;
142 std::vector<Phase2TrackerDigi> stripsBottom;
145 Phase2TrackerFEDRawChannelUnpacker unpacker = Phase2TrackerFEDRawChannelUnpacker(channel);
146 while (unpacker.hasData())
148 if(unpacker.stripOn())
150 if (unpacker.stripIndex()%2)
175 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
192 std::vector< edm::DetSet<Phase2TrackerDigi> > sorted_and_merged;
200 std::vector<Phase2TrackerDigi> & digis = sorted_and_merged.back().data;
202 size_t len = it->length;
203 for (it2 = it+1; (it2 !=
end) && (it2->detid == it->detid); ++it2) { len += it2->length; }
207 for (it2 = it+0; (it2 !=
end) && (it2->detid == it->detid); ++it2)
215 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