60 <<
"\n If negative value, the size is retrieved from the trailer." <<
"\n"
70 <<
"\nFED Id for DAQ GT record: "
78 <<
"\nError: failed to open text file = " <<
m_textFileName <<
"\n"
83 produces<FEDRawDataCollection>();
110 <<
"\nCleaning the text file\n"
122 <<
"\nComputing raw data size with getRecordSize() method."
128 <<
"\nComputed raw data size: " << rawDataSize
159 rawData.
resize(rawDataSize);
163 <<
"\n Size of raw data: " << rawData.
size() <<
"\n"
174 int sizeL =
sizeof(lineInt);
176 int fedBlockSize = 8;
177 int maskBlock = 0xff;
181 while (std::getline(
m_textFile, lineString)) {
183 if (lineString.empty()) {
188 std::istringstream iss(lineString);
190 iss >> std::hex >> lineInt;
193 << std::dec << std::setw(4) << std::setfill(
'0') << iLine <<
": "
194 << std::hex << std::setw(sizeL*2) << lineInt
195 << std::dec << std::setfill(
' ')
199 for (
int j = 0;
j < sizeL;
j++) {
200 char blockContent = (lineInt >> (fedBlockSize *
j)) & maskBlock;
201 rawData.
data()[iLine*sizeL +
j] = blockContent;
209 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