46 <<
"\n If negative value, the size is retrieved from the trailer."
55 LogDebug(
"L1GtTextToRaw") <<
"\nFED Id for DAQ GT record: " <<
m_daqGtFedId <<
" \n" << std::endl;
64 produces<FEDRawDataCollection>();
82 LogDebug(
"L1GtTextToRaw") <<
"\nComputing raw data size with getRecordSize() method." << std::endl;
86 LogDebug(
"L1GtTextToRaw") <<
"\nComputed raw data size: " << rawDataSize << std::endl;
110 rawData.
resize(rawDataSize);
112 LogDebug(
"L1GtTextToRaw") <<
"\n Size of raw data: " << rawData.
size() <<
"\n" << std::endl;
121 int sizeL =
sizeof(lineInt);
123 int fedBlockSize = 8;
124 int maskBlock = 0xff;
128 while (std::getline(
m_textFile, lineString)) {
129 if (lineString.empty()) {
134 std::istringstream iss(lineString);
136 iss >> std::hex >> lineInt;
138 LogTrace(
"L1GtTextToRaw") <<
std::dec << std::setw(4) << std::setfill(
'0') << iLine <<
": " << std::hex
139 << std::setw(sizeL * 2) << lineInt <<
std::dec << std::setfill(
' ') << std::endl;
142 for (
int j = 0;
j < sizeL;
j++) {
143 char blockContent = (lineInt >> (fedBlockSize *
j)) & maskBlock;
144 rawData.
data()[iLine * sizeL +
j] = blockContent;
virtual int getDataSize()
get the size of the record
T getUntrackedParameter(std::string const &, T const &) const
int m_daqGtFedId
FED ID for the system.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::string m_textFileName
file name for the text file
size_t size() const
Lenght of the data buffer in bytes.
void resize(size_t newsize)
std::string m_textFileType
file type for the text file
void beginJob() override
beginning of job stuff
L1GtTextToRaw(const edm::ParameterSet &)
constructor(s)
int m_rawDataSize
raw event size (including header and trailer) in units of 8 bits
void produce(edm::Event &, const edm::EventSetup &) override
loop over events
virtual void cleanTextFile()
clean the text file, if needed
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
unsigned long long cms_uint64_t
std::ifstream m_textFile
the file itself
void endJob() override
end of job stuff
~L1GtTextToRaw() override
destructor