34 namespace errorstreamsource{
65 std::auto_ptr<FEDRawDataCollection>
result_;
75 : ProducerSourceFromFiles(pset,desc,
true)
79 produces<FEDRawDataCollection>();
99 uint32_t lumiNumber(1);
100 uint32_t evtNumber(0);
102 status =
fin_.read((
char*)&runNumber,
sizeof(uint32_t));
103 if (runNumber < 32) {
105 status =
fin_.read((
char*)&runNumber,
sizeof(uint32_t));
108 status =
fin_.read((
char*)&lumiNumber,
sizeof(uint32_t));
110 status =
fin_.read((
char*)&evtNumber,
sizeof(uint32_t));
115 status =
fin_.read((
char*)&runNumber,
sizeof(uint32_t));
116 if (runNumber < 32) {
118 status =
fin_.read((
char*)&runNumber,
sizeof(uint32_t));
121 status =
fin_.read((
char*)&lumiNumber,
sizeof(uint32_t));
123 status =
fin_.read((
char*)&evtNumber,
sizeof(uint32_t));
124 if (!status) {
fin_.close();
return false; }
127 runNumber = (runNumber==0) ? 1 : runNumber;
132 unsigned int totalEventSize = 0;
136 uint32_t fedSize[1024];
137 fin_.read((
char*)fedSize,1024*
sizeof(uint32_t));
138 for (
unsigned int i=0;
i<1024;
i++) {
139 totalEventSize += fedSize[
i];
144 char *
event =
new char[totalEventSize];
146 while(totalEventSize>0) {
151 totalEventSize -= (fedsize - 8);
158 time = (time << 32) + gpsl;
163 memcpy(fedData.
data(),
event+totalEventSize,fedsize);
178 size_t pos = fileName.find(
':');
179 if (pos!=std::string::npos) {
181 if (prefix!=
"file")
return false;
187 return fin_.is_open();
unsigned int getgpshigh(const unsigned char *)
std::vector< std::string >::const_iterator itFileName_
std::vector< std::string > const & fileNames() const
bool openFile(const std::string &fileName)
virtual ~ErrorStreamSource()
void evm_board_setformat(size_t size)
ErrorStreamSource(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
void resize(size_t newsize)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void beginLuminosityBlock(edm::LuminosityBlock &lb)
#define FED_EVSZ_EXTRACT(a)
void endLuminosityBlock(edm::LuminosityBlock &lb)
unsigned long long TimeValue_t
virtual void produce(edm::Event &e)
void beginRun(edm::Run &r)
EventNumber_t event() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
constexpr unsigned int gtpEvmId_
std::auto_ptr< FEDRawDataCollection > result_
unsigned int getgpslow(const unsigned char *)
virtual bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &theTime)