41 packRctEm_(iConfig.getUntrackedParameter<
bool>(
"packRctEm",
true)),
42 packRctCalo_(iConfig.getUntrackedParameter<
bool>(
"packRctCalo",
true)),
43 fedId_(iConfig.getParameter<
int>(
"gctFedId")),
44 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
50 tokenPut_ = produces<FEDRawDataCollection>();
53 const std::string& gctInputLabelStr = gctInputTag.label();
67 tokenCaloEm_ = consumes<L1CaloEmCollection>(rctInputTag);
86 unsigned int bx =
counter % 3564;
124 if(packRctEmThisEvent)
129 packRctEmThisEvent =
false;
130 LogDebug(
"GCT") <<
"RCT EM Candidate packing requested, but failed to get them from event!";
137 if(packRctCaloThisEvent)
142 packRctCaloThisEvent =
false;
143 LogDebug(
"GCT") <<
"RCT Calo Region packing requested, but failed to get them from event!";
154 unsigned int rawSize = 88;
155 if(packRctEmThisEvent) { rawSize += 232; }
156 if(packRctCaloThisEvent) { rawSize += 800; }
157 fedRawData.
resize(rawSize);
158 unsigned char * pHeader = fedRawData.
data();
159 unsigned char * pPayload = pHeader + 16;
160 unsigned char * pFooter = pHeader + rawSize - 8;
164 fedHeader.
set(pHeader, 1, eventNumber, bx,
fedId_);
188 if(packRctEmThisEvent)
195 if(packRctCaloThisEvent)
214 const unsigned char *
d = data.
data();
216 for (
unsigned int i=0;
i<data.
size();
i=
i+4) {
217 uint32_t
w = (uint32_t)d[
i] + (uint32_t)(d[
i+1]<<8) + (uint32_t)(d[
i+2]<<16) + (uint32_t)(d[
i+3]<<24);
218 cout << std::hex << std::setw(4) <<
i/4 <<
" " << std::setw(8) << w << endl;
edm::EDGetTokenT< L1GctHFBitCountsCollection > tokenGctHFBitCounts_
std::atomic< int > counter_
T getParameter(std::string const &) const
EventNumber_t event() const
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_forJets_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< L1GctEmCandCollection > tokenL1GctEmCand_isoEm_
edm::EDGetTokenT< L1CaloEmCollection > tokenCaloEm_
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_tauJets_
edm::EDGetTokenT< L1GctHtMissCollection > tokenGctHtMiss_
unsigned long long EventNumber_t
edm::EDGetTokenT< L1GctEtTotalCollection > tokenGctEtTotal_
edm::EDGetTokenT< L1CaloRegionCollection > tokenCaloRegion_
edm::EDGetTokenT< L1GctJetCountsCollection > tokenGctJetCounts_
GctDigiToRaw(const edm::ParameterSet &)
size_t size() const
Lenght of the data buffer in bytes.
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_cenJets_
edm::EDGetTokenT< L1GctEtMissCollection > tokenGctEtMiss_
#define DEFINE_FWK_MODULE(type)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
edm::EDGetTokenT< L1GctEtHadCollection > tokenGctEtHad_
void resize(size_t newsize)
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDPutTokenT< FEDRawDataCollection > tokenPut_
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > tokenGctHFRingEtSums_
T const * product() const
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
edm::EDGetTokenT< L1GctEmCandCollection > tokenL1GctEmCand_nonIsoEm_
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void print(FEDRawData &data) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const final