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)),
51 produces<FEDRawDataCollection>();
54 const std::string& gctInputLabelStr = gctInputTag.label();
68 tokenCaloEm_ = consumes<L1CaloEmCollection>(rctInputTag);
130 if(packRctEmThisEvent)
135 packRctEmThisEvent =
false;
136 LogDebug(
"GCT") <<
"RCT EM Candidate packing requested, but failed to get them from event!";
143 if(packRctCaloThisEvent)
148 packRctCaloThisEvent =
false;
149 LogDebug(
"GCT") <<
"RCT Calo Region packing requested, but failed to get them from event!";
160 unsigned int rawSize = 88;
161 if(packRctEmThisEvent) { rawSize += 232; }
162 if(packRctCaloThisEvent) { rawSize += 800; }
163 fedRawData.
resize(rawSize);
164 unsigned char * pHeader = fedRawData.
data();
165 unsigned char * pPayload = pHeader + 16;
166 unsigned char * pFooter = pHeader + rawSize - 8;
170 fedHeader.
set(pHeader, 1, eventNumber, bx,
fedId_);
194 if(packRctEmThisEvent)
201 if(packRctCaloThisEvent)
220 const unsigned char *
d = data.
data();
222 for (
unsigned int i=0;
i<data.
size();
i=
i+4) {
223 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);
224 cout << std::hex << std::setw(4) <<
i/4 <<
" " << std::setw(8) << w << endl;
edm::EDGetTokenT< L1GctHFBitCountsCollection > tokenGctHFBitCounts_
T getParameter(std::string const &) const
EventNumber_t event() const
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_forJets_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< L1GctEmCandCollection > tokenL1GctEmCand_isoEm_
#define DEFINE_FWK_MODULE(type)
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_
static void set(unsigned char *trailer, int evt_lgth, int crc, int evt_stat, int tts, bool T=false)
Set all fields in the trailer.
GctDigiToRaw(const edm::ParameterSet &)
size_t size() const
Lenght of the data buffer in bytes.
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_cenJets_
edm::EDGetTokenT< L1GctEtMissCollection > tokenGctEtMiss_
void print(FEDRawData &data)
edm::EDGetTokenT< L1GctEtHadCollection > tokenGctEtHad_
void resize(size_t newsize)
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > tokenGctHFRingEtSums_
T const * product() const
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.
GctFormatTranslateMCLegacy formatTranslator_
void produce(edm::Event &, const edm::EventSetup &) override