24 namespace Phase2Tracker {
46 Registry(uint32_t aDetid, uint16_t firstStrip,
size_t indexInVector, uint16_t numberOfDigis)
69 namespace Phase2Tracker {
72 :
runNumber_(0), cabling_(nullptr), cacheId_(0) {
74 produces<edm::DetSetVector<Phase2TrackerDigi>>(
"ProcessedRaw");
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--) {
140 ss <<
" Nr CBC : " << hex << setw(16) << (int)tr_header.
getNumberOfCBC() << endl;
141 ss <<
" CBC stat : ";
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;
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;
183 stripsBottom.push_back(
198 LogTrace(
"Phase2TrackerDigiProducer") << ss.str();
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);
static const char runNumber_[]
const Phase2TrackerCabling * cabling_
const Phase2TrackerFEDChannel & channel(const uint8_t internalPhase2TrackerFEDChannelNum) const
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
const edm::EventSetup & c
#define DEFINE_FWK_MODULE(type)
size_t bufferSize() const
uint32_t detid
public data members
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.
Phase2Tracker::Phase2TrackerDigiProducer Phase2TrackerDigiProducer
void produce(edm::Event &, const edm::EventSetup &) override
uint32_t getDetid() const
static const int MAX_CBC_PER_FE
std::vector< Phase2TrackerDigi > proc_work_digis_
uint8_t stripIndex() const
std::vector< Registry > proc_work_registry_
Phase2TrackerDigiProducer(const edm::ParameterSet &pset)
constructor
void beginRun(edm::Run const &, edm::EventSetup const &) override
T const * product() const
T getParameter(std::string const &) const
bool operator<(const Registry &other) const
< operator to sort registries
~Phase2TrackerDigiProducer() override
default constructor
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
Registry(uint32_t aDetid, uint16_t firstStrip, size_t indexInVector, uint16_t numberOfDigis)
constructor