62 <<
"\n If negative value, the size is retrieved from the trailer." <<
"\n"
72 <<
"\nFED Id for DAQ GT record: "
80 <<
"\nError: failed to open text file = " <<
m_textFileName <<
"\n"
85 produces<FEDRawDataCollection>();
112 <<
"\nCleaning the text file\n"
124 <<
"\nComputing raw data size with getRecordSize() method."
130 <<
"\nComputed raw data size: " << rawDataSize
161 rawData.
resize(rawDataSize);
165 <<
"\n Size of raw data: " << rawData.
size() <<
"\n"
176 int sizeL =
sizeof(lineInt);
178 int fedBlockSize = 8;
179 int maskBlock = 0xff;
183 while (std::getline(
m_textFile, lineString)) {
185 if (lineString.empty()) {
190 std::istringstream iss(lineString);
192 iss >> std::hex >> lineInt;
195 << std::dec << std::setw(4) << std::setfill(
'0') << iLine <<
": "
196 << std::hex << std::setw(sizeL*2) << lineInt
197 << std::dec << std::setfill(
' ')
201 for (
int j = 0;
j < sizeL;
j++) {
202 char blockContent = (lineInt >> (fedBlockSize *
j)) & maskBlock;
203 rawData.
data()[iLine*sizeL +
j] = blockContent;
211 iEvent.
put(fedRawColl);
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.
std::string m_textFileName
file name for the text file
virtual void endJob()
end of job stuff
size_t size() const
Lenght of the data buffer in bytes.
void resize(size_t newsize)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string m_textFileType
file type for the text file
L1GtTextToRaw(const edm::ParameterSet &)
constructor(s)
int m_rawDataSize
raw event size (including header and trailer) in units of 8 bits
virtual void beginJob()
beginning of job stuff
virtual void cleanTextFile()
clean the text file, if needed
virtual void produce(edm::Event &, const edm::EventSetup &)
loop over events
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
virtual ~L1GtTextToRaw()
destructor